diff options
author | 2016-09-12 18:37:05 -0700 | |
---|---|---|
committer | 2016-09-12 22:57:02 -0700 | |
commit | 331b9c02f9372ef832e612d48b90991c181ba8a7 (patch) | |
tree | 02fa9ad3354a9f13a2f83e7da63b02e04e87c993 /src/core/ext/client_config/lb_policy_factory.h | |
parent | 42adfb89ce3f842bf7a3d24e9f04b32d46644457 (diff) |
Moved LB token changes solely into grpclb.c
Diffstat (limited to 'src/core/ext/client_config/lb_policy_factory.h')
-rw-r--r-- | src/core/ext/client_config/lb_policy_factory.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/core/ext/client_config/lb_policy_factory.h b/src/core/ext/client_config/lb_policy_factory.h index 2125eaba70..e1d67633b4 100644 --- a/src/core/ext/client_config/lb_policy_factory.h +++ b/src/core/ext/client_config/lb_policy_factory.h @@ -47,16 +47,25 @@ struct grpc_lb_policy_factory { const grpc_lb_policy_factory_vtable *vtable; }; -typedef struct grpc_lb_policy_address_token { - uint8_t *token; - size_t token_size; -} grpc_lb_policy_address_token; +/** A resolved address alongside any LB related information associated with it. + * \a user_data, if not \a NULL, is opaque and meant to be consumed by the gRPC + * LB policy. Anywhere else, refer to the functions in \a + * grpc_lb_policy_user_data_vtable to operate with it */ +typedef struct grpc_lb_address { + grpc_resolved_address *resolved_address; + void *user_data; +} grpc_lb_address; + +/** Functions acting upon the opaque \a grpc_lb_address.user_data */ +typedef struct grpc_lb_policy_user_data_vtable { + void *(*copy)(void *); + void (*destroy)(void *); +} grpc_lb_policy_user_data_vtable; typedef struct grpc_lb_policy_args { - grpc_resolved_addresses *addresses; - /* If not NULL, array of load balancing tokens associated with \a addresses, - * on a 1:1 correspondence. Some indices may be NULL for missing tokens. */ - grpc_lb_policy_address_token *tokens; + grpc_lb_address *lb_addresses; + size_t num_addresses; + grpc_lb_policy_user_data_vtable user_data_vtable; grpc_client_channel_factory *client_channel_factory; } grpc_lb_policy_args; |