]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: add extern "C" {} blocks to all libfrr headers
authorRenato Westphal <renato@opensourcerouting.org>
Thu, 7 Feb 2019 22:10:31 +0000 (20:10 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Tue, 12 Feb 2019 00:34:12 +0000 (22:34 -0200)
These are necessary to use functions defined in these headers from C++.

Signed-off-by: David Lamparter <equinox@diac24.net>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
93 files changed:
lib/agg_table.h
lib/bfd.h
lib/bitfield.h
lib/buffer.h
lib/checksum.h
lib/clippy.h
lib/command.h
lib/command_graph.h
lib/command_match.h
lib/compiler.h
lib/csv.h
lib/db.h
lib/debug.h
lib/distribute.h
lib/event_counter.h
lib/ferr.h
lib/fifo.h
lib/filter.h
lib/freebsd-queue.h
lib/frr_pthread.h
lib/frr_zmq.h
lib/frrstr.h
lib/graph.h
lib/hash.h
lib/hook.h
lib/id_alloc.h
lib/if.h
lib/if_rmap.h
lib/imsg.h
lib/ipaddr.h
lib/jhash.h
lib/json.h
lib/keychain.h
lib/lib_errors.h
lib/libfrr.h
lib/libospf.h
lib/linklist.h
lib/log.h
lib/log_int.h
lib/logicalrouter.h
lib/lua.h
lib/md5.h
lib/memory.h
lib/memory_vty.h
lib/mlag.h
lib/module.h
lib/monotime.h
lib/mpls.h
lib/network.h
lib/nexthop.h
lib/nexthop_group.h
lib/northbound.h
lib/northbound_cli.h
lib/northbound_db.h
lib/ns.h
lib/openbsd-queue.h
lib/openbsd-tree.h
lib/pbr.h
lib/plist.h
lib/plist_int.h
lib/pqueue.h
lib/prefix.h
lib/privs.h
lib/ptm_lib.h
lib/pw.h
lib/qobj.h
lib/queue.h
lib/ringbuf.h
lib/routemap.h
lib/sbuf.h
lib/sha256.h
lib/sigevent.h
lib/skiplist.h
lib/smux.h
lib/sockopt.h
lib/sockunion.h
lib/spf_backoff.h
lib/srcdest_table.h
lib/stream.h
lib/systemd.h
lib/table.h
lib/termtable.h
lib/thread.h
lib/vector.h
lib/vlan.h
lib/vrf.h
lib/vrf_int.h
lib/vty.h
lib/vxlan.h
lib/wheel.h
lib/workqueue.h
lib/yang.h
lib/yang_translator.h

index dc2ff03b674828151e05d5ace71ac6c4887fbdde..40ffe8c7552873e4a0f17f0b9b943d2162e3ee88 100644 (file)
 #include "prefix.h"
 #include "table.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct agg_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);
 }
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index b1e490a62279a2b95c8112d7ca56a8b861099b25..a93875c4cf80e1a6ef74845f2ca93b681f28ef32 100644 (file)
--- a/lib/bfd.h
+++ b/lib/bfd.h
 #include "lib/json.h"
 #include "lib/zclient.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define BFD_DEF_MIN_RX 300
 #define BFD_MIN_MIN_RX 50
 #define BFD_MAX_MIN_RX 60000
@@ -104,4 +108,8 @@ extern void bfd_gbl_init(void);
 
 extern void bfd_gbl_exit(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_BFD_H */
index 0e031ccc497f69f1b1b435748248ece40ca4a07f..eebfc049d9006838d04ace8bf4401669f1e19bb2 100644 (file)
 #include <string.h>
 #include <stdlib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef unsigned int word_t;
 #define WORD_MAX 0xFFFFFFFF
 #define WORD_SIZE (sizeof(word_t) * 8)
@@ -153,4 +157,8 @@ typedef unsigned int word_t;
                }                                                              \
        } while (0)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 0c945a2acfea3fbea58ff97fabea08174d29fd72..8b5a89825fe74ca79bf7312530e125be9de5f8b9 100644 (file)
 #ifndef _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
    size.  If the argument is 0, the library will supply a reasonable
    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,
                                           int height, int erase, int no_more);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_BUFFER_H */
index c2764e35fbd8f8822008e0c4f063730f56f85210..7d5037143975e4882a177c5beef846e7352b9893 100644 (file)
@@ -1,4 +1,12 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern int in_cksum(void *, int);
 #define FLETCHER_CHECKSUM_VALIDATE 0xffff
 extern uint16_t fletcher_checksum(uint8_t *, const size_t len,
                                  const uint16_t offset);
+
+#ifdef __cplusplus
+}
+#endif
index 8df98cbb8e38d7c8e79e42045cca05a3ef7afb99..be4db6e638de5451e109e3ce929cccee4ce4cb7d 100644 (file)
 
 #include <Python.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern PyObject *clippy_parse(PyObject *self, PyObject *args);
 extern PyMODINIT_FUNC command_py_init(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRR_CLIPPY_H */
index 11514fd5e845c6fedf18f4cb1195cb1c5d39c41c..0faaa426ac2356859488d0c3d0facefc16884c53 100644 (file)
 #include "hash.h"
 #include "command_graph.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 DECLARE_MTYPE(HOST)
 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 void command_setup_early_logging(const char *dest, const char *level);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_COMMAND_H */
index 82d562694cd844e67219af6736f97912964abb80..cfacad43e24738e6ae9b839a69c6932bfc166db1 100644 (file)
 #include "vector.h"
 #include "graph.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 DECLARE_MTYPE(CMD_ARG)
 
 struct vty;
@@ -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);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRR_COMMAND_GRAPH_H */
index c636d2dd9544630f52f4388aa5486e3a41e28a73..547f6f3b6d9e63e4547587186f3e9ecff4ef6701 100644 (file)
 #include "linklist.h"
 #include "command.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* These definitions exist in command.c in the current engine but should be
  * relocated here in the new engine
  */
