lib, zebra: add missing extern "C" {} blocks to new header files

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
Renato Westphal 2020-04-20 20:53:19 -03:00
parent 86ac1facf3
commit 17e38209a5
20 changed files with 160 additions and 0 deletions

View file

@ -20,6 +20,10 @@
#include "typesafe.h" #include "typesafe.h"
#include "frratomic.h" #include "frratomic.h"
#ifdef __cplusplus
extern "C" {
#endif
/* pointer with lock/deleted/invalid bit in lowest bit /* pointer with lock/deleted/invalid bit in lowest bit
* *
* for atomlist/atomsort, "locked" means "this pointer can't be updated, the * for atomlist/atomsort, "locked" means "this pointer can't be updated, the
@ -361,4 +365,8 @@ void atomsort_del_hint(struct atomsort_head *h,
struct atomsort_item *atomsort_pop(struct atomsort_head *h); struct atomsort_item *atomsort_pop(struct atomsort_head *h);
#ifdef __cplusplus
}
#endif
#endif /* _FRR_ATOMLIST_H */ #endif /* _FRR_ATOMLIST_H */

View file

@ -22,6 +22,10 @@
#include "compiler.h" #include "compiler.h"
#ifdef __cplusplus
extern "C" {
#endif
/* frr_default wraps information about a default that has different /* frr_default wraps information about a default that has different
* values depending on FRR version or default-set * values depending on FRR version or default-set
* *
@ -135,4 +139,8 @@ extern bool frr_defaults_profile_valid(const char *profile);
/* like strcmp(), but with version ordering */ /* like strcmp(), but with version ordering */
extern int frr_version_cmp(const char *aa, const char *bb); extern int frr_version_cmp(const char *aa, const char *bb);
#ifdef __cplusplus
}
#endif
#endif /* _FRR_DEFAULTS_H */ #endif /* _FRR_DEFAULTS_H */

View file

@ -20,6 +20,10 @@
#include "memory.h" #include "memory.h"
#include "atomlist.h" #include "atomlist.h"
#ifdef __cplusplus
extern "C" {
#endif
/* quick RCU primer: /* quick RCU primer:
* There's a global sequence counter. Whenever a thread does a * There's a global sequence counter. Whenever a thread does a
* rcu_read_lock(), it is marked as holding the current sequence counter. * rcu_read_lock(), it is marked as holding the current sequence counter.
@ -170,4 +174,8 @@ extern void rcu_enqueue(struct rcu_head *head, const struct rcu_action *action);
extern void rcu_close(struct rcu_head_close *head, int fd); extern void rcu_close(struct rcu_head_close *head, int fd);
#ifdef __cplusplus
}
#endif
#endif /* _FRRCU_H */ #endif /* _FRRCU_H */

View file

@ -21,6 +21,10 @@
#include <prefix.h> #include <prefix.h>
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* The above AFI and SAFI definitions are for internal use. The protocol * The above AFI and SAFI definitions are for internal use. The protocol
* definitions (IANA values) as for example used in BGP protocol packets * definitions (IANA values) as for example used in BGP protocol packets
@ -130,4 +134,8 @@ static inline const char *iana_safi2str(iana_safi_t safi)
return safi2str(safi_iana2int(safi)); return safi2str(safi_iana2int(safi));
} }
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -23,6 +23,10 @@
#include "lib/hook.h" #include "lib/hook.h"
#ifdef __cplusplus
extern "C" {
#endif
struct vty; struct vty;
extern void log_cmd_init(void); extern void log_cmd_init(void);
@ -33,4 +37,8 @@ extern void log_show_syslog(struct vty *vty);
DECLARE_HOOK(zlog_rotate, (), ()) DECLARE_HOOK(zlog_rotate, (), ())
extern void zlog_rotate(void); extern void zlog_rotate(void);
#ifdef __cplusplus
}
#endif
#endif /* __LOG_VTY_H__ */ #endif /* __LOG_VTY_H__ */

View file

