]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/network/networkd-fdb.h
networkd: bridge FDB support more NTF_* flags
[thirdparty/systemd.git] / src / network / networkd-fdb.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 Copyright © 2014 Intel Corporation. All rights reserved.
6 ***/
7
8 #include <linux/neighbour.h>
9
10 #include "conf-parser.h"
11 #include "list.h"
12 #include "macro.h"
13 #include "networkd-util.h"
14
15 typedef struct Network Network;
16 typedef struct FdbEntry FdbEntry;
17 typedef struct Link Link;
18 typedef struct NetworkConfigSection NetworkConfigSection;
19
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;
28
29 struct FdbEntry {
30 Network *network;
31 NetworkConfigSection *section;
32
33 uint32_t vni;
34
35 int family;
36 uint16_t vlan_id;
37
38 struct ether_addr *mac_addr;
39 union in_addr_union destination_addr;
40 NeighborCacheEntryFlags fdb_ntf_flags;
41
42 LIST_FIELDS(FdbEntry, static_fdb_entries);
43 };
44
45 void fdb_entry_free(FdbEntry *fdb_entry);
46 int fdb_entry_configure(Link *link, FdbEntry *fdb_entry);
47
48 DEFINE_NETWORK_SECTION_FUNCTIONS(FdbEntry, fdb_entry_free);
49
50 const char* fdb_ntf_flags_to_string(NeighborCacheEntryFlags i) _const_;
51 NeighborCacheEntryFlags fdb_ntf_flags_from_string(const char *s) _pure_;
52
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);