xref: /aosp_15_r20/external/libnl/include/netlink/route/mdb.h (revision 4dc78e53d49367fa8e61b07018507c90983a077d)
1 /* SPDX-License-Identifier: LGPL-2.1-only */
2 
3 #ifndef NETLINK_MDB_H_
4 #define NETLINK_MDB_H_
5 
6 #include <netlink/netlink.h>
7 #include <netlink/cache.h>
8 #include <netlink/route/link.h>
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 struct rtnl_mdb;
15 struct rtnl_mdb_entry;
16 
17 struct rtnl_mdb *rtnl_mdb_alloc(void);
18 void rtnl_mdb_put(struct rtnl_mdb *mdb);
19 
20 int rtnl_mdb_alloc_cache(struct nl_sock *sk, struct nl_cache **result);
21 int rtnl_mdb_alloc_cache_flags(struct nl_sock *sock,
22 			       struct nl_cache **result,
23 			       unsigned int flags);
24 
25 uint32_t rtnl_mdb_get_ifindex(struct rtnl_mdb *mdb);
26 void rtnl_mdb_add_entry(struct rtnl_mdb *mdb,
27 			struct rtnl_mdb_entry *_entry);
28 
29 void rtnl_mdb_foreach_entry(struct rtnl_mdb *mdb,
30 			    void (*cb)(struct rtnl_mdb_entry *, void *),
31 			    void *arg);
32 
33 int rtnl_mdb_entry_get_ifindex(struct rtnl_mdb_entry *mdb_entry);
34 int rtnl_mdb_entry_get_vid(struct rtnl_mdb_entry *mdb_entry);
35 int rtnl_mdb_entry_get_state(struct rtnl_mdb_entry *mdb_entry);
36 struct nl_addr *rtnl_mdb_entry_get_addr(struct rtnl_mdb_entry
37 					*mdb_entry);
38 uint16_t rtnl_mdb_entry_get_proto(struct rtnl_mdb_entry *mdb_entry);
39 #ifdef __cplusplus
40 }
41 #endif
42 #endif
43