Skip to content

Commit

Permalink
add cplusplus guards to all zebra headers
Browse files Browse the repository at this point in the history
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
  • Loading branch information
edipascale committed Mar 25, 2019
1 parent c9146c8 commit 51e94aa
Show file tree
Hide file tree
Showing 42 changed files with 343 additions and 2 deletions.
7 changes: 7 additions & 0 deletions zebra/connected.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
#include "lib/if.h"
#include "lib/prefix.h"

#ifdef __cplusplus
extern "C" {
#endif

extern struct connected *connected_check(struct interface *ifp,
union prefixconstptr p);
extern struct connected *connected_check_ptp(struct interface *ifp,
Expand Down Expand Up @@ -58,4 +62,7 @@ extern void connected_delete_ipv6(struct interface *ifp,

extern int connected_is_unnumbered(struct interface *);

#ifdef __cplusplus
}
#endif
#endif /*_ZEBRA_CONNECTED_H */
8 changes: 8 additions & 0 deletions zebra/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@

#include "lib/vty.h"

#ifdef __cplusplus
extern "C" {
#endif

/* Debug flags. */
#define ZEBRA_DEBUG_EVENT 0x01

Expand Down Expand Up @@ -99,4 +103,8 @@ extern void zebra_debug_init(void);

DECLARE_HOOK(zebra_debug_show_debugging, (struct vty *vty), (vty));

#ifdef __cplusplus
}
#endif

#endif /* _ZEBRA_DEBUG_H */
8 changes: 8 additions & 0 deletions zebra/if_netlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,19 @@

#ifdef HAVE_NETLINK

#ifdef __cplusplus
extern "C" {
#endif

extern int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id,
int startup);
extern int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup);
extern int interface_lookup_netlink(struct zebra_ns *zns);

#ifdef __cplusplus
}
#endif

#endif /* HAVE_NETLINK */

#endif /* _ZEBRA_IF_NETLINK_H */
8 changes: 8 additions & 0 deletions zebra/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

#include "zebra/zebra_l2.h"

#ifdef __cplusplus
extern "C" {
#endif

/* For interface multicast configuration. */
#define IF_ZEBRA_MULTICAST_UNSPEC 0
#define IF_ZEBRA_MULTICAST_ON 1
Expand Down Expand Up @@ -432,4 +436,8 @@ extern int interface_list_proc(void);
extern int ifaddr_proc_ipv6(void);
#endif /* HAVE_PROC_NET_IF_INET6 */

#ifdef __cplusplus
}
#endif

#endif /* _ZEBRA_INTERFACE_H */
8 changes: 8 additions & 0 deletions zebra/ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
#ifndef _ZEBRA_IOCTL_H
#define _ZEBRA_IOCTL_H

#ifdef __cplusplus
extern "C" {
#endif

/* Prototypes. */
extern void ifreq_set_name(struct ifreq *, struct interface *);
extern int if_ioctl(unsigned long, caddr_t);
Expand Down Expand Up @@ -53,4 +57,8 @@ extern struct connected *if_lookup_linklocal(struct interface *);

#endif /* SOLARIS_IPV6 */

#ifdef __cplusplus
}
#endif

#endif /* _ZEBRA_IOCTL_H */
8 changes: 8 additions & 0 deletions zebra/ioctl_solaris.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@
#ifndef _ZEBRA_IF_IOCTL_SOLARIS_H
#define _ZEBRA_IF_IOCTL_SOLARIS_H

#ifdef __cplusplus
extern "C" {
#endif

void lifreq_set_name(struct lifreq *, const char *);
int if_get_flags_direct(const char *, uint64_t *, unsigned int af);

#ifdef __cplusplus
}
#endif

#endif /* _ZEBRA_IF_IOCTL_SOLARIS_H */
8 changes: 8 additions & 0 deletions zebra/ipforward.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#ifndef _ZEBRA_IPFORWARD_H
#define _ZEBRA_IPFORWARD_H

#ifdef __cplusplus
extern "C" {
#endif

extern int ipforward(void);
extern int ipforward_on(void);
extern int ipforward_off(void);
Expand All @@ -29,4 +33,8 @@ extern int ipforward_ipv6(void);
extern int ipforward_ipv6_on(void);
extern int ipforward_ipv6_off(void);

#ifdef __cplusplus
}
#endif

