Ignore pb.h, pb.c for clang-fmt

pull/5213/head
Craig Tiller 9 years ago
parent eb841e2010
commit 00c4829669
  1. 119
      src/core/proto/grpc/lb/v0/load_balancer.pb.c
  2. 169
      src/core/proto/grpc/lb/v0/load_balancer.pb.h
  3. 19
      tools/codegen/core/gen_load_balancing_proto.sh
  4. 16
      tools/distrib/check_nanopb_output.sh
  5. 2
      tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh

@ -39,112 +39,81 @@
#error Regenerate this file with the current version of nanopb generator. #error Regenerate this file with the current version of nanopb generator.
#endif #endif
const pb_field_t grpc_lb_v0_Duration_fields[3] = { const pb_field_t grpc_lb_v0_Duration_fields[3] = {
PB_FIELD(1, INT64, OPTIONAL, STATIC, FIRST, grpc_lb_v0_Duration, seconds, PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, grpc_lb_v0_Duration, seconds, seconds, 0),
seconds, 0), PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Duration, nanos, seconds, 0),
PB_FIELD(2, INT32, OPTIONAL, STATIC, OTHER, grpc_lb_v0_Duration, nanos, PB_LAST_FIELD
seconds, 0), };
PB_LAST_FIELD};
const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3] = { const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3] = {
PB_FIELD(1, MESSAGE, OPTIONAL, STATIC, FIRST, grpc_lb_v0_LoadBalanceRequest, PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v0_LoadBalanceRequest, initial_request, initial_request, &grpc_lb_v0_InitialLoadBalanceRequest_fields),
initial_request, initial_request, PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_LoadBalanceRequest, client_stats, initial_request, &grpc_lb_v0_ClientStats_fields),
&grpc_lb_v0_InitialLoadBalanceRequest_fields), PB_LAST_FIELD
PB_FIELD(2, MESSAGE, OPTIONAL, STATIC, OTHER, grpc_lb_v0_LoadBalanceRequest, };
client_stats, initial_request, &grpc_lb_v0_ClientStats_fields),
PB_LAST_FIELD};
const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2] = { const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2] = {
PB_FIELD(1, STRING, OPTIONAL, STATIC, FIRST, PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v0_InitialLoadBalanceRequest, name, name, 0),
grpc_lb_v0_InitialLoadBalanceRequest, name, name, 0), PB_LAST_FIELD
PB_LAST_FIELD}; };
const pb_field_t grpc_lb_v0_ClientStats_fields[4] = { const pb_field_t grpc_lb_v0_ClientStats_fields[4] = {
PB_FIELD(1, INT64, OPTIONAL, STATIC, FIRST, grpc_lb_v0_ClientStats, PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, grpc_lb_v0_ClientStats, total_requests, total_requests, 0),
total_requests, total_requests, 0), PB_FIELD( 2, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_ClientStats, client_rpc_errors, total_requests, 0),
PB_FIELD(2, INT64, OPTIONAL, STATIC, OTHER, grpc_lb_v0_ClientStats, PB_FIELD( 3, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_ClientStats, dropped_requests, client_rpc_errors, 0),
client_rpc_errors, total_requests, 0), PB_LAST_FIELD
PB_FIELD(3, INT64, OPTIONAL, STATIC, OTHER, grpc_lb_v0_ClientStats, };
dropped_requests, client_rpc_errors, 0),
PB_LAST_FIELD};
const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3] = { const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3] = {
PB_FIELD(1, MESSAGE, OPTIONAL, STATIC, FIRST, PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v0_LoadBalanceResponse, initial_response, initial_response, &grpc_lb_v0_InitialLoadBalanceResponse_fields),
grpc_lb_v0_LoadBalanceResponse, initial_response, initial_response, PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_LoadBalanceResponse, server_list, initial_response, &grpc_lb_v0_ServerList_fields),
&grpc_lb_v0_InitialLoadBalanceResponse_fields), PB_LAST_FIELD
PB_FIELD(2, MESSAGE, OPTIONAL, STATIC, OTHER, };
grpc_lb_v0_LoadBalanceResponse, server_list, initial_response,
&grpc_lb_v0_ServerList_fields),
PB_LAST_FIELD};
const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4] = { const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4] = {
PB_FIELD(1, STRING, OPTIONAL, STATIC, FIRST, PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v0_InitialLoadBalanceResponse, client_config, client_config, 0),
grpc_lb_v0_InitialLoadBalanceResponse, client_config, PB_FIELD( 2, STRING , OPTIONAL, STATIC , OTHER, grpc_lb_v0_InitialLoadBalanceResponse, load_balancer_delegate, client_config, 0),
client_config, 0), PB_FIELD( 3, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval, load_balancer_delegate, &grpc_lb_v0_Duration_fields),
PB_FIELD(2, STRING, OPTIONAL, STATIC, OTHER, PB_LAST_FIELD
grpc_lb_v0_InitialLoadBalanceResponse, load_balancer_delegate, };
client_config, 0),
PB_FIELD(3, MESSAGE, OPTIONAL, STATIC, OTHER,
grpc_lb_v0_InitialLoadBalanceResponse,
client_stats_report_interval, load_balancer_delegate,
&grpc_lb_v0_Duration_fields),
PB_LAST_FIELD};
const pb_field_t grpc_lb_v0_ServerList_fields[3] = { const pb_field_t grpc_lb_v0_ServerList_fields[3] = {
PB_FIELD(1, MESSAGE, REPEATED, CALLBACK, FIRST, grpc_lb_v0_ServerList, PB_FIELD( 1, MESSAGE , REPEATED, CALLBACK, FIRST, grpc_lb_v0_ServerList, servers, servers, &grpc_lb_v0_Server_fields),
servers, servers, &grpc_lb_v0_Server_fields), PB_FIELD( 3, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_ServerList, expiration_interval, servers, &grpc_lb_v0_Duration_fields),
PB_FIELD(3, MESSAGE, OPTIONAL, STATIC, OTHER, grpc_lb_v0_ServerList, PB_LAST_FIELD
expiration_interval, servers, &grpc_lb_v0_Duration_fields), };
PB_LAST_FIELD};
const pb_field_t grpc_lb_v0_Server_fields[5] = { const pb_field_t grpc_lb_v0_Server_fields[5] = {
PB_FIELD(1, STRING, OPTIONAL, STATIC, FIRST, grpc_lb_v0_Server, ip_address, PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v0_Server, ip_address, ip_address, 0),
ip_address, 0), PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Server, port, ip_address, 0),
PB_FIELD(2, INT32, OPTIONAL, STATIC, OTHER, grpc_lb_v0_Server, port, PB_FIELD( 3, BYTES , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Server, load_balance_token, port, 0),
ip_address, 0), PB_FIELD( 4, BOOL , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Server, drop_request, load_balance_token, 0),
PB_FIELD(3, BYTES, OPTIONAL, STATIC, OTHER, grpc_lb_v0_Server, PB_LAST_FIELD
load_balance_token, port, 0), };
PB_FIELD(4, BOOL, OPTIONAL, STATIC, OTHER, grpc_lb_v0_Server, drop_request,
load_balance_token, 0),
PB_LAST_FIELD};
/* Check that field information fits in pb_field_t */ /* Check that field information fits in pb_field_t */
#if !defined(PB_FIELD_32BIT) #if !defined(PB_FIELD_32BIT)
/* If you get an error here, it means that you need to define PB_FIELD_32BIT /* If you get an error here, it means that you need to define PB_FIELD_32BIT
* compile-time option. You can do that in pb.h or on compiler command line. * compile-time option. You can do that in pb.h or on compiler command line.
* *
* The reason you need to do this is that some of your messages contain tag * The reason you need to do this is that some of your messages contain tag
* numbers or field sizes that are larger than what can fit in 8 or 16 bit * numbers or field sizes that are larger than what can fit in 8 or 16 bit
* field descriptors. * field descriptors.
*/ */
PB_STATIC_ASSERT( PB_STATIC_ASSERT((pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 65536 && pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval) < 65536 && pb_membersize(grpc_lb_v0_ServerList, servers) < 65536 && pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server)
(pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 65536 &&
pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 65536 &&
pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 65536 &&
pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 65536 &&
pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse,
client_stats_report_interval) < 65536 &&
pb_membersize(grpc_lb_v0_ServerList, servers) < 65536 &&
pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 65536),
YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server)
#endif #endif
#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) #if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT)
/* If you get an error here, it means that you need to define PB_FIELD_16BIT /* If you get an error here, it means that you need to define PB_FIELD_16BIT
* compile-time option. You can do that in pb.h or on compiler command line. * compile-time option. You can do that in pb.h or on compiler command line.
* *
* The reason you need to do this is that some of your messages contain tag * The reason you need to do this is that some of your messages contain tag
* numbers or field sizes that are larger than what can fit in the default * numbers or field sizes that are larger than what can fit in the default
* 8 bit descriptors. * 8 bit descriptors.
*/ */
PB_STATIC_ASSERT( PB_STATIC_ASSERT((pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 256 && pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval) < 256 && pb_membersize(grpc_lb_v0_ServerList, servers) < 256 && pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server)
(pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 256 &&
pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 256 &&
pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 256 &&
pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 256 &&
pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse,
client_stats_report_interval) < 256 &&
pb_membersize(grpc_lb_v0_ServerList, servers) < 256 &&
pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 256),
YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server)
#endif #endif

