| 1 |
/* SPDX-License-Identifier: LGPL-2.1-only */ |
| 2 |
/* |
| 3 |
* Copyright (c) 2003-2008 Thomas Graf <[email protected]> |
| 4 |
*/ |
| 5 |
|
| 6 |
#ifndef NETLINK_NEIGHBOUR_H_ |
| 7 |
#define NETLINK_NEIGHBOUR_H_ |
| 8 |
|
| 9 |
#include <netlink/netlink.h> |
| 10 |
#include <netlink/cache.h> |
| 11 |
#include <netlink/addr.h> |
| 12 |
|
| 13 |
#ifdef __cplusplus |
| 14 |
extern "C" { |
| 15 |
#endif |
| 16 |
|
| 17 |
struct rtnl_neigh; |
| 18 |
|
| 19 |
extern struct rtnl_neigh *rtnl_neigh_alloc(void); |
| 20 |
extern void rtnl_neigh_put(struct rtnl_neigh *); |
| 21 |
|
| 22 |
extern int rtnl_neigh_alloc_cache(struct nl_sock *, struct nl_cache **); |
| 23 |
extern int rtnl_neigh_alloc_cache_flags(struct nl_sock *, |
| 24 |
struct nl_cache **, |
| 25 |
unsigned int); |
| 26 |
extern struct rtnl_neigh *rtnl_neigh_get(struct nl_cache *, int, |
| 27 |
struct nl_addr *); |
| 28 |
extern struct rtnl_neigh *rtnl_neigh_get_by_vlan(struct nl_cache *, int, |
| 29 |
struct nl_addr *, int); |
| 30 |
|
| 31 |
extern int rtnl_neigh_parse(struct nlmsghdr *, struct rtnl_neigh **); |
| 32 |
|
| 33 |
extern char * rtnl_neigh_state2str(int, char *, size_t); |
| 34 |
extern int rtnl_neigh_str2state(const char *); |
| 35 |
|
| 36 |
extern char * rtnl_neigh_flags2str(int, char *, size_t); |
| 37 |
extern int rtnl_neigh_str2flag(const char *); |
| 38 |
|
| 39 |
extern char * rtnl_neigh_extflags2str(uint32_t, char *, size_t); |
| 40 |
extern uint32_t rtnl_neigh_str2extflag(const char *); |
| 41 |
|
| 42 |
extern int rtnl_neigh_add(struct nl_sock *, struct rtnl_neigh *, int); |
| 43 |
extern int rtnl_neigh_build_add_request(struct rtnl_neigh *, int, |
| 44 |
struct nl_msg **); |
| 45 |
|
| 46 |
extern int rtnl_neigh_delete(struct nl_sock *, struct rtnl_neigh *, int); |
| 47 |
extern int rtnl_neigh_build_delete_request(struct rtnl_neigh *, int, |
| 48 |
struct nl_msg **); |
| 49 |
|
| 50 |
extern void rtnl_neigh_set_state(struct rtnl_neigh *, int); |
| 51 |
extern int rtnl_neigh_get_state(struct rtnl_neigh *); |
| 52 |
extern void rtnl_neigh_unset_state(struct rtnl_neigh *, |
| 53 |
int); |
| 54 |
|
| 55 |
extern void rtnl_neigh_set_flags(struct rtnl_neigh *, |
| 56 |
unsigned int); |
| 57 |
extern void rtnl_neigh_unset_flags(struct rtnl_neigh *, |
| 58 |
unsigned int); |
| 59 |
extern unsigned int rtnl_neigh_get_flags(struct rtnl_neigh *); |
| 60 |
|
| 61 |
extern void rtnl_neigh_set_ext_flags(struct rtnl_neigh *, |
| 62 |
uint32_t); |
| 63 |
extern void rtnl_neigh_unset_ext_flags(struct rtnl_neigh *, |
| 64 |
uint32_t); |
| 65 |
extern int rtnl_neigh_get_ext_flags(struct rtnl_neigh *, |
| 66 |
uint32_t *); |
| 67 |
|
| 68 |
extern void rtnl_neigh_set_ifindex(struct rtnl_neigh *, |
| 69 |
int); |
| 70 |
extern int rtnl_neigh_get_ifindex(struct rtnl_neigh *); |
| 71 |
|
| 72 |
extern void rtnl_neigh_set_lladdr(struct rtnl_neigh *, |
| 73 |
struct nl_addr *); |
| 74 |
extern struct nl_addr * rtnl_neigh_get_lladdr(struct rtnl_neigh *); |
| 75 |
|
| 76 |
extern int rtnl_neigh_set_dst(struct rtnl_neigh *, |
| 77 |
struct nl_addr *); |
| 78 |
extern struct nl_addr * rtnl_neigh_get_dst(struct rtnl_neigh *); |
| 79 |
|
| 80 |
extern void rtnl_neigh_set_type(struct rtnl_neigh *, int); |
| 81 |
extern int rtnl_neigh_get_type(struct rtnl_neigh *); |
| 82 |
|
| 83 |
extern void rtnl_neigh_set_family(struct rtnl_neigh *, int); |
| 84 |
extern int rtnl_neigh_get_family(struct rtnl_neigh *); |
| 85 |
|
| 86 |
extern void rtnl_neigh_set_vlan(struct rtnl_neigh *, int); |
| 87 |
extern int rtnl_neigh_get_vlan(struct rtnl_neigh *); |
| 88 |
|
| 89 |
extern void rtnl_neigh_set_master(struct rtnl_neigh *, int); |
| 90 |
extern int rtnl_neigh_get_master(struct rtnl_neigh *); |
| 91 |
|
| 92 |
extern void rtnl_neigh_set_nhid(struct rtnl_neigh *, uint32_t); |
| 93 |
extern int rtnl_neigh_get_nhid(struct rtnl_neigh *, uint32_t *); |
| 94 |
|
| 95 |
#ifdef __cplusplus |
| 96 |
} |
| 97 |
#endif |
| 98 |
|
| 99 |
#endif |