#endif /* _ZEBRA_IPFORWARD_H */
7 changes: 7 additions & 0 deletions zebra/irdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

#include "lib/vty.h"

#ifdef __cplusplus
extern "C" {
#endif

#define TRUE 1
#define FALSE 0

Expand Down Expand Up @@ -150,5 +154,8 @@ extern int irdp_read_raw(struct thread *r);
extern void send_packet(struct interface *ifp, struct stream *s, uint32_t dst,
struct prefix *p, uint32_t ttl);

#ifdef __cplusplus
}
#endif

#endif /* _IRDP_H */
8 changes: 8 additions & 0 deletions zebra/kernel_netlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#ifndef _ZEBRA_KERNEL_NETLINK_H
#define _ZEBRA_KERNEL_NETLINK_H

#ifdef __cplusplus
extern "C" {
#endif

#ifdef HAVE_NETLINK

#define NL_RCV_PKT_BUF_SIZE 32768
Expand Down Expand Up @@ -68,4 +72,8 @@ extern int netlink_request(struct nlsock *nl, struct nlmsghdr *n);

#endif /* HAVE_NETLINK */

#ifdef __cplusplus
}
#endif

#endif /* _ZEBRA_KERNEL_NETLINK_H */
8 changes: 8 additions & 0 deletions zebra/kernel_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
#ifndef __ZEBRA_KERNEL_SOCKET_H
#define __ZEBRA_KERNEL_SOCKET_H

#ifdef __cplusplus
extern "C" {
#endif

/* Error codes of zebra. */
#define ZEBRA_ERR_NOERROR 0
#define ZEBRA_ERR_RTEXIST -1
Expand All @@ -38,4 +42,8 @@ extern int rtm_write(int, union sockunion *, union sockunion *,
enum blackhole_type, int);
extern const struct message rtm_type_str[];

#ifdef __cplusplus
}
#endif

#endif /* __ZEBRA_KERNEL_SOCKET_H */
8 changes: 8 additions & 0 deletions zebra/label_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

#include "zebra/zserv.h"

