| 1 |
#ifndef NETLINK_NEXTHOP_ENCAP_H_ |
| 2 |
#define NETLINK_NEXTHOP_ENCAP_H_ |
| 3 |
|
| 4 |
struct rtnl_nh_encap; |
| 5 |
|
| 6 |
struct nh_encap_ops { |
| 7 |
uint16_t encap_type; |
| 8 |
|
| 9 |
int (*build_msg)(struct nl_msg *msg, void *priv); |
| 10 |
int (*parse_msg)(struct nlattr *nla, struct rtnl_nh_encap **encap_out); |
| 11 |
|
| 12 |
int (*compare)(void *a, void *b); |
| 13 |
void *(*clone)(void *priv); |
| 14 |
|
| 15 |
void (*dump)(void *priv, struct nl_dump_params *dp); |
| 16 |
void (*destructor)(void *priv); |
| 17 |
}; |
| 18 |
|
| 19 |
/* |
| 20 |
* generic nexthop encap |
| 21 |
*/ |
| 22 |
int nh_encap_parse_msg(struct nlattr *encap, struct nlattr *encap_type, |
| 23 |
struct rtnl_nh_encap **encap_out); |
| 24 |
int nh_encap_build_msg(struct nl_msg *msg, struct rtnl_nh_encap *rtnh_encap); |
| 25 |
|
| 26 |
void nh_encap_dump(struct rtnl_nh_encap *rtnh_encap, struct nl_dump_params *dp); |
| 27 |
|
| 28 |
int nh_encap_compare(struct rtnl_nh_encap *a, struct rtnl_nh_encap *b); |
| 29 |
|
| 30 |
void *nh_encap_check_and_get_priv(struct rtnl_nh_encap *nh_encap, |
| 31 |
uint16_t encap_type); |
| 32 |
|
| 33 |
/* |
| 34 |
* MPLS encap |
| 35 |
*/ |
| 36 |
extern const struct nh_encap_ops mpls_encap_ops; |
| 37 |
|
| 38 |
/* |
| 39 |
* IPv6 encap |
| 40 |
*/ |
| 41 |
extern const struct nh_encap_ops ip6_encap_ops; |
| 42 |
|
| 43 |
/* |
| 44 |
* IPv4 encap |
| 45 |
*/ |
| 46 |
extern const struct nh_encap_ops ip_encap_ops; |
| 47 |
|
| 48 |
/* |
| 49 |
* ILA encap |
| 50 |
*/ |
| 51 |
extern const struct nh_encap_ops ila_encap_ops; |
| 52 |
#endif |