@@ -98,4 +102,8 @@ enum matcher_rv command_match(struct graph *cmdgraph, vector vline,
 enum matcher_rv command_complete(struct graph *cmdgraph, vector vline,
                                 struct list **completions);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_COMMAND_MATCH_H */
index 24b8fafd108a29a40e96688fcf7198ecc865be33..cb4f7531ecdec7b6335efe148cd13ef51c0acb23 100644 (file)
 #ifndef _FRR_COMPILER_H
 #define _FRR_COMPILER_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* function attributes, use like
  *   void prototype(void) __attribute__((_CONSTRUCTOR(100)));
  */
@@ -88,4 +92,8 @@
 #define CPP_NOTICE(text)
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRR_COMPILER_H */
index 3a0e5558cb7100c12ffb9e4604d4f1f6546e86ad..fe3599d5db11d534cc12159994c6cfb82b164001 100644 (file)
--- a/lib/csv.h
+++ b/lib/csv.h
 #include <stdarg.h>
 #include <sys/queue.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct _csv_field_t_ csv_field_t;
 typedef struct _csv_record_t_ csv_record_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);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 8c936ec4baa87dcdcee87a01774c16fc9e1afdf6..884c7377f2ee569a0ccab0503a8ef45e4335957b 100644 (file)
--- a/lib/db.h
+++ b/lib/db.h
 
 #include <sqlite3.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern int db_init(const char *path_fmt, ...);
 extern int db_close(void);
 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 int db_execute(const char *stmt_fmt, ...);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* HAVE_SQLITE3 */
 #endif /* _FRR_DB_H_ */
index 2b389e3d4c0c6aa5151e8071c43543ed223065ae..ace060d0578905fb64a0734da41a63b673c42a45 100644 (file)
 #include "command.h"
 #include "frratomic.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * Debugging modes.
  *
@@ -231,4 +235,8 @@ struct debug_callbacks {
  */
 void debug_init(const struct debug_callbacks *cb);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRRDEBUG_H */
index 44c699b38a15b217e5691427b684b93d2ebcabe9..4016d3b1331642119852bbb7531b61505b7cb155 100644 (file)
 #include "if.h"
 #include "filter.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Disctirubte list types. */
 enum distribute_type {
        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 *,
                                             struct prefix *);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_DISTRIBUTE_H */
index de5dbc06655bc089a5237364c03d1ece9eed957d..8ae276ffef74fd71f6a4ebc0275e095679ce6788 100644 (file)
 #ifndef _ZEBRA_EVENT_COUNTER_H
 #define _ZEBRA_EVENT_COUNTER_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct event_counter {
        unsigned long long count;
        time_t last;
@@ -51,4 +55,8 @@ struct event_counter {
 void event_counter_inc(struct event_counter *counter);
 const char *event_counter_format(const struct event_counter *counter);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 335875c166aaf57b18f077b7476677cddb3fceb3..93d0ced5389fa2ba537d49b8467b802756c7497b 100644 (file)
 
 #include "vty.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* return type when this error indication stuff is used.
  *
  * guaranteed to have boolean evaluation to "false" when OK, "true" when error
@@ -253,4 +257,8 @@ DEFUN("bla")
 
 #endif /* THIS_IS_AN_EXAMPLE */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FERR_H */
index f59e4dc6cda50cb40046ab430e608364304e302c..6f9c59b5c1164f7dd48c5247ebfa56f09ef62665 100644 (file)
 #ifndef __LIB_FIFO_H__
 #define __LIB_FIFO_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* FIFO -- first in first out structure and macros.  */
 struct fifo {
        struct fifo *next;
@@ -55,4 +59,8 @@ struct fifo {
 
 #define FIFO_TOP(F) (FIFO_EMPTY(F) ? NULL : ((struct fifo *)(F))->next)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __LIB_FIFO_H__ */
index 97854b1e97f54c4f5412e43e29ff39e25ccabd4a..3dd2eaaf1563477bd8a4c4ddcf296f8bb6f8a654 100644 (file)
 
 #include "if.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Maximum ACL name length */
 #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,
                                          const void *object);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_FILTER_H */
index 4fcfe85a687c682d77991044bdb13aae39643260..793cfff8d3d1b7b9121ede47708a88e10f35f1a2 100644 (file)
 #ifndef _SYS_QUEUE_H_
 #define        _SYS_QUEUE_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * This file defines four types of data structures: singly-linked lists,
  * singly-linked tail queues, lists and tail queues.
@@ -675,4 +679,8 @@ struct qm_trace {
                        (head2)->tqh_last = &(head2)->tqh_first;               \
        } while (0)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* !_SYS_QUEUE_H_ */
index d487c738af3b587b1fe63c9dbf1cd10cdeb3221b..9bc7b94033b2dd6688d2dcf84cc2bfb227101e2d 100644 (file)
 #include "memory.h"
 #include "thread.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 DECLARE_MTYPE(FRR_PTHREAD);
 DECLARE_MTYPE(PTHREAD_PRIM);
 
@@ -211,4 +215,8 @@ void frr_pthread_stop_all(void);
 #define pthread_condattr_setclock(A, B)
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRR_PTHREAD_H */
index 1146b879640c87ba66e17c3b7b01c2919a1108b2..4303df9ccdaa07e60ad3059090019561bb5e595e 100644 (file)
 #include "thread.h"
 #include <zmq.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* linking/packaging note:  this is a separate library that needs to be
  * linked into any daemon/library/module that wishes to use its
  * 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,
                                int event);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRRZMQ_H */
index 891a3f337ca98da88542c7392dfd2218dc3d0fab..8b591849a3e6687bc5a9d3cc6317ae95af045dfd 100644 (file)
 
 #include "vector.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * Tokenizes a string, storing tokens in a vector. Whitespace is ignored.
  * Delimiter characters are not included.
@@ -108,4 +112,8 @@ bool begins_with(const char *str, const char *prefix);
  */
 int all_digit(const char *str);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRRSTR_H_ */
index 87262a07b88757318ed1a1ce01d3a4e71c472a7f..8e126e6be4ee1fab1350aa6bb58acb7abbabd391 100644 (file)
 #include "vector.h"
 #include "buffer.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct graph {
        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));
 
 #endif /* BUILDING_CLIPPY */
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_COMMAND_GRAPH_H */
index aca2590a95731287a2a4cc60a3f475609616b30a..8c695d2381059112f5bb8f0a8a8857ff32e9b914 100644 (file)
 #include "memory.h"
 #include "frratomic.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 DECLARE_MTYPE(HASH)
 DECLARE_MTYPE(HASH_BACKET)
 