#ifdef __cplusplus
extern "C" {
#endif

#define NO_PROTO 0

/*
Expand Down Expand Up @@ -74,4 +78,8 @@ int release_label_chunk(uint8_t proto, unsigned short instance, uint32_t start,
int release_daemon_label_chunks(struct zserv *client);
void label_manager_close(void);

#ifdef __cplusplus
}
#endif

#endif /* _LABEL_MANAGER_H */
9 changes: 9 additions & 0 deletions zebra/redistribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
#include "zebra/zserv.h"
#include "zebra/rib.h"

#ifdef __cplusplus
extern "C" {
#endif

/* ZAPI command handlers */
extern void zebra_redistribute_add(ZAPI_HANDLER_ARGS);
extern void zebra_redistribute_delete(ZAPI_HANDLER_ARGS);
Expand Down Expand Up @@ -73,4 +77,9 @@ extern int is_zebra_import_table_enabled(afi_t, uint32_t table_id);
extern int zebra_import_table_config(struct vty *);

extern void zebra_import_table_rm_update(const char *rmap);

#ifdef __cplusplus
}
#endif

#endif /* _ZEBRA_REDISTRIBUTE_H */
9 changes: 9 additions & 0 deletions zebra/rib.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
#include "mpls.h"
#include "srcdest_table.h"

#ifdef __cplusplus
extern "C" {
#endif

#define DISTANCE_INFINITY 255
#define ZEBRA_KERNEL_TABLE_MAX 252 /* support for no more than this rt tables */

Expand Down Expand Up @@ -464,4 +468,9 @@ extern void zebra_vty_init(void);
extern pid_t pid;

extern bool v6_rr_semantics;

#ifdef __cplusplus
}
#endif

#endif /*_ZEBRA_RIB_H */
8 changes: 8 additions & 0 deletions zebra/router-id.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@
#include "zclient.h"
#include "if.h"

#ifdef __cplusplus
extern "C" {
#endif

extern void router_id_add_address(struct connected *);
extern void router_id_del_address(struct connected *);
extern void router_id_init(struct zebra_vrf *);
extern void router_id_cmd_init(void);
extern void router_id_write(struct vty *);
extern void router_id_get(struct prefix *, vrf_id_t);

#ifdef __cplusplus
}
#endif

#endif
8 changes: 8 additions & 0 deletions zebra/rt.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
#include "zebra/zebra_mpls.h"
#include "zebra/zebra_dplane.h"

#ifdef __cplusplus
extern "C" {
#endif

/*
* Update or delete a route, LSP, or pseudowire from the kernel,
* using info from a dataplane context.
Expand Down Expand Up @@ -91,4 +95,8 @@ extern void neigh_read_specific_ip(struct ipaddr *ip,
struct interface *vlan_if);
extern void route_read(struct zebra_ns *zns);

#ifdef __cplusplus
}
#endif

#endif /* _ZEBRA_RT_H */
8 changes: 8 additions & 0 deletions zebra/rt_netlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#include "zebra/zebra_mpls.h"
#include "zebra/zebra_dplane.h"

#ifdef __cplusplus
extern "C" {
#endif

#define NL_DEFAULT_ROUTE_METRIC 20

/*
Expand Down Expand Up @@ -79,6 +83,10 @@ extern int netlink_macfdb_read_specific_mac(struct zebra_ns *zns,
extern int netlink_neigh_read_specific_ip(struct ipaddr *ip,
struct interface *vlan_if);

#ifdef __cplusplus
}
#endif

#endif /* HAVE_NETLINK */

#endif /* _ZEBRA_RT_NETLINK_H */
7 changes: 7 additions & 0 deletions zebra/rtadv.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#include "vty.h"
#include "zebra/interface.h"

#ifdef __cplusplus
extern "C" {
#endif

/* NB: RTADV is defined in zebra/interface.h above */
#if defined(HAVE_RTADV)

Expand Down Expand Up @@ -137,5 +141,8 @@ extern void rtadv_cmd_init(void);
extern void zebra_interface_radv_disable(ZAPI_HANDLER_ARGS);
extern void zebra_interface_radv_enable(ZAPI_HANDLER_ARGS);

#ifdef __cplusplus
}
#endif

#endif /* _ZEBRA_RTADV_H */
8 changes: 8 additions & 0 deletions zebra/rule_netlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@

#ifdef HAVE_NETLINK

#ifdef __cplusplus
extern "C" {
#endif

/*
* Handle netlink notification informing a rule add or delete.
*/
Expand All @@ -36,6 +40,10 @@ extern int netlink_rule_change(struct nlmsghdr *h, ns_id_t ns_id, int startup);
*/
extern int netlink_rules_read(struct zebra_ns *zns);

#ifdef __cplusplus
}
#endif

#endif /* HAVE_NETLINK */

#endif /* _ZEBRA_RULE_NETLINK_H */
8 changes: 8 additions & 0 deletions zebra/table_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

#include "zebra/zserv.h"

#ifdef __cplusplus
extern "C" {
#endif

/*
* Table chunk struct
* Client daemon which the chunk belongs to can be identified by either
Expand Down Expand Up @@ -63,4 +67,8 @@ int release_table_chunk(uint8_t proto, uint16_t instance, uint32_t start,
int release_daemon_table_chunks(struct zserv *client);
void table_manager_disable(ns_id_t ns_id);

#ifdef __cplusplus
}
#endif

#endif /* _TABLE_MANAGER_H */
8 changes: 8 additions & 0 deletions zebra/zapi_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
#include "zebra/zebra_pbr.h"
#include "zebra/zebra_errors.h"

#ifdef __cplusplus
extern "C" {
#endif

/*
* This is called to process inbound ZAPI messages.
*
Expand Down Expand Up @@ -86,3 +90,7 @@ extern void zserv_nexthop_num_warn(const char *caller, const struct prefix *p,
const unsigned int nexthop_num);

extern void zsend_capabilities_all_clients(void);

#ifdef __cplusplus
}
#endif
Loading

0 comments on commit 51e94aa

Please sign in to comment.