MAC-based Virtual LAN link module
More...
|
struct rtnl_link * | rtnl_link_macvlan_alloc (void) |
| Allocate link object of type MACVLAN.
|
|
int | rtnl_link_is_macvlan (struct rtnl_link *link) |
| Check if link is a MACVLAN link.
|
|
int | rtnl_link_macvlan_set_mode (struct rtnl_link *link, uint32_t mode) |
| Set MACVLAN MODE.
|
|
uint32_t | rtnl_link_macvlan_get_mode (struct rtnl_link *link) |
| Get MACVLAN Mode.
|
|
int | rtnl_link_macvlan_set_macmode (struct rtnl_link *link, uint32_t macmode) |
| Set MACVLAN MACMODE.
|
|
int | rtnl_link_macvlan_get_macmode (struct rtnl_link *link, uint32_t *out_macmode) |
| Get MACVLAN MACMODE.
|
|
int | rtnl_link_macvlan_set_flags (struct rtnl_link *link, uint16_t flags) |
| Set MACVLAN flags.
|
|
int | rtnl_link_macvlan_unset_flags (struct rtnl_link *link, uint16_t flags) |
| Unset MACVLAN flags.
|
|
uint16_t | rtnl_link_macvlan_get_flags (struct rtnl_link *link) |
| Get MACVLAN flags.
|
|
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.
|
|
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.
|
|
int | rtnl_link_macvlan_add_macaddr (struct rtnl_link *link, struct nl_addr *addr) |
| Add MAC-Addr to MACVLAN device in source mode.
|
|
int | rtnl_link_macvlan_del_macaddr (struct rtnl_link *link, struct nl_addr *addr) |
| Remove MAC-Addr from MACVLAN device in source mode.
|
|
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 | ) |
|
◆ 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 347 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 377 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 398 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 423 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 448 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 470 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 488 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 504 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 533 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 563 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 | ) |
|
◆ 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 693 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 711 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 730 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 752 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 770 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 | ) |
|