diff options
| author | Emanuele Di Pascale <emanuele@voltanet.io> | 2019-06-27 10:11:35 +0200 | 
|---|---|---|
| committer | Emanuele Di Pascale <emanuele@voltanet.io> | 2019-07-10 15:20:27 +0200 | 
| commit | e11d7c96d7de7f7117dc544f2e6a59a83335d185 (patch) | |
| tree | 2bcc2e595bb91211692cf6ed136c5cad27103fdf /zebra/zserv.c | |
| parent | ff90cc95d510a314e1741357a945a9fabc8a22fb (diff) | |
zebra: label manager refactor
in order to both streamline the code and allow users to
define their own specialized versions of the LM api handlers,
define hooks for the 4 main primitives offered by the label
manager (i.e. connect, disconnect, get_chunk and release_chunk),
and have the existing code be run in response to a hook_call.
Additionally, have the responses to the requesting daemon be
callable from an external API.
Note that the proxy version of the label manager was a source of
issues and hardly used in practice. With the new hooks, users with
more complex requirements can simply plug in their own code to
handle label distribution remotely, so there is no longer a reason
to maintain this code.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Diffstat (limited to 'zebra/zserv.c')
| -rw-r--r-- | zebra/zserv.c | 25 | 
1 files changed, 0 insertions, 25 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c index cb9ca6578b..70b4594813 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -535,28 +535,6 @@ static int zserv_process_messages(struct thread *thread)  int zserv_send_message(struct zserv *client, struct stream *msg)  { -	/* -	 * This is a somewhat poorly named variable added with Zebra's portion -	 * of the label manager. That component does not use the regular -	 * zserv/zapi_msg interface for handling its messages, as the client -	 * itself runs in-process. Instead it uses synchronous writes on the -	 * zserv client's socket directly in the zread* handlers for its -	 * message types. Furthermore, it cannot handle the usual messages -	 * Zebra sends (such as those for interface changes) and so has added -	 * this flag and check here as a hack to suppress all messages that it -	 * does not explicitly know about. -	 * -	 * In any case this needs to be cleaned up at some point. -	 * -	 * See also: -	 *    zread_label_manager_request -	 *    zsend_label_manager_connect_response -	 *    zsend_assign_label_chunk_response -	 *    ... -	 */ -	if (client->is_synchronous) -		return 0; -  	pthread_mutex_lock(&client->obuf_mtx);  	{  		stream_fifo_push(client->obuf_fifo, msg); @@ -710,9 +688,6 @@ static struct zserv *zserv_client_create(int sock)  	}  	client->ridinfo = vrf_bitmap_init(); -	/* by default, it's not a synchronous client */ -	client->is_synchronous = 0; -  	/* Add this client to linked list. */  	listnode_add(zrouter.client_list, client);  | 
