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.
23 lines
465 B
C
23 lines
465 B
C
/* SPDX-License-Identifier: LGPL-2.1+ */
|
|
#pragma once
|
|
|
|
typedef struct MacVlan MacVlan;
|
|
|
|
#include "macvlan-util.h"
|
|
#include "netdev.h"
|
|
#include "set.h"
|
|
|
|
struct MacVlan {
|
|
NetDev meta;
|
|
|
|
MacVlanMode mode;
|
|
Set *match_source_mac;
|
|
};
|
|
|
|
DEFINE_NETDEV_CAST(MACVLAN, MacVlan);
|
|
DEFINE_NETDEV_CAST(MACVTAP, MacVlan);
|
|
extern const NetDevVTable macvlan_vtable;
|
|
extern const NetDevVTable macvtap_vtable;
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_macvlan_mode);
|