2 * Copyright 2015, LabN Consulting, L.L.C.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; see the file COPYING; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef _QUAGGA_BGP_ENCAP_TLV_H
20 #define _QUAGGA_BGP_ENCAP_TLV_H
22 /***********************************************************************
23 * TUNNEL TYPE-SPECIFIC TLV ENCODE
24 ***********************************************************************/
27 bgp_encap_type_l2tpv3overip_to_tlv(struct bgp_encap_type_l2tpv3_over_ip
*bet
,
30 extern void bgp_encap_type_gre_to_tlv(struct bgp_encap_type_gre
*bet
,
33 extern void bgp_encap_type_ip_in_ip_to_tlv(struct bgp_encap_type_ip_in_ip
*bet
,
36 extern void bgp_encap_type_transmit_tunnel_endpoint(
37 struct bgp_encap_type_transmit_tunnel_endpoint
*bet
, struct attr
*attr
);
39 extern void bgp_encap_type_ipsec_in_tunnel_mode_to_tlv(
40 struct bgp_encap_type_ipsec_in_tunnel_mode
*bet
, struct attr
*attr
);
42 extern void bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode_to_tlv(
43 struct bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode
*bet
,
46 extern void bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode_to_tlv(
47 struct bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode
*bet
,
50 extern void bgp_encap_type_pbb_to_tlv(struct bgp_encap_type_pbb
*bet
,
53 extern void bgp_encap_type_vxlan_to_tlv(struct bgp_encap_type_vxlan
*bet
,
56 extern void bgp_encap_type_nvgre_to_tlv(struct bgp_encap_type_nvgre
*bet
,
59 extern void bgp_encap_type_mpls_to_tlv(struct bgp_encap_type_mpls
*bet
,
63 bgp_encap_type_mpls_in_gre_to_tlv(struct bgp_encap_type_mpls_in_gre
*bet
,
67 bgp_encap_type_vxlan_gpe_to_tlv(struct bgp_encap_type_vxlan_gpe
*bet
,
71 bgp_encap_type_mpls_in_udp_to_tlv(struct bgp_encap_type_mpls_in_udp
*bet
,
74 /***********************************************************************
75 * TUNNEL TYPE-SPECIFIC TLV DECODE
76 ***********************************************************************/
78 extern int tlv_to_bgp_encap_type_l2tpv3overip(
79 struct bgp_attr_encap_subtlv
*stlv
, /* subtlv chain */
80 struct bgp_encap_type_l2tpv3_over_ip
*bet
); /* caller-allocated */
82 extern int tlv_to_bgp_encap_type_gre(
83 struct bgp_attr_encap_subtlv
*stlv
, /* subtlv chain */
84 struct bgp_encap_type_gre
*bet
); /* caller-allocated */
86 extern int tlv_to_bgp_encap_type_ip_in_ip(
87 struct bgp_attr_encap_subtlv
*stlv
, /* subtlv chain */
88 struct bgp_encap_type_ip_in_ip
*bet
); /* caller-allocated */
90 extern int tlv_to_bgp_encap_type_transmit_tunnel_endpoint(
91 struct bgp_attr_encap_subtlv
*stlv
,
92 struct bgp_encap_type_transmit_tunnel_endpoint
*bet
);
94 extern int tlv_to_bgp_encap_type_ipsec_in_tunnel_mode(
95 struct bgp_attr_encap_subtlv
*stlv
, /* subtlv chain */
96 struct bgp_encap_type_ipsec_in_tunnel_mode
*bet
); /* caller-allocated */
98 extern int tlv_to_bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode(
99 struct bgp_attr_encap_subtlv
*stlv
,
100 struct bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode
*bet
);
102 extern int tlv_to_bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode(
103 struct bgp_attr_encap_subtlv
*stlv
,
104 struct bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode
*bet
);
106 extern int tlv_to_bgp_encap_type_vxlan(struct bgp_attr_encap_subtlv
*stlv
,
107 struct bgp_encap_type_vxlan
*bet
);
109 extern int tlv_to_bgp_encap_type_nvgre(struct bgp_attr_encap_subtlv
*stlv
,
110 struct bgp_encap_type_nvgre
*bet
);
112 extern int tlv_to_bgp_encap_type_mpls(struct bgp_attr_encap_subtlv
*stlv
,
113 struct bgp_encap_type_mpls
*bet
);
115 extern int tlv_to_bgp_encap_type_mpls(struct bgp_attr_encap_subtlv
*stlv
,
116 struct bgp_encap_type_mpls
*bet
);
119 tlv_to_bgp_encap_type_mpls_in_gre(struct bgp_attr_encap_subtlv
*stlv
,
120 struct bgp_encap_type_mpls_in_gre
*bet
);
123 tlv_to_bgp_encap_type_vxlan_gpe(struct bgp_attr_encap_subtlv
*stlv
,
124 struct bgp_encap_type_vxlan_gpe
*bet
);
127 tlv_to_bgp_encap_type_mpls_in_udp(struct bgp_attr_encap_subtlv
*stlv
,
128 struct bgp_encap_type_mpls_in_udp
*bet
);
130 extern int tlv_to_bgp_encap_type_pbb(
131 struct bgp_attr_encap_subtlv
*stlv
, /* subtlv chain */
132 struct bgp_encap_type_pbb
*bet
); /* caller-allocated */
134 #endif /* _QUAGGA_BGP_ENCAP_TLV_H */