1 #ifndef NETLINK_NEXTHOP_ENCAP_H_ 2 #define NETLINK_NEXTHOP_ENCAP_H_ 3 4 struct nh_encap_ops { 5 uint16_t encap_type; 6 7 int (*build_msg)(struct nl_msg *msg, void *priv); 8 int (*parse_msg)(struct nlattr *nla, struct rtnl_nexthop *rtnh); 9 10 int (*compare)(void *a, void *b); 11 12 void (*dump)(void *priv, struct nl_dump_params *dp); 13 void (*destructor)(void *priv); 14 }; 15 16 struct rtnl_nh_encap; 17 18 /* 19 * generic nexthop encap 20 */ 21 void nh_set_encap(struct rtnl_nexthop *nh, struct rtnl_nh_encap *rtnh_encap); 22 23 int nh_encap_parse_msg(struct nlattr *encap, struct nlattr *encap_type, 24 struct rtnl_nexthop *rtnh); 25 int nh_encap_build_msg(struct nl_msg *msg, struct rtnl_nh_encap *rtnh_encap); 26 27 void nh_encap_dump(struct rtnl_nh_encap *rtnh_encap, struct nl_dump_params *dp); 28 29 int nh_encap_compare(struct rtnl_nh_encap *a, struct rtnl_nh_encap *b); 30 31 /* 32 * MPLS encap 33 */ 34 extern struct nh_encap_ops mpls_encap_ops; 35 #endif 36