diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/zclient.c | 83 | ||||
| -rw-r--r-- | lib/zclient.h | 2 |
2 files changed, 0 insertions, 85 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index 270f780ed0..de3aed46e9 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -2738,89 +2738,6 @@ stream_failure: } /** - * Connect to srv6 manager in a syncronous way - * - * It first writes the request to zcient output buffer and then - * immediately reads the answer from the input buffer. - * - * @param zclient Zclient used to connect to srv6 manager (zebra) - * @result Result of response - */ -int srv6_manager_connect(struct zclient *zclient) -{ - struct stream *s; - int ret, result = 0; - uint16_t cmd = ZEBRA_SRV6_MANAGER_CONNECT; - - if (zclient_debug) - zlog_debug("Connecting to SRv6 Manager"); - - if (zclient->sock < 0) { - zlog_debug("%s: invalid zclient socket", __func__); - return -1; - } - - /* send request */ - s = zclient->obuf; - stream_reset(s); - zclient_create_header(s, cmd, VRF_DEFAULT); - - stream_putc(s, zclient->redist_default); /* proto */ - stream_putw(s, zclient->instance); /* instance */ - stream_putw_at(s, 0, stream_get_endp(s)); - ret = writen(zclient->sock, s->data, stream_get_endp(s)); - if (ret < 0) { - flog_err(EC_LIB_ZAPI_SOCKET, "Can't write to zclient sock"); - close(zclient->sock); - zclient->sock = -1; - return -1; - } - if (ret == 0) { - flog_err(EC_LIB_ZAPI_SOCKET, "Zclient sock closed"); - close(zclient->sock); - zclient->sock = -1; - return -1; - } - if (zclient_debug) - zlog_debug("SRv6 Manager connect request sent (%d bytes)", ret); - - /* read response */ - if (zclient_read_sync_response(zclient, cmd) != 0) - return -1; - - s = zclient->ibuf; - - /* read instance and proto */ - uint8_t proto; - uint16_t instance; - - STREAM_GETC(s, proto); - STREAM_GETW(s, instance); - - /* sanity */ - if (proto != zclient->redist_default) - flog_err( - EC_LIB_ZAPI_ENCODE, - "Wrong proto (%u) in SRv6 Manager connect response. Should be %u", - proto, zclient->redist_default); - if (instance != zclient->instance) - flog_err( - EC_LIB_ZAPI_ENCODE, - "Wrong instId (%u) in SRv6 Manager connect response. Should be %u", - instance, zclient->instance); - - /* result code */ - STREAM_GETC(s, result); - if (zclient_debug) - zlog_debug("SRv6 Manager connect-response received, result %u", result); - - return (int)result; - -stream_failure: - return -1; -} - -/** * Function to request a srv6-locator chunk in an Asyncronous way * * @param zclient Zclient used to connect to table manager (zebra) diff --git a/lib/zclient.h b/lib/zclient.h index d9ca6a859d..c41d25133d 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -219,7 +219,6 @@ typedef enum { ZEBRA_EVPN_REMOTE_NH_DEL, ZEBRA_SRV6_LOCATOR_ADD, ZEBRA_SRV6_LOCATOR_DELETE, - ZEBRA_SRV6_MANAGER_CONNECT, ZEBRA_SRV6_MANAGER_GET_LOCATOR_CHUNK, ZEBRA_SRV6_MANAGER_RELEASE_LOCATOR_CHUNK, ZEBRA_ERROR, @@ -1070,7 +1069,6 @@ extern int tm_get_table_chunk(struct zclient *zclient, uint32_t chunk_size, uint32_t *start, uint32_t *end); extern int tm_release_table_chunk(struct zclient *zclient, uint32_t start, uint32_t end); -extern int srv6_manager_connect(struct zclient *zclient); extern int srv6_manager_get_locator_chunk(struct zclient *zclient, const char *locator_name); extern int srv6_manager_release_locator_chunk(struct zclient *zclient, |
