]>
git.proxmox.com Git - mirror_frr.git/blob - zebra/kernel_netlink.h
1 /* Declarations and definitions for kernel interaction over netlink
2 * Copyright (C) 2016 Cumulus Networks, Inc.
4 * This file is part of GNU Zebra.
6 * GNU Zebra is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
11 * GNU Zebra is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GNU Zebra; see the file COPYING. If not, write to the Free
18 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 #ifndef _ZEBRA_KERNEL_NETLINK_H
23 #define _ZEBRA_KERNEL_NETLINK_H
27 #define NL_PKT_BUF_SIZE 8192
29 extern void netlink_parse_rtattr (struct rtattr
**tb
, int max
,
30 struct rtattr
*rta
, int len
);
31 extern int addattr_l (struct nlmsghdr
*n
, unsigned int maxlen
,
32 int type
, void *data
, unsigned int alen
);
33 extern int rta_addattr_l (struct rtattr
*rta
, unsigned int maxlen
,
34 int type
, void *data
, unsigned int alen
);
35 extern int addattr32 (struct nlmsghdr
*n
, unsigned int maxlen
,
37 extern struct rtattr
*addattr_nest(struct nlmsghdr
*n
, int maxlen
, int type
);
38 extern int addattr_nest_end(struct nlmsghdr
*n
, struct rtattr
*nest
);
39 extern struct rtattr
* rta_nest(struct rtattr
*rta
, int maxlen
, int type
);
40 extern int rta_nest_end(struct rtattr
*rta
, struct rtattr
*nest
);
41 extern const char * nl_msg_type_to_str (uint16_t msg_type
);
42 extern const char * nl_rtproto_to_str (u_char rtproto
);
44 extern int netlink_parse_info (int (*filter
) (struct sockaddr_nl
*,
45 struct nlmsghdr
*, ns_id_t
), struct nlsock
*nl
,
46 struct zebra_ns
*zns
, int count
);
47 extern int netlink_talk (struct nlmsghdr
*n
, struct nlsock
*nl
,
48 struct zebra_ns
*zns
);
49 extern int netlink_request (int family
, int type
, struct nlsock
*nl
);
51 #endif /* HAVE_NETLINK */
53 #endif /* _ZEBRA_KERNEL_NETLINK_H */