libnl 3.5.0

macvlan.h
1 /*
2 * netlink/route/link/macvlan.h MACVLAN interface
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation version 2.1
7 * of the License.
8 *
9 * Copyright (c) 2013 Michael Braun <michael-dev@fami-braun.de>
10 */
11
12 #ifndef NETLINK_LINK_MACVLAN_H_
13 #define NETLINK_LINK_MACVLAN_H_
14
15 #include <netlink/netlink.h>
16 #include <netlink/route/link.h>
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 extern struct rtnl_link *rtnl_link_macvlan_alloc(void);
23
24 extern int rtnl_link_is_macvlan(struct rtnl_link *);
25
26 extern char * rtnl_link_macvlan_mode2str(int, char *, size_t);
27 extern int rtnl_link_macvlan_str2mode(const char *);
28
29 extern char * rtnl_link_macvlan_flags2str(int, char *, size_t);
30 extern int rtnl_link_macvlan_str2flags(const char *);
31
32 extern char * rtnl_link_macvlan_macmode2str(int, char *, size_t);
33 extern int rtnl_link_macvlan_str2macmode(const char *);
34
35 extern int rtnl_link_macvlan_set_mode(struct rtnl_link *,
36 uint32_t);
37 extern uint32_t rtnl_link_macvlan_get_mode(struct rtnl_link *);
38
39 extern int rtnl_link_macvlan_set_flags(struct rtnl_link *,
40 uint16_t);
41 extern int rtnl_link_macvlan_unset_flags(struct rtnl_link *,
42 uint16_t);
43 extern uint16_t rtnl_link_macvlan_get_flags(struct rtnl_link *);
44
45 extern int rtnl_link_macvlan_set_macmode(struct rtnl_link *,
46 uint32_t);
47 extern int rtnl_link_macvlan_get_macmode(struct rtnl_link *link,
48 uint32_t *out_macmode);
49
50 extern int rtnl_link_macvlan_count_macaddr(struct rtnl_link *link,
51 uint32_t *out_count);
52 extern int rtnl_link_macvlan_get_macaddr(struct rtnl_link *link,
53 uint32_t idx,
54 const struct nl_addr **addr);
55 extern int rtnl_link_macvlan_add_macaddr(struct rtnl_link *link,
56 struct nl_addr *addr);
57 extern int rtnl_link_macvlan_del_macaddr(struct rtnl_link *link,
58 struct nl_addr *addr);
59
60 #ifdef __cplusplus
61 }
62 #endif
63
64 #endif
rtnl_link_macvlan_get_macmode
int rtnl_link_macvlan_get_macmode(struct rtnl_link *link, uint32_t *out_macmode)
Get MACVLAN MACMODE.
Definition: macvlan.c:416
rtnl_link_is_macvlan
int rtnl_link_is_macvlan(struct rtnl_link *)
Check if link is a MACVLAN link.
Definition: macvlan.c:329
rtnl_link_macvlan_unset_flags
int rtnl_link_macvlan_unset_flags(struct rtnl_link *, uint16_t)
Unset MACVLAN flags.
Definition: macvlan.c:463
rtnl_link_macvlan_get_flags
uint16_t rtnl_link_macvlan_get_flags(struct rtnl_link *)
Get MACVLAN flags.
Definition: macvlan.c:481
rtnl_link_macvlan_get_mode
uint32_t rtnl_link_macvlan_get_mode(struct rtnl_link *)
Get MACVLAN Mode.
Definition: macvlan.c:370
rtnl_link_macvlan_del_macaddr
int rtnl_link_macvlan_del_macaddr(struct rtnl_link *link, struct nl_addr *addr)
Remove MAC-Addr from MACVLAN device in source mode.
Definition: macvlan.c:601
rtnl_link_macvlan_count_macaddr
int rtnl_link_macvlan_count_macaddr(struct rtnl_link *link, uint32_t *out_count)
Get number of MAC-Addr for MACVLAN device in source mode.
Definition: macvlan.c:497
rtnl_link
Link object.
rtnl_link_macvlan_set_macmode
int rtnl_link_macvlan_set_macmode(struct rtnl_link *, uint32_t)
Set MACVLAN MACMODE.
Definition: macvlan.c:391
rtnl_link_macvlan_set_flags
int rtnl_link_macvlan_set_flags(struct rtnl_link *, uint16_t)
Set MACVLAN flags.
Definition: macvlan.c:441
rtnl_link_macvlan_set_mode
int rtnl_link_macvlan_set_mode(struct rtnl_link *, uint32_t)
Set MACVLAN MODE.
Definition: macvlan.c:341
rtnl_link_macvlan_get_macaddr
int rtnl_link_macvlan_get_macaddr(struct rtnl_link *link, uint32_t idx, const struct nl_addr **addr)
Get configured remote MAC-Addr from MACVLAN device in source mode.
Definition: macvlan.c:526
rtnl_link_macvlan_alloc
struct rtnl_link * rtnl_link_macvlan_alloc(void)
Allocate link object of type MACVLAN.
Definition: macvlan.c:307
rtnl_link_macvlan_add_macaddr
int rtnl_link_macvlan_add_macaddr(struct rtnl_link *link, struct nl_addr *addr)
Add MAC-Addr to MACVLAN device in source mode.
Definition: macvlan.c:556