diff options
author | Matt Johnston <matt@codeconstruct.com.au> | 2021-07-29 05:20:47 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-29 17:06:50 +0300 |
commit | 4d8b9319282ae84f5a17b28d8b5b5d1e7e537312 (patch) | |
tree | 761ff24a307a22a4e86aa137ed65757eec346f5b /include/net/mctp.h | |
parent | 06d2f4c583a7d892300920fc85d654d48a15e914 (diff) | |
download | linux-4d8b9319282ae84f5a17b28d8b5b5d1e7e537312.tar.xz |
mctp: Add neighbour implementation
Add an initial neighbour table implementation, to be used in the route
output path.
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/mctp.h')
-rw-r--r-- | include/net/mctp.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/net/mctp.h b/include/net/mctp.h index bc36e37e8198..53f035c8b59c 100644 --- a/include/net/mctp.h +++ b/include/net/mctp.h @@ -117,6 +117,31 @@ int mctp_route_add_local(struct mctp_dev *mdev, mctp_eid_t addr); int mctp_route_remove_local(struct mctp_dev *mdev, mctp_eid_t addr); void mctp_route_remove_dev(struct mctp_dev *mdev); +/* neighbour definitions */ +enum mctp_neigh_source { + MCTP_NEIGH_STATIC, + MCTP_NEIGH_DISCOVER, +}; + +struct mctp_neigh { + struct mctp_dev *dev; + mctp_eid_t eid; + enum mctp_neigh_source source; + + unsigned char ha[MAX_ADDR_LEN]; + + struct list_head list; + struct rcu_head rcu; +}; + +int mctp_neigh_init(void); +void mctp_neigh_exit(void); + +// ret_hwaddr may be NULL, otherwise must have space for MAX_ADDR_LEN +int mctp_neigh_lookup(struct mctp_dev *dev, mctp_eid_t eid, + void *ret_hwaddr); +void mctp_neigh_remove_dev(struct mctp_dev *mdev); + int mctp_routes_init(void); void mctp_routes_exit(void); |