@ -24,6 +24,10 @@
#include "compiler.h" #include "compiler.h"
#include "memory.h" #include "memory.h"
#ifdef __cplusplus
extern "C" {
#endif
struct fbuf { struct fbuf {
char *buf; char *buf;
char *pos; char *pos;
@ -156,4 +160,8 @@ void printfrr_ext_reg(const struct printfrr_ext *);
} \ } \
/* end */ /* end */
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -26,6 +26,10 @@
#include "thread.h" #include "thread.h"
#include "stream.h" #include "stream.h"
#ifdef __cplusplus
extern "C" {
#endif
struct pullwr; struct pullwr;
/* This is a "pull-driven" write event handler. Instead of having some buffer /* This is a "pull-driven" write event handler. Instead of having some buffer
@ -107,4 +111,8 @@ static inline void pullwr_write_stream(struct pullwr *pullwr,
extern void pullwr_stats(struct pullwr *pullwr, uint64_t *total_written, extern void pullwr_stats(struct pullwr *pullwr, uint64_t *total_written,
size_t *pending, size_t *kernel_pending); size_t *pending, size_t *kernel_pending);
#ifdef __cplusplus
}
#endif
#endif /* _WRITEPOLL_H */ #endif /* _WRITEPOLL_H */

View file

@ -13,6 +13,10 @@
#include "thread.h" #include "thread.h"
#include "sockunion.h" #include "sockunion.h"
#ifdef __cplusplus
extern "C" {
#endif
struct resolver_query { struct resolver_query {
void (*callback)(struct resolver_query *, const char *errstr, int n, void (*callback)(struct resolver_query *, const char *errstr, int n,
union sockunion *); union sockunion *);
@ -28,4 +32,8 @@ void resolver_resolve(struct resolver_query *query, int af,
const char *, int, const char *, int,
union sockunion *)); union sockunion *));
#ifdef __cplusplus
}
#endif
#endif /* _FRR_RESOLVER_H */ #endif /* _FRR_RESOLVER_H */

View file

@ -27,6 +27,10 @@
#include <pthread.h> #include <pthread.h>
#include "frratomic.h" #include "frratomic.h"
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* this locking primitive is intended to use in a 1:N setup. * this locking primitive is intended to use in a 1:N setup.
* *
@ -135,4 +139,8 @@ extern void seqlock_release(struct seqlock *sqlo);
* anything other than reading RCU items was done * anything other than reading RCU items was done
*/ */
#ifdef __cplusplus
}
#endif
#endif /* _SEQLOCK_H */ #endif /* _SEQLOCK_H */

View file

@ -28,6 +28,10 @@
#include "gitversion.h" #include "gitversion.h"
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef GIT_SUFFIX #ifndef GIT_SUFFIX
#define GIT_SUFFIX "" #define GIT_SUFFIX ""
#endif #endif
@ -54,4 +58,8 @@
pid_t pid_output (const char *); pid_t pid_output (const char *);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_VERSION_H */ #endif /* _ZEBRA_VERSION_H */

View file

@ -22,6 +22,10 @@
#include "prefix.h" #include "prefix.h"
#ifdef __cplusplus
extern "C" {
#endif
/* bool */ /* bool */
extern bool yang_str2bool(const char *value); extern bool yang_str2bool(const char *value);
extern struct yang_data *yang_data_new_bool(const char *xpath, bool value); extern struct yang_data *yang_data_new_bool(const char *xpath, bool value);
@ -182,4 +186,8 @@ extern void yang_str2mac(const char *value, struct ethaddr *mac);
extern const char *yang_nexthop_type2str(uint32_t ntype); extern const char *yang_nexthop_type2str(uint32_t ntype);
#ifdef __cplusplus
}
#endif
#endif /* _FRR_NORTHBOUND_WRAPPERS_H_ */ #endif /* _FRR_NORTHBOUND_WRAPPERS_H_ */

View file