@ -47,144 +47,104 @@ extern "C" {
/* Enum definitions */ /* Enum definitions */
/* Struct definitions */ /* Struct definitions */
typedef struct _grpc_lb_v0_ClientStats { typedef struct _grpc_lb_v0_ClientStats {
bool has_total_requests; bool has_total_requests;
int64_t total_requests; int64_t total_requests;
bool has_client_rpc_errors; bool has_client_rpc_errors;
int64_t client_rpc_errors; int64_t client_rpc_errors;
bool has_dropped_requests; bool has_dropped_requests;
int64_t dropped_requests; int64_t dropped_requests;
} grpc_lb_v0_ClientStats; } grpc_lb_v0_ClientStats;
typedef struct _grpc_lb_v0_Duration { typedef struct _grpc_lb_v0_Duration {
bool has_seconds; bool has_seconds;
int64_t seconds; int64_t seconds;
bool has_nanos; bool has_nanos;
int32_t nanos; int32_t nanos;
} grpc_lb_v0_Duration; } grpc_lb_v0_Duration;
typedef struct _grpc_lb_v0_InitialLoadBalanceRequest { typedef struct _grpc_lb_v0_InitialLoadBalanceRequest {
bool has_name; bool has_name;
char name[128]; char name[128];
} grpc_lb_v0_InitialLoadBalanceRequest; } grpc_lb_v0_InitialLoadBalanceRequest;
typedef PB_BYTES_ARRAY_T(64) grpc_lb_v0_Server_load_balance_token_t; typedef PB_BYTES_ARRAY_T(64) grpc_lb_v0_Server_load_balance_token_t;
typedef struct _grpc_lb_v0_Server { typedef struct _grpc_lb_v0_Server {
bool has_ip_address; bool has_ip_address;
char ip_address[46]; char ip_address[46];
bool has_port; bool has_port;
int32_t port; int32_t port;
bool has_load_balance_token; bool has_load_balance_token;
grpc_lb_v0_Server_load_balance_token_t load_balance_token; grpc_lb_v0_Server_load_balance_token_t load_balance_token;
bool has_drop_request; bool has_drop_request;
bool drop_request; bool drop_request;
} grpc_lb_v0_Server; } grpc_lb_v0_Server;
typedef struct _grpc_lb_v0_InitialLoadBalanceResponse { typedef struct _grpc_lb_v0_InitialLoadBalanceResponse {
bool has_client_config; bool has_client_config;
char client_config[64]; char client_config[64];
bool has_load_balancer_delegate; bool has_load_balancer_delegate;
char load_balancer_delegate[64]; char load_balancer_delegate[64];
bool has_client_stats_report_interval; bool has_client_stats_report_interval;
grpc_lb_v0_Duration client_stats_report_interval; grpc_lb_v0_Duration client_stats_report_interval;
} grpc_lb_v0_InitialLoadBalanceResponse; } grpc_lb_v0_InitialLoadBalanceResponse;
typedef struct _grpc_lb_v0_LoadBalanceRequest { typedef struct _grpc_lb_v0_LoadBalanceRequest {
bool has_initial_request; bool has_initial_request;
grpc_lb_v0_InitialLoadBalanceRequest initial_request; grpc_lb_v0_InitialLoadBalanceRequest initial_request;
bool has_client_stats; bool has_client_stats;
grpc_lb_v0_ClientStats client_stats; grpc_lb_v0_ClientStats client_stats;
} grpc_lb_v0_LoadBalanceRequest; } grpc_lb_v0_LoadBalanceRequest;
typedef struct _grpc_lb_v0_ServerList { typedef struct _grpc_lb_v0_ServerList {
pb_callback_t servers; pb_callback_t servers;
bool has_expiration_interval; bool has_expiration_interval;
grpc_lb_v0_Duration expiration_interval; grpc_lb_v0_Duration expiration_interval;
} grpc_lb_v0_ServerList; } grpc_lb_v0_ServerList;
typedef struct _grpc_lb_v0_LoadBalanceResponse { typedef struct _grpc_lb_v0_LoadBalanceResponse {
bool has_initial_response; bool has_initial_response;
grpc_lb_v0_InitialLoadBalanceResponse initial_response; grpc_lb_v0_InitialLoadBalanceResponse initial_response;
bool has_server_list; bool has_server_list;
grpc_lb_v0_ServerList server_list; grpc_lb_v0_ServerList server_list;
} grpc_lb_v0_LoadBalanceResponse; } grpc_lb_v0_LoadBalanceResponse;
/* Default values for struct fields */ /* Default values for struct fields */
/* Initializer values for message structs */ /* Initializer values for message structs */
#define grpc_lb_v0_Duration_init_default \ #define grpc_lb_v0_Duration_init_default {false, 0, false, 0}
{ false, 0, false, 0 } #define grpc_lb_v0_LoadBalanceRequest_init_default {false, grpc_lb_v0_InitialLoadBalanceRequest_init_default, false, grpc_lb_v0_ClientStats_init_default}
#define grpc_lb_v0_LoadBalanceRequest_init_default \ #define grpc_lb_v0_InitialLoadBalanceRequest_init_default {false, ""}
{ \ #define grpc_lb_v0_ClientStats_init_default {false, 0, false, 0, false, 0}
false, grpc_lb_v0_InitialLoadBalanceRequest_init_default, false, \ #define grpc_lb_v0_LoadBalanceResponse_init_default {false, grpc_lb_v0_InitialLoadBalanceResponse_init_default, false, grpc_lb_v0_ServerList_init_default}
grpc_lb_v0_ClientStats_init_default \ #define grpc_lb_v0_InitialLoadBalanceResponse_init_default {false, "", false, "", false, grpc_lb_v0_Duration_init_default}
} #define grpc_lb_v0_ServerList_init_default {{{NULL}, NULL}, false, grpc_lb_v0_Duration_init_default}
#define grpc_lb_v0_InitialLoadBalanceRequest_init_default \ #define grpc_lb_v0_Server_init_default {false, "", false, 0, false, {0, {0}}, false, 0}
{ false, "" } #define grpc_lb_v0_Duration_init_zero {false, 0, false, 0}
#define grpc_lb_v0_ClientStats_init_default \ #define grpc_lb_v0_LoadBalanceRequest_init_zero {false, grpc_lb_v0_InitialLoadBalanceRequest_init_zero, false, grpc_lb_v0_ClientStats_init_zero}
{ false, 0, false, 0, false, 0 } #define grpc_lb_v0_InitialLoadBalanceRequest_init_zero {false, ""}
#define grpc_lb_v0_LoadBalanceResponse_init_default \ #define grpc_lb_v0_ClientStats_init_zero {false, 0, false, 0, false, 0}
{ \ #define grpc_lb_v0_LoadBalanceResponse_init_zero {false, grpc_lb_v0_InitialLoadBalanceResponse_init_zero, false, grpc_lb_v0_ServerList_init_zero}
false, grpc_lb_v0_InitialLoadBalanceResponse_init_default, false, \ #define grpc_lb_v0_InitialLoadBalanceResponse_init_zero {false, "", false, "", false, grpc_lb_v0_Duration_init_zero}
grpc_lb_v0_ServerList_init_default \ #define grpc_lb_v0_ServerList_init_zero {{{NULL}, NULL}, false, grpc_lb_v0_Duration_init_zero}
} #define grpc_lb_v0_Server_init_zero {false, "", false, 0, false, {0, {0}}, false, 0}
#define grpc_lb_v0_InitialLoadBalanceResponse_init_default \
{ false, "", false, "", false, grpc_lb_v0_Duration_init_default }
#define grpc_lb_v0_ServerList_init_default \
{ \
{ \
{ NULL } \
, NULL \
} \
, false, grpc_lb_v0_Duration_init_default \
}
#define grpc_lb_v0_Server_init_default \
{ false, "", false, 0, false, {0, {0}}, false, 0 }
#define grpc_lb_v0_Duration_init_zero \
{ false, 0, false, 0 }
#define grpc_lb_v0_LoadBalanceRequest_init_zero \
{ \
false, grpc_lb_v0_InitialLoadBalanceRequest_init_zero, false, \
grpc_lb_v0_ClientStats_init_zero \
}
#define grpc_lb_v0_InitialLoadBalanceRequest_init_zero \
{ false, "" }
#define grpc_lb_v0_ClientStats_init_zero \
{ false, 0, false, 0, false, 0 }
#define grpc_lb_v0_LoadBalanceResponse_init_zero \
{ \
false, grpc_lb_v0_InitialLoadBalanceResponse_init_zero, false, \
grpc_lb_v0_ServerList_init_zero \
}
#define grpc_lb_v0_InitialLoadBalanceResponse_init_zero \
{ false, "", false, "", false, grpc_lb_v0_Duration_init_zero }
#define grpc_lb_v0_ServerList_init_zero \
{ \
{ \
{ NULL } \
, NULL \
} \
, false, grpc_lb_v0_Duration_init_zero \
}
#define grpc_lb_v0_Server_init_zero \
{ false, "", false, 0, false, {0, {0}}, false, 0 }
/* Field tags (for use in manual encoding/decoding) */ /* Field tags (for use in manual encoding/decoding) */
#define grpc_lb_v0_ClientStats_total_requests_tag 1 #define grpc_lb_v0_ClientStats_total_requests_tag 1
#define grpc_lb_v0_ClientStats_client_rpc_errors_tag 2 #define grpc_lb_v0_ClientStats_client_rpc_errors_tag 2
#define grpc_lb_v0_ClientStats_dropped_requests_tag 3 #define grpc_lb_v0_ClientStats_dropped_requests_tag 3
#define grpc_lb_v0_Duration_seconds_tag 1 #define grpc_lb_v0_Duration_seconds_tag 1
#define grpc_lb_v0_Duration_nanos_tag 2 #define grpc_lb_v0_Duration_nanos_tag 2
#define grpc_lb_v0_InitialLoadBalanceRequest_name_tag 1 #define grpc_lb_v0_InitialLoadBalanceRequest_name_tag 1
#define grpc_lb_v0_Server_ip_address_tag 1 #define grpc_lb_v0_Server_ip_address_tag 1
#define grpc_lb_v0_Server_port_tag 2 #define grpc_lb_v0_Server_port_tag 2
#define grpc_lb_v0_Server_load_balance_token_tag 3 #define grpc_lb_v0_Server_load_balance_token_tag 3
#define grpc_lb_v0_Server_drop_request_tag 4 #define grpc_lb_v0_Server_drop_request_tag 4
#define grpc_lb_v0_InitialLoadBalanceResponse_client_config_tag 1 #define grpc_lb_v0_InitialLoadBalanceResponse_client_config_tag 1
#define grpc_lb_v0_InitialLoadBalanceResponse_load_balancer_delegate_tag 2 #define grpc_lb_v0_InitialLoadBalanceResponse_load_balancer_delegate_tag 2
#define grpc_lb_v0_InitialLoadBalanceResponse_client_stats_report_interval_tag 3 #define grpc_lb_v0_InitialLoadBalanceResponse_client_stats_report_interval_tag 3
#define grpc_lb_v0_LoadBalanceRequest_initial_request_tag 1 #define grpc_lb_v0_LoadBalanceRequest_initial_request_tag 1
#define grpc_lb_v0_LoadBalanceRequest_client_stats_tag 2 #define grpc_lb_v0_LoadBalanceRequest_client_stats_tag 2
#define grpc_lb_v0_ServerList_servers_tag 1 #define grpc_lb_v0_ServerList_servers_tag 1
#define grpc_lb_v0_ServerList_expiration_interval_tag 3 #define grpc_lb_v0_ServerList_expiration_interval_tag 3
#define grpc_lb_v0_LoadBalanceResponse_initial_response_tag 1 #define grpc_lb_v0_LoadBalanceResponse_initial_response_tag 1
#define grpc_lb_v0_LoadBalanceResponse_server_list_tag 2 #define grpc_lb_v0_LoadBalanceResponse_server_list_tag 2
@ -200,17 +160,18 @@ extern const pb_field_t grpc_lb_v0_ServerList_fields[3];
extern const pb_field_t grpc_lb_v0_Server_fields[5]; extern const pb_field_t grpc_lb_v0_Server_fields[5];
/* Maximum encoded size of messages (where known) */ /* Maximum encoded size of messages (where known) */
#define grpc_lb_v0_Duration_size 22 #define grpc_lb_v0_Duration_size 22
#define grpc_lb_v0_LoadBalanceRequest_size 169 #define grpc_lb_v0_LoadBalanceRequest_size 169
#define grpc_lb_v0_InitialLoadBalanceRequest_size 131 #define grpc_lb_v0_InitialLoadBalanceRequest_size 131
#define grpc_lb_v0_ClientStats_size 33 #define grpc_lb_v0_ClientStats_size 33
#define grpc_lb_v0_InitialLoadBalanceResponse_size 156 #define grpc_lb_v0_InitialLoadBalanceResponse_size 156
#define grpc_lb_v0_Server_size 127 #define grpc_lb_v0_Server_size 127
/* Message IDs (where set with "msgid" option) */ /* Message IDs (where set with "msgid" option) */
#ifdef PB_MSGID #ifdef PB_MSGID
#define LOAD_BALANCER_MESSAGES #define LOAD_BALANCER_MESSAGES \
#endif #endif

@ -70,9 +70,6 @@ read -r -d '' COPYRIGHT <<'EOF'
EOF EOF
# build clang-format docker image
docker build -t grpc_clang_format tools/dockerfile/grpc_clang_format
CURRENT_YEAR=$(date +%Y) CURRENT_YEAR=$(date +%Y)
COPYRIGHT_FILE=$(mktemp) COPYRIGHT_FILE=$(mktemp)
echo "${COPYRIGHT/<YEAR>/$CURRENT_YEAR}" > $COPYRIGHT_FILE echo "${COPYRIGHT/<YEAR>/$CURRENT_YEAR}" > $COPYRIGHT_FILE
@ -106,6 +103,15 @@ if [[ ! -f "${EXPECTED_OPTIONS_FILE_PATH}" ]]; then
exit 4 exit 4
fi fi
readonly VENV_DIR=$(mktemp -d)
readonly VENV_NAME="nanopb-$(date '+%Y%m%d_%H%M%S_%N')"
pushd $VENV_DIR
virtualenv $VENV_NAME
. $VENV_NAME/bin/activate
popd
pip install protobuf==3.0.0b2
pushd "$(dirname $1)" > /dev/null pushd "$(dirname $1)" > /dev/null
protoc \ protoc \
@ -124,10 +130,7 @@ mv -v $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.c"
cat $COPYRIGHT_FILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" > $TMPFILE cat $COPYRIGHT_FILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" > $TMPFILE
mv -v $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" mv -v $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h"
readonly MOUNTPOINT='/protos' deactivate
docker run --rm=true -v ${HOST_GIT_ROOT}/gens/src/proto/grpc/lb/v0:$MOUNTPOINT \ rm -rf $VENV_DIR
-t grpc_clang_format \
clang-format-3.6 -style="{BasedOnStyle: Google, Language: Cpp}" \
-i $MOUNTPOINT/load_balancer.pb.c $MOUNTPOINT/load_balancer.pb.h
popd > /dev/null popd > /dev/null

@ -33,22 +33,6 @@ set -ex
apt-get install -y autoconf automake libtool curl python-virtualenv apt-get install -y autoconf automake libtool curl python-virtualenv
readonly NANOPB_TMP_OUTPUT="${LOCAL_GIT_ROOT}/gens/src/proto/grpc/lb/v0" readonly NANOPB_TMP_OUTPUT="${LOCAL_GIT_ROOT}/gens/src/proto/grpc/lb/v0"
readonly VENV_DIR=$(mktemp -d)
# create a virtualenv for nanopb's compiler
pushd $VENV_DIR
readonly VENV_NAME="nanopb-$(date '+%Y%m%d_%H%M%S_%N')"
virtualenv $VENV_NAME
. $VENV_NAME/bin/activate
popd
# install proto3
pip install protobuf==3.0.0b2
# change to root directory
cd $(dirname $0)/../..
# build clang-format docker image
docker build -t grpc_clang_format tools/dockerfile/grpc_clang_format
# install protoc version 3 # install protoc version 3
pushd third_party/protobuf pushd third_party/protobuf

@ -44,7 +44,7 @@ for dir in $DIRS
do do
for glob in $GLOB for glob in $GLOB
do do
files="$files `find /local-code/$dir -name $glob -and -not -name *.generated.*`" files="$files `find /local-code/$dir -name $glob -and -not -name *.generated.* -and -not -name *.pb.h -and -not -name *.pb.c`"
done done
done done

Loading…
Cancel
Save