@@ -325,4 +329,8 @@ extern unsigned int string_hash_make(const char *);
  */
 extern void hash_cmd_init(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_HASH_H */
index 96fec97d7efa761f5bd350a057244304b9f043a2..f7fb7b8a5cf619b14f64a8da2d33872371f7447b 100644 (file)
 #include "module.h"
 #include "memory.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* type-safe subscribable hook points
  *
  * 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_HOOK_INT(hookname, arglist, passlist, true)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRR_HOOK_H */
index efe355658ac18518924d877ca6aa59edafcd1225..8705ffb37df68a67271151fb6f0d314a357b6ab3 100644 (file)
 #include <limits.h>
 #include <stdint.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define IDALLOC_INVALID 0
 
 #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);
 void idalloc_destroy(struct id_alloc *alloc);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 822dbbaa5443bb601a74fe40c636e2d1765b5c7e..6689769beb8872c6b0be22bfa3759f83c6fea755 100644 (file)
--- a/lib/if.h
+++ b/lib/if.h
 #include "qobj.h"
 #include "hook.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 DECLARE_MTYPE(IF)
 DECLARE_MTYPE(CONNECTED_LABEL)
 
@@ -545,4 +549,8 @@ void if_link_params_free(struct interface *);
 extern void if_cmd_init(void);
 extern const struct frr_yang_module_info frr_interface_info;
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_IF_H */
index 4468b9fb9cddfc73473011affbe9f42a71a0a781..8dded2cb487fa34ddbc847c8f9ad5507aac552e6 100644 (file)
 #ifndef _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 };
 
 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 int config_write_if_rmap(struct vty *);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_IF_RMAP_H */
index eed7074e4af8a7f897645d9e913f666f6430d880..3f81b76bea084e2c05aac7d972471e3bdcdf3156 100644 (file)
 #ifndef _IMSG_H_
 #define _IMSG_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define IBUF_READ_SIZE         65535
 #define IMSG_HEADER_SIZE       sizeof(struct imsg_hdr)
 #define MAX_IMSGSIZE           16384
@@ -108,4 +112,8 @@ void imsg_free(struct imsg *);
 int imsg_flush(struct imsgbuf *);
 void imsg_clear(struct imsgbuf *);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 7f2d06548bdf9bce095ffeef114007b24d6a9259..f4ddadc66e18ec817f7ed001136ff40f60c7c225 100644 (file)
 
 #include <zebra.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * 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));
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __IPADDR_H__ */
index f8ab4209a8f1c61a38ebb6ba15b178ced6970acc..977421495cefaf111461a588107f81529e3961f3 100644 (file)
 #ifndef _QUAGGA_JHASH_H
 #define _QUAGGA_JHASH_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* The most generic version, hashes an arbitrary sequence
  * of bytes.  No alignment or length assumptions are made about
  * 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_1word(uint32_t a, uint32_t initval);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _QUAGGA_JHASH_H */
index d34916230473447e79f399c29d85dd8b283c6df2..a5251662be1a0a365150f6fb3d823467c54ca0cd 100644 (file)
 #ifndef _QUAGGA_JSON_H
 #define _QUAGGA_JSON_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #if defined(HAVE_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)
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _QUAGGA_JSON_H */
index 49da9ba459b7c8609aaf008c3830fde368fe20be..e5cf39f7c6557a2c7a154b7b5d4ed699db5b4d06 100644 (file)
 
 #include "qobj.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct keychain {
        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_lookup_for_send(const struct keychain *);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_KEYCHAIN_H */
index 86a83df46c216ae19f406d3dc1109b26efb55c14..fc405c20983a3a2303def2bc57152bb4c486befd 100644 (file)
 
 #include "lib/ferr.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 enum lib_log_refs {
        EC_LIB_PRIVILEGES = LIB_FERR_START,
        EC_LIB_VRF_START,
@@ -82,4 +86,8 @@ enum lib_log_refs {
 
 extern void lib_error_init(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 2705397b8571bac27b8f096ea0ca9f2c6127ebcc..891e2c12825c6599d83ef1f0f82bb76e84276518 100644 (file)
 #include "hook.h"
 #include "northbound.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* The following options disable specific command line options that
  * are not applicable for a particular daemon.
  */
@@ -152,4 +156,8 @@ extern char frr_protonameinst[];
 
 extern bool debug_memstats_at_exit;
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_FRR_H */
index 45aedb6a7de7066758f59421bf3d880c4f87b924..d2bb29d80e16ada46c12c1a8974f465e6ba302ff 100644 (file)
 #ifndef _LIBOSPFD_H
 #define _LIBOSPFD_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* IP precedence. */
 #ifndef IPTOS_PREC_INTERNETCONTROL
 #define IPTOS_PREC_INTERNETCONTROL     0xC0
@@ -94,4 +98,8 @@
 #define OSPF_LSA_MAXAGE_CHECK_INTERVAL         30
 #define OSPF_LSA_MAXAGE_REMOVE_DELAY_DEFAULT   60
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _LIBOSPFD_H */
index 0475391e9f98c153f7f4b53aa6d88aa7003eb147..5908e97a1401be898a95da2b4f1a5a58cd98bb10 100644 (file)
 #ifndef _ZEBRA_LINKLIST_H
 #define _ZEBRA_LINKLIST_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* listnodes must always contain data to be valid. Adding an empty node
  * to a list is invalid
  */
@@ -336,4 +340,8 @@ extern void list_add_list(struct list *list, struct list *add);
                (L)->count--;                                                  \
        } while (0)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_LINKLIST_H */
index 816daea3054d8bb226dd865db7c462b627c52052..189857a90746360bf588b96d940bb294ffde874e 100644 (file)
--- a/lib/log.h
+++ b/lib/log.h
 #include <stdarg.h>
 #include "lib/hook.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Hook for external logging function */
 DECLARE_HOOK(zebra_ext_log, (int priority, const char *format, va_list args),
             (priority, format, args));
@@ -196,4 +200,8 @@ struct timestamp_control {
        "Local use\n"                                                          \
        "Local use\n"
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_LOG_H */
index a7f8be9ae71499eb6c67eee2d61091b25e7d6824..58ae031e1b77e1fd90a07866a088f3d35ce51c13 100644 (file)
 
 #include "log.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct zlog {
        const char *ident; /* daemon name (first arg to openlog) */
        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 zlog(int priority, const char *format, ...) PRINTF_ATTRIBUTE(2, 3);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_LOG_PRIVATE_H */
index 5a0780c009e76777f536d5423720558bb1ddcd23..d18832ef70c9780c111f758889dc959db2bb8cc6 100644 (file)
 #ifndef _ZEBRA_LOGICAL_ROUTER_H
 #define _ZEBRA_LOGICAL_ROUTER_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Logical Router Backend defines */
 #define LOGICALROUTER_BACKEND_OFF   0
 #define LOGICALROUTER_BACKEND_NETNS 1
@@ -38,4 +42,8 @@ extern void logicalrouter_terminate(void);
  */
 extern void logicalrouter_configure_backend(int backend_netns);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /*_ZEBRA_LOGICAL_ROUTER_H*/
index 8020a22711a169d170c096098a0346bc3e181d2c..a864ab30e04d24d033a22699dc7826f585ea1add 100644 (file)
--- a/lib/lua.h
+++ b/lib/lua.h
 #include <lualib.h>
 #include <lauxlib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * These functions are helper functions that
  * 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);
 int get_integer(lua_State *L, const char *key);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 #endif
index 1dcbf45752564941149837d26a3bab743ff3f53d..691a294333599bd45cc79e462e41a2e7d4010dbb 100644 (file)
--- a/lib/md5.h
+++ b/lib/md5.h
 #ifndef _LIBZEBRA_MD5_H_
 #define _LIBZEBRA_MD5_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define MD5_BUFLEN     64
 
 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,
              int key_len, uint8_t *digest);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* ! _LIBZEBRA_MD5_H_*/
index 40b9d36ee6722acec3a86724fd3a9be4c3e4f7ba..91a02b7966c2aad18882a9c7f84a32c47712a117 100644 (file)
 #include <frratomic.h>
 #include "compiler.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define array_size(ar) (sizeof(ar) / sizeof(ar[0]))
 
 #if defined(HAVE_MALLOC_SIZE) && !defined(HAVE_MALLOC_USABLE_SIZE)
@@ -176,4 +180,8 @@ extern int log_memstats(FILE *fp, const char *);
 
 extern void memory_oom(size_t size, const char *name);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _QUAGGA_MEMORY_H */
index b66c3b6d6e5b20dd14236444c15238189bf80006..941255be1d1ed26a67179c8214560b41b2d74310 100644 (file)
 
 #include "memory.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern void memory_init(void);
 
 /* Human friendly string for given byte count */
 #define MTYPE_MEMSTR_LEN 20
 extern const char *mtype_memstr(char *, size_t, unsigned long);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_MEMORY_VTY_H */
index 73725ca3fd910f51c9644b45a71636fda945d4b9..2b904d44f463c31a267c77c2471e8e1b6c14486d 100644 (file)
 #ifndef __MLAG_H__
 #define __MLAG_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 enum mlag_role {
        MLAG_ROLE_NONE,
        MLAG_ROLE_PRIMARY,
@@ -29,4 +33,9 @@ enum mlag_role {
 };
 
 extern char *mlag_role2str(enum mlag_role role, char *buf, size_t size);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 68ed959270c9122c4bb755b659d135155e0aaeed..73ba8665ed6b67599edf1269605171a957d36aa6 100644 (file)
 #include <stdint.h>
 #include <stdbool.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #if !defined(__GNUC__)
 #error module code needs GCC visibility extensions
 #elif __GNUC__ < 4
@@ -95,4 +99,8 @@ extern struct frrmod_runtime *frrmod_load(const char *spec, const char *dir,
 extern void frrmod_unload(struct frrmod_runtime *module);
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRR_MODULE_H */
index 00b9400462e2f6c8b6e49c29ae6e1099fd80854c..6aac966ea14a2aee8e6872ca68893a58f953f620 100644 (file)
 #include <time.h>
 #include <sys/time.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifndef TIMESPEC_TO_TIMEVAL
 /* should be in sys/time.h on BSD & Linux libcs */
 #define TIMESPEC_TO_TIMEVAL(tv, ts)                                            \
@@ -91,4 +95,8 @@ static inline char *time_to_string(time_t ts)
        return ctime(&tbuf);
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRR_MONOTIME_H */
index 61469856105fb0b35a2108172ca41672bde19412..b140c8e3176dec3f5ce6b400effde9a3cb73f427 100644 (file)
 #include <zebra.h>
 #include <arpa/inet.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef MPLS_LABEL_MAX
 #undef MPLS_LABEL_MAX
 #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,
                     int len, int pretty);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 4703dc9b6364635494d8aa9f7a07d20348a67147..a00c5a0a6574ce6122c868c6ba2a773ea1037c6e 100644 (file)
 #ifndef _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
    suitable for use with non-blocking file descriptors.
  */
@@ -41,4 +45,8 @@ extern int set_cloexec(int fd);
 extern float htonf(float);
 extern float ntohf(float);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_NETWORK_H */
index e4af405d5fa23aff0df25d3b09c7716e4e636296..c79ec590a80e70b84abc20d9d19e1baf1619f61f 100644 (file)
 #include "prefix.h"
 #include "mpls.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Maximum next hop string length - gateway + ifindex */
 #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 struct nexthop *nexthop_next(struct nexthop *nexthop);
 extern unsigned int nexthop_level(struct nexthop *nexthop);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /*_LIB_NEXTHOP_H */
index b31ec7f06cadd6c9e41001f6a292321329e3adcf..b14cbb5b5c7314ebd0a7d7d2428bc085765fc24b 100644 (file)
 
 #include <vty.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * What is a nexthop group?
  *
@@ -110,4 +114,9 @@ extern struct nexthop *nexthop_exists(struct nexthop_group *nhg,
 extern struct nexthop_group_cmd *nhgc_find(const char *name);
 
 extern void nexthop_group_write_nexthop(struct vty *vty, struct nexthop *nh);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 4d760e2d33304decb86b6d56349a25a20c75f5e8..bb6b62af7d4197084897993e7460c408d272967a 100644 (file)
 #include "yang.h"
 #include "yang_translator.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Forward declaration(s). */
 struct vty;
 
@@ -839,4 +843,8 @@ extern void nb_init(struct thread_master *tm, const struct frr_yang_module_info
  */
 extern void nb_terminate(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRR_NORTHBOUND_H_ */
index 884f2509412dcc3804d1af1ec0257a5474f7ea42..209239ca6318d6ba39256aa6ca6a85159a3876a5 100644 (file)
 
 #include "northbound.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Possible formats in which a configuration can be displayed. */
 enum nb_cfg_format {
        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_terminate(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRR_NORTHBOUND_CLI_H_ */
index ad6096644191f15824e14a8b8fbee6af2c58bcf4..14df09caa37b8a9c65c731c57c741d74c53a8d2e 100644 (file)
 
 #include "northbound.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * Initialize the northbound database.
  *
@@ -101,4 +105,8 @@ extern int nb_db_transactions_iterate(
                     const char *date, const char *comment),
        void *arg);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRR_NORTHBOUND_DB_H_ */
index b3810f069b46b8914b24c565b5c8daa524247990..f3ad83788914cf16db9ca542a70e1d443d37c539 100644 (file)
--- a/lib/ns.h
+++ b/lib/ns.h
 #include "linklist.h"
 #include "vty.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef uint32_t ns_id_t;
 
 /* 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 void ns_disable(struct ns *ns);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /*_ZEBRA_NS_H*/
index e09cc3d4e529d41e56afb6615b71af6f5d965e9e..d4c08a3be8c8cc0a1447c73431eff56a96714dd8 100644 (file)
 #ifndef _SYS_QUEUE_H_
 #define        _SYS_QUEUE_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * This file defines five types of data structures: singly-linked lists,
  * lists, simple queues, tail queues and XOR simple queues.
                }                                                              \
        } while (0)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* !_SYS_QUEUE_H_ */
index b3efe4cbd385d501f400ae06dc0cf59719471b82..d2f078133340ef8da4d6ebaeb808d84e1d1c89ae 100644 (file)
 #ifndef _SYS_TREE_H_
 #define        _SYS_TREE_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * This file defines data structures for different types of trees:
  * splay trees and red-black trees.
@@ -567,4 +571,8 @@ int _rb_check(const struct rb_type *, void *, unsigned long);
        for ((_e) = RB_MAX(_name, (_head));                                    \
             (_e) != NULL && ((_n) = RB_PREV(_name, (_e)), 1); (_e) = (_n))
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _SYS_TREE_H_ */
index 90997348cf3ab3bdf129abe9541fc6cb27a2882c..1425e679c5e5e948a25038499aa721c817a0c274 100644 (file)
--- a/lib/pbr.h
+++ b/lib/pbr.h
 #include "stream.h"
 #include "prefix.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #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,
                                struct pbr_rule *zrule);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _PBR_H */
index 8a4fa8d3ce6cf4c60e47c66ed82ceada80970961..ba2846d74add9c9b42085cec2d91b4a37557dfdf 100644 (file)
 #include "stream.h"
 #include "vty.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 enum prefix_list_type {
        PREFIX_DENY,
        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,
                                       bool use_json);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _QUAGGA_PLIST_H */
index 6bc2d034d6996d21e65b16c9f9b1fe6bf34e14bc..443b0c614dfb3a76f0ae63c8ee160bf47b68d6c8 100644 (file)
 #ifndef _QUAGGA_PLIST_INT_H
 #define _QUAGGA_PLIST_INT_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 enum prefix_name_type { PREFIX_TYPE_STRING, PREFIX_TYPE_NUMBER };
 
 struct pltrie_table;
@@ -68,4 +72,8 @@ struct prefix_list_entry {
        struct prefix_list_entry *next_best;
 };
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _QUAGGA_PLIST_INT_H */
index 53e5aa83328b118b119a4260ff92a1a99c015fe7..032ee9db4cea804b654d5f6f9f5e0967020a5a17 100644 (file)
 #ifndef _ZEBRA_PQUEUE_H
 #define _ZEBRA_PQUEUE_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct pqueue {
        void **array;
        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_up(int index, struct pqueue *queue);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_PQUEUE_H */
index 231a407cc8f0106ec775c0f5511bbe82e7b65bc8..ae931288c02527736a18a039d3876f8d459aebcf 100644 (file)
 #include "ipaddr.h"
 #include "compiler.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifndef ETH_ALEN
 #define ETH_ALEN 6
 #endif
@@ -506,4 +510,9 @@ static inline int is_host_route(struct prefix *p)
                return (p->prefixlen == IPV6_MAX_BITLEN);
        return 0;
 }
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_PREFIX_H */
index b061370b753d2ce2bc88b39699ede003175cb645..1fee423a95e35dff57d1e332aac9fc73afab6f5a 100644 (file)
 #ifndef _ZEBRA_PRIVS_H
 #define _ZEBRA_PRIVS_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* list of zebra capabilities */
 typedef enum {
        ZCAP_SETID,
@@ -120,4 +124,8 @@ extern void _zprivs_lower(struct zebra_privs_t **privs);
                                          _zprivs_raise(privs, __func__);      \
             _once == NULL; _once = (void *)1)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_PRIVS_H */
