Merge pull request #3622 from mjstapp/fix_cpp_compile

libs, daemons: changes to permit c++ compilation
This commit is contained in:
Donald Sharp 2019-02-13 12:47:23 -05:00 committed by GitHub
commit cfef27e56e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
113 changed files with 1142 additions and 201 deletions

View file

@ -147,7 +147,7 @@ dnl - specifically, options to control warnings
AC_USE_SYSTEM_EXTENSIONS AC_USE_SYSTEM_EXTENSIONS
AC_DEFUN([AC_C_FLAG], [{ AC_DEFUN([AC_C_FLAG], [{
m4_pushdef([cachename],[m4_translit([frr_cv_$1],[ =-],[___])]) m4_pushdef([cachename],[m4_translit([frr_cv_$1],[ =-+],[____])])
AC_CACHE_CHECK([[whether $CC supports $1]], cachename, [ AC_CACHE_CHECK([[whether $CC supports $1]], cachename, [
AC_LANG_PUSH([C]) AC_LANG_PUSH([C])
ac_c_flag_save="$CFLAGS" ac_c_flag_save="$CFLAGS"
@ -261,6 +261,9 @@ fi
AC_C_FLAG([-Wno-unused-parameter]) AC_C_FLAG([-Wno-unused-parameter])
AC_C_FLAG([-Wno-missing-field-initializers]) AC_C_FLAG([-Wno-missing-field-initializers])
AC_C_FLAG([-Wc++-compat], [], [CXX_COMPAT_CFLAGS="-Wc++-compat"])
AC_SUBST([CXX_COMPAT_CFLAGS])
dnl ICC emits a broken warning for const char *x = a ? "b" : "c"; dnl ICC emits a broken warning for const char *x = a ? "b" : "c";
dnl for some reason the string consts get 'promoted' to char *, dnl for some reason the string consts get 'promoted' to char *,
dnl triggering a const to non-const conversion warning. dnl triggering a const to non-const conversion warning.

View file

@ -89,7 +89,7 @@ DEFPY(no_router_isis, no_router_isis_cmd, "no router isis WORD$tag",
return CMD_ERR_NOTHING_TODO; return CMD_ERR_NOTHING_TODO;
} }
nb_cli_enqueue_change(vty, ".", NB_OP_DELETE, NULL); nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL);
area = isis_area_lookup(tag); area = isis_area_lookup(tag);
if (area && area->circuit_list && listcount(area->circuit_list)) { if (area && area->circuit_list && listcount(area->circuit_list)) {
for (ALL_LIST_ELEMENTS(area->circuit_list, node, nnode, for (ALL_LIST_ELEMENTS(area->circuit_list, node, nnode,
@ -103,7 +103,7 @@ DEFPY(no_router_isis, no_router_isis_cmd, "no router isis WORD$tag",
temp_xpath, XPATH_MAXLEN, temp_xpath, XPATH_MAXLEN,
"/frr-interface:lib/interface[name='%s'][vrf='%s']/frr-isisd:isis", "/frr-interface:lib/interface[name='%s'][vrf='%s']/frr-isisd:isis",
circuit->interface->name, vrf_name); circuit->interface->name, vrf_name);
nb_cli_enqueue_change(vty, temp_xpath, NB_OP_DELETE, nb_cli_enqueue_change(vty, temp_xpath, NB_OP_DESTROY,
NULL); NULL);
} }
} }
@ -289,7 +289,7 @@ DEFPY(no_ip_router_isis, no_ip_router_isis_cmd,
&& !yang_dnode_get_bool(dnode, && !yang_dnode_get_bool(dnode,
"./frr-isisd:isis/ipv4-routing")) "./frr-isisd:isis/ipv4-routing"))
nb_cli_enqueue_change(vty, "./frr-isisd:isis", nb_cli_enqueue_change(vty, "./frr-isisd:isis",
NB_OP_DELETE, NULL); NB_OP_DESTROY, NULL);
else else
nb_cli_enqueue_change(vty, nb_cli_enqueue_change(vty,
"./frr-isisd:isis/ipv6-routing", "./frr-isisd:isis/ipv6-routing",
@ -299,7 +299,7 @@ DEFPY(no_ip_router_isis, no_ip_router_isis_cmd,
&& !yang_dnode_get_bool(dnode, && !yang_dnode_get_bool(dnode,
"./frr-isisd:isis/ipv6-routing")) "./frr-isisd:isis/ipv6-routing"))
nb_cli_enqueue_change(vty, "./frr-isisd:isis", nb_cli_enqueue_change(vty, "./frr-isisd:isis",
NB_OP_DELETE, NULL); NB_OP_DESTROY, NULL);
else else
nb_cli_enqueue_change(vty, nb_cli_enqueue_change(vty,
"./frr-isisd:isis/ipv4-routing", "./frr-isisd:isis/ipv4-routing",
@ -336,7 +336,7 @@ DEFPY(net, net_cmd, "[no] net WORD",
"XX.XXXX. ... .XXX.XX Network entity title (NET)\n") "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
{ {
nb_cli_enqueue_change(vty, "./area-address", nb_cli_enqueue_change(vty, "./area-address",
no ? NB_OP_DELETE : NB_OP_CREATE, net); no ? NB_OP_DESTROY : NB_OP_CREATE, net);
return nb_cli_apply_changes(vty, NULL); return nb_cli_apply_changes(vty, NULL);
} }
@ -589,7 +589,7 @@ DEFPY(no_area_passwd, no_area_passwd_cmd,
"Configure the authentication password for an area\n" "Configure the authentication password for an area\n"
"Set the authentication password for a routing domain\n") "Set the authentication password for a routing domain\n")
{ {
nb_cli_enqueue_change(vty, ".", NB_OP_DELETE, NULL); nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL);
return nb_cli_apply_changes(vty, "./%s", cmd); return nb_cli_apply_changes(vty, "./%s", cmd);
} }
@ -892,7 +892,7 @@ DEFPY(no_spf_delay_ietf, no_spf_delay_ietf_cmd,
"Maximum duration needed to learn all the events related to a single failure\n" "Maximum duration needed to learn all the events related to a single failure\n"
"Maximum duration needed to learn all the events related to a single failure (in milliseconds)\n") "Maximum duration needed to learn all the events related to a single failure (in milliseconds)\n")
{ {
nb_cli_enqueue_change(vty, "./spf/ietf-backoff-delay", NB_OP_DELETE, nb_cli_enqueue_change(vty, "./spf/ietf-backoff-delay", NB_OP_DESTROY,
NULL); NULL);
return nb_cli_apply_changes(vty, NULL); return nb_cli_apply_changes(vty, NULL);
@ -947,7 +947,7 @@ DEFPY(no_isis_mpls_te_on, no_isis_mpls_te_on_cmd, "no mpls-te [on]",
"Disable the MPLS-TE functionality\n" "Disable the MPLS-TE functionality\n"
"Enable the MPLS-TE functionality\n") "Enable the MPLS-TE functionality\n")
{ {
nb_cli_enqueue_change(vty, "/frr-isisd:isis/mpls-te", NB_OP_DELETE, nb_cli_enqueue_change(vty, "/frr-isisd:isis/mpls-te", NB_OP_DESTROY,
NULL); NULL);
return nb_cli_apply_changes(vty, NULL); return nb_cli_apply_changes(vty, NULL);
@ -1014,16 +1014,16 @@ DEFPY(isis_default_originate, isis_default_originate_cmd,
"Pointer to route-map entries\n") "Pointer to route-map entries\n")
{ {
if (no) if (no)
nb_cli_enqueue_change(vty, ".", NB_OP_DELETE, NULL); nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL);
else { else {
nb_cli_enqueue_change(vty, ".", NB_OP_CREATE, NULL); nb_cli_enqueue_change(vty, ".", NB_OP_CREATE, NULL);
nb_cli_enqueue_change(vty, "./always", NB_OP_MODIFY, nb_cli_enqueue_change(vty, "./always", NB_OP_MODIFY,
always ? "true" : "false"); always ? "true" : "false");
nb_cli_enqueue_change(vty, "./route-map", nb_cli_enqueue_change(vty, "./route-map",
rmap ? NB_OP_MODIFY : NB_OP_DELETE, rmap ? NB_OP_MODIFY : NB_OP_DESTROY,
rmap ? rmap : NULL); rmap ? rmap : NULL);
nb_cli_enqueue_change(vty, "./metric", nb_cli_enqueue_change(vty, "./metric",
metric ? NB_OP_MODIFY : NB_OP_DELETE, metric ? NB_OP_MODIFY : NB_OP_DESTROY,
metric ? metric_str : NULL); metric ? metric_str : NULL);
if (strmatch(ip, "ipv6") && !always) { if (strmatch(ip, "ipv6") && !always) {
vty_out(vty, vty_out(vty,
@ -1094,14 +1094,14 @@ DEFPY(isis_redistribute, isis_redistribute_cmd,
"Pointer to route-map entries\n") "Pointer to route-map entries\n")
{ {
if (no) if (no)
nb_cli_enqueue_change(vty, ".", NB_OP_DELETE, NULL); nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL);
else { else {
nb_cli_enqueue_change(vty, ".", NB_OP_CREATE, NULL); nb_cli_enqueue_change(vty, ".", NB_OP_CREATE, NULL);
nb_cli_enqueue_change(vty, "./route-map", nb_cli_enqueue_change(vty, "./route-map",
route_map ? NB_OP_MODIFY : NB_OP_DELETE, route_map ? NB_OP_MODIFY : NB_OP_DESTROY,
route_map ? route_map : NULL); route_map ? route_map : NULL);
nb_cli_enqueue_change(vty, "./metric", nb_cli_enqueue_change(vty, "./metric",
metric ? NB_OP_MODIFY : NB_OP_DELETE, metric ? NB_OP_MODIFY : NB_OP_DESTROY,
metric ? metric_str : NULL); metric ? metric_str : NULL);
} }
@ -1182,7 +1182,7 @@ DEFPY(isis_topology, isis_topology_cmd,
topology); topology);
if (no) if (no)
nb_cli_enqueue_change(vty, ".", NB_OP_DELETE, NULL); nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL);
else { else {
nb_cli_enqueue_change(vty, ".", NB_OP_CREATE, NULL); nb_cli_enqueue_change(vty, ".", NB_OP_CREATE, NULL);
nb_cli_enqueue_change(vty, "./overload", NB_OP_MODIFY, nb_cli_enqueue_change(vty, "./overload", NB_OP_MODIFY,
@ -1297,7 +1297,7 @@ DEFPY(no_isis_passwd, no_isis_passwd_cmd, "no isis password [<md5|clear> WORD]",
"Cleartext password\n" "Cleartext password\n"
"Circuit password\n") "Circuit password\n")
{ {
nb_cli_enqueue_change(vty, "./frr-isisd:isis/password", NB_OP_DELETE, nb_cli_enqueue_change(vty, "./frr-isisd:isis/password", NB_OP_DESTROY,
NULL); NULL);
return nb_cli_apply_changes(vty, NULL); return nb_cli_apply_changes(vty, NULL);

View file

@ -72,7 +72,7 @@ static int isis_instance_create(enum nb_event event,
return NB_OK; return NB_OK;
} }
static int isis_instance_delete(enum nb_event event, static int isis_instance_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
const char *area_tag; const char *area_tag;
@ -193,7 +193,7 @@ static int isis_instance_area_address_create(enum nb_event event,
return NB_OK; return NB_OK;
} }
static int isis_instance_area_address_delete(enum nb_event event, static int isis_instance_area_address_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
struct area_addr addr, *addrp = NULL; struct area_addr addr, *addrp = NULL;
@ -536,7 +536,7 @@ isis_instance_spf_ietf_backoff_delay_create(enum nb_event event,
} }
static int static int
isis_instance_spf_ietf_backoff_delay_delete(enum nb_event event, isis_instance_spf_ietf_backoff_delay_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
struct isis_area *area; struct isis_area *area;
@ -676,7 +676,7 @@ static int isis_instance_area_password_create(enum nb_event event,
return NB_OK; return NB_OK;
} }
static int isis_instance_area_password_delete(enum nb_event event, static int isis_instance_area_password_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
struct isis_area *area; struct isis_area *area;
@ -755,7 +755,7 @@ static int isis_instance_domain_password_create(enum nb_event event,
return NB_OK; return NB_OK;
} }
static int isis_instance_domain_password_delete(enum nb_event event, static int isis_instance_domain_password_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
struct isis_area *area; struct isis_area *area;
@ -851,7 +851,7 @@ static int isis_instance_default_information_originate_ipv4_create(
return NB_OK; return NB_OK;
} }
static int isis_instance_default_information_originate_ipv4_delete( static int isis_instance_default_information_originate_ipv4_destroy(
enum nb_event event, const struct lyd_node *dnode) enum nb_event event, const struct lyd_node *dnode)
{ {
struct isis_area *area; struct isis_area *area;
@ -889,7 +889,7 @@ static int isis_instance_default_information_originate_ipv4_route_map_modify(
return NB_OK; return NB_OK;
} }
static int isis_instance_default_information_originate_ipv4_route_map_delete( static int isis_instance_default_information_originate_ipv4_route_map_destroy(
enum nb_event event, const struct lyd_node *dnode) enum nb_event event, const struct lyd_node *dnode)
{ {
/* It's all done by default_info_origin_apply_finish */ /* It's all done by default_info_origin_apply_finish */
@ -907,7 +907,7 @@ static int isis_instance_default_information_originate_ipv4_metric_modify(
return NB_OK; return NB_OK;
} }
static int isis_instance_default_information_originate_ipv4_metric_delete( static int isis_instance_default_information_originate_ipv4_metric_destroy(
enum nb_event event, const struct lyd_node *dnode) enum nb_event event, const struct lyd_node *dnode)
{ {
/* It's all done by default_info_origin_apply_finish */ /* It's all done by default_info_origin_apply_finish */
@ -925,7 +925,7 @@ static int isis_instance_default_information_originate_ipv6_create(
return NB_OK; return NB_OK;
} }
static int isis_instance_default_information_originate_ipv6_delete( static int isis_instance_default_information_originate_ipv6_destroy(
enum nb_event event, const struct lyd_node *dnode) enum nb_event event, const struct lyd_node *dnode)
{ {
struct isis_area *area; struct isis_area *area;
@ -963,7 +963,7 @@ static int isis_instance_default_information_originate_ipv6_route_map_modify(
return NB_OK; return NB_OK;
} }
static int isis_instance_default_information_originate_ipv6_route_map_delete( static int isis_instance_default_information_originate_ipv6_route_map_destroy(
enum nb_event event, const struct lyd_node *dnode) enum nb_event event, const struct lyd_node *dnode)
{ {
/* It's all done by default_info_origin_apply_finish */ /* It's all done by default_info_origin_apply_finish */
@ -981,7 +981,7 @@ static int isis_instance_default_information_originate_ipv6_metric_modify(
return NB_OK; return NB_OK;
} }
static int isis_instance_default_information_originate_ipv6_metric_delete( static int isis_instance_default_information_originate_ipv6_metric_destroy(
enum nb_event event, const struct lyd_node *dnode) enum nb_event event, const struct lyd_node *dnode)
{ {
/* It's all done by default_info_origin_apply_finish */ /* It's all done by default_info_origin_apply_finish */
@ -1029,7 +1029,7 @@ static int isis_instance_redistribute_ipv4_create(enum nb_event event,
return NB_OK; return NB_OK;
} }
static int isis_instance_redistribute_ipv4_delete(enum nb_event event, static int isis_instance_redistribute_ipv4_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
struct isis_area *area; struct isis_area *area;
@ -1059,7 +1059,7 @@ isis_instance_redistribute_ipv4_route_map_modify(enum nb_event event,
} }
static int static int
isis_instance_redistribute_ipv4_route_map_delete(enum nb_event event, isis_instance_redistribute_ipv4_route_map_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
/* It's all done by redistribute_apply_finish */ /* It's all done by redistribute_apply_finish */
@ -1079,7 +1079,7 @@ isis_instance_redistribute_ipv4_metric_modify(enum nb_event event,
} }
static int static int
isis_instance_redistribute_ipv4_metric_delete(enum nb_event event, isis_instance_redistribute_ipv4_metric_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
/* It's all done by redistribute_apply_finish */ /* It's all done by redistribute_apply_finish */
@ -1097,7 +1097,7 @@ static int isis_instance_redistribute_ipv6_create(enum nb_event event,
return NB_OK; return NB_OK;
} }
static int isis_instance_redistribute_ipv6_delete(enum nb_event event, static int isis_instance_redistribute_ipv6_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
struct isis_area *area; struct isis_area *area;
@ -1127,7 +1127,7 @@ isis_instance_redistribute_ipv6_route_map_modify(enum nb_event event,
} }
static int static int
isis_instance_redistribute_ipv6_route_map_delete(enum nb_event event, isis_instance_redistribute_ipv6_route_map_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
/* It's all done by redistribute_apply_finish */ /* It's all done by redistribute_apply_finish */
@ -1147,7 +1147,7 @@ isis_instance_redistribute_ipv6_metric_modify(enum nb_event event,
} }
static int static int
isis_instance_redistribute_ipv6_metric_delete(enum nb_event event, isis_instance_redistribute_ipv6_metric_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
/* It's all done by redistribute_apply_finish */ /* It's all done by redistribute_apply_finish */
@ -1217,7 +1217,7 @@ isis_instance_multi_topology_ipv4_multicast_create(enum nb_event event,
} }
static int static int
isis_instance_multi_topology_ipv4_multicast_delete(enum nb_event event, isis_instance_multi_topology_ipv4_multicast_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
return isis_multi_topology_common(event, dnode, "ipv4-multicast", return isis_multi_topology_common(event, dnode, "ipv4-multicast",
@ -1245,7 +1245,7 @@ static int isis_instance_multi_topology_ipv4_management_create(
return isis_multi_topology_common(event, dnode, "ipv4-mgmt", true); return isis_multi_topology_common(event, dnode, "ipv4-mgmt", true);
} }
static int isis_instance_multi_topology_ipv4_management_delete( static int isis_instance_multi_topology_ipv4_management_destroy(
enum nb_event event, const struct lyd_node *dnode) enum nb_event event, const struct lyd_node *dnode)
{ {
return isis_multi_topology_common(event, dnode, "ipv4-mgmt", false); return isis_multi_topology_common(event, dnode, "ipv4-mgmt", false);
@ -1273,7 +1273,7 @@ isis_instance_multi_topology_ipv6_unicast_create(enum nb_event event,
} }
static int static int
isis_instance_multi_topology_ipv6_unicast_delete(enum nb_event event, isis_instance_multi_topology_ipv6_unicast_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
return isis_multi_topology_common(event, dnode, "ipv6-unicast", false); return isis_multi_topology_common(event, dnode, "ipv6-unicast", false);
@ -1302,7 +1302,7 @@ isis_instance_multi_topology_ipv6_multicast_create(enum nb_event event,
} }
static int static int
isis_instance_multi_topology_ipv6_multicast_delete(enum nb_event event, isis_instance_multi_topology_ipv6_multicast_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
return isis_multi_topology_common(event, dnode, "ipv6-multicast", return isis_multi_topology_common(event, dnode, "ipv6-multicast",
@ -1330,7 +1330,7 @@ static int isis_instance_multi_topology_ipv6_management_create(
return isis_multi_topology_common(event, dnode, "ipv6-mgmt", true); return isis_multi_topology_common(event, dnode, "ipv6-mgmt", true);
} }
static int isis_instance_multi_topology_ipv6_management_delete( static int isis_instance_multi_topology_ipv6_management_destroy(
enum nb_event event, const struct lyd_node *dnode) enum nb_event event, const struct lyd_node *dnode)
{ {
return isis_multi_topology_common(event, dnode, "ipv6-mgmt", false); return isis_multi_topology_common(event, dnode, "ipv6-mgmt", false);
@ -1358,7 +1358,7 @@ isis_instance_multi_topology_ipv6_dstsrc_create(enum nb_event event,
} }
static int static int
isis_instance_multi_topology_ipv6_dstsrc_delete(enum nb_event event, isis_instance_multi_topology_ipv6_dstsrc_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
return isis_multi_topology_common(event, dnode, "ipv6-dstsrc", false); return isis_multi_topology_common(event, dnode, "ipv6-dstsrc", false);
@ -1436,7 +1436,7 @@ static int isis_mpls_te_create(enum nb_event event,
return NB_OK; return NB_OK;
} }
static int isis_mpls_te_delete(enum nb_event event, static int isis_mpls_te_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
struct listnode *node; struct listnode *node;
@ -1494,7 +1494,7 @@ static int isis_mpls_te_router_address_modify(enum nb_event event,
return NB_OK; return NB_OK;
} }
static int isis_mpls_te_router_address_delete(enum nb_event event, static int isis_mpls_te_router_address_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
struct listnode *node; struct listnode *node;
@ -1555,7 +1555,7 @@ static int lib_interface_isis_create(enum nb_event event,
return NB_OK; return NB_OK;
} }
static int lib_interface_isis_delete(enum nb_event event, static int lib_interface_isis_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
struct isis_circuit *circuit; struct isis_circuit *circuit;
@ -2062,7 +2062,7 @@ static int lib_interface_isis_password_create(enum nb_event event,
return NB_OK; return NB_OK;
} }
static int lib_interface_isis_password_delete(enum nb_event event, static int lib_interface_isis_password_destroy(enum nb_event event,
const struct lyd_node *dnode) const struct lyd_node *dnode)
{ {
struct isis_circuit *circuit; struct isis_circuit *circuit;
@ -2749,7 +2749,7 @@ const struct frr_yang_module_info frr_isisd_info = {
{ {
.xpath = "/frr-isisd:isis/instance", .xpath = "/frr-isisd:isis/instance",
.cbs.create = isis_instance_create, .cbs.create = isis_instance_create,
.cbs.delete = isis_instance_delete, .cbs.destroy = isis_instance_destroy,
.cbs.cli_show = cli_show_router_isis, .cbs.cli_show = cli_show_router_isis,
.priority = NB_DFLT_PRIORITY - 1, .priority = NB_DFLT_PRIORITY - 1,
}, },
@ -2761,7 +2761,7 @@ const struct frr_yang_module_info frr_isisd_info = {
{ {
.xpath = "/frr-isisd:isis/instance/area-address", .xpath = "/frr-isisd:isis/instance/area-address",
.cbs.create = isis_instance_area_address_create, .cbs.create = isis_instance_area_address_create,
.cbs.delete = isis_instance_area_address_delete, .cbs.destroy = isis_instance_area_address_destroy,
.cbs.cli_show = cli_show_isis_area_address, .cbs.cli_show = cli_show_isis_area_address,
}, },
{ {
@ -2833,7 +2833,7 @@ const struct frr_yang_module_info frr_isisd_info = {
{ {
.xpath = "/frr-isisd:isis/instance/spf/ietf-backoff-delay", .xpath = "/frr-isisd:isis/instance/spf/ietf-backoff-delay",
.cbs.create = isis_instance_spf_ietf_backoff_delay_create, .cbs.create = isis_instance_spf_ietf_backoff_delay_create,
.cbs.delete = isis_instance_spf_ietf_backoff_delay_delete, .cbs.destroy = isis_instance_spf_ietf_backoff_delay_destroy,
.cbs.apply_finish = ietf_backoff_delay_apply_finish, .cbs.apply_finish = ietf_backoff_delay_apply_finish,
.cbs.cli_show = cli_show_isis_spf_ietf_backoff, .cbs.cli_show = cli_show_isis_spf_ietf_backoff,
}, },
@ -2872,7 +2872,7 @@ const struct frr_yang_module_info frr_isisd_info = {
{ {
.xpath = "/frr-isisd:isis/instance/area-password", .xpath = "/frr-isisd:isis/instance/area-password",
.cbs.create = isis_instance_area_password_create, .cbs.create = isis_instance_area_password_create,
.cbs.delete = isis_instance_area_password_delete, .cbs.destroy = isis_instance_area_password_destroy,
.cbs.apply_finish = area_password_apply_finish, .cbs.apply_finish = area_password_apply_finish,
.cbs.cli_show = cli_show_isis_area_pwd, .cbs.cli_show = cli_show_isis_area_pwd,
}, },
@ -2891,7 +2891,7 @@ const struct frr_yang_module_info frr_isisd_info = {
{ {
.xpath = "/frr-isisd:isis/instance/domain-password", .xpath = "/frr-isisd:isis/instance/domain-password",
.cbs.create = isis_instance_domain_password_create, .cbs.create = isis_instance_domain_password_create,
.cbs.delete = isis_instance_domain_password_delete, .cbs.destroy = isis_instance_domain_password_destroy,
.cbs.apply_finish = domain_password_apply_finish, .cbs.apply_finish = domain_password_apply_finish,
.cbs.cli_show = cli_show_isis_domain_pwd, .cbs.cli_show = cli_show_isis_domain_pwd,
}, },
@ -2910,7 +2910,7 @@ const struct frr_yang_module_info frr_isisd_info = {
{ {
.xpath = "/frr-isisd:isis/instance/default-information-originate/ipv4", .xpath = "/frr-isisd:isis/instance/default-information-originate/ipv4",
.cbs.create = isis_instance_default_information_originate_ipv4_create, .cbs.create = isis_instance_default_information_originate_ipv4_create,
.cbs.delete = isis_instance_default_information_originate_ipv4_delete, .cbs.destroy = isis_instance_default_information_originate_ipv4_destroy,
.cbs.apply_finish = default_info_origin_ipv4_apply_finish, .cbs.apply_finish = default_info_origin_ipv4_apply_finish,
.cbs.cli_show = cli_show_isis_def_origin_ipv4, .cbs.cli_show = cli_show_isis_def_origin_ipv4,
}, },
@ -2921,17 +2921,17 @@ const struct frr_yang_module_info frr_isisd_info = {
{ {
.xpath = "/frr-isisd:isis/instance/default-information-originate/ipv4/route-map", .xpath = "/frr-isisd:isis/instance/default-information-originate/ipv4/route-map",
.cbs.modify = isis_instance_default_information_originate_ipv4_route_map_modify, .cbs.modify = isis_instance_default_information_originate_ipv4_route_map_modify,
.cbs.delete = isis_instance_default_information_originate_ipv4_route_map_delete, .cbs.destroy = isis_instance_default_information_originate_ipv4_route_map_destroy,
}, },
{ {
.xpath = "/frr-isisd:isis/instance/default-information-originate/ipv4/metric", .xpath = "/frr-isisd:isis/instance/default-information-originate/ipv4/metric",
.cbs.modify = isis_instance_default_information_originate_ipv4_metric_modify, .cbs.modify = isis_instance_default_information_originate_ipv4_metric_modify,
.cbs.delete = isis_instance_default_information_originate_ipv4_metric_delete, .cbs.destroy = isis_instance_default_information_originate_ipv4_metric_destroy,
}, },
{ {
.xpath = "/frr-isisd:isis/instance/default-information-originate/ipv6", .xpath = "/frr-isisd:isis/instance/default-information-originate/ipv6",
.cbs.create = isis_instance_default_information_originate_ipv6_create, .cbs.create = isis_instance_default_information_originate_ipv6_create,
.cbs.delete = isis_instance_default_information_originate_ipv6_delete, .cbs.destroy = isis_instance_default_information_originate_ipv6_destroy,
.cbs.apply_finish = default_info_origin_ipv6_apply_finish, .cbs.apply_finish = default_info_origin_ipv6_apply_finish,
.cbs.cli_show = cli_show_isis_def_origin_ipv6, .cbs.cli_show = cli_show_isis_def_origin_ipv6,
}, },
@ -2942,51 +2942,51 @@ const struct frr_yang_module_info frr_isisd_info = {
{ {
.xpath = "/frr-isisd:isis/instance/default-information-originate/ipv6/route-map", .xpath = "/frr-isisd:isis/instance/default-information-originate/ipv6/route-map",
.cbs.modify = isis_instance_default_information_originate_ipv6_route_map_modify, .cbs.modify = isis_instance_default_information_originate_ipv6_route_map_modify,
.cbs.delete = isis_instance_default_information_originate_ipv6_route_map_delete, .cbs.destroy = isis_instance_default_information_originate_ipv6_route_map_destroy,
}, },
{ {
.xpath = "/frr-isisd:isis/instance/default-information-originate/ipv6/metric", .xpath = "/frr-isisd:isis/instance/default-information-originate/ipv6/metric",
.cbs.modify = isis_instance_default_information_originate_ipv6_metric_modify, .cbs.modify = isis_instance_default_information_originate_ipv6_metric_modify,
.cbs.delete = isis_instance_default_information_originate_ipv6_metric_delete, .cbs.destroy = isis_instance_default_information_originate_ipv6_metric_destroy,
}, },
{ {
.xpath = "/frr-isisd:isis/instance/redistribute/ipv4", .xpath = "/frr-isisd:isis/instance/redistribute/ipv4",
.cbs.create = isis_instance_redistribute_ipv4_create, .cbs.create = isis_instance_redistribute_ipv4_create,
.cbs.delete = isis_instance_redistribute_ipv4_delete, .cbs.destroy = isis_instance_redistribute_ipv4_destroy,
.cbs.apply_finish = redistribute_ipv4_apply_finish, .cbs.apply_finish = redistribute_ipv4_apply_finish,
.cbs.cli_show = cli_show_isis_redistribute_ipv4, .cbs.cli_show = cli_show_isis_redistribute_ipv4,
}, },
{ {
.xpath = "/frr-isisd:isis/instance/redistribute/ipv4/route-map", .xpath = "/frr-isisd:isis/instance/redistribute/ipv4/route-map",
.cbs.modify = isis_instance_redistribute_ipv4_route_map_modify, .cbs.modify = isis_instance_redistribute_ipv4_route_map_modify,
.cbs.delete = isis_instance_redistribute_ipv4_route_map_delete, .cbs.destroy = isis_instance_redistribute_ipv4_route_map_destroy,
}, },
{ {
.xpath = "/frr-isisd:isis/instance/redistribute/ipv4/metric", .xpath = "/frr-isisd:isis/instance/redistribute/ipv4/metric",
.cbs.modify = isis_instance_redistribute_ipv4_metric_modify, .cbs.modify = isis_instance_redistribute_ipv4_metric_modify,
.cbs.delete = isis_instance_redistribute_ipv4_metric_delete, .cbs.destroy = isis_instance_redistribute_ipv4_metric_destroy,
}, },
{ {
.xpath = "/frr-isisd:isis/instance/redistribute/ipv6", .xpath = "/frr-isisd:isis/instance/redistribute/ipv6",
.cbs.create = isis_instance_redistribute_ipv6_create, .cbs.create = isis_instance_redistribute_ipv6_create,
.cbs.delete = isis_instance_redistribute_ipv6_delete, .cbs.destroy = isis_instance_redistribute_ipv6_destroy,
.cbs.apply_finish = redistribute_ipv6_apply_finish, .cbs.apply_finish = redistribute_ipv6_apply_finish,
.cbs.cli_show = cli_show_isis_redistribute_ipv6, .cbs.cli_show = cli_show_isis_redistribute_ipv6,
}, },
{ {
.xpath = "/frr-isisd:isis/instance/redistribute/ipv6/route-map", .xpath = "/frr-isisd:isis/instance/redistribute/ipv6/route-map",
.cbs.modify = isis_instance_redistribute_ipv6_route_map_modify, .cbs.modify = isis_instance_redistribute_ipv6_route_map_modify,
.cbs.delete = isis_instance_redistribute_ipv6_route_map_delete, .cbs.destroy = isis_instance_redistribute_ipv6_route_map_destroy,
}, },
{ {
.xpath = "/frr-isisd:isis/instance/redistribute/ipv6/metric", .xpath = "/frr-isisd:isis/instance/redistribute/ipv6/metric",
.cbs.modify = isis_instance_redistribute_ipv6_metric_modify, .cbs.modify = isis_instance_redistribute_ipv6_metric_modify,
.cbs.delete = isis_instance_redistribute_ipv6_metric_delete, .cbs.destroy = isis_instance_redistribute_ipv6_metric_destroy,
}, },
{ {
.xpath = "/frr-isisd:isis/instance/multi-topology/ipv4-multicast", .xpath = "/frr-isisd:isis/instance/multi-topology/ipv4-multicast",
.cbs.create = isis_instance_multi_topology_ipv4_multicast_create, .cbs.create = isis_instance_multi_topology_ipv4_multicast_create,
.cbs.delete = isis_instance_multi_topology_ipv4_multicast_delete, .cbs.destroy = isis_instance_multi_topology_ipv4_multicast_destroy,
.cbs.cli_show = cli_show_isis_mt_ipv4_multicast, .cbs.cli_show = cli_show_isis_mt_ipv4_multicast,
}, },
{ {
@ -2996,7 +2996,7 @@ const struct frr_yang_module_info frr_isisd_info = {
{ {
.xpath = "/frr-isisd:isis/instance/multi-topology/ipv4-management", .xpath = "/frr-isisd:isis/instance/multi-topology/ipv4-management",
.cbs.create = isis_instance_multi_topology_ipv4_management_create, .cbs.create = isis_instance_multi_topology_ipv4_management_create,
.cbs.delete = isis_instance_multi_topology_ipv4_management_delete, .cbs.destroy = isis_instance_multi_topology_ipv4_management_destroy,
.cbs.cli_show = cli_show_isis_mt_ipv4_mgmt, .cbs.cli_show = cli_show_isis_mt_ipv4_mgmt,
}, },
{ {
@ -3006,7 +3006,7 @@ const struct frr_yang_module_info frr_isisd_info = {
{ {
.xpath = "/frr-isisd:isis/instance/multi-topology/ipv6-unicast", .xpath = "/frr-isisd:isis/instance/multi-topology/ipv6-unicast",
.cbs.create = isis_instance_multi_topology_ipv6_unicast_create, .cbs.create = isis_instance_multi_topology_ipv6_unicast_create,
.cbs.delete = isis_instance_multi_topology_ipv6_unicast_delete, .cbs.destroy = isis_instance_multi_topology_ipv6_unicast_destroy,
.cbs.cli_show = cli_show_isis_mt_ipv6_unicast, .cbs.cli_show = cli_show_isis_mt_ipv6_unicast,
}, },
{ {
@ -3016,7 +3016,7 @@ const struct frr_yang_module_info frr_isisd_info = {
{ {
.xpath = "/frr-isisd:isis/instance/multi-topology/ipv6-multicast", .xpath = "/frr-isisd:isis/instance/multi-topology/ipv6-multicast",
.cbs.create = isis_instance_multi_topology_ipv6_multicast_create, .cbs.create = isis_instance_multi_topology_ipv6_multicast_create,
.cbs.delete = isis_instance_multi_topology_ipv6_multicast_delete, .cbs.destroy = isis_instance_multi_topology_ipv6_multicast_destroy,
.cbs.cli_show = cli_show_isis_mt_ipv6_multicast, .cbs.cli_show = cli_show_isis_mt_ipv6_multicast,
}, },
{ {
@ -3026,7 +3026,7 @@ const struct frr_yang_module_info frr_isisd_info = {
{ {
.xpath = "/frr-isisd:isis/instance/multi-topology/ipv6-management", .xpath = "/frr-isisd:isis/instance/multi-topology/ipv6-management",
.cbs.create = isis_instance_multi_topology_ipv6_management_create, .cbs.create = isis_instance_multi_topology_ipv6_management_create,
.cbs.delete = isis_instance_multi_topology_ipv6_management_delete, .cbs.destroy = isis_instance_multi_topology_ipv6_management_destroy,
.cbs.cli_show = cli_show_isis_mt_ipv6_mgmt, .cbs.cli_show = cli_show_isis_mt_ipv6_mgmt,
}, },
{ {
@ -3036,7 +3036,7 @@ const struct frr_yang_module_info frr_isisd_info = {
{ {
.xpath = "/frr-isisd:isis/instance/multi-topology/ipv6-dstsrc", .xpath = "/frr-isisd:isis/instance/multi-topology/ipv6-dstsrc",
.cbs.create = isis_instance_multi_topology_ipv6_dstsrc_create, .cbs.create = isis_instance_multi_topology_ipv6_dstsrc_create,
.cbs.delete = isis_instance_multi_topology_ipv6_dstsrc_delete, .cbs.destroy = isis_instance_multi_topology_ipv6_dstsrc_destroy,
.cbs.cli_show = cli_show_isis_mt_ipv6_dstsrc, .cbs.cli_show = cli_show_isis_mt_ipv6_dstsrc,
}, },
{ {
@ -3051,19 +3051,19 @@ const struct frr_yang_module_info frr_isisd_info = {
{ {
.xpath = "/frr-isisd:isis/mpls-te", .xpath = "/frr-isisd:isis/mpls-te",
.cbs.create = isis_mpls_te_create, .cbs.create = isis_mpls_te_create,
.cbs.delete = isis_mpls_te_delete, .cbs.destroy = isis_mpls_te_destroy,
.cbs.cli_show = cli_show_isis_mpls_te, .cbs.cli_show = cli_show_isis_mpls_te,
}, },
{ {
.xpath = "/frr-isisd:isis/mpls-te/router-address", .xpath = "/frr-isisd:isis/mpls-te/router-address",
.cbs.modify = isis_mpls_te_router_address_modify, .cbs.modify = isis_mpls_te_router_address_modify,
.cbs.delete = isis_mpls_te_router_address_delete, .cbs.destroy = isis_mpls_te_router_address_destroy,
.cbs.cli_show = cli_show_isis_mpls_te_router_addr, .cbs.cli_show = cli_show_isis_mpls_te_router_addr,
}, },
{ {
.xpath = "/frr-interface:lib/interface/frr-isisd:isis", .xpath = "/frr-interface:lib/interface/frr-isisd:isis",
.cbs.create = lib_interface_isis_create, .cbs.create = lib_interface_isis_create,
.cbs.delete = lib_interface_isis_delete, .cbs.destroy = lib_interface_isis_destroy,
}, },
{ {
.xpath = "/frr-interface:lib/interface/frr-isisd:isis/area-tag", .xpath = "/frr-interface:lib/interface/frr-isisd:isis/area-tag",
@ -3174,7 +3174,7 @@ const struct frr_yang_module_info frr_isisd_info = {
{ {
.xpath = "/frr-interface:lib/interface/frr-isisd:isis/password", .xpath = "/frr-interface:lib/interface/frr-isisd:isis/password",
.cbs.create = lib_interface_isis_password_create, .cbs.create = lib_interface_isis_password_create,
.cbs.delete = lib_interface_isis_password_delete, .cbs.destroy = lib_interface_isis_password_destroy,
.cbs.cli_show = cli_show_ip_isis_password, .cbs.cli_show = cli_show_ip_isis_password,
}, },
{ {

View file

@ -23,6 +23,10 @@
#include "prefix.h" #include "prefix.h"
#include "table.h" #include "table.h"
#ifdef __cplusplus
extern "C" {
#endif
struct agg_table { struct agg_table {
struct route_table *route_table; struct route_table *route_table;
@ -150,4 +154,9 @@ static inline struct agg_table *agg_get_table(struct agg_node *node)
{ {
return (struct agg_table *)route_table_get_info(node->table); return (struct agg_table *)route_table_get_info(node->table);
} }
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -26,6 +26,10 @@
#include "lib/json.h" #include "lib/json.h"
#include "lib/zclient.h" #include "lib/zclient.h"
#ifdef __cplusplus
extern "C" {
#endif
#define BFD_DEF_MIN_RX 300 #define BFD_DEF_MIN_RX 300
#define BFD_MIN_MIN_RX 50 #define BFD_MIN_MIN_RX 50
#define BFD_MAX_MIN_RX 60000 #define BFD_MAX_MIN_RX 60000
@ -104,4 +108,8 @@ extern void bfd_gbl_init(void);
extern void bfd_gbl_exit(void); extern void bfd_gbl_exit(void);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_BFD_H */ #endif /* _ZEBRA_BFD_H */

View file

@ -44,6 +44,10 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef unsigned int word_t; typedef unsigned int word_t;
#define WORD_MAX 0xFFFFFFFF #define WORD_MAX 0xFFFFFFFF
#define WORD_SIZE (sizeof(word_t) * 8) #define WORD_SIZE (sizeof(word_t) * 8)
@ -153,4 +157,8 @@ typedef unsigned int word_t;
} \ } \
} while (0) } while (0)
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -22,6 +22,10 @@
#ifndef _ZEBRA_BUFFER_H #ifndef _ZEBRA_BUFFER_H
#define _ZEBRA_BUFFER_H #define _ZEBRA_BUFFER_H
#ifdef __cplusplus
extern "C" {
#endif
/* Create a new buffer. Memory will be allocated in chunks of the given /* Create a new buffer. Memory will be allocated in chunks of the given
size. If the argument is 0, the library will supply a reasonable size. If the argument is 0, the library will supply a reasonable
default size suitable for buffering socket I/O. */ default size suitable for buffering socket I/O. */
@ -99,4 +103,8 @@ extern buffer_status_t buffer_flush_all(struct buffer *, int fd);
extern buffer_status_t buffer_flush_window(struct buffer *, int fd, int width, extern buffer_status_t buffer_flush_window(struct buffer *, int fd, int width,
int height, int erase, int no_more); int height, int erase, int no_more);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_BUFFER_H */ #endif /* _ZEBRA_BUFFER_H */

View file

@ -1,4 +1,12 @@
#ifdef __cplusplus
extern "C" {
#endif
extern int in_cksum(void *, int); extern int in_cksum(void *, int);
#define FLETCHER_CHECKSUM_VALIDATE 0xffff #define FLETCHER_CHECKSUM_VALIDATE 0xffff
extern uint16_t fletcher_checksum(uint8_t *, const size_t len, extern uint16_t fletcher_checksum(uint8_t *, const size_t len,
const uint16_t offset); const uint16_t offset);
#ifdef __cplusplus
}
#endif

View file

@ -22,7 +22,15 @@
#include <Python.h> #include <Python.h>
#ifdef __cplusplus
extern "C" {
#endif
extern PyObject *clippy_parse(PyObject *self, PyObject *args); extern PyObject *clippy_parse(PyObject *self, PyObject *args);
extern PyMODINIT_FUNC command_py_init(void); extern PyMODINIT_FUNC command_py_init(void);
#ifdef __cplusplus
}
#endif
#endif /* _FRR_CLIPPY_H */ #endif /* _FRR_CLIPPY_H */

View file

@ -1009,7 +1009,7 @@ enum node_type node_parent(enum node_type node)
} }
/* Execute command by argument vline vector. */ /* Execute command by argument vline vector. */
static int cmd_execute_command_real(vector vline, enum filter_type filter, static int cmd_execute_command_real(vector vline, enum cmd_filter_type filter,
struct vty *vty, struct vty *vty,
const struct cmd_element **cmd) const struct cmd_element **cmd)
{ {

View file

@ -30,6 +30,10 @@
#include "hash.h" #include "hash.h"
#include "command_graph.h" #include "command_graph.h"
#ifdef __cplusplus
extern "C" {
#endif
DECLARE_MTYPE(HOST) DECLARE_MTYPE(HOST)
DECLARE_MTYPE(COMPLETION) DECLARE_MTYPE(COMPLETION)
@ -488,4 +492,9 @@ cmd_variable_handler_register(const struct cmd_variable_handler *cvh);
extern char *cmd_variable_comp2str(vector comps, unsigned short cols); extern char *cmd_variable_comp2str(vector comps, unsigned short cols);
extern void command_setup_early_logging(const char *dest, const char *level); extern void command_setup_early_logging(const char *dest, const char *level);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_COMMAND_H */ #endif /* _ZEBRA_COMMAND_H */

View file

@ -32,6 +32,10 @@
#include "vector.h" #include "vector.h"
#include "graph.h" #include "graph.h"
#ifdef __cplusplus
extern "C" {
#endif
DECLARE_MTYPE(CMD_ARG) DECLARE_MTYPE(CMD_ARG)
struct vty; struct vty;
@ -114,7 +118,7 @@ extern void cmd_token_varname_set(struct cmd_token *token, const char *varname);
extern void cmd_graph_parse(struct graph *graph, struct cmd_element *cmd); extern void cmd_graph_parse(struct graph *graph, struct cmd_element *cmd);
extern void cmd_graph_names(struct graph *graph); extern void cmd_graph_names(struct graph *graph);
extern void cmd_graph_merge(struct graph *old, struct graph *new, extern void cmd_graph_merge(struct graph *old, struct graph *n,
int direction); int direction);
/* /*
* Print callback for DOT dumping. * Print callback for DOT dumping.
@ -133,4 +137,8 @@ extern void cmd_graph_node_print_cb(struct graph_node *gn, struct buffer *buf);
*/ */
char *cmd_graph_dump_dot(struct graph *cmdgraph); char *cmd_graph_dump_dot(struct graph *cmdgraph);
#ifdef __cplusplus
}
#endif
#endif /* _FRR_COMMAND_GRAPH_H */ #endif /* _FRR_COMMAND_GRAPH_H */

View file

@ -28,10 +28,14 @@
#include "linklist.h" #include "linklist.h"
#include "command.h" #include "command.h"
#ifdef __cplusplus
extern "C" {
#endif
/* These definitions exist in command.c in the current engine but should be /* These definitions exist in command.c in the current engine but should be
* relocated here in the new engine * relocated here in the new engine
*/ */
enum filter_type { FILTER_RELAXED, FILTER_STRICT }; enum cmd_filter_type { FILTER_RELAXED, FILTER_STRICT };
/* matcher result value */ /* matcher result value */
enum matcher_rv { enum matcher_rv {
@ -98,4 +102,8 @@ enum matcher_rv command_match(struct graph *cmdgraph, vector vline,
enum matcher_rv command_complete(struct graph *cmdgraph, vector vline, enum matcher_rv command_complete(struct graph *cmdgraph, vector vline,
struct list **completions); struct list **completions);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_COMMAND_MATCH_H */ #endif /* _ZEBRA_COMMAND_MATCH_H */

View file

@ -17,6 +17,10 @@
#ifndef _FRR_COMPILER_H #ifndef _FRR_COMPILER_H
#define _FRR_COMPILER_H #define _FRR_COMPILER_H
#ifdef __cplusplus
extern "C" {
#endif
/* function attributes, use like /* function attributes, use like
* void prototype(void) __attribute__((_CONSTRUCTOR(100))); * void prototype(void) __attribute__((_CONSTRUCTOR(100)));
*/ */
@ -88,4 +92,8 @@
#define CPP_NOTICE(text) #define CPP_NOTICE(text)
#endif #endif
#ifdef __cplusplus
}
#endif
#endif /* _FRR_COMPILER_H */ #endif /* _FRR_COMPILER_H */

View file

@ -70,6 +70,10 @@
#include <stdarg.h> #include <stdarg.h>
#include <sys/queue.h> #include <sys/queue.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _csv_field_t_ csv_field_t; typedef struct _csv_field_t_ csv_field_t;
typedef struct _csv_record_t_ csv_record_t; typedef struct _csv_record_t_ csv_record_t;
typedef struct _csv_t_ csv_t; typedef struct _csv_t_ csv_t;
@ -185,4 +189,8 @@ void csv_clone_record(csv_t *csv, csv_record_t *in_rec, csv_record_t **out_rec);
*/ */
int csv_num_records(csv_t *csv); int csv_num_records(csv_t *csv);
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -38,6 +38,10 @@
#include <sqlite3.h> #include <sqlite3.h>
#ifdef __cplusplus
extern "C" {
#endif
extern int db_init(const char *path_fmt, ...); extern int db_init(const char *path_fmt, ...);
extern int db_close(void); extern int db_close(void);
extern int db_bindf(struct sqlite3_stmt *ss, const char *fmt, ...); extern int db_bindf(struct sqlite3_stmt *ss, const char *fmt, ...);
@ -48,5 +52,9 @@ extern int db_loadf(struct sqlite3_stmt *ss, const char *fmt, ...);
extern void db_finalize(struct sqlite3_stmt **ss); extern void db_finalize(struct sqlite3_stmt **ss);
extern int db_execute(const char *stmt_fmt, ...); extern int db_execute(const char *stmt_fmt, ...);
#ifdef __cplusplus
}
#endif
#endif /* HAVE_SQLITE3 */ #endif /* HAVE_SQLITE3 */
#endif /* _FRR_DB_H_ */ #endif /* _FRR_DB_H_ */

View file

@ -24,6 +24,10 @@
#include "command.h" #include "command.h"
#include "frratomic.h" #include "frratomic.h"
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* Debugging modes. * Debugging modes.
* *
@ -76,7 +80,7 @@
* Human-readable description of this debugging record. * Human-readable description of this debugging record.
*/ */
struct debug { struct debug {
_Atomic uint32_t flags; atomic_uint_fast32_t flags;
const char *desc; const char *desc;
}; };
@ -231,4 +235,8 @@ struct debug_callbacks {
*/ */
void debug_init(const struct debug_callbacks *cb); void debug_init(const struct debug_callbacks *cb);
#ifdef __cplusplus
}
#endif
#endif /* _FRRDEBUG_H */ #endif /* _FRRDEBUG_H */

View file

@ -25,6 +25,10 @@
#include "if.h" #include "if.h"
#include "filter.h" #include "filter.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Disctirubte list types. */ /* Disctirubte list types. */
enum distribute_type { enum distribute_type {
DISTRIBUTE_V4_IN, DISTRIBUTE_V4_IN,
@ -81,4 +85,8 @@ extern enum filter_type distribute_apply_in(struct interface *,
extern enum filter_type distribute_apply_out(struct interface *, extern enum filter_type distribute_apply_out(struct interface *,
struct prefix *); struct prefix *);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_DISTRIBUTE_H */ #endif /* _ZEBRA_DISTRIBUTE_H */

View file

@ -43,6 +43,10 @@
#ifndef _ZEBRA_EVENT_COUNTER_H #ifndef _ZEBRA_EVENT_COUNTER_H
#define _ZEBRA_EVENT_COUNTER_H #define _ZEBRA_EVENT_COUNTER_H
#ifdef __cplusplus
extern "C" {
#endif
struct event_counter { struct event_counter {
unsigned long long count; unsigned long long count;
time_t last; time_t last;
@ -51,4 +55,8 @@ struct event_counter {
void event_counter_inc(struct event_counter *counter); void event_counter_inc(struct event_counter *counter);
const char *event_counter_format(const struct event_counter *counter); const char *event_counter_format(const struct event_counter *counter);
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -27,6 +27,10 @@
#include "vty.h" #include "vty.h"
#ifdef __cplusplus
extern "C" {
#endif
/* return type when this error indication stuff is used. /* return type when this error indication stuff is used.
* *
* guaranteed to have boolean evaluation to "false" when OK, "true" when error * guaranteed to have boolean evaluation to "false" when OK, "true" when error
@ -253,4 +257,8 @@ DEFUN("bla")
#endif /* THIS_IS_AN_EXAMPLE */ #endif /* THIS_IS_AN_EXAMPLE */
#ifdef __cplusplus
}
#endif
#endif /* _FERR_H */ #endif /* _FERR_H */

View file

@ -20,6 +20,10 @@
#ifndef __LIB_FIFO_H__ #ifndef __LIB_FIFO_H__
#define __LIB_FIFO_H__ #define __LIB_FIFO_H__
#ifdef __cplusplus
extern "C" {
#endif
/* FIFO -- first in first out structure and macros. */ /* FIFO -- first in first out structure and macros. */
struct fifo { struct fifo {
struct fifo *next; struct fifo *next;
@ -55,4 +59,8 @@ struct fifo {
#define FIFO_TOP(F) (FIFO_EMPTY(F) ? NULL : ((struct fifo *)(F))->next) #define FIFO_TOP(F) (FIFO_EMPTY(F) ? NULL : ((struct fifo *)(F))->next)
#ifdef __cplusplus
}
#endif
#endif /* __LIB_FIFO_H__ */ #endif /* __LIB_FIFO_H__ */

View file

@ -24,6 +24,10 @@
#include "if.h" #include "if.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Maximum ACL name length */ /* Maximum ACL name length */
#define ACL_NAMSIZ 128 #define ACL_NAMSIZ 128
@ -62,4 +66,8 @@ extern struct access_list *access_list_lookup(afi_t, const char *);
extern enum filter_type access_list_apply(struct access_list *access, extern enum filter_type access_list_apply(struct access_list *access,
const void *object); const void *object);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_FILTER_H */ #endif /* _ZEBRA_FILTER_H */

View file

@ -33,6 +33,10 @@
#ifndef _SYS_QUEUE_H_ #ifndef _SYS_QUEUE_H_
#define _SYS_QUEUE_H_ #define _SYS_QUEUE_H_
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* This file defines four types of data structures: singly-linked lists, * This file defines four types of data structures: singly-linked lists,
* singly-linked tail queues, lists and tail queues. * singly-linked tail queues, lists and tail queues.
@ -675,4 +679,8 @@ struct qm_trace {
(head2)->tqh_last = &(head2)->tqh_first; \ (head2)->tqh_last = &(head2)->tqh_first; \
} while (0) } while (0)
#ifdef __cplusplus
}
#endif
#endif /* !_SYS_QUEUE_H_ */ #endif /* !_SYS_QUEUE_H_ */

View file

@ -25,6 +25,10 @@
#include "memory.h" #include "memory.h"
#include "thread.h" #include "thread.h"
#ifdef __cplusplus
extern "C" {
#endif
DECLARE_MTYPE(FRR_PTHREAD); DECLARE_MTYPE(FRR_PTHREAD);
DECLARE_MTYPE(PTHREAD_PRIM); DECLARE_MTYPE(PTHREAD_PRIM);
@ -73,7 +77,7 @@ struct frr_pthread {
*/ */
pthread_cond_t *running_cond; pthread_cond_t *running_cond;
pthread_mutex_t *running_cond_mtx; pthread_mutex_t *running_cond_mtx;
_Atomic bool running; atomic_bool running;
/* /*
* Fake thread-specific storage. No constraints on usage. Helpful when * Fake thread-specific storage. No constraints on usage. Helpful when
@ -211,4 +215,8 @@ void frr_pthread_stop_all(void);
#define pthread_condattr_setclock(A, B) #define pthread_condattr_setclock(A, B)
#endif #endif
#ifdef __cplusplus
}
#endif
#endif /* _FRR_PTHREAD_H */ #endif /* _FRR_PTHREAD_H */

View file

@ -23,6 +23,10 @@
#include "thread.h" #include "thread.h"
#include <zmq.h> #include <zmq.h>
#ifdef __cplusplus
extern "C" {
#endif
/* linking/packaging note: this is a separate library that needs to be /* linking/packaging note: this is a separate library that needs to be
* linked into any daemon/library/module that wishes to use its * linked into any daemon/library/module that wishes to use its
* functionality. The purpose of this is to encapsulate the libzmq * functionality. The purpose of this is to encapsulate the libzmq
@ -124,4 +128,8 @@ extern void frrzmq_thread_cancel(struct frrzmq_cb **cb, struct cb_core *core);
extern void frrzmq_check_events(struct frrzmq_cb **cbp, struct cb_core *core, extern void frrzmq_check_events(struct frrzmq_cb **cbp, struct cb_core *core,
int event); int event);
#ifdef __cplusplus
}
#endif
#endif /* _FRRZMQ_H */ #endif /* _FRRZMQ_H */

View file

@ -26,7 +26,23 @@
#endif #endif
/* ISO C11 */ /* ISO C11 */
#ifdef HAVE_STDATOMIC_H #ifdef __cplusplus
#include <stdint.h>
#include <atomic>
using std::atomic_int;
using std::memory_order;
using std::memory_order_relaxed;
using std::memory_order_acquire;
using std::memory_order_release;
using std::memory_order_acq_rel;
using std::memory_order_consume;
using std::memory_order_seq_cst;
typedef std::atomic<bool> atomic_bool;
typedef std::atomic<size_t> atomic_size_t;
typedef std::atomic<uint_fast32_t> atomic_uint_fast32_t;
#elif defined(HAVE_STDATOMIC_H)
#include <stdatomic.h> #include <stdatomic.h>
/* These are available in gcc, but not in stdatomic */ /* These are available in gcc, but not in stdatomic */
@ -39,6 +55,7 @@
#elif defined(HAVE___ATOMIC) #elif defined(HAVE___ATOMIC)
#define _Atomic volatile #define _Atomic volatile
#define _ATOMIC_WANT_TYPEDEFS
#define memory_order_relaxed __ATOMIC_RELAXED #define memory_order_relaxed __ATOMIC_RELAXED
#define memory_order_consume __ATOMIC_CONSUME #define memory_order_consume __ATOMIC_CONSUME
@ -74,6 +91,7 @@
#elif defined(HAVE___SYNC) #elif defined(HAVE___SYNC)
#define _Atomic volatile #define _Atomic volatile
#define _ATOMIC_WANT_TYPEDEFS
#define memory_order_relaxed 0 #define memory_order_relaxed 0
#define memory_order_consume 0 #define memory_order_consume 0
@ -198,4 +216,15 @@
#error no atomic functions... #error no atomic functions...
#endif #endif
#ifdef _ATOMIC_WANT_TYPEDEFS
#undef _ATOMIC_WANT_TYPEDEFS
#include <stdint.h>
#include <stdbool.h>
typedef _Atomic bool atomic_bool;
typedef _Atomic size_t atomic_size_t;
typedef _Atomic uint_fast32_t atomic_uint_fast32_t;
#endif
#endif /* _FRRATOMIC_H */ #endif /* _FRRATOMIC_H */

View file

@ -27,6 +27,10 @@
#include "vector.h" #include "vector.h"
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* Tokenizes a string, storing tokens in a vector. Whitespace is ignored. * Tokenizes a string, storing tokens in a vector. Whitespace is ignored.
* Delimiter characters are not included. * Delimiter characters are not included.
@ -108,4 +112,8 @@ bool begins_with(const char *str, const char *prefix);
*/ */
int all_digit(const char *str); int all_digit(const char *str);
#ifdef __cplusplus
}
#endif
#endif /* _FRRSTR_H_ */ #endif /* _FRRSTR_H_ */

View file

@ -28,6 +28,10 @@
#include "vector.h" #include "vector.h"
#include "buffer.h" #include "buffer.h"
#ifdef __cplusplus
extern "C" {
#endif
struct graph { struct graph {
vector nodes; vector nodes;
}; };
@ -164,4 +168,9 @@ char *graph_dump_dot(struct graph *graph, struct graph_node *start,
void (*pcb)(struct graph_node *, struct buffer *buf)); void (*pcb)(struct graph_node *, struct buffer *buf));
#endif /* BUILDING_CLIPPY */ #endif /* BUILDING_CLIPPY */
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_COMMAND_GRAPH_H */ #endif /* _ZEBRA_COMMAND_GRAPH_H */

View file

@ -24,6 +24,10 @@
#include "memory.h" #include "memory.h"
#include "frratomic.h" #include "frratomic.h"
#ifdef __cplusplus
extern "C" {
#endif
DECLARE_MTYPE(HASH) DECLARE_MTYPE(HASH)
DECLARE_MTYPE(HASH_BACKET) DECLARE_MTYPE(HASH_BACKET)
@ -54,9 +58,9 @@ struct hash_backet {
struct hashstats { struct hashstats {
/* number of empty hash buckets */ /* number of empty hash buckets */
_Atomic uint_fast32_t empty; atomic_uint_fast32_t empty;
/* sum of squares of bucket length */ /* sum of squares of bucket length */
_Atomic uint_fast32_t ssq; atomic_uint_fast32_t ssq;
}; };
struct hash { struct hash {
@ -325,4 +329,8 @@ extern unsigned int string_hash_make(const char *);
*/ */
extern void hash_cmd_init(void); extern void hash_cmd_init(void);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_HASH_H */ #endif /* _ZEBRA_HASH_H */

View file

@ -22,6 +22,10 @@
#include "module.h" #include "module.h"
#include "memory.h" #include "memory.h"
#ifdef __cplusplus
extern "C" {
#endif
/* type-safe subscribable hook points /* type-safe subscribable hook points
* *
* where "type-safe" applies to the function pointers used for subscriptions * where "type-safe" applies to the function pointers used for subscriptions
@ -219,4 +223,8 @@ extern void _hook_unregister(struct hook *hook, void *funcptr, void *arg,
#define DEFINE_KOOH(hookname, arglist, passlist) \ #define DEFINE_KOOH(hookname, arglist, passlist) \
DEFINE_HOOK_INT(hookname, arglist, passlist, true) DEFINE_HOOK_INT(hookname, arglist, passlist, true)
#ifdef __cplusplus
}
#endif
#endif /* _FRR_HOOK_H */ #endif /* _FRR_HOOK_H */

View file

@ -24,6 +24,10 @@
#include <limits.h> #include <limits.h>
#include <stdint.h> #include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define IDALLOC_INVALID 0 #define IDALLOC_INVALID 0
#define IDALLOC_DIR_BITS 8 #define IDALLOC_DIR_BITS 8
@ -87,4 +91,8 @@ uint32_t idalloc_reserve(struct id_alloc *alloc, uint32_t id);
struct id_alloc *idalloc_new(const char *name); struct id_alloc *idalloc_new(const char *name);
void idalloc_destroy(struct id_alloc *alloc); void idalloc_destroy(struct id_alloc *alloc);
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -1160,7 +1160,7 @@ DEFPY (no_interface,
if (!vrfname) if (!vrfname)
vrfname = VRF_DEFAULT_NAME; vrfname = VRF_DEFAULT_NAME;
nb_cli_enqueue_change(vty, ".", NB_OP_DELETE, NULL); nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL);
return nb_cli_apply_changes( return nb_cli_apply_changes(
vty, "/frr-interface:lib/interface[name='%s'][vrf='%s']", vty, "/frr-interface:lib/interface[name='%s'][vrf='%s']",
@ -1207,7 +1207,7 @@ DEFPY (no_interface_desc,
NO_STR NO_STR
"Interface specific description\n") "Interface specific description\n")
{ {
nb_cli_enqueue_change(vty, "./description", NB_OP_DELETE, NULL); nb_cli_enqueue_change(vty, "./description", NB_OP_DESTROY, NULL);
return nb_cli_apply_changes(vty, NULL); return nb_cli_apply_changes(vty, NULL);
} }
@ -1379,13 +1379,13 @@ const struct frr_yang_module_info frr_interface_info = {
{ {
.xpath = "/frr-interface:lib/interface", .xpath = "/frr-interface:lib/interface",
.cbs.create = lib_interface_create, .cbs.create = lib_interface_create,
.cbs.delete = lib_interface_delete, .cbs.destroy = lib_interface_delete,
.cbs.cli_show = cli_show_interface, .cbs.cli_show = cli_show_interface,
}, },
{ {
.xpath = "/frr-interface:lib/interface/description", .xpath = "/frr-interface:lib/interface/description",
.cbs.modify = lib_interface_description_modify, .cbs.modify = lib_interface_description_modify,
.cbs.delete = lib_interface_description_delete, .cbs.destroy = lib_interface_description_delete,
.cbs.cli_show = cli_show_interface_desc, .cbs.cli_show = cli_show_interface_desc,
}, },
{ {

View file

@ -27,6 +27,10 @@
#include "qobj.h" #include "qobj.h"
#include "hook.h" #include "hook.h"
#ifdef __cplusplus
extern "C" {
#endif
DECLARE_MTYPE(IF) DECLARE_MTYPE(IF)
DECLARE_MTYPE(CONNECTED_LABEL) DECLARE_MTYPE(CONNECTED_LABEL)
@ -290,9 +294,9 @@ struct interface {
}; };
RB_HEAD(if_name_head, interface); RB_HEAD(if_name_head, interface);
RB_PROTOTYPE(if_name_head, interface, name_entry, if_cmp_func); RB_PROTOTYPE(if_name_head, interface, name_entry, if_cmp_func)
RB_HEAD(if_index_head, interface); RB_HEAD(if_index_head, interface);
RB_PROTOTYPE(if_index_head, interface, index_entry, if_cmp_func); RB_PROTOTYPE(if_index_head, interface, index_entry, if_cmp_func)
DECLARE_QOBJ_TYPE(interface) DECLARE_QOBJ_TYPE(interface)
#define IFNAME_RB_INSERT(vrf, ifp) \ #define IFNAME_RB_INSERT(vrf, ifp) \
@ -545,4 +549,8 @@ void if_link_params_free(struct interface *);
extern void if_cmd_init(void); extern void if_cmd_init(void);
extern const struct frr_yang_module_info frr_interface_info; extern const struct frr_yang_module_info frr_interface_info;
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_IF_H */ #endif /* _ZEBRA_IF_H */

View file

@ -21,6 +21,10 @@
#ifndef _ZEBRA_IF_RMAP_H #ifndef _ZEBRA_IF_RMAP_H
#define _ZEBRA_IF_RMAP_H #define _ZEBRA_IF_RMAP_H
#ifdef __cplusplus
extern "C" {
#endif
enum if_rmap_type { IF_RMAP_IN, IF_RMAP_OUT, IF_RMAP_MAX }; enum if_rmap_type { IF_RMAP_IN, IF_RMAP_OUT, IF_RMAP_MAX };
struct if_rmap { struct if_rmap {
@ -37,4 +41,8 @@ extern void if_rmap_hook_delete(void (*)(struct if_rmap *));
extern struct if_rmap *if_rmap_lookup(const char *); extern struct if_rmap *if_rmap_lookup(const char *);
extern int config_write_if_rmap(struct vty *); extern int config_write_if_rmap(struct vty *);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_IF_RMAP_H */ #endif /* _ZEBRA_IF_RMAP_H */

View file

@ -21,6 +21,10 @@
#ifndef _IMSG_H_ #ifndef _IMSG_H_
#define _IMSG_H_ #define _IMSG_H_
#ifdef __cplusplus
extern "C" {
#endif
#define IBUF_READ_SIZE 65535 #define IBUF_READ_SIZE 65535
#define IMSG_HEADER_SIZE sizeof(struct imsg_hdr) #define IMSG_HEADER_SIZE sizeof(struct imsg_hdr)
#define MAX_IMSGSIZE 16384 #define MAX_IMSGSIZE 16384
@ -108,4 +112,8 @@ void imsg_free(struct imsg *);
int imsg_flush(struct imsgbuf *); int imsg_flush(struct imsgbuf *);
void imsg_clear(struct imsgbuf *); void imsg_clear(struct imsgbuf *);
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -25,6 +25,10 @@
#include <zebra.h> #include <zebra.h>
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* Generic IP address - union of IPv4 and IPv6 address. * Generic IP address - union of IPv4 and IPv6 address.
*/ */
@ -112,4 +116,8 @@ static inline void ipv4_mapped_ipv6_to_ipv4(struct in6_addr *in6,
memcpy(in, (char *)in6 + 12, sizeof(struct in_addr)); memcpy(in, (char *)in6 + 12, sizeof(struct in_addr));
} }
#ifdef __cplusplus
}
#endif
#endif /* __IPADDR_H__ */ #endif /* __IPADDR_H__ */

View file

@ -20,6 +20,10 @@
#ifndef _QUAGGA_JHASH_H #ifndef _QUAGGA_JHASH_H
#define _QUAGGA_JHASH_H #define _QUAGGA_JHASH_H
#ifdef __cplusplus
extern "C" {
#endif
/* The most generic version, hashes an arbitrary sequence /* The most generic version, hashes an arbitrary sequence
* of bytes. No alignment or length assumptions are made about * of bytes. No alignment or length assumptions are made about
* the input key. * the input key.
@ -42,4 +46,8 @@ extern uint32_t jhash_3words(uint32_t a, uint32_t b, uint32_t c,
extern uint32_t jhash_2words(uint32_t a, uint32_t b, uint32_t initval); extern uint32_t jhash_2words(uint32_t a, uint32_t b, uint32_t initval);
extern uint32_t jhash_1word(uint32_t a, uint32_t initval); extern uint32_t jhash_1word(uint32_t a, uint32_t initval);
#ifdef __cplusplus
}
#endif
#endif /* _QUAGGA_JHASH_H */ #endif /* _QUAGGA_JHASH_H */

View file

@ -21,6 +21,10 @@
#ifndef _QUAGGA_JSON_H #ifndef _QUAGGA_JSON_H
#define _QUAGGA_JSON_H #define _QUAGGA_JSON_H
#ifdef __cplusplus
extern "C" {
#endif
#if defined(HAVE_JSON_C_JSON_H) #if defined(HAVE_JSON_C_JSON_H)
#include <json-c/json.h> #include <json-c/json.h>
@ -81,4 +85,8 @@ extern void json_object_free(struct json_object *obj);
#define JSON_C_TO_STRING_NOSLASHESCAPE (1<<4) #define JSON_C_TO_STRING_NOSLASHESCAPE (1<<4)
#endif #endif
#ifdef __cplusplus
}
#endif
#endif /* _QUAGGA_JSON_H */ #endif /* _QUAGGA_JSON_H */

View file

@ -23,6 +23,10 @@
#include "qobj.h" #include "qobj.h"
#ifdef __cplusplus
extern "C" {
#endif
struct keychain { struct keychain {
char *name; char *name;
@ -57,4 +61,8 @@ extern struct key *key_lookup_for_accept(const struct keychain *, uint32_t);
extern struct key *key_match_for_accept(const struct keychain *, const char *); extern struct key *key_match_for_accept(const struct keychain *, const char *);
extern struct key *key_lookup_for_send(const struct keychain *); extern struct key *key_lookup_for_send(const struct keychain *);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_KEYCHAIN_H */ #endif /* _ZEBRA_KEYCHAIN_H */

View file

@ -23,6 +23,10 @@
#include "lib/ferr.h" #include "lib/ferr.h"
#ifdef __cplusplus
extern "C" {
#endif
enum lib_log_refs { enum lib_log_refs {
EC_LIB_PRIVILEGES = LIB_FERR_START, EC_LIB_PRIVILEGES = LIB_FERR_START,
EC_LIB_VRF_START, EC_LIB_VRF_START,
@ -82,4 +86,8 @@ enum lib_log_refs {
extern void lib_error_init(void); extern void lib_error_init(void);
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -30,6 +30,10 @@
#include "hook.h" #include "hook.h"
#include "northbound.h" #include "northbound.h"
#ifdef __cplusplus
extern "C" {
#endif
/* The following options disable specific command line options that /* The following options disable specific command line options that
* are not applicable for a particular daemon. * are not applicable for a particular daemon.
*/ */
@ -152,4 +156,8 @@ extern char frr_protonameinst[];
extern bool debug_memstats_at_exit; extern bool debug_memstats_at_exit;
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_FRR_H */ #endif /* _ZEBRA_FRR_H */

View file

@ -22,6 +22,10 @@
#ifndef _LIBOSPFD_H #ifndef _LIBOSPFD_H
#define _LIBOSPFD_H #define _LIBOSPFD_H
#ifdef __cplusplus
extern "C" {
#endif
/* IP precedence. */ /* IP precedence. */
#ifndef IPTOS_PREC_INTERNETCONTROL #ifndef IPTOS_PREC_INTERNETCONTROL
#define IPTOS_PREC_INTERNETCONTROL 0xC0 #define IPTOS_PREC_INTERNETCONTROL 0xC0
@ -94,4 +98,8 @@
#define OSPF_LSA_MAXAGE_CHECK_INTERVAL 30 #define OSPF_LSA_MAXAGE_CHECK_INTERVAL 30
#define OSPF_LSA_MAXAGE_REMOVE_DELAY_DEFAULT 60 #define OSPF_LSA_MAXAGE_REMOVE_DELAY_DEFAULT 60
#ifdef __cplusplus
}
#endif
#endif /* _LIBOSPFD_H */ #endif /* _LIBOSPFD_H */

View file

@ -21,6 +21,10 @@
#ifndef _ZEBRA_LINKLIST_H #ifndef _ZEBRA_LINKLIST_H
#define _ZEBRA_LINKLIST_H #define _ZEBRA_LINKLIST_H
#ifdef __cplusplus
extern "C" {
#endif
/* listnodes must always contain data to be valid. Adding an empty node /* listnodes must always contain data to be valid. Adding an empty node
* to a list is invalid * to a list is invalid
*/ */
@ -291,7 +295,8 @@ extern void list_add_list(struct list *list, struct list *add);
#define ALL_LIST_ELEMENTS(list, node, nextnode, data) \ #define ALL_LIST_ELEMENTS(list, node, nextnode, data) \
(node) = listhead(list), ((data) = NULL); \ (node) = listhead(list), ((data) = NULL); \
(node) != NULL \ (node) != NULL \
&& ((data) = listgetdata(node), (nextnode) = node->next, 1); \ && ((data) = static_cast(data, listgetdata(node)), \
(nextnode) = node->next, 1); \
(node) = (nextnode), ((data) = NULL) (node) = (nextnode), ((data) = NULL)
/* read-only list iteration macro. /* read-only list iteration macro.
@ -302,7 +307,7 @@ extern void list_add_list(struct list *list, struct list *add);
*/ */
#define ALL_LIST_ELEMENTS_RO(list, node, data) \ #define ALL_LIST_ELEMENTS_RO(list, node, data) \
(node) = listhead(list), ((data) = NULL); \ (node) = listhead(list), ((data) = NULL); \
(node) != NULL && ((data) = listgetdata(node), 1); \ (node) != NULL && ((data) = static_cast(data, listgetdata(node)), 1); \
(node) = listnextnode(node), ((data) = NULL) (node) = listnextnode(node), ((data) = NULL)
/* these *do not* cleanup list nodes and referenced data, as the functions /* these *do not* cleanup list nodes and referenced data, as the functions
@ -336,4 +341,8 @@ extern void list_add_list(struct list *list, struct list *add);
(L)->count--; \ (L)->count--; \
} while (0) } while (0)
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_LINKLIST_H */ #endif /* _ZEBRA_LINKLIST_H */

View file

@ -29,6 +29,10 @@
#include <stdarg.h> #include <stdarg.h>
#include "lib/hook.h" #include "lib/hook.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Hook for external logging function */ /* Hook for external logging function */
DECLARE_HOOK(zebra_ext_log, (int priority, const char *format, va_list args), DECLARE_HOOK(zebra_ext_log, (int priority, const char *format, va_list args),
(priority, format, args)); (priority, format, args));
@ -93,11 +97,11 @@ extern void zlog_debug(const char *format, ...) PRINTF_ATTRIBUTE(1, 2);
/* For logs which have error codes associated with them */ /* For logs which have error codes associated with them */
#define flog_err(ferr_id, format, ...) \ #define flog_err(ferr_id, format, ...) \
zlog_err("[EC %"PRIu32"] " format, ferr_id, ##__VA_ARGS__) zlog_err("[EC %" PRIu32 "] " format, ferr_id, ##__VA_ARGS__)
#define flog_err_sys(ferr_id, format, ...) \ #define flog_err_sys(ferr_id, format, ...) \
flog_err(ferr_id, format, ##__VA_ARGS__) flog_err(ferr_id, format, ##__VA_ARGS__)
#define flog_warn(ferr_id, format, ...) \ #define flog_warn(ferr_id, format, ...) \
zlog_warn("[EC %"PRIu32"] " format, ferr_id, ##__VA_ARGS__) zlog_warn("[EC %" PRIu32 "] " format, ferr_id, ##__VA_ARGS__)
extern void zlog_thread_info(int log_level); extern void zlog_thread_info(int log_level);
@ -196,4 +200,8 @@ struct timestamp_control {
"Local use\n" \ "Local use\n" \
"Local use\n" "Local use\n"
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_LOG_H */ #endif /* _ZEBRA_LOG_H */

View file

@ -24,6 +24,10 @@
#include "log.h" #include "log.h"
#ifdef __cplusplus
extern "C" {
#endif
struct zlog { struct zlog {
const char *ident; /* daemon name (first arg to openlog) */ const char *ident; /* daemon name (first arg to openlog) */
const char *protoname; const char *protoname;
@ -49,4 +53,8 @@ extern const char *zlog_priority[];
extern void vzlog(int priority, const char *format, va_list args); extern void vzlog(int priority, const char *format, va_list args);
extern void zlog(int priority, const char *format, ...) PRINTF_ATTRIBUTE(2, 3); extern void zlog(int priority, const char *format, ...) PRINTF_ATTRIBUTE(2, 3);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_LOG_PRIVATE_H */ #endif /* _ZEBRA_LOG_PRIVATE_H */

View file

@ -20,6 +20,10 @@
#ifndef _ZEBRA_LOGICAL_ROUTER_H #ifndef _ZEBRA_LOGICAL_ROUTER_H
#define _ZEBRA_LOGICAL_ROUTER_H #define _ZEBRA_LOGICAL_ROUTER_H
#ifdef __cplusplus
extern "C" {
#endif
/* Logical Router Backend defines */ /* Logical Router Backend defines */
#define LOGICALROUTER_BACKEND_OFF 0 #define LOGICALROUTER_BACKEND_OFF 0
#define LOGICALROUTER_BACKEND_NETNS 1 #define LOGICALROUTER_BACKEND_NETNS 1
@ -38,4 +42,8 @@ extern void logicalrouter_terminate(void);
*/ */
extern void logicalrouter_configure_backend(int backend_netns); extern void logicalrouter_configure_backend(int backend_netns);
#ifdef __cplusplus
}
#endif
#endif /*_ZEBRA_LOGICAL_ROUTER_H*/ #endif /*_ZEBRA_LOGICAL_ROUTER_H*/

View file

@ -29,6 +29,10 @@
#include <lualib.h> #include <lualib.h>
#include <lauxlib.h> #include <lauxlib.h>
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* These functions are helper functions that * These functions are helper functions that
* try to glom some of the lua_XXX functionality * try to glom some of the lua_XXX functionality
@ -75,5 +79,10 @@ enum lua_rm_status lua_run_rm_rule(lua_State *L, const char *rule);
*/ */
const char *get_string(lua_State *L, const char *key); const char *get_string(lua_State *L, const char *key);
int get_integer(lua_State *L, const char *key); int get_integer(lua_State *L, const char *key);
#ifdef __cplusplus
}
#endif
#endif #endif
#endif #endif

View file

@ -38,6 +38,10 @@
#ifndef _LIBZEBRA_MD5_H_ #ifndef _LIBZEBRA_MD5_H_
#define _LIBZEBRA_MD5_H_ #define _LIBZEBRA_MD5_H_
#ifdef __cplusplus
extern "C" {
#endif
#define MD5_BUFLEN 64 #define MD5_BUFLEN 64
typedef struct { typedef struct {
@ -82,4 +86,8 @@ extern void md5_result(uint8_t *, md5_ctxt *);
void hmac_md5(unsigned char *text, int text_len, unsigned char *key, void hmac_md5(unsigned char *text, int text_len, unsigned char *key,
int key_len, uint8_t *digest); int key_len, uint8_t *digest);
#ifdef __cplusplus
}
#endif
#endif /* ! _LIBZEBRA_MD5_H_*/ #endif /* ! _LIBZEBRA_MD5_H_*/

View file

@ -22,6 +22,10 @@
#include <frratomic.h> #include <frratomic.h>
#include "compiler.h" #include "compiler.h"
#ifdef __cplusplus
extern "C" {
#endif
#define array_size(ar) (sizeof(ar) / sizeof(ar[0])) #define array_size(ar) (sizeof(ar) / sizeof(ar[0]))
#if defined(HAVE_MALLOC_SIZE) && !defined(HAVE_MALLOC_USABLE_SIZE) #if defined(HAVE_MALLOC_SIZE) && !defined(HAVE_MALLOC_USABLE_SIZE)
@ -33,12 +37,12 @@
struct memtype { struct memtype {
struct memtype *next, **ref; struct memtype *next, **ref;
const char *name; const char *name;
_Atomic size_t n_alloc; atomic_size_t n_alloc;
_Atomic size_t n_max; atomic_size_t n_max;
_Atomic size_t size; atomic_size_t size;
#ifdef HAVE_MALLOC_USABLE_SIZE #ifdef HAVE_MALLOC_USABLE_SIZE
_Atomic size_t total; atomic_size_t total;
_Atomic size_t max_size; atomic_size_t max_size;
#endif #endif
}; };
@ -176,4 +180,8 @@ extern int log_memstats(FILE *fp, const char *);
extern void memory_oom(size_t size, const char *name); extern void memory_oom(size_t size, const char *name);
#ifdef __cplusplus
}
#endif
#endif /* _QUAGGA_MEMORY_H */ #endif /* _QUAGGA_MEMORY_H */

View file

@ -23,9 +23,18 @@
#include "memory.h" #include "memory.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void memory_init(void); extern void memory_init(void);
/* Human friendly string for given byte count */ /* Human friendly string for given byte count */
#define MTYPE_MEMSTR_LEN 20 #define MTYPE_MEMSTR_LEN 20
extern const char *mtype_memstr(char *, size_t, unsigned long); extern const char *mtype_memstr(char *, size_t, unsigned long);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_MEMORY_VTY_H */ #endif /* _ZEBRA_MEMORY_VTY_H */

View file

@ -22,6 +22,10 @@
#ifndef __MLAG_H__ #ifndef __MLAG_H__
#define __MLAG_H__ #define __MLAG_H__
#ifdef __cplusplus
extern "C" {
#endif
enum mlag_role { enum mlag_role {
MLAG_ROLE_NONE, MLAG_ROLE_NONE,
MLAG_ROLE_PRIMARY, MLAG_ROLE_PRIMARY,
@ -29,4 +33,9 @@ enum mlag_role {
}; };
extern char *mlag_role2str(enum mlag_role role, char *buf, size_t size); extern char *mlag_role2str(enum mlag_role role, char *buf, size_t size);
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -20,6 +20,10 @@
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(__GNUC__) #if !defined(__GNUC__)
#error module code needs GCC visibility extensions #error module code needs GCC visibility extensions
#elif __GNUC__ < 4 #elif __GNUC__ < 4
@ -78,9 +82,10 @@ extern union _frrmod_runtime_u _frrmod_this_module;
#define FRR_COREMOD_SETUP(...) \ #define FRR_COREMOD_SETUP(...) \
static const struct frrmod_info _frrmod_info = {__VA_ARGS__}; \ static const struct frrmod_info _frrmod_info = {__VA_ARGS__}; \
DSO_LOCAL union _frrmod_runtime_u _frrmod_this_module = { \ DSO_LOCAL union _frrmod_runtime_u _frrmod_this_module = {{ \
.r.info = &_frrmod_info, \ NULL, \
}; &_frrmod_info, \
}};
#define FRR_MODULE_SETUP(...) \ #define FRR_MODULE_SETUP(...) \
FRR_COREMOD_SETUP(__VA_ARGS__) \ FRR_COREMOD_SETUP(__VA_ARGS__) \
DSO_SELF struct frrmod_runtime *frr_module = &_frrmod_this_module.r; DSO_SELF struct frrmod_runtime *frr_module = &_frrmod_this_module.r;
@ -95,4 +100,8 @@ extern struct frrmod_runtime *frrmod_load(const char *spec, const char *dir,
extern void frrmod_unload(struct frrmod_runtime *module); extern void frrmod_unload(struct frrmod_runtime *module);
#endif #endif
#ifdef __cplusplus
}
#endif
#endif /* _FRR_MODULE_H */ #endif /* _FRR_MODULE_H */

View file

@ -21,6 +21,10 @@
#include <time.h> #include <time.h>
#include <sys/time.h> #include <sys/time.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef TIMESPEC_TO_TIMEVAL #ifndef TIMESPEC_TO_TIMEVAL
/* should be in sys/time.h on BSD & Linux libcs */ /* should be in sys/time.h on BSD & Linux libcs */
#define TIMESPEC_TO_TIMEVAL(tv, ts) \ #define TIMESPEC_TO_TIMEVAL(tv, ts) \
@ -91,4 +95,8 @@ static inline char *time_to_string(time_t ts)
return ctime(&tbuf); return ctime(&tbuf);
} }
#ifdef __cplusplus
}
#endif
#endif /* _FRR_MONOTIME_H */ #endif /* _FRR_MONOTIME_H */

View file

@ -25,6 +25,10 @@
#include <zebra.h> #include <zebra.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef MPLS_LABEL_MAX #ifdef MPLS_LABEL_MAX
#undef MPLS_LABEL_MAX #undef MPLS_LABEL_MAX
#endif #endif
@ -209,4 +213,8 @@ int mpls_str2label(const char *label_str, uint8_t *num_labels,
char *mpls_label2str(uint8_t num_labels, mpls_label_t *labels, char *buf, char *mpls_label2str(uint8_t num_labels, mpls_label_t *labels, char *buf,
int len, int pretty); int len, int pretty);
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -22,6 +22,10 @@
#ifndef _ZEBRA_NETWORK_H #ifndef _ZEBRA_NETWORK_H
#define _ZEBRA_NETWORK_H #define _ZEBRA_NETWORK_H
#ifdef __cplusplus
extern "C" {
#endif
/* Both readn and writen are deprecated and will be removed. They are not /* Both readn and writen are deprecated and will be removed. They are not
suitable for use with non-blocking file descriptors. suitable for use with non-blocking file descriptors.
*/ */
@ -41,4 +45,8 @@ extern int set_cloexec(int fd);
extern float htonf(float); extern float htonf(float);
extern float ntohf(float); extern float ntohf(float);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_NETWORK_H */ #endif /* _ZEBRA_NETWORK_H */

View file

@ -26,6 +26,10 @@
#include "prefix.h" #include "prefix.h"
#include "mpls.h" #include "mpls.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Maximum next hop string length - gateway + ifindex */ /* Maximum next hop string length - gateway + ifindex */
#define NEXTHOP_STRLEN (INET6_ADDRSTRLEN + 30) #define NEXTHOP_STRLEN (INET6_ADDRSTRLEN + 30)
@ -146,4 +150,9 @@ extern int nexthop_same_firsthop(struct nexthop *next1, struct nexthop *next2);
extern const char *nexthop2str(const struct nexthop *nexthop, char *str, int size); extern const char *nexthop2str(const struct nexthop *nexthop, char *str, int size);
extern struct nexthop *nexthop_next(struct nexthop *nexthop); extern struct nexthop *nexthop_next(struct nexthop *nexthop);
extern unsigned int nexthop_level(struct nexthop *nexthop); extern unsigned int nexthop_level(struct nexthop *nexthop);
#ifdef __cplusplus
}
#endif
#endif /*_LIB_NEXTHOP_H */ #endif /*_LIB_NEXTHOP_H */

View file

@ -23,6 +23,10 @@
#include <vty.h> #include <vty.h>
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* What is a nexthop group? * What is a nexthop group?
* *
@ -92,12 +96,12 @@ DECLARE_QOBJ_TYPE(nexthop_group_cmd)
* code * code
*/ */
void nexthop_group_init( void nexthop_group_init(
void (*new)(const char *name), void (*create)(const char *name),
void (*add_nexthop)(const struct nexthop_group_cmd *nhgc, void (*add_nexthop)(const struct nexthop_group_cmd *nhgc,
const struct nexthop *nhop), const struct nexthop *nhop),
void (*del_nexthop)(const struct nexthop_group_cmd *nhgc, void (*del_nexthop)(const struct nexthop_group_cmd *nhgc,
const struct nexthop *nhop), const struct nexthop *nhop),
void (*delete)(const char *name)); void (*destroy)(const char *name));
void nexthop_group_enable_vrf(struct vrf *vrf); void nexthop_group_enable_vrf(struct vrf *vrf);
void nexthop_group_disable_vrf(struct vrf *vrf); void nexthop_group_disable_vrf(struct vrf *vrf);
@ -110,4 +114,9 @@ extern struct nexthop *nexthop_exists(struct nexthop_group *nhg,
extern struct nexthop_group_cmd *nhgc_find(const char *name); extern struct nexthop_group_cmd *nhgc_find(const char *name);
extern void nexthop_group_write_nexthop(struct vty *vty, struct nexthop *nh); extern void nexthop_group_write_nexthop(struct vty *vty, struct nexthop *nh);
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -184,8 +184,8 @@ static unsigned int nb_node_validate_cbs(const struct nb_node *nb_node)
!!nb_node->cbs.create, false); !!nb_node->cbs.create, false);
error += nb_node_validate_cb(nb_node, NB_OP_MODIFY, error += nb_node_validate_cb(nb_node, NB_OP_MODIFY,
!!nb_node->cbs.modify, false); !!nb_node->cbs.modify, false);
error += nb_node_validate_cb(nb_node, NB_OP_DELETE, error += nb_node_validate_cb(nb_node, NB_OP_DESTROY,
!!nb_node->cbs.delete, false); !!nb_node->cbs.destroy, false);
error += nb_node_validate_cb(nb_node, NB_OP_MOVE, !!nb_node->cbs.move, error += nb_node_validate_cb(nb_node, NB_OP_MOVE, !!nb_node->cbs.move,
false); false);
error += nb_node_validate_cb(nb_node, NB_OP_APPLY_FINISH, error += nb_node_validate_cb(nb_node, NB_OP_APPLY_FINISH,
@ -417,7 +417,7 @@ static void nb_config_diff(const struct nb_config *config1,
break; break;
case LYD_DIFF_DELETED: case LYD_DIFF_DELETED:
dnode = diff->first[i]; dnode = diff->first[i];
operation = NB_OP_DELETE; operation = NB_OP_DESTROY;
break; break;
case LYD_DIFF_CHANGED: case LYD_DIFF_CHANGED:
dnode = diff->second[i]; dnode = diff->second[i];
@ -485,7 +485,7 @@ int nb_candidate_edit(struct nb_config *candidate,
lyd_validate(&dnode, LYD_OPT_CONFIG, ly_native_ctx); lyd_validate(&dnode, LYD_OPT_CONFIG, ly_native_ctx);
} }
break; break;
case NB_OP_DELETE: case NB_OP_DESTROY:
dnode = yang_dnode_get(candidate->dnode, xpath_edit); dnode = yang_dnode_get(candidate->dnode, xpath_edit);
if (!dnode) if (!dnode)
/* /*
@ -741,8 +741,8 @@ static int nb_configuration_callback(const enum nb_event event,
case NB_OP_MODIFY: case NB_OP_MODIFY:
ret = (*nb_node->cbs.modify)(event, dnode, resource); ret = (*nb_node->cbs.modify)(event, dnode, resource);
break; break;
case NB_OP_DELETE: case NB_OP_DESTROY:
ret = (*nb_node->cbs.delete)(event, dnode); ret = (*nb_node->cbs.destroy)(event, dnode);
break; break;
case NB_OP_MOVE: case NB_OP_MOVE:
ret = (*nb_node->cbs.move)(event, dnode); ret = (*nb_node->cbs.move)(event, dnode);
@ -912,7 +912,7 @@ static void nb_transaction_apply_finish(struct nb_transaction *transaction)
* (the 'apply_finish' callbacks from the node ancestors should * (the 'apply_finish' callbacks from the node ancestors should
* be called though). * be called though).
*/ */
if (change->cb.operation == NB_OP_DELETE) { if (change->cb.operation == NB_OP_DESTROY) {
char xpath[XPATH_MAXLEN]; char xpath[XPATH_MAXLEN];
dnode = dnode->parent; dnode = dnode->parent;
@ -1359,7 +1359,7 @@ bool nb_operation_is_valid(enum nb_operation operation,
return false; return false;
} }
return true; return true;
case NB_OP_DELETE: case NB_OP_DESTROY:
if (!CHECK_FLAG(snode->flags, LYS_CONFIG_W)) if (!CHECK_FLAG(snode->flags, LYS_CONFIG_W))
return false; return false;
@ -1511,8 +1511,8 @@ const char *nb_operation_name(enum nb_operation operation)
return "create"; return "create";
case NB_OP_MODIFY: case NB_OP_MODIFY:
return "modify"; return "modify";
case NB_OP_DELETE: case NB_OP_DESTROY:
return "delete"; return "destroy";
case NB_OP_MOVE: case NB_OP_MOVE:
return "move"; return "move";
case NB_OP_APPLY_FINISH: case NB_OP_APPLY_FINISH:

View file

@ -27,6 +27,10 @@
#include "yang.h" #include "yang.h"
#include "yang_translator.h" #include "yang_translator.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declaration(s). */ /* Forward declaration(s). */
struct vty; struct vty;
@ -65,7 +69,7 @@ enum nb_event {
enum nb_operation { enum nb_operation {
NB_OP_CREATE, NB_OP_CREATE,
NB_OP_MODIFY, NB_OP_MODIFY,
NB_OP_DELETE, NB_OP_DESTROY,
NB_OP_MOVE, NB_OP_MOVE,
NB_OP_APPLY_FINISH, NB_OP_APPLY_FINISH,
NB_OP_GET_ELEM, NB_OP_GET_ELEM,
@ -168,7 +172,7 @@ struct nb_callbacks {
* - NB_ERR_INCONSISTENCY when an inconsistency was detected. * - NB_ERR_INCONSISTENCY when an inconsistency was detected.
* - NB_ERR for other errors. * - NB_ERR for other errors.
*/ */
int (*delete)(enum nb_event event, const struct lyd_node *dnode); int (*destroy)(enum nb_event event, const struct lyd_node *dnode);
/* /*
* Configuration callback. * Configuration callback.
@ -839,4 +843,8 @@ extern void nb_init(struct thread_master *tm, const struct frr_yang_module_info
*/ */
extern void nb_terminate(void); extern void nb_terminate(void);
#ifdef __cplusplus
}
#endif
#endif /* _FRR_NORTHBOUND_H_ */ #endif /* _FRR_NORTHBOUND_H_ */

View file

@ -22,6 +22,10 @@
#include "northbound.h" #include "northbound.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Possible formats in which a configuration can be displayed. */ /* Possible formats in which a configuration can be displayed. */
enum nb_cfg_format { enum nb_cfg_format {
NB_CFG_FMT_CMDS = 0, NB_CFG_FMT_CMDS = 0,
@ -111,4 +115,8 @@ extern void nb_cli_install_default(int node);
extern void nb_cli_init(struct thread_master *tm); extern void nb_cli_init(struct thread_master *tm);
extern void nb_cli_terminate(void); extern void nb_cli_terminate(void);
#ifdef __cplusplus
}
#endif
#endif /* _FRR_NORTHBOUND_CLI_H_ */ #endif /* _FRR_NORTHBOUND_CLI_H_ */

View file

@ -228,7 +228,7 @@ frr_confd_cdb_diff_iter(confd_hkeypath_t *kp, enum cdb_iter_op cdb_op,
nb_op = NB_OP_CREATE; nb_op = NB_OP_CREATE;
break; break;
case MOP_DELETED: case MOP_DELETED:
nb_op = NB_OP_DELETE; nb_op = NB_OP_DESTROY;
break; break;
case MOP_VALUE_SET: case MOP_VALUE_SET:
if (nb_operation_is_valid(NB_OP_MODIFY, nb_node->snode)) if (nb_operation_is_valid(NB_OP_MODIFY, nb_node->snode))

View file

@ -22,6 +22,10 @@
#include "northbound.h" #include "northbound.h"
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* Initialize the northbound database. * Initialize the northbound database.
* *
@ -101,4 +105,8 @@ extern int nb_db_transactions_iterate(
const char *date, const char *comment), const char *date, const char *comment),
void *arg); void *arg);
#ifdef __cplusplus
}
#endif
#endif /* _FRR_NORTHBOUND_DB_H_ */ #endif /* _FRR_NORTHBOUND_DB_H_ */

View file

@ -202,10 +202,10 @@ static int frr_sr_process_change(struct nb_config *candidate,
* notified about the removal of all of its leafs, even the ones * notified about the removal of all of its leafs, even the ones
* that are non-optional. We need to ignore these notifications. * that are non-optional. We need to ignore these notifications.
*/ */
if (!nb_operation_is_valid(NB_OP_DELETE, nb_node->snode)) if (!nb_operation_is_valid(NB_OP_DESTROY, nb_node->snode))
return NB_OK; return NB_OK;
nb_op = NB_OP_DELETE; nb_op = NB_OP_DESTROY;
break; break;
case SR_OP_MOVED: case SR_OP_MOVED:
nb_op = NB_OP_MOVE; nb_op = NB_OP_MOVE;

View file

@ -26,6 +26,10 @@
#include "linklist.h" #include "linklist.h"
#include "vty.h" #include "vty.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef uint32_t ns_id_t; typedef uint32_t ns_id_t;
/* the default NS ID */ /* the default NS ID */
@ -174,4 +178,8 @@ extern int ns_enable(struct ns *ns, void (*func)(ns_id_t, void *));
extern struct ns *ns_get_created(struct ns *ns, char *name, ns_id_t ns_id); extern struct ns *ns_get_created(struct ns *ns, char *name, ns_id_t ns_id);
extern void ns_disable(struct ns *ns); extern void ns_disable(struct ns *ns);
#ifdef __cplusplus
}
#endif
#endif /*_ZEBRA_NS_H*/ #endif /*_ZEBRA_NS_H*/

View file

@ -35,6 +35,10 @@
#ifndef _SYS_QUEUE_H_ #ifndef _SYS_QUEUE_H_
#define _SYS_QUEUE_H_ #define _SYS_QUEUE_H_
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* This file defines five types of data structures: singly-linked lists, * This file defines five types of data structures: singly-linked lists,
* lists, simple queues, tail queues and XOR simple queues. * lists, simple queues, tail queues and XOR simple queues.
@ -572,4 +576,8 @@
} \ } \
} while (0) } while (0)
#ifdef __cplusplus
}
#endif
#endif /* !_SYS_QUEUE_H_ */ #endif /* !_SYS_QUEUE_H_ */

View file

@ -27,6 +27,10 @@
#ifndef _SYS_TREE_H_ #ifndef _SYS_TREE_H_
#define _SYS_TREE_H_ #define _SYS_TREE_H_
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* This file defines data structures for different types of trees: * This file defines data structures for different types of trees:
* splay trees and red-black trees. * splay trees and red-black trees.
@ -397,31 +401,36 @@ int _rb_check(const struct rb_type *, void *, unsigned long);
__attribute__((__unused__)) static inline struct _type \ __attribute__((__unused__)) static inline struct _type \
*_name##_RB_INSERT(struct _name *head, struct _type *elm) \ *_name##_RB_INSERT(struct _name *head, struct _type *elm) \
{ \ { \
return _rb_insert(_name##_RB_TYPE, &head->rbh_root, elm); \ return (struct _type *)_rb_insert( \
_name##_RB_TYPE, &head->rbh_root, elm); \
} \ } \
\ \
__attribute__((__unused__)) static inline struct _type \ __attribute__((__unused__)) static inline struct _type \
*_name##_RB_REMOVE(struct _name *head, struct _type *elm) \ *_name##_RB_REMOVE(struct _name *head, struct _type *elm) \
{ \ { \
return _rb_remove(_name##_RB_TYPE, &head->rbh_root, elm); \ return (struct _type *)_rb_remove( \
_name##_RB_TYPE, &head->rbh_root, elm); \
} \ } \
\ \
__attribute__((__unused__)) static inline struct _type \ __attribute__((__unused__)) static inline struct _type \
*_name##_RB_FIND(struct _name *head, const struct _type *key) \ *_name##_RB_FIND(struct _name *head, const struct _type *key) \
{ \ { \
return _rb_find(_name##_RB_TYPE, &head->rbh_root, key); \ return (struct _type *)_rb_find( \
_name##_RB_TYPE, &head->rbh_root, key); \
} \ } \
\ \
__attribute__((__unused__)) static inline struct _type \ __attribute__((__unused__)) static inline struct _type \
*_name##_RB_NFIND(struct _name *head, const struct _type *key) \ *_name##_RB_NFIND(struct _name *head, const struct _type *key) \
{ \ { \
return _rb_nfind(_name##_RB_TYPE, &head->rbh_root, key); \ return (struct _type *)_rb_nfind( \
_name##_RB_TYPE, &head->rbh_root, key); \
} \ } \
\ \
__attribute__((__unused__)) static inline struct _type \ __attribute__((__unused__)) static inline struct _type \
*_name##_RB_ROOT(struct _name *head) \ *_name##_RB_ROOT(struct _name *head) \
{ \ { \
return _rb_root(_name##_RB_TYPE, &head->rbh_root); \ return (struct _type *)_rb_root( \
_name##_RB_TYPE, &head->rbh_root); \
} \ } \
\ \
__attribute__((__unused__)) static inline int _name##_RB_EMPTY( \ __attribute__((__unused__)) static inline int _name##_RB_EMPTY( \
@ -433,43 +442,45 @@ int _rb_check(const struct rb_type *, void *, unsigned long);
__attribute__((__unused__)) static inline struct _type \ __attribute__((__unused__)) static inline struct _type \
*_name##_RB_MIN(struct _name *head) \ *_name##_RB_MIN(struct _name *head) \
{ \ { \
return _rb_min(_name##_RB_TYPE, &head->rbh_root); \ return (struct _type *)_rb_min( \
_name##_RB_TYPE, &head->rbh_root); \
} \ } \
\ \
__attribute__((__unused__)) static inline struct _type \ __attribute__((__unused__)) static inline struct _type \
*_name##_RB_MAX(struct _name *head) \ *_name##_RB_MAX(struct _name *head) \
{ \ { \
return _rb_max(_name##_RB_TYPE, &head->rbh_root); \ return (struct _type *)_rb_max( \
_name##_RB_TYPE, &head->rbh_root); \
} \ } \
\ \
__attribute__((__unused__)) static inline struct _type \ __attribute__((__unused__)) static inline struct _type \
*_name##_RB_NEXT(struct _type *elm) \ *_name##_RB_NEXT(struct _type *elm) \
{ \ { \
return _rb_next(_name##_RB_TYPE, elm); \ return (struct _type *)_rb_next(_name##_RB_TYPE, elm); \
} \ } \
\ \
__attribute__((__unused__)) static inline struct _type \ __attribute__((__unused__)) static inline struct _type \
*_name##_RB_PREV(struct _type *elm) \ *_name##_RB_PREV(struct _type *elm) \
{ \ { \
return _rb_prev(_name##_RB_TYPE, elm); \ return (struct _type *)_rb_prev(_name##_RB_TYPE, elm); \
} \ } \
\ \
__attribute__((__unused__)) static inline struct _type \ __attribute__((__unused__)) static inline struct _type \
*_name##_RB_LEFT(struct _type *elm) \ *_name##_RB_LEFT(struct _type *elm) \
{ \ { \
return _rb_left(_name##_RB_TYPE, elm); \ return (struct _type *)_rb_left(_name##_RB_TYPE, elm); \
} \ } \
\ \
__attribute__((__unused__)) static inline struct _type \ __attribute__((__unused__)) static inline struct _type \
*_name##_RB_RIGHT(struct _type *elm) \ *_name##_RB_RIGHT(struct _type *elm) \
{ \ { \
return _rb_right(_name##_RB_TYPE, elm); \ return (struct _type *)_rb_right(_name##_RB_TYPE, elm); \
} \ } \
\ \
__attribute__((__unused__)) static inline struct _type \ __attribute__((__unused__)) static inline struct _type \
*_name##_RB_PARENT(struct _type *elm) \ *_name##_RB_PARENT(struct _type *elm) \
{ \ { \
return _rb_parent(_name##_RB_TYPE, elm); \ return (struct _type *)_rb_parent(_name##_RB_TYPE, elm); \
} \ } \
\ \
__attribute__((__unused__)) static inline void _name##_RB_SET_LEFT( \ __attribute__((__unused__)) static inline void _name##_RB_SET_LEFT( \
@ -560,4 +571,8 @@ int _rb_check(const struct rb_type *, void *, unsigned long);
for ((_e) = RB_MAX(_name, (_head)); \ for ((_e) = RB_MAX(_name, (_head)); \
(_e) != NULL && ((_n) = RB_PREV(_name, (_e)), 1); (_e) = (_n)) (_e) != NULL && ((_n) = RB_PREV(_name, (_e)), 1); (_e) = (_n))
#ifdef __cplusplus
}
#endif
#endif /* _SYS_TREE_H_ */ #endif /* _SYS_TREE_H_ */

View file

@ -24,6 +24,10 @@
#include "stream.h" #include "stream.h"
#include "prefix.h" #include "prefix.h"
#ifdef __cplusplus
extern "C" {
#endif
#define PBR_STR "Policy Based Routing\n" #define PBR_STR "Policy Based Routing\n"
/* /*
@ -121,4 +125,8 @@ struct pbr_rule {
extern int zapi_pbr_rule_encode(uint8_t cmd, struct stream *s, extern int zapi_pbr_rule_encode(uint8_t cmd, struct stream *s,
struct pbr_rule *zrule); struct pbr_rule *zrule);
#ifdef __cplusplus
}
#endif
#endif /* _PBR_H */ #endif /* _PBR_H */

View file

@ -27,6 +27,10 @@
#include "stream.h" #include "stream.h"
#include "vty.h" #include "vty.h"
#ifdef __cplusplus
extern "C" {
#endif
enum prefix_list_type { enum prefix_list_type {
PREFIX_DENY, PREFIX_DENY,
PREFIX_PERMIT, PREFIX_PERMIT,
@ -75,4 +79,8 @@ extern void prefix_bgp_orf_remove_all(afi_t, char *);
extern int prefix_bgp_show_prefix_list(struct vty *vty, afi_t afi, char *name, extern int prefix_bgp_show_prefix_list(struct vty *vty, afi_t afi, char *name,
bool use_json); bool use_json);
#ifdef __cplusplus
}
#endif
#endif /* _QUAGGA_PLIST_H */ #endif /* _QUAGGA_PLIST_H */

View file

@ -22,6 +22,10 @@
#ifndef _QUAGGA_PLIST_INT_H #ifndef _QUAGGA_PLIST_INT_H
#define _QUAGGA_PLIST_INT_H #define _QUAGGA_PLIST_INT_H
#ifdef __cplusplus
extern "C" {
#endif
enum prefix_name_type { PREFIX_TYPE_STRING, PREFIX_TYPE_NUMBER }; enum prefix_name_type { PREFIX_TYPE_STRING, PREFIX_TYPE_NUMBER };
struct pltrie_table; struct pltrie_table;
@ -68,4 +72,8 @@ struct prefix_list_entry {
struct prefix_list_entry *next_best; struct prefix_list_entry *next_best;
}; };
#ifdef __cplusplus
}
#endif
#endif /* _QUAGGA_PLIST_INT_H */ #endif /* _QUAGGA_PLIST_INT_H */

View file

@ -21,6 +21,10 @@
#ifndef _ZEBRA_PQUEUE_H #ifndef _ZEBRA_PQUEUE_H
#define _ZEBRA_PQUEUE_H #define _ZEBRA_PQUEUE_H
#ifdef __cplusplus
extern "C" {
#endif
struct pqueue { struct pqueue {
void **array; void **array;
int array_size; int array_size;
@ -43,4 +47,8 @@ extern void pqueue_remove(void *data, struct pqueue *queue);
extern void trickle_down(int index, struct pqueue *queue); extern void trickle_down(int index, struct pqueue *queue);
extern void trickle_up(int index, struct pqueue *queue); extern void trickle_up(int index, struct pqueue *queue);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_PQUEUE_H */ #endif /* _ZEBRA_PQUEUE_H */

View file

@ -35,6 +35,10 @@
#include "ipaddr.h" #include "ipaddr.h"
#include "compiler.h" #include "compiler.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef ETH_ALEN #ifndef ETH_ALEN
#define ETH_ALEN 6 #define ETH_ALEN 6
#endif #endif
@ -276,20 +280,29 @@ struct prefix_sg {
* side, which strips type safety since the cast will accept any pointer * side, which strips type safety since the cast will accept any pointer
* type.) * type.)
*/ */
#ifndef __cplusplus
#define prefixtype(uname, typename, fieldname) \
typename *fieldname;
#else
#define prefixtype(uname, typename, fieldname) \
typename *fieldname; \
uname(typename *x) { this->fieldname = x; }
#endif
union prefixptr { union prefixptr {
struct prefix *p; prefixtype(prefixptr, struct prefix, p)
struct prefix_ipv4 *p4; prefixtype(prefixptr, struct prefix_ipv4, p4)
struct prefix_ipv6 *p6; prefixtype(prefixptr, struct prefix_ipv6, p6)
struct prefix_evpn *evp; prefixtype(prefixptr, struct prefix_evpn, evp)
const struct prefix_fs *fs; prefixtype(prefixptr, struct prefix_fs, fs)
} __attribute__((transparent_union)); } __attribute__((transparent_union));
union prefixconstptr { union prefixconstptr {
const struct prefix *p; prefixtype(prefixconstptr, const struct prefix, p)
const struct prefix_ipv4 *p4; prefixtype(prefixconstptr, const struct prefix_ipv4, p4)
const struct prefix_ipv6 *p6; prefixtype(prefixconstptr, const struct prefix_ipv6, p6)
const struct prefix_evpn *evp; prefixtype(prefixconstptr, const struct prefix_evpn, evp)
const struct prefix_fs *fs; prefixtype(prefixconstptr, const struct prefix_fs, fs)
} __attribute__((transparent_union)); } __attribute__((transparent_union));
#ifndef INET_ADDRSTRLEN #ifndef INET_ADDRSTRLEN
@ -497,4 +510,9 @@ static inline int is_host_route(struct prefix *p)
return (p->prefixlen == IPV6_MAX_BITLEN); return (p->prefixlen == IPV6_MAX_BITLEN);
return 0; return 0;
} }
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_PREFIX_H */ #endif /* _ZEBRA_PREFIX_H */

View file

@ -23,6 +23,10 @@
#ifndef _ZEBRA_PRIVS_H #ifndef _ZEBRA_PRIVS_H
#define _ZEBRA_PRIVS_H #define _ZEBRA_PRIVS_H
#ifdef __cplusplus
extern "C" {
#endif
/* list of zebra capabilities */ /* list of zebra capabilities */
typedef enum { typedef enum {
ZCAP_SETID, ZCAP_SETID,
@ -120,4 +124,8 @@ extern void _zprivs_lower(struct zebra_privs_t **privs);
_zprivs_raise(privs, __func__); \ _zprivs_raise(privs, __func__); \
_once == NULL; _once = (void *)1) _once == NULL; _once = (void *)1)
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_PRIVS_H */ #endif /* _ZEBRA_PRIVS_H */

View file

@ -20,6 +20,10 @@
#ifndef __PTM_LIB_H__ #ifndef __PTM_LIB_H__
#define __PTM_LIB_H__ #define __PTM_LIB_H__
#ifdef __cplusplus
extern "C" {
#endif
#define PTMLIB_MSG_SZ 1024 #define PTMLIB_MSG_SZ 1024
#define PTMLIB_MSG_HDR_LEN 37 #define PTMLIB_MSG_HDR_LEN 37
#define PTMLIB_MSG_VERSION 2 #define PTMLIB_MSG_VERSION 2
@ -65,4 +69,8 @@ int ptm_lib_append_msg(ptm_lib_handle_t *, void *, const char *, const char *);
int ptm_lib_complete_msg(ptm_lib_handle_t *, void *, char *, int *); int ptm_lib_complete_msg(ptm_lib_handle_t *, void *, char *, int *);
int ptm_lib_cleanup_msg(ptm_lib_handle_t *, void *); int ptm_lib_cleanup_msg(ptm_lib_handle_t *, void *);
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -20,6 +20,10 @@
#ifndef _FRR_PW_H #ifndef _FRR_PW_H
#define _FRR_PW_H #define _FRR_PW_H
#ifdef __cplusplus
extern "C" {
#endif
/* L2VPN name length. */ /* L2VPN name length. */
#define L2VPN_NAME_LEN 32 #define L2VPN_NAME_LEN 32
@ -44,9 +48,10 @@ union pw_protocol_fields {
uint32_t pwid; uint32_t pwid;
char vpn_name[L2VPN_NAME_LEN]; char vpn_name[L2VPN_NAME_LEN];
} ldp; } ldp;
struct {
/* TODO */
} bgp;
}; };
#ifdef __cplusplus
}
#endif
#endif /* _FRR_PW_H */ #endif /* _FRR_PW_H */

View file

@ -21,6 +21,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <stddef.h> #include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/* reserve a specific amount of bytes for a struct, which can grow up to /* reserve a specific amount of bytes for a struct, which can grow up to
* that size (or be dummy'd out if not needed) * that size (or be dummy'd out if not needed)
* *
@ -28,11 +32,17 @@
* this is intentional to prevent the struct from growing beyond the allocated * this is intentional to prevent the struct from growing beyond the allocated
* space. * space.
*/ */
#ifndef __cplusplus
#define RESERVED_SPACE_STRUCT(name, fieldname, size) \ #define RESERVED_SPACE_STRUCT(name, fieldname, size) \
struct { \ struct { \
struct name fieldname; \ struct name fieldname; \
char padding##fieldname[size - sizeof(struct name)]; \ char padding##fieldname[size - sizeof(struct name)]; \
}; };
#else
#define RESERVED_SPACE_STRUCT(name, fieldname, size) \
struct name fieldname; \
char padding##fieldname[size - sizeof(struct name)];
#endif
/* don't need struct definitions for these here. code actually using /* don't need struct definitions for these here. code actually using
* these needs to define the struct *before* including this header. * these needs to define the struct *before* including this header.
@ -127,4 +137,8 @@ void *qobj_get_typed(uint64_t id, struct qobj_nodetype *type);
void qobj_init(void); void qobj_init(void);
void qobj_finish(void); void qobj_finish(void);
#ifdef __cplusplus
}
#endif
#endif /* _QOBJ_H */ #endif /* _QOBJ_H */

View file

@ -19,6 +19,10 @@
#ifndef _FRR_QUEUE_H #ifndef _FRR_QUEUE_H
#define _FRR_QUEUE_H #define _FRR_QUEUE_H
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__OpenBSD__) && !defined(STAILQ_HEAD) #if defined(__OpenBSD__) && !defined(STAILQ_HEAD)
#include "openbsd-queue.h" #include "openbsd-queue.h"
@ -85,4 +89,8 @@
}; _elm; }) }; _elm; })
#endif #endif
#ifdef __cplusplus
}
#endif
#endif /* _FRR_QUEUE_H */ #endif /* _FRR_QUEUE_H */

View file

@ -25,6 +25,10 @@
#include "memory.h" #include "memory.h"
#ifdef __cplusplus
extern "C" {
#endif
struct ringbuf { struct ringbuf {
size_t size; size_t size;
ssize_t start; ssize_t start;
@ -122,4 +126,8 @@ void ringbuf_reset(struct ringbuf *buf);
*/ */
void ringbuf_wipe(struct ringbuf *buf); void ringbuf_wipe(struct ringbuf *buf);
#ifdef __cplusplus
}
#endif
#endif /* _FRR_RINGBUF_H_ */ #endif /* _FRR_RINGBUF_H_ */

View file

@ -26,6 +26,10 @@
#include "qobj.h" #include "qobj.h"
#include "vty.h" #include "vty.h"
#ifdef __cplusplus
extern "C" {
#endif
DECLARE_MTYPE(ROUTE_MAP_NAME) DECLARE_MTYPE(ROUTE_MAP_NAME)
DECLARE_MTYPE(ROUTE_MAP_RULE) DECLARE_MTYPE(ROUTE_MAP_RULE)
DECLARE_MTYPE(ROUTE_MAP_COMPILED) DECLARE_MTYPE(ROUTE_MAP_COMPILED)
@ -388,4 +392,8 @@ extern void route_map_counter_increment(struct route_map *map);
/* Decrement the route-map used counter */ /* Decrement the route-map used counter */
extern void route_map_counter_decrement(struct route_map *map); extern void route_map_counter_decrement(struct route_map *map);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_ROUTEMAP_H */ #endif /* _ZEBRA_ROUTEMAP_H */

View file

@ -23,6 +23,10 @@
#ifndef SBUF_H #ifndef SBUF_H
#define SBUF_H #define SBUF_H
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* sbuf provides a simple string buffer. One application where this comes * sbuf provides a simple string buffer. One application where this comes
* in handy is the parsing of binary data: If there is an error in the parsing * in handy is the parsing of binary data: If there is an error in the parsing
@ -76,4 +80,8 @@ void sbuf_free(struct sbuf *buf);
void sbuf_push(struct sbuf *buf, int indent, const char *format, ...) void sbuf_push(struct sbuf *buf, int indent, const char *format, ...)
PRINTF_ATTRIBUTE(3, 4); PRINTF_ATTRIBUTE(3, 4);
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -29,6 +29,10 @@
#ifndef _SHA256_H_ #ifndef _SHA256_H_
#define _SHA256_H_ #define _SHA256_H_
#ifdef __cplusplus
extern "C" {
#endif
typedef struct SHA256Context { typedef struct SHA256Context {
uint32_t state[8]; uint32_t state[8];
uint32_t count[2]; uint32_t count[2];
@ -55,4 +59,8 @@ void HMAC__SHA256_Final(unsigned char[32], HMAC_SHA256_CTX *);
void PBKDF2_SHA256(const uint8_t *, size_t, const uint8_t *, size_t, uint64_t, void PBKDF2_SHA256(const uint8_t *, size_t, const uint8_t *, size_t, uint64_t,
uint8_t *, size_t); uint8_t *, size_t);
#ifdef __cplusplus
}
#endif
#endif /* !_SHA256_H_ */ #endif /* !_SHA256_H_ */

View file

@ -25,6 +25,10 @@
#include <thread.h> #include <thread.h>
#ifdef __cplusplus
extern "C" {
#endif
#define QUAGGA_SIGNAL_TIMER_INTERVAL 2L #define QUAGGA_SIGNAL_TIMER_INTERVAL 2L
struct quagga_signal_t { struct quagga_signal_t {
@ -47,4 +51,8 @@ extern void signal_init(struct thread_master *m, int sigc,
/* check whether there are signals to handle, process any found */ /* check whether there are signals to handle, process any found */
extern int quagga_sigevent_process(void); extern int quagga_sigevent_process(void);
#ifdef __cplusplus
}
#endif
#endif /* _QUAGGA_SIGNAL_H */ #endif /* _QUAGGA_SIGNAL_H */

View file

@ -31,6 +31,10 @@
#ifndef _ZEBRA_SKIPLIST_H #ifndef _ZEBRA_SKIPLIST_H
#define _ZEBRA_SKIPLIST_H #define _ZEBRA_SKIPLIST_H
#ifdef __cplusplus
extern "C" {
#endif
#define SKIPLIST_0TIMER_DEBUG 1 #define SKIPLIST_0TIMER_DEBUG 1
/* /*
@ -122,4 +126,8 @@ extern void skiplist_debug(struct vty *vty, struct skiplist *l);
extern void skiplist_test(struct vty *vty); extern void skiplist_test(struct vty *vty);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_SKIPLIST_H */ #endif /* _ZEBRA_SKIPLIST_H */

View file

@ -26,6 +26,10 @@
#include "thread.h" #include "thread.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Structures here are mostly compatible with UCD SNMP 4.1.1 */ /* Structures here are mostly compatible with UCD SNMP 4.1.1 */
#define MATCH_FAILED (-1) #define MATCH_FAILED (-1)
#define MATCH_SUCCEEDED 0 #define MATCH_SUCCEEDED 0
@ -103,4 +107,8 @@ extern void oid2in_addr(oid[], int, struct in_addr *);
extern void *oid_copy(void *, const void *, size_t); extern void *oid_copy(void *, const void *, size_t);
extern void oid_copy_addr(oid[], struct in_addr *, int); extern void oid_copy_addr(oid[], struct in_addr *, int);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_SNMP_H */ #endif /* _ZEBRA_SNMP_H */

View file

@ -23,6 +23,10 @@
#include "sockunion.h" #include "sockunion.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void setsockopt_so_recvbuf(int sock, int size); extern void setsockopt_so_recvbuf(int sock, int size);
extern void setsockopt_so_sendbuf(const int sock, int size); extern void setsockopt_so_sendbuf(const int sock, int size);
extern int getsockopt_so_sendbuf(const int sock); extern int getsockopt_so_sendbuf(const int sock);
@ -98,4 +102,9 @@ extern void sockopt_iphdrincl_swab_systoh(struct ip *iph);
extern int sockopt_tcp_rtt(int); extern int sockopt_tcp_rtt(int);
extern int sockopt_tcp_signature(int sock, union sockunion *su, extern int sockopt_tcp_signature(int sock, union sockunion *su,
const char *password); const char *password);
#ifdef __cplusplus
}
#endif
#endif /*_ZEBRA_SOCKOPT_H */ #endif /*_ZEBRA_SOCKOPT_H */

View file

@ -28,6 +28,10 @@
#include <netmpls/mpls.h> #include <netmpls/mpls.h>
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
union sockunion { union sockunion {
struct sockaddr sa; struct sockaddr sa;
struct sockaddr_in sin; struct sockaddr_in sin;
@ -99,4 +103,8 @@ extern union sockunion *sockunion_dup(const union sockunion *);
extern void sockunion_free(union sockunion *); extern void sockunion_free(union sockunion *);
extern void sockunion_init(union sockunion *); extern void sockunion_init(union sockunion *);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_SOCKUNION_H */ #endif /* _ZEBRA_SOCKUNION_H */

View file

@ -26,6 +26,10 @@
#ifndef _ZEBRA_SPF_BACKOFF_H #ifndef _ZEBRA_SPF_BACKOFF_H
#define _ZEBRA_SPF_BACKOFF_H #define _ZEBRA_SPF_BACKOFF_H
#ifdef __cplusplus
extern "C" {
#endif
struct spf_backoff; struct spf_backoff;
struct thread_master; struct thread_master;
struct vty; struct vty;
@ -58,4 +62,8 @@ long spf_backoff_long_delay(struct spf_backoff *backoff);
long spf_backoff_holddown(struct spf_backoff *backoff); long spf_backoff_holddown(struct spf_backoff *backoff);
long spf_backoff_timetolearn(struct spf_backoff *backoff); long spf_backoff_timetolearn(struct spf_backoff *backoff);
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -46,6 +46,10 @@
#include "prefix.h" #include "prefix.h"
#include "table.h" #include "table.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SRCDEST2STR_BUFFER (2*PREFIX2STR_BUFFER + sizeof(" from ")) #define SRCDEST2STR_BUFFER (2*PREFIX2STR_BUFFER + sizeof(" from "))
/* extended route node for IPv6 srcdest routing */ /* extended route node for IPv6 srcdest routing */
@ -84,7 +88,8 @@ static inline int rnode_is_srcnode(struct route_node *rn)
static inline struct route_table *srcdest_rnode_table(struct route_node *rn) static inline struct route_table *srcdest_rnode_table(struct route_node *rn)
{ {
if (rnode_is_srcnode(rn)) { if (rnode_is_srcnode(rn)) {
struct route_node *dst_rn = route_table_get_info(rn->table); struct route_node *dst_rn =
(struct route_node *)route_table_get_info(rn->table);
return dst_rn->table; return dst_rn->table;
} else { } else {
return rn->table; return rn->table;
@ -95,4 +100,8 @@ static inline void *srcdest_rnode_table_info(struct route_node *rn)
return route_table_get_info(srcdest_rnode_table(rn)); return route_table_get_info(srcdest_rnode_table(rn));
} }
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_SRC_DEST_TABLE_H */ #endif /* _ZEBRA_SRC_DEST_TABLE_H */

View file

@ -28,6 +28,10 @@
#include "mpls.h" #include "mpls.h"
#include "prefix.h" #include "prefix.h"
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* A stream is an arbitrary buffer, whose contents generally are assumed to * A stream is an arbitrary buffer, whose contents generally are assumed to
* be in network order. * be in network order.
@ -115,9 +119,9 @@ struct stream_fifo {
pthread_mutex_t mtx; pthread_mutex_t mtx;
/* number of streams in this fifo */ /* number of streams in this fifo */
_Atomic size_t count; atomic_size_t count;
#if defined DEV_BUILD #if defined DEV_BUILD
_Atomic size_t max_count; atomic_size_t max_count;
#endif #endif
struct stream *head; struct stream *head;
@ -404,4 +408,8 @@ static inline uint8_t *ptr_get_be32(uint8_t *ptr, uint32_t *out)
goto stream_failure; \ goto stream_failure; \
} while (0) } while (0)
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_STREAM_H */ #endif /* _ZEBRA_STREAM_H */

View file

@ -19,6 +19,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* Wrapper functions to systemd calls. * Wrapper functions to systemd calls.
* *
@ -37,3 +41,7 @@ void systemd_send_stopping(void);
* process? * process?
*/ */
void systemd_send_started(struct thread_master *master, int the_process); void systemd_send_started(struct thread_master *master, int the_process);
#ifdef __cplusplus
}
#endif

View file

@ -25,6 +25,11 @@
#include "memory.h" #include "memory.h"
#include "hash.h" #include "hash.h"
#include "prefix.h" #include "prefix.h"
#ifdef __cplusplus
extern "C" {
#endif
DECLARE_MTYPE(ROUTE_TABLE) DECLARE_MTYPE(ROUTE_TABLE)
DECLARE_MTYPE(ROUTE_NODE) DECLARE_MTYPE(ROUTE_NODE)
@ -318,4 +323,8 @@ static inline int route_table_iter_started(route_table_iter_t *iter)
return iter->state != RT_ITER_STATE_INIT; return iter->state != RT_ITER_STATE_INIT;
} }
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_TABLE_H */ #endif /* _ZEBRA_TABLE_H */

View file

@ -22,6 +22,10 @@
#include <zebra.h> #include <zebra.h>
#ifdef __cplusplus
extern "C" {
#endif
enum ttable_align { enum ttable_align {
LEFT, LEFT,
RIGHT, RIGHT,
@ -294,4 +298,8 @@ void ttable_rowseps(struct ttable *tt, unsigned int row,
*/ */
char *ttable_dump(struct ttable *tt, const char *newline); char *ttable_dump(struct ttable *tt, const char *newline);
#ifdef __cplusplus
}
#endif
#endif /* _TERMTABLE_H */ #endif /* _TERMTABLE_H */

View file

@ -93,7 +93,8 @@ static void cpu_record_hash_free(void *a)
static void vty_out_cpu_thread_history(struct vty *vty, static void vty_out_cpu_thread_history(struct vty *vty,
struct cpu_thread_history *a) struct cpu_thread_history *a)
{ {
vty_out(vty, "%5d %10lu.%03lu %9u %8lu %9lu %8lu %9lu", a->total_active, vty_out(vty, "%5"PRIdFAST32" %10lu.%03lu %9"PRIuFAST32
" %8lu %9lu %8lu %9lu", a->total_active,
a->cpu.total / 1000, a->cpu.total % 1000, a->total_calls, a->cpu.total / 1000, a->cpu.total % 1000, a->total_calls,
a->cpu.total / a->total_calls, a->cpu.max, a->cpu.total / a->total_calls, a->cpu.max,
a->real.total / a->total_calls, a->real.max); a->real.total / a->total_calls, a->real.max);

View file

@ -27,6 +27,10 @@
#include "monotime.h" #include "monotime.h"
#include "frratomic.h" #include "frratomic.h"
#ifdef __cplusplus
extern "C" {
#endif
struct rusage_t { struct rusage_t {
struct rusage cpu; struct rusage cpu;
struct timeval real; struct timeval real;
@ -119,13 +123,13 @@ struct thread {
struct cpu_thread_history { struct cpu_thread_history {
int (*func)(struct thread *); int (*func)(struct thread *);
_Atomic unsigned int total_calls; atomic_uint_fast32_t total_calls;
_Atomic unsigned int total_active; atomic_uint_fast32_t total_active;
struct time_stats { struct time_stats {
_Atomic unsigned long total, max; atomic_size_t total, max;
} real; } real;
struct time_stats cpu; struct time_stats cpu;
_Atomic uint32_t types; atomic_uint_fast32_t types;
const char *funcname; const char *funcname;
}; };
@ -233,4 +237,8 @@ extern unsigned long thread_consumed_time(RUSAGE_T *after, RUSAGE_T *before,
/* only for use in logging functions! */ /* only for use in logging functions! */
extern pthread_key_t thread_current; extern pthread_key_t thread_current;
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_THREAD_H */ #endif /* _ZEBRA_THREAD_H */

View file

@ -24,6 +24,10 @@
#include "memory.h" #include "memory.h"
#ifdef __cplusplus
extern "C" {
#endif
/* struct for vector */ /* struct for vector */
struct _vector { struct _vector {
unsigned int active; /* number of active slots */ unsigned int active; /* number of active slots */
@ -63,4 +67,9 @@ extern void *vector_lookup(vector, unsigned int);
extern void *vector_lookup_ensure(vector, unsigned int); extern void *vector_lookup_ensure(vector, unsigned int);
extern void vector_to_array(vector v, void ***dest, int *argc); extern void vector_to_array(vector v, void ***dest, int *argc);
extern vector array_to_vector(void **src, int argc); extern vector array_to_vector(void **src, int argc);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_VECTOR_H */ #endif /* _ZEBRA_VECTOR_H */

View file

@ -22,8 +22,16 @@
#ifndef __VLAN_H__ #ifndef __VLAN_H__
#define __VLAN_H__ #define __VLAN_H__
#ifdef __cplusplus
extern "C" {
#endif
/* VLAN Identifier */ /* VLAN Identifier */
typedef uint16_t vlanid_t; typedef uint16_t vlanid_t;
#define VLANID_MAX 4095 #define VLANID_MAX 4095
#ifdef __cplusplus
}
#endif
#endif /* __VLAN_H__ */ #endif /* __VLAN_H__ */

View file

@ -471,7 +471,7 @@ static const struct cmd_variable_handler vrf_var_handlers[] = {
/* Initialize VRF module. */ /* Initialize VRF module. */
void vrf_init(int (*create)(struct vrf *), int (*enable)(struct vrf *), void vrf_init(int (*create)(struct vrf *), int (*enable)(struct vrf *),
int (*disable)(struct vrf *), int (*delete)(struct vrf *), int (*disable)(struct vrf *), int (*destroy)(struct vrf *),
int ((*update)(struct vrf *))) int ((*update)(struct vrf *)))
{ {
struct vrf *default_vrf; struct vrf *default_vrf;
@ -485,7 +485,7 @@ void vrf_init(int (*create)(struct vrf *), int (*enable)(struct vrf *),
vrf_master.vrf_new_hook = create; vrf_master.vrf_new_hook = create;
vrf_master.vrf_enable_hook = enable; vrf_master.vrf_enable_hook = enable;
vrf_master.vrf_disable_hook = disable; vrf_master.vrf_disable_hook = disable;
vrf_master.vrf_delete_hook = delete; vrf_master.vrf_delete_hook = destroy;
vrf_master.vrf_update_name_hook = update; vrf_master.vrf_update_name_hook = update;
/* The default VRF always exists. */ /* The default VRF always exists. */

View file

@ -28,6 +28,10 @@
#include "vty.h" #include "vty.h"
#include "ns.h" #include "ns.h"
#ifdef __cplusplus
extern "C" {
#endif
/* The default VRF ID */ /* The default VRF ID */
#define VRF_UNKNOWN UINT32_MAX #define VRF_UNKNOWN UINT32_MAX
@ -200,7 +204,7 @@ extern int vrf_bitmap_check(vrf_bitmap_t, vrf_id_t);
* the system ( 2 and 3 ) above. * the system ( 2 and 3 ) above.
*/ */
extern void vrf_init(int (*create)(struct vrf *vrf), int (*enable)(struct vrf *vrf), extern void vrf_init(int (*create)(struct vrf *vrf), int (*enable)(struct vrf *vrf),
int (*disable)(struct vrf *vrf), int (*delete)(struct vrf *vrf), int (*disable)(struct vrf *vrf), int (*destroy)(struct vrf *vrf),
int (*update)(struct vrf *vrf)); int (*update)(struct vrf *vrf));
/* /*
@ -292,4 +296,8 @@ extern int vrf_enable(struct vrf *vrf);
extern void vrf_delete(struct vrf *vrf); extern void vrf_delete(struct vrf *vrf);
extern vrf_id_t vrf_generate_id(void); extern vrf_id_t vrf_generate_id(void);
#ifdef __cplusplus
}
#endif
#endif /*_ZEBRA_VRF_H*/ #endif /*_ZEBRA_VRF_H*/

View file

@ -25,6 +25,10 @@
#include "vrf.h" #include "vrf.h"
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* These functions should only be called by: * These functions should only be called by:
* zebra/if_netlink.c -> The interface from OS into Zebra * zebra/if_netlink.c -> The interface from OS into Zebra
@ -52,4 +56,8 @@ extern int vrf_enable(struct vrf *);
*/ */
extern void vrf_delete(struct vrf *); extern void vrf_delete(struct vrf *);
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -31,6 +31,10 @@
#include "compiler.h" #include "compiler.h"
#include "northbound.h" #include "northbound.h"
#ifdef __cplusplus
extern "C" {
#endif
#define VTY_BUFSIZ 4096 #define VTY_BUFSIZ 4096
#define VTY_MAXHIST 20 #define VTY_MAXHIST 20
#define VTY_MAXDEPTH 8 #define VTY_MAXDEPTH 8
@ -333,4 +337,8 @@ extern void vty_stdio_close(void);
an async-signal-safe function. */ an async-signal-safe function. */
extern void vty_log_fixed(char *buf, size_t len); extern void vty_log_fixed(char *buf, size_t len);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_VTY_H */ #endif /* _ZEBRA_VTY_H */

View file

@ -22,6 +22,10 @@
#ifndef __VXLAN_H__ #ifndef __VXLAN_H__
#define __VXLAN_H__ #define __VXLAN_H__
#ifdef __cplusplus
extern "C" {
#endif
/* VxLAN Network Identifier - 24-bit (RFC 7348) */ /* VxLAN Network Identifier - 24-bit (RFC 7348) */
typedef uint32_t vni_t; typedef uint32_t vni_t;
#define VNI_MAX 16777215 /* (2^24 - 1) */ #define VNI_MAX 16777215 /* (2^24 - 1) */
@ -35,4 +39,9 @@ enum vxlan_flood_control {
VXLAN_FLOOD_HEAD_END_REPL = 0, VXLAN_FLOOD_HEAD_END_REPL = 0,
VXLAN_FLOOD_DISABLED, VXLAN_FLOOD_DISABLED,
}; };
#ifdef __cplusplus
}
#endif
#endif /* __VXLAN_H__ */ #endif /* __VXLAN_H__ */

Some files were not shown because too many files have changed in this diff Show more