libnl 3.7.0
macvlan.h
1/* SPDX-License-Identifier: LGPL-2.1-only */
2/*
3 * Copyright (c) 2013 Michael Braun <michael-dev@fami-braun.de>
4 */
5
6#ifndef NETLINK_LINK_MACVLAN_H_
7#define NETLINK_LINK_MACVLAN_H_
8
9#include <netlink/netlink.h>
10#include <netlink/route/link.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16extern struct rtnl_link *rtnl_link_macvlan_alloc(void);
17
18extern int rtnl_link_is_macvlan(struct rtnl_link *);
19
20extern char * rtnl_link_macvlan_mode2str(int, char *, size_t);
21extern int rtnl_link_macvlan_str2mode(const char *);
22
23extern char * rtnl_link_macvlan_flags2str(int, char *, size_t);
24extern int rtnl_link_macvlan_str2flags(const char *);
25
26extern char * rtnl_link_macvlan_macmode2str(int, char *, size_t);
27extern int rtnl_link_macvlan_str2macmode(const char *);
28
29extern int rtnl_link_macvlan_set_mode(struct rtnl_link *,
30 uint32_t);
31extern uint32_t rtnl_link_macvlan_get_mode(struct rtnl_link *);
32
33extern int rtnl_link_macvlan_set_flags(struct rtnl_link *,
34 uint16_t);
36 uint16_t);
37extern uint16_t rtnl_link_macvlan_get_flags(struct rtnl_link *);
38
40 uint32_t);
41extern int rtnl_link_macvlan_get_macmode(struct rtnl_link *link,
42 uint32_t *out_macmode);
43
44extern int rtnl_link_macvlan_count_macaddr(struct rtnl_link *link,
45 uint32_t *out_count);
46extern int rtnl_link_macvlan_get_macaddr(struct rtnl_link *link,
47 uint32_t idx,
48 const struct nl_addr **addr);
49extern int rtnl_link_macvlan_add_macaddr(struct rtnl_link *link,
50 struct nl_addr *addr);
51extern int rtnl_link_macvlan_del_macaddr(struct rtnl_link *link,
52 struct nl_addr *addr);
53
54#ifdef __cplusplus
55}
56#endif
57
58#endif
int rtnl_link_macvlan_get_macmode(struct rtnl_link *link, uint32_t *out_macmode)
Get MACVLAN MACMODE.
Definition: macvlan.c:415
int rtnl_link_macvlan_unset_flags(struct rtnl_link *, uint16_t)
Unset MACVLAN flags.
Definition: macvlan.c:462
int rtnl_link_macvlan_set_mode(struct rtnl_link *, uint32_t)
Set MACVLAN MODE.
Definition: macvlan.c:340
struct rtnl_link * rtnl_link_macvlan_alloc(void)
Allocate link object of type MACVLAN.
Definition: macvlan.c:307
uint32_t rtnl_link_macvlan_get_mode(struct rtnl_link *)
Get MACVLAN Mode.
Definition: macvlan.c:369
int rtnl_link_macvlan_set_macmode(struct rtnl_link *, uint32_t)
Set MACVLAN MACMODE.
Definition: macvlan.c:390
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:525
int rtnl_link_macvlan_set_flags(struct rtnl_link *, uint16_t)
Set MACVLAN flags.
Definition: macvlan.c:440
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:600
uint16_t rtnl_link_macvlan_get_flags(struct rtnl_link *)
Get MACVLAN flags.
Definition: macvlan.c:480
int rtnl_link_is_macvlan(struct rtnl_link *)
Check if link is a MACVLAN link.
Definition: macvlan.c:328
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:555
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:496