index fc4d520dcb41b4c188d9340c7ee5a5edf96cc67b..c2170407c036d7345783089032b1accedacf218c 100644 (file)
 #ifndef __PTM_LIB_H__
 #define __PTM_LIB_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define PTMLIB_MSG_SZ           1024
 #define PTMLIB_MSG_HDR_LEN      37
 #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_cleanup_msg(ptm_lib_handle_t *, void *);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 2cfaa47e5d6ef3b38ceb7c7cd21469b7ea925dfb..0b923ed6b122ff8a27f6e5c8f8eefd1ba1e30f9a 100644 (file)
--- a/lib/pw.h
+++ b/lib/pw.h
 #ifndef _FRR_PW_H
 #define _FRR_PW_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* L2VPN name length. */
 #define L2VPN_NAME_LEN         32
 
@@ -49,4 +53,8 @@ union pw_protocol_fields {
        } bgp;
 };
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRR_PW_H */
index a109bf4a734cce66aacf1a4229f0bb912513fc45..d63988cbab0b5f4b46170e8baa4128b97abafc52 100644 (file)
 #include <stdlib.h>
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* reserve a specific amount of bytes for a struct, which can grow up to
  * that size (or be dummy'd out if not needed)
  *
@@ -133,4 +137,8 @@ void *qobj_get_typed(uint64_t id, struct qobj_nodetype *type);
 void qobj_init(void);
 void qobj_finish(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _QOBJ_H */
index 11e28b4c912554caf2c9cae8adebb407a46ce0fb..dab43e3c54ff6cc4d6a9551446caeb093f539014 100644 (file)
 #ifndef _FRR_QUEUE_H
 #define _FRR_QUEUE_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #if defined(__OpenBSD__) && !defined(STAILQ_HEAD)
 #include "openbsd-queue.h"
 
@@ -85,4 +89,8 @@
        }; _elm; })
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRR_QUEUE_H */
index 15049e3eeab7d426621c246d40fcd79c610b39f7..b8f4d9798dc97f2391c6358271111bf30758328e 100644 (file)
 
 #include "memory.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct ringbuf {
        size_t size;
        ssize_t start;