@ -19,6 +19,10 @@
#ifndef _QUAGGA_ASSERT_H #ifndef _QUAGGA_ASSERT_H
#define _QUAGGA_ASSERT_H #define _QUAGGA_ASSERT_H
#ifdef __cplusplus
extern "C" {
#endif
extern void _zlog_assert_failed(const char *assertion, const char *file, extern void _zlog_assert_failed(const char *assertion, const char *file,
unsigned int line, const char *function) unsigned int line, const char *function)
__attribute__((noreturn)); __attribute__((noreturn));
@ -39,4 +43,8 @@ extern void _zlog_assert_failed(const char *assertion, const char *file,
#undef assert #undef assert
#define assert(EX) zassert(EX) #define assert(EX) zassert(EX)
#ifdef __cplusplus
}
#endif
#endif /* _QUAGGA_ASSERT_H */ #endif /* _QUAGGA_ASSERT_H */

View file

@ -38,6 +38,10 @@
#include "mlag.h" #include "mlag.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Zebra types. Used in Zserv message header. */ /* Zebra types. Used in Zserv message header. */
typedef uint16_t zebra_size_t; typedef uint16_t zebra_size_t;
@ -826,4 +830,8 @@ extern void zclient_send_mlag_data(struct zclient *client,
*/ */
extern int zclient_send_hello(struct zclient *client); extern int zclient_send_hello(struct zclient *client);
#ifdef __cplusplus
}
#endif
#endif /* _ZEBRA_ZCLIENT_H */ #endif /* _ZEBRA_ZCLIENT_H */

View file

@ -30,6 +30,10 @@
#include "memory.h" #include "memory.h"
#include "hook.h" #include "hook.h"
#ifdef __cplusplus
extern "C" {
#endif
extern char zlog_prefix[]; extern char zlog_prefix[];
extern size_t zlog_prefixsz; extern size_t zlog_prefixsz;
extern int zlog_tmpdirfd; extern int zlog_tmpdirfd;
@ -183,4 +187,8 @@ extern void zlog_tls_buffer_init(void);
extern void zlog_tls_buffer_flush(void); extern void zlog_tls_buffer_flush(void);
extern void zlog_tls_buffer_fini(void); extern void zlog_tls_buffer_fini(void);
#ifdef __cplusplus
}
#endif
#endif /* _FRR_ZLOG_H */ #endif /* _FRR_ZLOG_H */

View file

@ -21,6 +21,10 @@
#include "zlog.h" #include "zlog.h"
#ifdef __cplusplus
extern "C" {
#endif
/* multiple file log targets can be active */ /* multiple file log targets can be active */
struct zlt_fd; struct zlt_fd;
@ -63,4 +67,8 @@ extern int zlog_syslog_get_facility(void);
extern void zlog_syslog_set_prio_min(int prio_min); extern void zlog_syslog_set_prio_min(int prio_min);
extern int zlog_syslog_get_prio_min(void); extern int zlog_syslog_get_prio_min(void);
#ifdef __cplusplus
}
#endif
#endif /* _FRR_ZLOG_TARGETS_H */ #endif /* _FRR_ZLOG_TARGETS_H */

View file

@ -30,6 +30,10 @@
#include "mlag/mlag.pb-c.h" #include "mlag/mlag.pb-c.h"
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
#define ZEBRA_MLAG_BUF_LIMIT 2048 #define ZEBRA_MLAG_BUF_LIMIT 2048
#define ZEBRA_MLAG_LEN_SIZE 4 #define ZEBRA_MLAG_LEN_SIZE 4
@ -73,4 +77,8 @@ int zebra_mlag_protobuf_encode_client_data(struct stream *s,
uint32_t *msg_type); uint32_t *msg_type);
int zebra_mlag_protobuf_decode_message(struct stream *s, uint8_t *data, int zebra_mlag_protobuf_decode_message(struct stream *s, uint8_t *data,
uint32_t len); uint32_t len);
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -22,10 +22,18 @@
#ifndef __ZEBRA_MLAG_VTY_CODE__ #ifndef __ZEBRA_MLAG_VTY_CODE__
#define __ZEBRA_MLAG_VTY_CODE__ #define __ZEBRA_MLAG_VTY_CODE__
#ifdef __cplusplus
extern "C" {
#endif
extern int32_t zebra_mlag_test_mlag_internal(const char *none, extern int32_t zebra_mlag_test_mlag_internal(const char *none,
const char *primary, const char *primary,
const char *secondary); const char *secondary);
extern void zebra_mlag_vty_init(void); extern void zebra_mlag_vty_init(void);
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -20,6 +20,10 @@
#ifndef ZEBRA_ZEBRA_NB_H_ #ifndef ZEBRA_ZEBRA_NB_H_
#define ZEBRA_ZEBRA_NB_H_ #define ZEBRA_ZEBRA_NB_H_
#ifdef __cplusplus
extern "C" {
#endif
extern const struct frr_yang_module_info frr_zebra_info; extern const struct frr_yang_module_info frr_zebra_info;
/* prototypes */ /* prototypes */
@ -485,4 +489,8 @@ struct yang_data *
lib_vrf_ribs_rib_route_route_entry_nexthop_group_frr_nexthops_nexthop_weight_get_elem( lib_vrf_ribs_rib_route_route_entry_nexthop_group_frr_nexthops_nexthop_weight_get_elem(
const char *xpath, const void *list_entry); const char *xpath, const void *list_entry);
#ifdef __cplusplus
}
#endif
#endif #endif

View file

@ -26,6 +26,10 @@
#include "lib/nexthop.h" #include "lib/nexthop.h"
#include "lib/nexthop_group.h" #include "lib/nexthop_group.h"
#ifdef __cplusplus
extern "C" {
#endif
/* This struct is used exclusively for dataplane /* This struct is used exclusively for dataplane
* interaction via a dataplane context. * interaction via a dataplane context.
* *
@ -269,4 +273,8 @@ extern void zebra_nhg_sweep_table(struct hash *hash);
struct route_entry; /* Forward ref to avoid circular includes */ struct route_entry; /* Forward ref to avoid circular includes */
extern int nexthop_active_update(struct route_node *rn, struct route_entry *re); extern int nexthop_active_update(struct route_node *rn, struct route_entry *re);
#ifdef __cplusplus
}
#endif
#endif /* __ZEBRA_NHG_H__ */ #endif /* __ZEBRA_NHG_H__ */

View file

@ -30,6 +30,10 @@
#include "zebra/zebra_nhg.h" #include "zebra/zebra_nhg.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Abstraction for connected trees */ /* Abstraction for connected trees */
struct nhg_connected { struct nhg_connected {
struct nhg_connected_tree_item tree_item; struct nhg_connected_tree_item tree_item;
@ -70,4 +74,8 @@ extern struct nhg_hash_entry *
nhg_connected_tree_add_nhe(struct nhg_connected_tree_head *head, nhg_connected_tree_add_nhe(struct nhg_connected_tree_head *head,
struct nhg_hash_entry *nhe); struct nhg_hash_entry *nhe);
#ifdef __cplusplus
}
#endif
#endif /* __ZEBRA_NHG_PRIVATE_H__ */ #endif /* __ZEBRA_NHG_PRIVATE_H__ */