MAC-based Virtual LAN link module.
More...
|
struct rtnl_link * | rtnl_link_macvlan_alloc (void) |
| Allocate link object of type MACVLAN. More...
|
|
int | rtnl_link_is_macvlan (struct rtnl_link *link) |
| Check if link is a MACVLAN link. More...
|
|
int | rtnl_link_macvlan_set_mode (struct rtnl_link *link, uint32_t mode) |
| Set MACVLAN MODE. More...
|
|
uint32_t | rtnl_link_macvlan_get_mode (struct rtnl_link *link) |
| Get MACVLAN Mode. More...
|
|
int | rtnl_link_macvlan_set_macmode (struct rtnl_link *link, uint32_t macmode) |
| Set MACVLAN MACMODE. More...
|
|
int | rtnl_link_macvlan_get_macmode (struct rtnl_link *link, uint32_t *out_macmode) |
| Get MACVLAN MACMODE. More...
|
|
int | rtnl_link_macvlan_set_flags (struct rtnl_link *link, uint16_t flags) |
| Set MACVLAN flags. More...
|
|
int | rtnl_link_macvlan_unset_flags (struct rtnl_link *link, uint16_t flags) |
| Unset MACVLAN flags. More...
|
|
uint16_t | rtnl_link_macvlan_get_flags (struct rtnl_link *link) |
| Get MACVLAN flags. More...
|
|
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. More...
|
|
int | rtnl_link_macvlan_get_macaddr (struct rtnl_link *link, uint32_t idx, const struct nl_addr **out_addr) |
| Get configured remote MAC-Addr from MACVLAN device in source mode. More...
|
|
int | rtnl_link_macvlan_add_macaddr (struct rtnl_link *link, struct nl_addr *addr) |
| Add MAC-Addr to MACVLAN device in source mode. More...
|
|
int | rtnl_link_macvlan_del_macaddr (struct rtnl_link *link, struct nl_addr *addr) |
| Remove MAC-Addr from MACVLAN device in source mode. More...
|
|
MAC-based Virtual LAN link module.
Link Type Name: "macvlan"
MACVLAN Documentation (Netlink Routing Development Guide) MACVTAP Documentation (Netlink Routing Development Guide)
◆ rtnl_link_macvlan_alloc()
struct rtnl_link * rtnl_link_macvlan_alloc |
( |
void |
| ) |
|
◆ rtnl_link_is_macvlan()
int rtnl_link_is_macvlan |
( |
struct rtnl_link * |
link | ) |
|
Check if link is a MACVLAN link.
- Parameters
-
- Returns
- True if link is a MACVLAN link, otherwise false is returned.
Definition at line 328 of file macvlan.c.
◆ rtnl_link_macvlan_set_mode()
int rtnl_link_macvlan_set_mode |
( |
struct rtnl_link * |
link, |
|
|
uint32_t |
mode |
|
) |
| |
Set MACVLAN MODE.
- Parameters
-
link | Link object |
mode | MACVLAN mode |
- Returns
- 0 on success or a negative error code
Definition at line 340 of file macvlan.c.
References nl_addr_put().
◆ rtnl_link_macvlan_get_mode()
uint32_t rtnl_link_macvlan_get_mode |
( |
struct rtnl_link * |
link | ) |
|
Get MACVLAN Mode.
- Parameters
-
- Returns
- MACVLAN mode, 0 if not set or a negative error code.
Definition at line 369 of file macvlan.c.
◆ rtnl_link_macvlan_set_macmode()
int rtnl_link_macvlan_set_macmode |
( |
struct rtnl_link * |
link, |
|
|
uint32_t |
macmode |
|
) |
| |
Set MACVLAN MACMODE.
- Parameters
-
link | Link object |
mode | MACVLAN mac list modification mode |
Only for macvlan SOURCE mode.
- Returns
- 0 on success or a negative error code
Definition at line 390 of file macvlan.c.
◆ rtnl_link_macvlan_get_macmode()
int rtnl_link_macvlan_get_macmode |
( |
struct rtnl_link * |
link, |
|
|
uint32_t * |
out_macmode |
|
) |
| |
Get MACVLAN MACMODE.
- Parameters
-
link | Link object |
out_macmode | mac list modification mode |
Only for SOURCE mode.
- Returns
- 0 on success or a negative error code.
Definition at line 415 of file macvlan.c.
◆ rtnl_link_macvlan_set_flags()
int rtnl_link_macvlan_set_flags |
( |
struct rtnl_link * |
link, |
|
|
uint16_t |
flags |
|
) |
| |
Set MACVLAN flags.
- Parameters
-
link | Link object |
flags | MACVLAN flags |
- Returns
- 0 on success or a negative error code.
Definition at line 440 of file macvlan.c.
◆ rtnl_link_macvlan_unset_flags()
int rtnl_link_macvlan_unset_flags |
( |
struct rtnl_link * |
link, |
|
|
uint16_t |
flags |
|
) |
| |
Unset MACVLAN flags.
- Parameters
-
link | Link object |
flags | MACVLAN flags |
Note: kernel currently only has a single flag and lacks flags_mask to indicate which flags shall be changed (it always all).
- Returns
- 0 on success or a negative error code.
Definition at line 462 of file macvlan.c.
◆ rtnl_link_macvlan_get_flags()
uint16_t rtnl_link_macvlan_get_flags |
( |
struct rtnl_link * |
link | ) |
|
Get MACVLAN flags.
- Parameters
-
- Returns
- MACVLAN flags, 0 if none set, or a negative error code.
Definition at line 480 of file macvlan.c.
◆ 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.
- Parameters
-
link | Link object |
out_count | number of mac addresses |
- Returns
- 0 on success or a negative error code.
Definition at line 496 of file macvlan.c.
◆ rtnl_link_macvlan_get_macaddr()
int rtnl_link_macvlan_get_macaddr |
( |
struct rtnl_link * |
link, |
|
|
uint32_t |
idx, |
|
|
const struct nl_addr ** |
out_addr |
|
) |
| |
Get configured remote MAC-Addr from MACVLAN device in source mode.
- Parameters
-
link | Link object |
out_addr | address object |
The returned nl_addr struct needs NOT to be released using nl_addr_put. It is only valid until the address is not removed from this link object or its mode is changed to non-source.
- Returns
- 0 on success or negative error code
Definition at line 525 of file macvlan.c.
◆ 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.
- Parameters
-
link | Link object |
addr | MAC-Addr |
addr is not release but cloned by this method.
- Returns
- 0 on success or a negative error code.
Definition at line 555 of file macvlan.c.
References nl_addr_clone(), and nl_addr_get_family().
◆ rtnl_link_macvlan_del_macaddr()
int rtnl_link_macvlan_del_macaddr |
( |
struct rtnl_link * |
link, |
|
|
struct nl_addr * |
addr |
|
) |
| |
◆ rtnl_link_macvtap_alloc()
struct rtnl_link * rtnl_link_macvtap_alloc |
( |
void |
| ) |
|
◆ rtnl_link_is_macvtap()
int rtnl_link_is_macvtap |
( |
struct rtnl_link * |
link | ) |
|
Check if link is a MACVTAP link.
- Parameters
-
- Returns
- True if link is a MACVTAP link, otherwise false is returned.
Definition at line 673 of file macvlan.c.
◆ rtnl_link_macvtap_set_mode()
int rtnl_link_macvtap_set_mode |
( |
struct rtnl_link * |
link, |
|
|
uint32_t |
mode |
|
) |
| |
Set MACVTAP MODE.
- Parameters
-
link | Link object |
mode | MACVTAP mode |
- Returns
- 0 on success or a negative error code
Definition at line 685 of file macvlan.c.
◆ rtnl_link_macvtap_get_mode()
uint32_t rtnl_link_macvtap_get_mode |
( |
struct rtnl_link * |
link | ) |
|
Get MACVTAP Mode.
- Parameters
-
- Returns
- MACVTAP mode, 0 if not set or a negative error code.
Definition at line 703 of file macvlan.c.
◆ rtnl_link_macvtap_set_flags()
int rtnl_link_macvtap_set_flags |
( |
struct rtnl_link * |
link, |
|
|
uint16_t |
flags |
|
) |
| |
Set MACVTAP flags.
- Parameters
-
link | Link object |
flags | MACVTAP flags |
- Returns
- 0 on success or a negative error code.
Definition at line 722 of file macvlan.c.
◆ rtnl_link_macvtap_unset_flags()
int rtnl_link_macvtap_unset_flags |
( |
struct rtnl_link * |
link, |
|
|
uint16_t |
flags |
|
) |
| |
Unset MACVTAP flags.
- Parameters
-
link | Link object |
flags | MACVTAP flags |
Note: kernel currently only has a single flag and lacks flags_mask to indicate which flags shall be changed (it always all).
- Returns
- 0 on success or a negative error code.
Definition at line 744 of file macvlan.c.
◆ rtnl_link_macvtap_get_flags()
uint16_t rtnl_link_macvtap_get_flags |
( |
struct rtnl_link * |
link | ) |
|
Get MACVTAP flags.
- Parameters
-
- Returns
- MACVTAP flags, 0 if none set, or a negative error code.
Definition at line 762 of file macvlan.c.
◆ rtnl_link_macvlan_flags2str()
char * rtnl_link_macvlan_flags2str |
( |
int |
flags, |
|
|
char * |
buf, |
|
|
size_t |
len |
|
) |
| |
◆ rtnl_link_macvlan_str2flags()
int rtnl_link_macvlan_str2flags |
( |
const char * |
name | ) |
|
◆ rtnl_link_macvtap_flags2str()
char * rtnl_link_macvtap_flags2str |
( |
int |
flags, |
|
|
char * |
buf, |
|
|
size_t |
len |
|
) |
| |
◆ rtnl_link_macvtap_str2flags()
int rtnl_link_macvtap_str2flags |
( |
const char * |
name | ) |
|
◆ rtnl_link_macvlan_mode2str()
char * rtnl_link_macvlan_mode2str |
( |
int |
mode, |
|
|
char * |
buf, |
|
|
size_t |
len |
|
) |
| |
◆ rtnl_link_macvlan_str2mode()
int rtnl_link_macvlan_str2mode |
( |
const char * |
name | ) |
|
◆ rtnl_link_macvlan_macmode2str()
char * rtnl_link_macvlan_macmode2str |
( |
int |
mode, |
|
|
char * |
buf, |
|
|
size_t |
len |
|
) |
| |
◆ rtnl_link_macvlan_str2macmode()
int rtnl_link_macvlan_str2macmode |
( |
const char * |
name | ) |
|
◆ rtnl_link_macvtap_mode2str()
char * rtnl_link_macvtap_mode2str |
( |
int |
mode, |
|
|
char * |
buf, |
|
|
size_t |
len |
|
) |
| |
◆ rtnl_link_macvtap_str2mode()
int rtnl_link_macvtap_str2mode |
( |
const char * |
name | ) |
|