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

libnl 3.7.0

addr.h
1 /* SPDX-License-Identifier: LGPL-2.1-only */
2 /*
3 * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch>
4 * Copyright (c) 2003-2006 Baruch Even <baruch@ev-en.org>
5 * Copyright (c) 2003-2006 Mediatrix Telecom, inc. <ericb@mediatrix.com>
6 */
7
8 #ifndef NETADDR_ADDR_H_
9 #define NETADDR_ADDR_H_
10
11 #include <netlink/netlink.h>
12 #include <netlink/cache.h>
13 #include <netlink/addr.h>
14 #include <netlink/route/link.h>
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 struct rtnl_addr;
21
22 /* General */
23 extern struct rtnl_addr *rtnl_addr_alloc(void);
24 extern void rtnl_addr_put(struct rtnl_addr *);
25
26 extern int rtnl_addr_alloc_cache(struct nl_sock *, struct nl_cache **);
27 extern struct rtnl_addr *
28 rtnl_addr_get(struct nl_cache *, int, struct nl_addr *);
29
30 extern int rtnl_addr_build_add_request(struct rtnl_addr *, int,
31 struct nl_msg **);
32 extern int rtnl_addr_add(struct nl_sock *, struct rtnl_addr *, int);
33
34 extern int rtnl_addr_build_delete_request(struct rtnl_addr *, int,
35 struct nl_msg **);
36 extern int rtnl_addr_delete(struct nl_sock *,
37 struct rtnl_addr *, int);
38
39 extern char * rtnl_addr_flags2str(int, char *, size_t);
40 extern int rtnl_addr_str2flags(const char *);
41
42 extern int rtnl_addr_set_label(struct rtnl_addr *, const char *);
43 extern char * rtnl_addr_get_label(struct rtnl_addr *);
44
45 extern void rtnl_addr_set_ifindex(struct rtnl_addr *, int);
46 extern int rtnl_addr_get_ifindex(struct rtnl_addr *);
47
48 extern void rtnl_addr_set_link(struct rtnl_addr *, struct rtnl_link *);
49 extern struct rtnl_link *
50 rtnl_addr_get_link(struct rtnl_addr *);
51
52 extern void rtnl_addr_set_family(struct rtnl_addr *, int);
53 extern int rtnl_addr_get_family(struct rtnl_addr *);
54
55 extern void rtnl_addr_set_prefixlen(struct rtnl_addr *, int);
56 extern int rtnl_addr_get_prefixlen(struct rtnl_addr *);
57
58 extern void rtnl_addr_set_scope(struct rtnl_addr *, int);
59 extern int rtnl_addr_get_scope(struct rtnl_addr *);
60
61 extern void rtnl_addr_set_flags(struct rtnl_addr *, unsigned int);
62 extern void rtnl_addr_unset_flags(struct rtnl_addr *, unsigned int);
63 extern unsigned int rtnl_addr_get_flags(struct rtnl_addr *);
64
65 extern int rtnl_addr_set_local(struct rtnl_addr *,
66 struct nl_addr *);
67 extern struct nl_addr *rtnl_addr_get_local(struct rtnl_addr *);
68
69 extern int rtnl_addr_set_peer(struct rtnl_addr *, struct nl_addr *);
70 extern struct nl_addr *rtnl_addr_get_peer(struct rtnl_addr *);
71
72 extern int rtnl_addr_set_broadcast(struct rtnl_addr *, struct nl_addr *);
73 extern struct nl_addr *rtnl_addr_get_broadcast(struct rtnl_addr *);
74
75 extern int rtnl_addr_set_multicast(struct rtnl_addr *, struct nl_addr *);
76 extern struct nl_addr *rtnl_addr_get_multicast(struct rtnl_addr *);
77
78 extern int rtnl_addr_set_anycast(struct rtnl_addr *, struct nl_addr *);
79 extern struct nl_addr *rtnl_addr_get_anycast(struct rtnl_addr *);
80
81 extern uint32_t rtnl_addr_get_valid_lifetime(struct rtnl_addr *);
82 extern void rtnl_addr_set_valid_lifetime(struct rtnl_addr *, uint32_t);
83 extern uint32_t rtnl_addr_get_preferred_lifetime(struct rtnl_addr *);
84 extern void rtnl_addr_set_preferred_lifetime(struct rtnl_addr *, uint32_t);
85 extern uint32_t rtnl_addr_get_create_time(struct rtnl_addr *);
86 extern uint32_t rtnl_addr_get_last_update_time(struct rtnl_addr *);
87
88 #ifdef __cplusplus
89 }
90 #endif
91
92 #endif
rtnl_addr_build_delete_request
int rtnl_addr_build_delete_request(struct rtnl_addr *, int, struct nl_msg **)
Build a netlink request message to request deletion of an address.
Definition: addr.c:795
rtnl_addr_delete
int rtnl_addr_delete(struct nl_sock *, struct rtnl_addr *, int)
Request deletion of an address.
Definition: addr.c:820
rtnl_addr_add
int rtnl_addr_add(struct nl_sock *, struct rtnl_addr *, int)
Request addition of new address.
Definition: addr.c:748
rtnl_addr_get
struct rtnl_addr * rtnl_addr_get(struct nl_cache *, int, struct nl_addr *)
Search address in cache.
Definition: addr.c:596
rtnl_addr_build_add_request
int rtnl_addr_build_add_request(struct rtnl_addr *, int, struct nl_msg **)
Build netlink request message to request addition of new address.
Definition: addr.c:722
rtnl_addr_set_prefixlen
void rtnl_addr_set_prefixlen(struct rtnl_addr *, int)
Set the prefix length / netmask.
Definition: addr.c:923
rtnl_link
Link object.