Add support for creating a MACVLAN interface in "source" mode by
specifying Mode=source in the [MACVLAN] section of a .netdev file.
A list of allowed MAC addresses for the corresponding MACVLAN can also
be specified with the SourceMACAddress= option of the [MACVLAN] section.
An example .netdev file:
[NetDev]
Name=macvlan0
Kind=macvlan
MACAddress=02:DE:AD:BE:EF:00
[MACVLAN]
Mode=source
SourceMACAddress=02:AB:AB:AB:AB:01 02:CD:CD:CD:CD:01
SourceMACAddress=02:EF:EF:EF:EF:01
The same keys can also be specified in [MACVTAP] for MACVTAP kinds of
interfaces, with the same semantics.
16 lines
500 B
C
16 lines
500 B
C
/* SPDX-License-Identifier: LGPL-2.1+ */
|
|
|
|
#include "conf-parser.h"
|
|
#include "macvlan-util.h"
|
|
#include "string-table.h"
|
|
|
|
static const char* const macvlan_mode_table[_NETDEV_MACVLAN_MODE_MAX] = {
|
|
[NETDEV_MACVLAN_MODE_PRIVATE] = "private",
|
|
[NETDEV_MACVLAN_MODE_VEPA] = "vepa",
|
|
[NETDEV_MACVLAN_MODE_BRIDGE] = "bridge",
|
|
[NETDEV_MACVLAN_MODE_PASSTHRU] = "passthru",
|
|
[NETDEV_MACVLAN_MODE_SOURCE] = "source",
|
|
};
|
|
|
|
DEFINE_STRING_TABLE_LOOKUP(macvlan_mode, MacVlanMode);
|