libnl 3.7.0
neighbour.h
1/* SPDX-License-Identifier: LGPL-2.1-only */
2/*
3 * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch>
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
14extern "C" {
15#endif
16
17struct rtnl_neigh;
18
19extern struct rtnl_neigh *rtnl_neigh_alloc(void);
20extern void rtnl_neigh_put(struct rtnl_neigh *);
21
22extern int rtnl_neigh_alloc_cache(struct nl_sock *, struct nl_cache **);
23extern int rtnl_neigh_alloc_cache_flags(struct nl_sock *,
24 struct nl_cache **,
25 unsigned int);
26extern struct rtnl_neigh *rtnl_neigh_get(struct nl_cache *, int,
27 struct nl_addr *);
28extern struct rtnl_neigh *rtnl_neigh_get_by_vlan(struct nl_cache *, int,
29 struct nl_addr *, int);
30
31extern int rtnl_neigh_parse(struct nlmsghdr *, struct rtnl_neigh **);
32
33extern char * rtnl_neigh_state2str(int, char *, size_t);
34extern int rtnl_neigh_str2state(const char *);
35
36extern char * rtnl_neigh_flags2str(int, char *, size_t);
37extern int rtnl_neigh_str2flag(const char *);
38
39extern int rtnl_neigh_add(struct nl_sock *, struct rtnl_neigh *, int);
40extern int rtnl_neigh_build_add_request(struct rtnl_neigh *, int,
41 struct nl_msg **);
42
43extern int rtnl_neigh_delete(struct nl_sock *, struct rtnl_neigh *, int);
44extern int rtnl_neigh_build_delete_request(struct rtnl_neigh *, int,
45 struct nl_msg **);
46
47extern void rtnl_neigh_set_state(struct rtnl_neigh *, int);
48extern int rtnl_neigh_get_state(struct rtnl_neigh *);
49extern void rtnl_neigh_unset_state(struct rtnl_neigh *,
50 int);
51
52extern void rtnl_neigh_set_flags(struct rtnl_neigh *,
53 unsigned int);
54extern void rtnl_neigh_unset_flags(struct rtnl_neigh *,
55 unsigned int);
56extern unsigned int rtnl_neigh_get_flags(struct rtnl_neigh *);
57
58extern void rtnl_neigh_set_ifindex(struct rtnl_neigh *,
59 int);
60extern int rtnl_neigh_get_ifindex(struct rtnl_neigh *);
61
62extern void rtnl_neigh_set_lladdr(struct rtnl_neigh *,
63 struct nl_addr *);
64extern struct nl_addr * rtnl_neigh_get_lladdr(struct rtnl_neigh *);
65
66extern int rtnl_neigh_set_dst(struct rtnl_neigh *,
67 struct nl_addr *);
68extern struct nl_addr * rtnl_neigh_get_dst(struct rtnl_neigh *);
69
70extern void rtnl_neigh_set_type(struct rtnl_neigh *, int);
71extern int rtnl_neigh_get_type(struct rtnl_neigh *);
72
73extern void rtnl_neigh_set_family(struct rtnl_neigh *, int);
74extern int rtnl_neigh_get_family(struct rtnl_neigh *);
75
76extern void rtnl_neigh_set_vlan(struct rtnl_neigh *, int);
77extern int rtnl_neigh_get_vlan(struct rtnl_neigh *);
78
79extern void rtnl_neigh_set_master(struct rtnl_neigh *, int);
80extern int rtnl_neigh_get_master(struct rtnl_neigh *);
81
82#ifdef __cplusplus
83}
84#endif
85
86#endif
int rtnl_neigh_build_delete_request(struct rtnl_neigh *, int, struct nl_msg **)
Build a netlink request message to delete a neighbour.
Definition: neigh.c:813
int rtnl_neigh_build_add_request(struct rtnl_neigh *, int, struct nl_msg **)
Build netlink request message to add a new neighbour.
Definition: neigh.c:752
int rtnl_neigh_alloc_cache(struct nl_sock *, struct nl_cache **)
Build a neighbour cache including all neighbours currently configured in the kernel.
Definition: neigh.c:590
int rtnl_neigh_add(struct nl_sock *, struct rtnl_neigh *, int)
Add a new neighbour.
Definition: neigh.c:776
struct rtnl_neigh * rtnl_neigh_get_by_vlan(struct nl_cache *, int, struct nl_addr *, int)
Look up a neighbour by interface index, link layer address and vlan id.
Definition: neigh.c:661
int rtnl_neigh_delete(struct nl_sock *, struct rtnl_neigh *, int)
Delete a neighbour.
Definition: neigh.c:831
struct rtnl_neigh * rtnl_neigh_get(struct nl_cache *, int, struct nl_addr *)
Look up a neighbour by interface index and destination address.
Definition: neigh.c:635
int rtnl_neigh_alloc_cache_flags(struct nl_sock *, struct nl_cache **, unsigned int)
Build a neighbour cache including all neighbours currently configured in the kernel.
Definition: neigh.c:606