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>
#include "prefix.h"
#include "table.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct agg_table {
struct route_table *route_table;
{
return (struct agg_table *)route_table_get_info(node->table);
}
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
#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
extern void bfd_gbl_exit(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_BFD_H */
#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)
} \
} while (0)
+#ifdef __cplusplus
+}
+#endif
+
#endif
#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. */
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 */
+#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
#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 */
#include "hash.h"
#include "command_graph.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
DECLARE_MTYPE(HOST)
DECLARE_MTYPE(COMPLETION)
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 */
#include "vector.h"
#include "graph.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
DECLARE_MTYPE(CMD_ARG)
struct vty;
*/
char *cmd_graph_dump_dot(struct graph *cmdgraph);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRR_COMMAND_GRAPH_H */
#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
*/
enum matcher_rv command_complete(struct graph *cmdgraph, vector vline,
struct list **completions);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_COMMAND_MATCH_H */
#ifndef _FRR_COMPILER_H
#define _FRR_COMPILER_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* function attributes, use like
* void prototype(void) __attribute__((_CONSTRUCTOR(100)));
*/
#define CPP_NOTICE(text)
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRR_COMPILER_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;
*/
int csv_num_records(csv_t *csv);
+#ifdef __cplusplus
+}
+#endif
+
#endif
#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, ...);
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_ */
#include "command.h"
#include "frratomic.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Debugging modes.
*
*/
void debug_init(const struct debug_callbacks *cb);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRRDEBUG_H */
#include "if.h"
#include "filter.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Disctirubte list types. */
enum distribute_type {
DISTRIBUTE_V4_IN,
extern enum filter_type distribute_apply_out(struct interface *,
struct prefix *);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_DISTRIBUTE_H */
#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;
void event_counter_inc(struct event_counter *counter);
const char *event_counter_format(const struct event_counter *counter);
+#ifdef __cplusplus
+}
+#endif
+
#endif
#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
#endif /* THIS_IS_AN_EXAMPLE */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FERR_H */
#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;
#define FIFO_TOP(F) (FIFO_EMPTY(F) ? NULL : ((struct fifo *)(F))->next)
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __LIB_FIFO_H__ */
#include "if.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Maximum ACL name length */
#define ACL_NAMSIZ 128
extern enum filter_type access_list_apply(struct access_list *access,
const void *object);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_FILTER_H */
#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.
(head2)->tqh_last = &(head2)->tqh_first; \
} while (0)
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !_SYS_QUEUE_H_ */
#include "memory.h"
#include "thread.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
DECLARE_MTYPE(FRR_PTHREAD);
DECLARE_MTYPE(PTHREAD_PRIM);
#define pthread_condattr_setclock(A, B)
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRR_PTHREAD_H */
#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
extern void frrzmq_check_events(struct frrzmq_cb **cbp, struct cb_core *core,
int event);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRRZMQ_H */
#include "vector.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Tokenizes a string, storing tokens in a vector. Whitespace is ignored.
* Delimiter characters are not included.
*/
int all_digit(const char *str);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRRSTR_H_ */
#include "vector.h"
#include "buffer.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct graph {
vector nodes;
};
void (*pcb)(struct graph_node *, struct buffer *buf));
#endif /* BUILDING_CLIPPY */
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_COMMAND_GRAPH_H */
#include "memory.h"
#include "frratomic.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
DECLARE_MTYPE(HASH)
DECLARE_MTYPE(HASH_BACKET)
*/
extern void hash_cmd_init(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_HASH_H */
#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
#define DEFINE_KOOH(hookname, arglist, passlist) \
DEFINE_HOOK_INT(hookname, arglist, passlist, true)
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRR_HOOK_H */
#include <limits.h>
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define IDALLOC_INVALID 0
#define IDALLOC_DIR_BITS 8
struct id_alloc *idalloc_new(const char *name);
void idalloc_destroy(struct id_alloc *alloc);
+#ifdef __cplusplus
+}
+#endif
+
#endif
#include "qobj.h"
#include "hook.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
DECLARE_MTYPE(IF)
DECLARE_MTYPE(CONNECTED_LABEL)
extern void if_cmd_init(void);
extern const struct frr_yang_module_info frr_interface_info;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_IF_H */
#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 {
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 */
#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
int imsg_flush(struct imsgbuf *);
void imsg_clear(struct imsgbuf *);
+#ifdef __cplusplus
+}
+#endif
+
#endif
#include <zebra.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Generic IP address - union of IPv4 and IPv6 address.
*/
memcpy(in, (char *)in6 + 12, sizeof(struct in_addr));
}
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __IPADDR_H__ */
#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.
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 */
#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>
#define JSON_C_TO_STRING_NOSLASHESCAPE (1<<4)
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _QUAGGA_JSON_H */
#include "qobj.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct keychain {
char *name;
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 */
#include "lib/ferr.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
enum lib_log_refs {
EC_LIB_PRIVILEGES = LIB_FERR_START,
EC_LIB_VRF_START,
extern void lib_error_init(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif
#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.
*/
extern bool debug_memstats_at_exit;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_FRR_H */
#ifndef _LIBOSPFD_H
#define _LIBOSPFD_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* IP precedence. */
#ifndef IPTOS_PREC_INTERNETCONTROL
#define IPTOS_PREC_INTERNETCONTROL 0xC0
#define OSPF_LSA_MAXAGE_CHECK_INTERVAL 30
#define OSPF_LSA_MAXAGE_REMOVE_DELAY_DEFAULT 60
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _LIBOSPFD_H */
#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
*/
(L)->count--; \
} while (0)
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_LINKLIST_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));
"Local use\n" \
"Local use\n"
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_LOG_H */
#include "log.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct zlog {
const char *ident; /* daemon name (first arg to openlog) */
const char *protoname;
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 */
#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
*/
extern void logicalrouter_configure_backend(int backend_netns);
+#ifdef __cplusplus
+}
+#endif
+
#endif /*_ZEBRA_LOGICAL_ROUTER_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
*/
const char *get_string(lua_State *L, const char *key);
int get_integer(lua_State *L, const char *key);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
#endif
#ifndef _LIBZEBRA_MD5_H_
#define _LIBZEBRA_MD5_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define MD5_BUFLEN 64
typedef struct {
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_*/
#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)
extern void memory_oom(size_t size, const char *name);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _QUAGGA_MEMORY_H */
#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 */
#ifndef __MLAG_H__
#define __MLAG_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
enum mlag_role {
MLAG_ROLE_NONE,
MLAG_ROLE_PRIMARY,
};
extern char *mlag_role2str(enum mlag_role role, char *buf, size_t size);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
#include <stdint.h>
#include <stdbool.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if !defined(__GNUC__)
#error module code needs GCC visibility extensions
#elif __GNUC__ < 4
extern void frrmod_unload(struct frrmod_runtime *module);
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRR_MODULE_H */
#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) \
return ctime(&tbuf);
}
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRR_MONOTIME_H */
#include <zebra.h>
#include <arpa/inet.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef MPLS_LABEL_MAX
#undef MPLS_LABEL_MAX
#endif
char *mpls_label2str(uint8_t num_labels, mpls_label_t *labels, char *buf,
int len, int pretty);
+#ifdef __cplusplus
+}
+#endif
+
#endif
#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.
*/
extern float htonf(float);
extern float ntohf(float);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_NETWORK_H */
#include "prefix.h"
#include "mpls.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Maximum next hop string length - gateway + ifindex */
#define NEXTHOP_STRLEN (INET6_ADDRSTRLEN + 30)
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 */
#include <vty.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* What is a nexthop group?
*
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
#include "yang.h"
#include "yang_translator.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Forward declaration(s). */
struct vty;
*/
extern void nb_terminate(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRR_NORTHBOUND_H_ */
#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,
extern void nb_cli_init(struct thread_master *tm);
extern void nb_cli_terminate(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRR_NORTHBOUND_CLI_H_ */
#include "northbound.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Initialize the northbound database.
*
const char *date, const char *comment),
void *arg);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRR_NORTHBOUND_DB_H_ */
#include "linklist.h"
#include "vty.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef uint32_t ns_id_t;
/* the default 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);
+#ifdef __cplusplus
+}
+#endif
+
#endif /*_ZEBRA_NS_H*/
#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_ */
#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.
for ((_e) = RB_MAX(_name, (_head)); \
(_e) != NULL && ((_n) = RB_PREV(_name, (_e)), 1); (_e) = (_n))
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _SYS_TREE_H_ */
#include "stream.h"
#include "prefix.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define PBR_STR "Policy Based Routing\n"
/*
extern int zapi_pbr_rule_encode(uint8_t cmd, struct stream *s,
struct pbr_rule *zrule);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _PBR_H */
#include "stream.h"
#include "vty.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
enum prefix_list_type {
PREFIX_DENY,
PREFIX_PERMIT,
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 */
#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;
struct prefix_list_entry *next_best;
};
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _QUAGGA_PLIST_INT_H */
#ifndef _ZEBRA_PQUEUE_H
#define _ZEBRA_PQUEUE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct pqueue {
void **array;
int array_size;
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 */
#include "ipaddr.h"
#include "compiler.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef ETH_ALEN
#define ETH_ALEN 6
#endif
return (p->prefixlen == IPV6_MAX_BITLEN);
return 0;
}
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_PREFIX_H */
#ifndef _ZEBRA_PRIVS_H
#define _ZEBRA_PRIVS_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* list of zebra capabilities */
typedef enum {
ZCAP_SETID,
_zprivs_raise(privs, __func__); \
_once == NULL; _once = (void *)1)
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_PRIVS_H */
#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
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
#ifndef _FRR_PW_H
#define _FRR_PW_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* L2VPN name length. */
#define L2VPN_NAME_LEN 32
} bgp;
};
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRR_PW_H */
#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)
*
void qobj_init(void);
void qobj_finish(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _QOBJ_H */
#ifndef _FRR_QUEUE_H
#define _FRR_QUEUE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if defined(__OpenBSD__) && !defined(STAILQ_HEAD)
#include "openbsd-queue.h"
}; _elm; })
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRR_QUEUE_H */
#include "memory.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct ringbuf {
size_t size;
ssize_t start;
*/
void ringbuf_wipe(struct ringbuf *buf);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRR_RINGBUF_H_ */
#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)
/* Decrement the route-map used counter */
extern void route_map_counter_decrement(struct route_map *map);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_ROUTEMAP_H */
#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
void sbuf_push(struct sbuf *buf, int indent, const char *format, ...)
PRINTF_ATTRIBUTE(3, 4);
+#ifdef __cplusplus
+}
+#endif
+
#endif
#ifndef _SHA256_H_
#define _SHA256_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct SHA256Context {
uint32_t state[8];
uint32_t count[2];
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_ */
#include <thread.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define QUAGGA_SIGNAL_TIMER_INTERVAL 2L
struct quagga_signal_t {
/* check whether there are signals to handle, process any found */
extern int quagga_sigevent_process(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _QUAGGA_SIGNAL_H */
#ifndef _ZEBRA_SKIPLIST_H
#define _ZEBRA_SKIPLIST_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define SKIPLIST_0TIMER_DEBUG 1
/*
extern void skiplist_test(struct vty *vty);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_SKIPLIST_H */
#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
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 */
#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);
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 */
#include <netmpls/mpls.h>
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
union sockunion {
struct sockaddr sa;
struct sockaddr_in sin;
extern void sockunion_free(union sockunion *);
extern void sockunion_init(union sockunion *);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_SOCKUNION_H */
#ifndef _ZEBRA_SPF_BACKOFF_H
#define _ZEBRA_SPF_BACKOFF_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct spf_backoff;
struct thread_master;
struct vty;
long spf_backoff_holddown(struct spf_backoff *backoff);
long spf_backoff_timetolearn(struct spf_backoff *backoff);
+#ifdef __cplusplus
+}
+#endif
+
#endif
#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 */
return route_table_get_info(srcdest_rnode_table(rn));
}
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_SRC_DEST_TABLE_H */
#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.
goto stream_failure; \
} while (0)
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_STREAM_H */
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Wrapper functions to systemd calls.
*
* process?
*/
void systemd_send_started(struct thread_master *master, int the_process);
+
+#ifdef __cplusplus
+}
+#endif
#include "memory.h"
#include "hash.h"
#include "prefix.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
DECLARE_MTYPE(ROUTE_TABLE)
DECLARE_MTYPE(ROUTE_NODE)
return iter->state != RT_ITER_STATE_INIT;
}
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_TABLE_H */
#include <zebra.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
enum ttable_align {
LEFT,
RIGHT,
*/
char *ttable_dump(struct ttable *tt, const char *newline);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _TERMTABLE_H */
#include "monotime.h"
#include "frratomic.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct rusage_t {
struct rusage cpu;
struct timeval real;
/* only for use in logging functions! */
extern pthread_key_t thread_current;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_THREAD_H */
#include "memory.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* struct for vector */
struct _vector {
unsigned int active; /* number of active slots */
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 */
#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__ */
#include "vty.h"
#include "ns.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* The default VRF ID */
#define VRF_UNKNOWN UINT32_MAX
extern void vrf_delete(struct vrf *vrf);
extern vrf_id_t vrf_generate_id(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /*_ZEBRA_VRF_H*/
#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
*/
extern void vrf_delete(struct vrf *);
+#ifdef __cplusplus
+}
+#endif
+
#endif
#include "compiler.h"
#include "northbound.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define VTY_BUFSIZ 4096
#define VTY_MAXHIST 20
#define VTY_MAXDEPTH 8
an async-signal-safe function. */
extern void vty_log_fixed(char *buf, size_t len);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_VTY_H */
#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) */
VXLAN_FLOOD_HEAD_END_REPL = 0,
VXLAN_FLOOD_DISABLED,
};
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __VXLAN_H__ */
#ifndef __WHEEL_H__
#define __WHEEL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct timer_wheel {
char *name;
struct thread_master *master;
*/
int wheel_remove_item(struct timer_wheel *wheel, void *item);
+#ifdef __cplusplus
+}
+#endif
+
#endif
#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 */
extern void workqueue_cmd_init(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _QUAGGA_WORK_QUEUE_H */
#include "yang_wrappers.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
DECLARE_MTYPE(YANG_MODULE)
DECLARE_MTYPE(YANG_DATA)
*/
extern void yang_terminate(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRR_YANG_H_ */
#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
*/
extern void yang_translator_terminate(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRR_YANG_TRANSLATOR_H_ */