X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=zebra%2Fkernel_netlink.h;h=076ca5c5c7579253eb07859d42ee15046cc99568;hb=724935d5a20bc3c7b714d5e8c497e7095026704c;hp=dc075b9aff8890535ba73796d01717bf2af93ee6;hpb=cfe50de15be87aced904965dbede086ccf21cc1c;p=mirror_frr.git diff --git a/zebra/kernel_netlink.h b/zebra/kernel_netlink.h index dc075b9af..076ca5c5c 100644 --- a/zebra/kernel_netlink.h +++ b/zebra/kernel_netlink.h @@ -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 @@ -28,10 +32,12 @@ extern void netlink_parse_rtattr(struct rtattr **tb, int max, struct rtattr *rta, int len); +extern void netlink_parse_rtattr_nested(struct rtattr **tb, int max, + struct rtattr *rta); extern int addattr_l(struct nlmsghdr *n, unsigned int maxlen, int type, - void *data, unsigned int alen); + const void *data, unsigned int alen); extern int rta_addattr_l(struct rtattr *rta, unsigned int maxlen, int type, - void *data, unsigned int alen); + const void *data, unsigned int alen); extern int addattr16(struct nlmsghdr *n, unsigned int maxlen, int type, uint16_t data); extern int addattr32(struct nlmsghdr *n, unsigned int maxlen, int type, @@ -45,18 +51,29 @@ extern const char *nl_rtproto_to_str(uint8_t rtproto); extern const char *nl_family_to_str(uint8_t family); extern const char *nl_rttype_to_str(uint8_t rttype); -extern int netlink_parse_info(int (*filter)(struct sockaddr_nl *, - struct nlmsghdr *, ns_id_t, int), - struct nlsock *nl, struct zebra_ns *zns, +#if defined(HANDLE_NETLINK_FUZZING) +extern bool netlink_read; +extern void netlink_read_init(const char *fname); +#endif /* HANDLE_NETLINK_FUZZING */ +extern int netlink_parse_info(int (*filter)(struct nlmsghdr *, ns_id_t, int), + const struct nlsock *nl, + const struct zebra_dplane_info *dp_info, int count, int startup); -extern int netlink_talk_filter(struct sockaddr_nl *, struct nlmsghdr *, ns_id_t, - int startup); -extern int netlink_talk(int (*filter)(struct sockaddr_nl *, struct nlmsghdr *, - ns_id_t, int startup), +extern int netlink_talk_filter(struct nlmsghdr *h, ns_id_t ns, int startup); +extern int netlink_talk(int (*filter)(struct nlmsghdr *, ns_id_t, int startup), struct nlmsghdr *n, struct nlsock *nl, struct zebra_ns *zns, int startup); +/* Version with 'info' struct only */ +int netlink_talk_info(int (*filter)(struct nlmsghdr *, ns_id_t, int startup), + struct nlmsghdr *n, + const struct zebra_dplane_info *dp_info, int startup); + extern int netlink_request(struct nlsock *nl, struct nlmsghdr *n); #endif /* HAVE_NETLINK */ +#ifdef __cplusplus +} +#endif + #endif /* _ZEBRA_KERNEL_NETLINK_H */