-
Notifications
You must be signed in to change notification settings - Fork 5
/
fdb.h
34 lines (27 loc) · 791 Bytes
/
fdb.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2022 Felix Fietkau <nbd@nbd.name>
*/
#ifndef __BRIDGER_FDB_H
#define __BRIDGER_FDB_H
struct fdb_key {
uint8_t addr[ETH_ALEN];
uint16_t vlan;
};
struct fdb_entry {
struct avl_node node;
struct fdb_key key;
uint16_t ndm_state;
bool updated;
struct device *dev;
struct list_head dev_list;
struct list_head flows_in;
struct list_head flows_out;
};
void fdb_init(struct bridge *br);
struct fdb_entry *fdb_get(struct bridge *br, const struct fdb_key *key);
struct fdb_entry *fdb_create(struct bridge *br, const struct fdb_key *key, struct device *dev);
void fdb_delete(struct bridge *br, struct fdb_entry *f);
void fdb_set_device(struct fdb_entry *f, struct device *dev);
void fdb_clear_flows(struct fdb_entry *f);
#endif