@@ -122,4 +126,8 @@ void ringbuf_reset(struct ringbuf *buf);
  */
 void ringbuf_wipe(struct ringbuf *buf);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRR_RINGBUF_H_ */
index 6fd88ba5de831e7bb43e695e39695e76a138347d..e43e74a633dda2424d1491f67c6b5c92698a0d55 100644 (file)
 #include "qobj.h"
 #include "vty.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 DECLARE_MTYPE(ROUTE_MAP_NAME)
 DECLARE_MTYPE(ROUTE_MAP_RULE)
 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 */
 extern void route_map_counter_decrement(struct route_map *map);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_ROUTEMAP_H */
index c38e96912f9cfbfc5e5392a06c23cf5beb721953..b1518a3aa8de3538f93de0ac7f3f35d217b2cf9d 100644 (file)
 #ifndef SBUF_H
 #define SBUF_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * 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
@@ -76,4 +80,8 @@ void sbuf_free(struct sbuf *buf);
 void sbuf_push(struct sbuf *buf, int indent, const char *format, ...)
        PRINTF_ATTRIBUTE(3, 4);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 2473da7bda2ed15dfd7038361795fc9668fe7a72..c93d25305184abf7a3ce04202928cc423f961b35 100644 (file)
 #ifndef _SHA256_H_
 #define _SHA256_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct SHA256Context {
        uint32_t state[8];
        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,
                   uint8_t *, size_t);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* !_SHA256_H_ */
