1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 Copyright © 2014 Intel Corporation. All rights reserved.
8 #include <linux/neighbour.h>
10 #include "conf-parser.h"
13 #include "networkd-util.h"
15 typedef struct Network Network
;
16 typedef struct FdbEntry FdbEntry
;
17 typedef struct Link Link
;
18 typedef struct NetworkConfigSection NetworkConfigSection
;
20 typedef enum NeighborCacheEntryFlags
{
21 NEIGHBOR_CACHE_ENTRY_FLAGS_USE
= NTF_USE
,
22 NEIGHBOR_CACHE_ENTRY_FLAGS_SELF
= NTF_SELF
,
23 NEIGHBOR_CACHE_ENTRY_FLAGS_MASTER
= NTF_MASTER
,
24 NEIGHBOR_CACHE_ENTRY_FLAGS_ROUTER
= NTF_ROUTER
,
25 _NEIGHBOR_CACHE_ENTRY_FLAGS_MAX
,
26 _NEIGHBOR_CACHE_ENTRY_FLAGS_INVALID
= -1,
27 } NeighborCacheEntryFlags
;
31 NetworkConfigSection
*section
;
38 struct ether_addr
*mac_addr
;
39 union in_addr_union destination_addr
;
40 NeighborCacheEntryFlags fdb_ntf_flags
;
42 LIST_FIELDS(FdbEntry
, static_fdb_entries
);
45 void fdb_entry_free(FdbEntry
*fdb_entry
);
46 int fdb_entry_configure(Link
*link
, FdbEntry
*fdb_entry
);
48 DEFINE_NETWORK_SECTION_FUNCTIONS(FdbEntry
, fdb_entry_free
);
50 const char* fdb_ntf_flags_to_string(NeighborCacheEntryFlags i
) _const_
;
51 NeighborCacheEntryFlags
fdb_ntf_flags_from_string(const char *s
) _pure_
;
53 CONFIG_PARSER_PROTOTYPE(config_parse_fdb_hwaddr
);
54 CONFIG_PARSER_PROTOTYPE(config_parse_fdb_vlan_id
);
55 CONFIG_PARSER_PROTOTYPE(config_parse_fdb_destination
);
56 CONFIG_PARSER_PROTOTYPE(config_parse_fdb_vxlan_vni
);
57 CONFIG_PARSER_PROTOTYPE(config_parse_fdb_ntf_flags
);