libnl: /data/src/libnl/include/netlink/route/neighbour.h Source File

libnl 3.12.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 char * rtnl_neigh_extflags2str(uint32_t, char *, size_t);
40extern uint32_t rtnl_neigh_str2extflag(const char *);
41
42extern int rtnl_neigh_add(struct nl_sock *, struct rtnl_neigh *, int);
43extern int rtnl_neigh_build_add_request(struct rtnl_neigh *, int,
44 struct nl_msg **);
45
46extern int rtnl_neigh_delete(struct nl_sock *, struct rtnl_neigh *, int);
47extern int rtnl_neigh_build_delete_request(struct rtnl_neigh *, int,
48 struct nl_msg **);
49
50extern void rtnl_neigh_set_state(struct rtnl_neigh *, int);
51extern int rtnl_neigh_get_state(struct rtnl_neigh *);
52extern void rtnl_neigh_unset_state(struct rtnl_neigh *,
53 int);
54
55extern void rtnl_neigh_set_flags(struct rtnl_neigh *,
56 unsigned int);
57extern void rtnl_neigh_unset_flags(struct rtnl_neigh *,
58 unsigned int);
59extern unsigned int rtnl_neigh_get_flags(struct rtnl_neigh *);
60
61extern void rtnl_neigh_set_ext_flags(struct rtnl_neigh *,
62 uint32_t);
63extern void rtnl_neigh_unset_ext_flags(struct rtnl_neigh *,
64 uint32_t);
65extern int rtnl_neigh_get_ext_flags(struct rtnl_neigh *,
66 uint32_t *);
67
68extern void rtnl_neigh_set_ifindex(struct rtnl_neigh *,
69 int);
70extern int rtnl_neigh_get_ifindex(struct rtnl_neigh *);
71
72extern void rtnl_neigh_set_lladdr(struct rtnl_neigh *,
73 struct nl_addr *);
74extern struct nl_addr * rtnl_neigh_get_lladdr(struct rtnl_neigh *);
75
76extern int rtnl_neigh_set_dst(struct rtnl_neigh *,
77 struct nl_addr *);
78extern struct nl_addr * rtnl_neigh_get_dst(struct rtnl_neigh *);
79
80extern void rtnl_neigh_set_type(struct rtnl_neigh *, int);
81extern int rtnl_neigh_get_type(struct rtnl_neigh *);
82
83extern void rtnl_neigh_set_family(struct rtnl_neigh *, int);
84extern int rtnl_neigh_get_family(struct rtnl_neigh *);
85
86extern void rtnl_neigh_set_vlan(struct rtnl_neigh *, int);
87extern int rtnl_neigh_get_vlan(struct rtnl_neigh *);
88
89extern void rtnl_neigh_set_master(struct rtnl_neigh *, int);
90extern int rtnl_neigh_get_master(struct rtnl_neigh *);
91
92extern void rtnl_neigh_set_nhid(struct rtnl_neigh *, uint32_t);
93extern int rtnl_neigh_get_nhid(struct rtnl_neigh *, uint32_t *);
94
95#ifdef __cplusplus
96}
97#endif
98
99#endif
rtnl_neigh_build_delete_request
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:879
rtnl_neigh_build_add_request
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:818
rtnl_neigh_alloc_cache
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:643
rtnl_neigh_add
int rtnl_neigh_add(struct nl_sock *, struct rtnl_neigh *, int)
Add a new neighbour.
Definition neigh.c:842
rtnl_neigh_get_by_vlan
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:714
rtnl_neigh_delete
int rtnl_neigh_delete(struct nl_sock *, struct rtnl_neigh *, int)
Delete a neighbour.
Definition neigh.c:897
rtnl_neigh_get
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:688
rtnl_neigh_alloc_cache_flags
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:659