index d4ab5741ac97c8fabc670814125211347c28a4c9..a0ad88fcaaaa2b10026f19813cbdd42dd3b4b6b3 100644 (file)
 
 #include <thread.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define QUAGGA_SIGNAL_TIMER_INTERVAL 2L
 
 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 */
 extern int quagga_sigevent_process(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _QUAGGA_SIGNAL_H */
index a2e8c374b1f7b1877ab5c1c5d1c0d1b1555c2363..2ab37331c9a9c8e96c1946ff3dcccf57d4299fb0 100644 (file)
 #ifndef _ZEBRA_SKIPLIST_H
 #define _ZEBRA_SKIPLIST_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #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);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_SKIPLIST_H */
index 9adfacb3e45d5e55377513635c5dac84008cb5ca..3f860db0dc4af5f3c1222e224f072474de2827d4 100644 (file)
 
 #include "thread.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Structures here are mostly compatible with UCD SNMP 4.1.1 */
 #define MATCH_FAILED     (-1)
 #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_addr(oid[], struct in_addr *, int);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_SNMP_H */
index f54f60ffd7609c77f14a3ecb118f1bb9729fa0ce..8fa5987cff967c6097820a79d3f13b40e0dddff7 100644 (file)
 
 #include "sockunion.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern void setsockopt_so_recvbuf(int sock, int size);
 extern void setsockopt_so_sendbuf(const int sock, int size);
 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_signature(int sock, union sockunion *su,
                                 const char *password);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /*_ZEBRA_SOCKOPT_H */
index b585aee5b4ed4315f02b0be5024f070d5b00add6..d7d26ba85ad9beff8043ab6ed6c27926e4b8af9c 100644 (file)
 #include <netmpls/mpls.h>
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 union sockunion {
        struct sockaddr sa;
        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_init(union sockunion *);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_SOCKUNION_H */
index 6de5804ace39daa748be92bb5c428f25c9f730d2..11b2701e3eeb2336131e51a988d29312b08234f6 100644 (file)
 #ifndef _ZEBRA_SPF_BACKOFF_H
 #define _ZEBRA_SPF_BACKOFF_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct spf_backoff;
 struct thread_master;
 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_timetolearn(struct spf_backoff *backoff);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 6f9457826cc541689053d6cb4b691102651e91e8..8845931de79cc29847f0b786abfc4e755b768959 100644 (file)
 #include "prefix.h"
 #include "table.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define SRCDEST2STR_BUFFER (2*PREFIX2STR_BUFFER + sizeof(" from "))
 
 /* extended route node for IPv6 srcdest routing */
@@ -96,4 +100,8 @@ static inline void *srcdest_rnode_table_info(struct route_node *rn)
        return route_table_get_info(srcdest_rnode_table(rn));
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_SRC_DEST_TABLE_H */
index 20c5d3d77d930644f1014e1f742831c3fa710bd6..5341bfa40bde4468dfd8eee46f062123078d9562 100644 (file)
 #include "mpls.h"
 #include "prefix.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * A stream is an arbitrary buffer, whose contents generally are assumed to
  * be in network order.
@@ -404,4 +408,8 @@ static inline uint8_t *ptr_get_be32(uint8_t *ptr, uint32_t *out)
                        goto stream_failure;                                   \
        } while (0)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_STREAM_H */
index a13ea7bfdd8b1117f244f5552ba247bfba616a03..6e43df527d7a9fc17b929a72f9e1f3112de7eb86 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * Wrapper functions to systemd calls.
  *
@@ -37,3 +41,7 @@ void systemd_send_stopping(void);
  *                process?
  */
 void systemd_send_started(struct thread_master *master, int the_process);
+
+#ifdef __cplusplus
+}
+#endif
index 541d74d77bff9f1c3b32d000acc4dfa6ad43bdd1..ce578e795c648f782fbffc8c64aead792fb8d5bf 100644 (file)
 #include "memory.h"
 #include "hash.h"
 #include "prefix.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 DECLARE_MTYPE(ROUTE_TABLE)
 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;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_TABLE_H */
