1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
/*
* netlink/route/addr.c rtnetlink addr layer
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
* Baruch Even <baruch@ev-en.org>,
* Mediatrix Telecom, inc. <ericb@mediatrix.com>
*/
#ifndef NETADDR_ADDR_H_
#define NETADDR_ADDR_H_
#include <netlink/netlink.h>
#include <netlink/cache.h>
#include <netlink/addr.h>
#ifdef __cplusplus
extern "C" {
#endif
struct rtnl_addr;
/* General */
extern struct rtnl_addr *rtnl_addr_alloc(void);
extern void rtnl_addr_put(struct rtnl_addr *);
extern struct nl_cache *rtnl_addr_alloc_cache(struct nl_handle *);
/* Address Addition */
extern struct nl_msg * rtnl_addr_build_add_request(struct rtnl_addr *, int);
extern int rtnl_addr_add(struct nl_handle *, struct rtnl_addr *,
int);
/* Address Deletion */
extern struct nl_msg * rtnl_addr_build_delete_request(struct rtnl_addr *, int);
extern int rtnl_addr_delete(struct nl_handle *,
struct rtnl_addr *, int);
/* Address Flags Translations */
extern char * rtnl_addr_flags2str(int, char *, size_t);
extern int rtnl_addr_str2flags(const char *);
/* Attribute Access */
extern void rtnl_addr_set_label(struct rtnl_addr *, const char *);
extern char * rtnl_addr_get_label(struct rtnl_addr *);
extern void rtnl_addr_set_ifindex(struct rtnl_addr *, int);
extern int rtnl_addr_get_ifindex(struct rtnl_addr *);
extern void rtnl_addr_set_family(struct rtnl_addr *, int);
extern int rtnl_addr_get_family(struct rtnl_addr *);
extern void rtnl_addr_set_prefixlen(struct rtnl_addr *, int);
extern int rtnl_addr_get_prefixlen(struct rtnl_addr *);
extern void rtnl_addr_set_scope(struct rtnl_addr *, int);
extern int rtnl_addr_get_scope(struct rtnl_addr *);
extern void rtnl_addr_set_flags(struct rtnl_addr *, unsigned int);
extern void rtnl_addr_unset_flags(struct rtnl_addr *, unsigned int);
extern unsigned int rtnl_addr_get_flags(struct rtnl_addr *);
extern int rtnl_addr_set_local(struct rtnl_addr *,
struct nl_addr *);
extern struct nl_addr * rtnl_addr_get_local(struct rtnl_addr *);
extern int rtnl_addr_set_peer(struct rtnl_addr *,
struct nl_addr *);
extern struct nl_addr * rtnl_addr_get_peer(struct rtnl_addr *);
extern int rtnl_addr_set_broadcast(struct rtnl_addr *,
struct nl_addr *);
extern struct nl_addr * rtnl_addr_get_broadcast(struct rtnl_addr *);
extern int rtnl_addr_set_anycast(struct rtnl_addr *,
struct nl_addr *);
extern struct nl_addr * rtnl_addr_get_anycast(struct rtnl_addr *);
extern int rtnl_addr_set_multicast(struct rtnl_addr *,
struct nl_addr *);
extern struct nl_addr * rtnl_addr_get_multicast(struct rtnl_addr *);
#ifdef __cplusplus
}
#endif
#endif
|