1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3 
4 /***
5   Copyright © 2014 Intel Corporation. All rights reserved.
6 ***/
7 
8 #include <inttypes.h>
9 #include <linux/neighbour.h>
10 
11 #include "conf-parser.h"
12 #include "ether-addr-util.h"
13 #include "in-addr-util.h"
14 
15 typedef struct Link Link;
16 typedef struct Network Network;
17 
18 typedef enum NeighborCacheEntryFlags {
19         NEIGHBOR_CACHE_ENTRY_FLAGS_USE = NTF_USE,
20         NEIGHBOR_CACHE_ENTRY_FLAGS_SELF = NTF_SELF,
21         NEIGHBOR_CACHE_ENTRY_FLAGS_MASTER = NTF_MASTER,
22         NEIGHBOR_CACHE_ENTRY_FLAGS_ROUTER = NTF_ROUTER,
23         _NEIGHBOR_CACHE_ENTRY_FLAGS_MAX,
24         _NEIGHBOR_CACHE_ENTRY_FLAGS_INVALID = -EINVAL,
25 } NeighborCacheEntryFlags;
26 
27 typedef struct BridgeFDB {
28         Network *network;
29         ConfigSection *section;
30 
31         uint32_t vni;
32 
33         int family;
34         uint16_t vlan_id;
35 
36         struct ether_addr mac_addr;
37         union in_addr_union destination_addr;
38         NeighborCacheEntryFlags ntf_flags;
39         char *outgoing_ifname;
40         int outgoing_ifindex;
41 } BridgeFDB;
42 
43 BridgeFDB *bridge_fdb_free(BridgeFDB *fdb);
44 
45 void network_drop_invalid_bridge_fdb_entries(Network *network);
46 
47 int link_request_static_bridge_fdb(Link *link);
48 
49 CONFIG_PARSER_PROTOTYPE(config_parse_fdb_hwaddr);
50 CONFIG_PARSER_PROTOTYPE(config_parse_fdb_vlan_id);
51 CONFIG_PARSER_PROTOTYPE(config_parse_fdb_destination);
52 CONFIG_PARSER_PROTOTYPE(config_parse_fdb_vxlan_vni);
53 CONFIG_PARSER_PROTOTYPE(config_parse_fdb_ntf_flags);
54 CONFIG_PARSER_PROTOTYPE(config_parse_fdb_interface);
55