index ca5cc1df9fce4c9363f3c1761221e6e8abb826fe..491010a856faca54efc381bf07c1fc36f6b7f8cc 100644 (file)
 
 #include <zebra.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 enum ttable_align {
        LEFT,
        RIGHT,
@@ -294,4 +298,8 @@ void ttable_rowseps(struct ttable *tt, unsigned int row,
  */
 char *ttable_dump(struct ttable *tt, const char *newline);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _TERMTABLE_H */
index 036e39f77e5d066e5fc1d8d69af95519506c278c..ec774a654309e9b5d2e36e481d374b17c36c12b0 100644 (file)
 #include "monotime.h"
 #include "frratomic.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct rusage_t {
        struct rusage cpu;
        struct timeval real;
@@ -233,4 +237,8 @@ extern unsigned long thread_consumed_time(RUSAGE_T *after, RUSAGE_T *before,
 /* only for use in logging functions! */
 extern pthread_key_t thread_current;
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_THREAD_H */
index 97e15da04099c621ced75845f0f3dbe8cd7ce801..d5857eb599d079c625efb47e27bd2277836b5d98 100644 (file)
 
 #include "memory.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* struct for vector */
 struct _vector {
        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_to_array(vector v, void ***dest, int *argc);
 extern vector array_to_vector(void **src, int argc);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_VECTOR_H */
index 6d15e62dfc2fd91972c7f6be230bf83a38a27344..eea2633d4eea2a11956e89dcfbc270cb166736ab 100644 (file)
 #ifndef __VLAN_H__
 #define __VLAN_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* VLAN Identifier */
 typedef uint16_t vlanid_t;
 #define VLANID_MAX 4095
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __VLAN_H__ */
index 20ca85d09175ce4d0aef0ab671e5b3838a978462..b947ab1d52ca1640146baeff242c6f05c93fb28a 100644 (file)
--- a/lib/vrf.h
+++ b/lib/vrf.h
 #include "vty.h"
 #include "ns.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* The default VRF ID */
 #define VRF_UNKNOWN UINT32_MAX
 
@@ -292,4 +296,8 @@ extern int vrf_enable(struct vrf *vrf);
 extern void vrf_delete(struct vrf *vrf);
 extern vrf_id_t vrf_generate_id(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /*_ZEBRA_VRF_H*/
index d7fe7358173097e46aa44c4082de8072e181e389..8dc078e4f3c1ab755ee3b7b548c5f3c44e0dce19 100644 (file)
 
 #include "vrf.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * These functions should only be called by:
  * 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 *);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 79b1bd5e9311aee3d44d0e3947d6f1e294e287f5..ca5a2003c46402940ec7fae86c2159cffd1e2d6f 100644 (file)
--- a/lib/vty.h
+++ b/lib/vty.h
 #include "compiler.h"
 #include "northbound.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define VTY_BUFSIZ 4096
 #define VTY_MAXHIST 20
 #define VTY_MAXDEPTH 8
@@ -333,4 +337,8 @@ extern void vty_stdio_close(void);
    an async-signal-safe function. */
 extern void vty_log_fixed(char *buf, size_t len);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_VTY_H */
index bcf8354539d982220cab64513d10bd62e08a7314..2a8077f8cf3297984d9d3a650d56edf44cbf9db5 100644 (file)
 #ifndef __VXLAN_H__
 #define __VXLAN_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* VxLAN Network Identifier - 24-bit (RFC 7348) */
 typedef uint32_t vni_t;
 #define VNI_MAX 16777215 /* (2^24 - 1) */
@@ -35,4 +39,9 @@ enum vxlan_flood_control {
        VXLAN_FLOOD_HEAD_END_REPL = 0,
        VXLAN_FLOOD_DISABLED,
 };
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __VXLAN_H__ */
index c8e83fafcb81ea3f4753121d0158554f754276ad..e66751c1d092a135dee1fb8f0c243ac522a34c94 100644 (file)
 #ifndef __WHEEL_H__
 #define __WHEEL_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct timer_wheel {
        char *name;
        struct thread_master *master;
@@ -115,4 +119,8 @@ int wheel_add_item(struct timer_wheel *wheel, void *item);
  */
 int wheel_remove_item(struct timer_wheel *wheel, void *item);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index cbbacc0561522514563ed88e06fa832f0218a785..7c610f5dd6b5e51d7c0fe8e118d5537fbb9aeb44 100644 (file)
 
 #include "memory.h"
 #include "queue.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 DECLARE_MTYPE(WORK_QUEUE)
 
 /* Hold time for the initial schedule of a queue run, in  millisec */
@@ -176,4 +181,8 @@ extern int work_queue_run(struct thread *);
 
 extern void workqueue_cmd_init(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _QUAGGA_WORK_QUEUE_H */
index 3259189e987099ba9ab83f1c388a8b25e999b258..4680db08d40f012c3624b9a07520af8084c5e814 100644 (file)
 
 #include "yang_wrappers.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 DECLARE_MTYPE(YANG_MODULE)
 DECLARE_MTYPE(YANG_DATA)
 
@@ -521,4 +525,8 @@ extern void yang_init(void);
  */
 extern void yang_terminate(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRR_YANG_H_ */
index 6b49d1acf36e38191bf83b44f5a63c8d394e6b83..55f396a434a589215eb8897d1a41b458f591eeac 100644 (file)
 #ifndef _FRR_YANG_TRANSLATOR_H_
 #define _FRR_YANG_TRANSLATOR_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define YANG_TRANSLATE_TO_NATIVE 0
 #define YANG_TRANSLATE_FROM_NATIVE 1
 #define YANG_TRANSLATE_MAX 2
@@ -141,4 +145,8 @@ extern void yang_translator_init(void);
  */
 extern void yang_translator_terminate(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FRR_YANG_TRANSLATOR_H_ */