1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright 2015, LabN Consulting, L.L.C.
6 #ifndef _QUAGGA_BGP_ENCAP_TLV_H
7 #define _QUAGGA_BGP_ENCAP_TLV_H
9 /***********************************************************************
10 * TUNNEL TYPE-SPECIFIC TLV ENCODE
11 ***********************************************************************/
14 bgp_encap_type_l2tpv3overip_to_tlv(struct bgp_encap_type_l2tpv3_over_ip
*bet
,
17 extern void bgp_encap_type_gre_to_tlv(struct bgp_encap_type_gre
*bet
,
20 extern void bgp_encap_type_ip_in_ip_to_tlv(struct bgp_encap_type_ip_in_ip
*bet
,
23 extern void bgp_encap_type_transmit_tunnel_endpoint(
24 struct bgp_encap_type_transmit_tunnel_endpoint
*bet
, struct attr
*attr
);
26 extern void bgp_encap_type_ipsec_in_tunnel_mode_to_tlv(
27 struct bgp_encap_type_ipsec_in_tunnel_mode
*bet
, struct attr
*attr
);
29 extern void bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode_to_tlv(
30 struct bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode
*bet
,
33 extern void bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode_to_tlv(
34 struct bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode
*bet
,
37 extern void bgp_encap_type_pbb_to_tlv(struct bgp_encap_type_pbb
*bet
,
40 extern void bgp_encap_type_vxlan_to_tlv(struct bgp_encap_type_vxlan
*bet
,
43 extern void bgp_encap_type_nvgre_to_tlv(struct bgp_encap_type_nvgre
*bet
,
46 extern void bgp_encap_type_mpls_to_tlv(struct bgp_encap_type_mpls
*bet
,
50 bgp_encap_type_mpls_in_gre_to_tlv(struct bgp_encap_type_mpls_in_gre
*bet
,
54 bgp_encap_type_vxlan_gpe_to_tlv(struct bgp_encap_type_vxlan_gpe
*bet
,
58 bgp_encap_type_mpls_in_udp_to_tlv(struct bgp_encap_type_mpls_in_udp
*bet
,
61 /***********************************************************************
62 * TUNNEL TYPE-SPECIFIC TLV DECODE
63 ***********************************************************************/
65 extern int tlv_to_bgp_encap_type_l2tpv3overip(
66 struct bgp_attr_encap_subtlv
*stlv
, /* subtlv chain */
67 struct bgp_encap_type_l2tpv3_over_ip
*bet
); /* caller-allocated */
69 extern int tlv_to_bgp_encap_type_gre(
70 struct bgp_attr_encap_subtlv
*stlv
, /* subtlv chain */
71 struct bgp_encap_type_gre
*bet
); /* caller-allocated */
73 extern int tlv_to_bgp_encap_type_ip_in_ip(
74 struct bgp_attr_encap_subtlv
*stlv
, /* subtlv chain */
75 struct bgp_encap_type_ip_in_ip
*bet
); /* caller-allocated */
77 extern int tlv_to_bgp_encap_type_transmit_tunnel_endpoint(
78 struct bgp_attr_encap_subtlv
*stlv
,
79 struct bgp_encap_type_transmit_tunnel_endpoint
*bet
);
81 extern int tlv_to_bgp_encap_type_ipsec_in_tunnel_mode(
82 struct bgp_attr_encap_subtlv
*stlv
, /* subtlv chain */
83 struct bgp_encap_type_ipsec_in_tunnel_mode
*bet
); /* caller-allocated */
85 extern int tlv_to_bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode(
86 struct bgp_attr_encap_subtlv
*stlv
,
87 struct bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode
*bet
);
89 extern int tlv_to_bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode(
90 struct bgp_attr_encap_subtlv
*stlv
,
91 struct bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode
*bet
);
93 extern int tlv_to_bgp_encap_type_vxlan(struct bgp_attr_encap_subtlv
*stlv
,
94 struct bgp_encap_type_vxlan
*bet
);
96 extern int tlv_to_bgp_encap_type_nvgre(struct bgp_attr_encap_subtlv
*stlv
,
97 struct bgp_encap_type_nvgre
*bet
);
99 extern int tlv_to_bgp_encap_type_mpls(struct bgp_attr_encap_subtlv
*stlv
,
100 struct bgp_encap_type_mpls
*bet
);
102 extern int tlv_to_bgp_encap_type_mpls(struct bgp_attr_encap_subtlv
*stlv
,
103 struct bgp_encap_type_mpls
*bet
);
106 tlv_to_bgp_encap_type_mpls_in_gre(struct bgp_attr_encap_subtlv
*stlv
,
107 struct bgp_encap_type_mpls_in_gre
*bet
);
110 tlv_to_bgp_encap_type_vxlan_gpe(struct bgp_attr_encap_subtlv
*stlv
,
111 struct bgp_encap_type_vxlan_gpe
*bet
);
114 tlv_to_bgp_encap_type_mpls_in_udp(struct bgp_attr_encap_subtlv
*stlv
,
115 struct bgp_encap_type_mpls_in_udp
*bet
);
117 extern int tlv_to_bgp_encap_type_pbb(
118 struct bgp_attr_encap_subtlv
*stlv
, /* subtlv chain */
119 struct bgp_encap_type_pbb
*bet
); /* caller-allocated */
121 #endif /* _QUAGGA_BGP_ENCAP_TLV_H */