ibuf = stream_new(ZEBRA_MAX_PACKET_SIZ);
obuf = stream_new(ZEBRA_MAX_PACKET_SIZ);
- hook_register(client_close, release_daemon_label_chunks);
+ hook_register(zapi_client_close, release_daemon_label_chunks);
}
/**
return;
tbl_mgr.lc_list = list_new();
tbl_mgr.lc_list->del = delete_table_chunk;
- hook_register(client_close, release_daemon_table_chunks);
+ hook_register(zapi_client_close, release_daemon_table_chunks);
}
/**
/*
- * Zebra API server.
+ * Zebra API message creation & consumption.
* Portions:
* Copyright (C) 1997-1999 Kunihiro Ishiguro
* Copyright (C) 2015-2018 Cumulus Networks, Inc.
/*
- * Zebra API server.
+ * Zebra API message creation & consumption.
* Portions:
* Copyright (C) 1997-1999 Kunihiro Ishiguro
* Copyright (C) 2015-2018 Cumulus Networks, Inc.
if (!mpls_processq_init(&zebrad))
mpls_enabled = 1;
- hook_register(client_close, zebra_mpls_cleanup_fecs_for_client);
+ hook_register(zapi_client_close, zebra_mpls_cleanup_fecs_for_client);
}
ptm_cb.ptm_sock = -1;
- hook_register(client_close, zebra_ptm_bfd_client_deregister);
+ hook_register(zapi_client_close, zebra_ptm_bfd_client_deregister);
}
void zebra_ptm_finish(void)
RB_INIT(zebra_pw_head, &zvrf->pseudowires);
RB_INIT(zebra_static_pw_head, &zvrf->static_pseudowires);
- hook_register(client_close, zebra_pw_client_close);
+ hook_register(zapi_client_close, zebra_pw_client_close);
}
void zebra_pw_exit(struct zebra_vrf *zvrf)
void zebra_rnh_init(void)
{
- hook_register(client_close, zebra_client_cleanup_rnh);
+ hook_register(zapi_client_close, zebra_client_cleanup_rnh);
}
static inline struct route_table *get_rnh_table(vrf_id_t vrfid, int family,
*/
#include <zebra.h>
-
+
+/* clang-format off */
#include <errno.h> /* for errno */
#include <netinet/in.h> /* for sockaddr_in */
#include <stdint.h> /* for uint8_t */
#include "lib/zclient.h" /* for zmsghdr, ZEBRA_HEADER_SIZE, ZEBRA... */
#include "zebra/debug.h" /* for various debugging macros */
-#include "zebra/label_manager.h" /* for release_daemon_label_chunks, rele... */
#include "zebra/rib.h" /* for rib_score_proto */
-#include "zebra/table_manager.h" /* for release_daemon_table_chunks */
#include "zebra/zapi_msg.h" /* for zserv_handle_commands */
#include "zebra/zebra_vrf.h" /* for zebra_vrf_lookup_by_id, zvrf */
-#include "zebra/zserv.h" /* for zclient */
+#include "zebra/zserv.h" /* for zserv */
+/* clang-format on */
/* Event list of zebra. */
enum event { ZEBRA_READ, ZEBRA_WRITE };
/* Lifecycle ---------------------------------------------------------------- */
/* Hooks for client connect / disconnect */
-DEFINE_HOOK(client_connect, (struct zserv *client), (client));
-DEFINE_KOOH(client_close, (struct zserv *client), (client));
+DEFINE_HOOK(zapi_client_connect, (struct zserv * client), (client));
+DEFINE_KOOH(zapi_client_close, (struct zserv * client), (client));
/* free zebra client information. */
static void zebra_client_free(struct zserv *client)
{
- hook_call(client_close, client);
+ hook_call(zapi_client_close, client);
/* Close file descriptor. */
if (client->sock) {
zebra_vrf_update_all(client);
- hook_call(client_connect, client);
+ hook_call(zapi_client_connect, client);
/* start read loop */
zebra_event(client, ZEBRA_READ);
#ifndef _ZEBRA_ZSERV_H
#define _ZEBRA_ZSERV_H
+/* clang-format off */
#include <stdint.h> /* for uint32_t, uint8_t */
#include <time.h> /* for time_t */
#include "lib/hook.h" /* for DECLARE_HOOK, DECLARE_KOOH */
#include "zebra/zebra_vrf.h" /* for zebra_vrf */
+/* clang-format on */
/* Default port information. */
#define ZEBRA_VTY_PORT 2601
struct zebra_vrf *zvrf
/* Hooks for client connect / disconnect */
-DECLARE_HOOK(client_connect, (struct zserv *client), (client));
-DECLARE_KOOH(client_close, (struct zserv *client), (client));
+DECLARE_HOOK(zapi_client_connect, (struct zserv * client), (client));
+DECLARE_KOOH(zapi_client_close, (struct zserv * client), (client));
/* Zebra instance */
struct zebra_t {