1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright 2015-2016, LabN Consulting, L.L.C.
8 #include "lib/memory.h"
9 #include "lib/prefix.h"
10 #include "lib/table.h"
13 #include "bgpd/bgpd.h"
14 #include "bgpd/bgp_attr.h"
16 #include "bgpd/bgp_encap_types.h"
17 #include "bgpd/bgp_encap_tlv.h"
19 #include "bgpd/rfapi/rfapi.h"
20 #include "bgpd/rfapi/rfapi_encap_tlv.h"
21 #include "bgpd/rfapi/rfapi_private.h"
22 #include "bgpd/rfapi/rfapi_monitor.h"
23 #include "bgpd/rfapi/rfapi_vty.h"
24 #include "bgpd/rfapi/bgp_rfapi_cfg.h"
25 #include "bgpd/rfapi/vnc_debug.h"
27 static void rfapi_add_endpoint_address_to_subtlv(
28 struct bgp
*bgp
, struct rfapi_ip_addr
*ea
,
29 struct bgp_tea_subtlv_remote_endpoint
*subtlv
)
31 subtlv
->family
= ea
->addr_family
;
32 if (subtlv
->family
== AF_INET
)
33 subtlv
->ip_address
.v4
= ea
->addr
.v4
;
35 subtlv
->ip_address
.v6
= ea
->addr
.v6
;
36 subtlv
->as4
= htonl(bgp
->as
);
40 rfapi_tunneltype_option_to_tlv(struct bgp
*bgp
, struct rfapi_ip_addr
*ea
,
41 struct rfapi_tunneltype_option
*tto
,
42 struct attr
*attr
, int always_add
)
45 #define _RTTO_MAYBE_ADD_ENDPOINT_ADDRESS(ttype) \
48 && !CHECK_FLAG(bgp->rfapi_cfg->flags, \
49 BGP_VNC_CONFIG_ADV_UN_METHOD_ENCAP))) \
51 && !CHECK_SUBTLV_FLAG(&tto->bgpinfo.ttype, \
52 BGP_TEA_SUBTLV_REMOTE_ENDPOINT)) { \
53 rfapi_add_endpoint_address_to_subtlv( \
54 bgp, ea, &tto->bgpinfo.ttype.st_endpoint); \
55 SET_SUBTLV_FLAG(&tto->bgpinfo.ttype, \
56 BGP_TEA_SUBTLV_REMOTE_ENDPOINT); \
59 struct rfapi_tunneltype_option dto
;
60 if (tto
== NULL
) { /* create default type */
62 memset(tto
, 0, sizeof(dto
));
63 tto
->type
= RFAPI_BGP_ENCAP_TYPE_DEFAULT
;
66 case BGP_ENCAP_TYPE_L2TPV3_OVER_IP
:
67 _RTTO_MAYBE_ADD_ENDPOINT_ADDRESS(l2tpv3_ip
);
68 bgp_encap_type_l2tpv3overip_to_tlv(&tto
->bgpinfo
.l2tpv3_ip
,
72 case BGP_ENCAP_TYPE_GRE
:
73 _RTTO_MAYBE_ADD_ENDPOINT_ADDRESS(gre
);
74 bgp_encap_type_gre_to_tlv(&tto
->bgpinfo
.gre
, attr
);
77 case BGP_ENCAP_TYPE_TRANSMIT_TUNNEL_ENDPOINT
:
78 _RTTO_MAYBE_ADD_ENDPOINT_ADDRESS(transmit_tunnel_endpoint
);
79 bgp_encap_type_transmit_tunnel_endpoint(
80 &tto
->bgpinfo
.transmit_tunnel_endpoint
, attr
);
83 case BGP_ENCAP_TYPE_IPSEC_IN_TUNNEL_MODE
:
84 _RTTO_MAYBE_ADD_ENDPOINT_ADDRESS(ipsec_tunnel
);
85 bgp_encap_type_ipsec_in_tunnel_mode_to_tlv(
86 &tto
->bgpinfo
.ipsec_tunnel
, attr
);
89 case BGP_ENCAP_TYPE_IP_IN_IP_TUNNEL_WITH_IPSEC_TRANSPORT_MODE
:
90 _RTTO_MAYBE_ADD_ENDPOINT_ADDRESS(ip_ipsec
);
91 bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode_to_tlv(
92 &tto
->bgpinfo
.ip_ipsec
, attr
);
95 case BGP_ENCAP_TYPE_MPLS_IN_IP_TUNNEL_WITH_IPSEC_TRANSPORT_MODE
:
96 _RTTO_MAYBE_ADD_ENDPOINT_ADDRESS(mpls_ipsec
);
97 bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode_to_tlv(
98 &tto
->bgpinfo
.mpls_ipsec
, attr
);
101 case BGP_ENCAP_TYPE_IP_IN_IP
:
102 _RTTO_MAYBE_ADD_ENDPOINT_ADDRESS(ip_ip
);
103 bgp_encap_type_ip_in_ip_to_tlv(&tto
->bgpinfo
.ip_ip
, attr
);
106 case BGP_ENCAP_TYPE_VXLAN
:
107 _RTTO_MAYBE_ADD_ENDPOINT_ADDRESS(vxlan
);
108 bgp_encap_type_vxlan_to_tlv(&tto
->bgpinfo
.vxlan
, attr
);
111 case BGP_ENCAP_TYPE_NVGRE
:
112 _RTTO_MAYBE_ADD_ENDPOINT_ADDRESS(nvgre
);
113 bgp_encap_type_nvgre_to_tlv(&tto
->bgpinfo
.nvgre
, attr
);
116 case BGP_ENCAP_TYPE_MPLS
:
117 /* nothing to do for MPLS */
120 case BGP_ENCAP_TYPE_MPLS_IN_GRE
:
121 _RTTO_MAYBE_ADD_ENDPOINT_ADDRESS(mpls_gre
);
122 bgp_encap_type_mpls_in_gre_to_tlv(&tto
->bgpinfo
.mpls_gre
, attr
);
125 case BGP_ENCAP_TYPE_VXLAN_GPE
:
126 _RTTO_MAYBE_ADD_ENDPOINT_ADDRESS(vxlan_gpe
);
127 bgp_encap_type_vxlan_gpe_to_tlv(&tto
->bgpinfo
.vxlan_gpe
, attr
);
130 case BGP_ENCAP_TYPE_MPLS_IN_UDP
:
131 _RTTO_MAYBE_ADD_ENDPOINT_ADDRESS(mpls_udp
);
132 bgp_encap_type_mpls_in_udp_to_tlv(&tto
->bgpinfo
.mpls_udp
, attr
);
135 case BGP_ENCAP_TYPE_PBB
:
136 _RTTO_MAYBE_ADD_ENDPOINT_ADDRESS(pbb
);
137 bgp_encap_type_pbb_to_tlv(&tto
->bgpinfo
.pbb
, attr
);
140 case BGP_ENCAP_TYPE_RESERVED
:
141 assert(!"Cannot process BGP_ENCAP_TYPE_RESERVED");
146 struct rfapi_un_option
*rfapi_encap_tlv_to_un_option(struct attr
*attr
)
148 struct rfapi_un_option
*uo
= NULL
;
149 struct rfapi_tunneltype_option
*tto
;
151 struct bgp_attr_encap_subtlv
*stlv
;
153 /* no tunnel encap attr stored */
154 if (!attr
->encap_tunneltype
)
157 stlv
= attr
->encap_subtlvs
;
159 uo
= XCALLOC(MTYPE_RFAPI_UN_OPTION
, sizeof(struct rfapi_un_option
));
160 uo
->type
= RFAPI_UN_OPTION_TYPE_TUNNELTYPE
;
161 uo
->v
.tunnel
.type
= attr
->encap_tunneltype
;
164 switch (attr
->encap_tunneltype
) {
165 case BGP_ENCAP_TYPE_L2TPV3_OVER_IP
:
166 rc
= tlv_to_bgp_encap_type_l2tpv3overip(
167 stlv
, &tto
->bgpinfo
.l2tpv3_ip
);
170 case BGP_ENCAP_TYPE_GRE
:
171 rc
= tlv_to_bgp_encap_type_gre(stlv
, &tto
->bgpinfo
.gre
);
174 case BGP_ENCAP_TYPE_TRANSMIT_TUNNEL_ENDPOINT
:
175 rc
= tlv_to_bgp_encap_type_transmit_tunnel_endpoint(
176 stlv
, &tto
->bgpinfo
.transmit_tunnel_endpoint
);
179 case BGP_ENCAP_TYPE_IPSEC_IN_TUNNEL_MODE
:
180 rc
= tlv_to_bgp_encap_type_ipsec_in_tunnel_mode(
181 stlv
, &tto
->bgpinfo
.ipsec_tunnel
);
184 case BGP_ENCAP_TYPE_IP_IN_IP_TUNNEL_WITH_IPSEC_TRANSPORT_MODE
:
185 rc
= tlv_to_bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode(
186 stlv
, &tto
->bgpinfo
.ip_ipsec
);
189 case BGP_ENCAP_TYPE_MPLS_IN_IP_TUNNEL_WITH_IPSEC_TRANSPORT_MODE
:
190 rc
= tlv_to_bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode(
191 stlv
, &tto
->bgpinfo
.mpls_ipsec
);
194 case BGP_ENCAP_TYPE_IP_IN_IP
:
195 rc
= tlv_to_bgp_encap_type_ip_in_ip(stlv
, &tto
->bgpinfo
.ip_ip
);
198 case BGP_ENCAP_TYPE_VXLAN
:
199 rc
= tlv_to_bgp_encap_type_vxlan(stlv
, &tto
->bgpinfo
.vxlan
);
202 case BGP_ENCAP_TYPE_NVGRE
:
203 rc
= tlv_to_bgp_encap_type_nvgre(stlv
, &tto
->bgpinfo
.nvgre
);
206 case BGP_ENCAP_TYPE_MPLS
:
207 rc
= tlv_to_bgp_encap_type_mpls(stlv
, &tto
->bgpinfo
.mpls
);
210 case BGP_ENCAP_TYPE_MPLS_IN_GRE
:
211 rc
= tlv_to_bgp_encap_type_mpls_in_gre(stlv
,
212 &tto
->bgpinfo
.mpls_gre
);
215 case BGP_ENCAP_TYPE_VXLAN_GPE
:
216 rc
= tlv_to_bgp_encap_type_vxlan_gpe(stlv
,
217 &tto
->bgpinfo
.vxlan_gpe
);
220 case BGP_ENCAP_TYPE_MPLS_IN_UDP
:
221 rc
= tlv_to_bgp_encap_type_mpls_in_udp(stlv
,
222 &tto
->bgpinfo
.mpls_udp
);
225 case BGP_ENCAP_TYPE_PBB
:
226 rc
= tlv_to_bgp_encap_type_pbb(stlv
, &tto
->bgpinfo
.pbb
);
230 vnc_zlog_debug_verbose("%s: unknown tunnel type %d", __func__
,
231 attr
->encap_tunneltype
);
236 XFREE(MTYPE_RFAPI_UN_OPTION
, uo
);
241 /***********************************************************************
243 ***********************************************************************/
245 static void subtlv_print_encap_l2tpv3_over_ip(
246 void *stream
, int column_offset
,
247 struct bgp_tea_subtlv_encap_l2tpv3_over_ip
*st
)
249 int (*fp
)(void *, const char *, ...);
252 const char *vty_newline
;
254 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
259 fp(out
, "%*s%s%s", column_offset
, "", "SubTLV: Encap(L2TPv3 over IP)",
261 fp(out
, "%*s SessionID: %d%s", column_offset
, "", st
->sessionid
,
263 fp(out
, "%*s Cookie: (length %d)%s", column_offset
, "",
264 st
->cookie_length
, vty_newline
);
267 static void subtlv_print_encap_gre(void *stream
, int column_offset
,
268 struct bgp_tea_subtlv_encap_gre_key
*st
)
270 int (*fp
)(void *, const char *, ...);
273 const char *vty_newline
;
275 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
280 fp(out
, "%*s%s%s", column_offset
, "", "SubTLV: Encap(GRE)",
282 fp(out
, "%*s GRE key: %d (0x%x)%s", column_offset
, "", st
->gre_key
,
283 st
->gre_key
, vty_newline
);
286 static void subtlv_print_encap_pbb(void *stream
, int column_offset
,
287 struct bgp_tea_subtlv_encap_pbb
*st
)
289 int (*fp
)(void *, const char *, ...);
292 const char *vty_newline
;
294 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
299 fp(out
, "%*s%s%s", column_offset
, "", "SubTLV: Encap(PBB)",
302 fp(out
, "%*s ISID: %d (0x%x)%s", column_offset
, "", st
->isid
,
303 st
->isid
, vty_newline
);
306 fp(out
, "%*s VID: %d (0x%x)%s", column_offset
, "", st
->vid
,
307 st
->vid
, vty_newline
);
309 fp(out
, "%*s MACADDR %02x:%02x:%02x:%02x:%02x:%02x%s", column_offset
,
310 "", st
->macaddr
[0], st
->macaddr
[1], st
->macaddr
[2], st
->macaddr
[3],
311 st
->macaddr
[4], st
->macaddr
[5], vty_newline
);
314 static void subtlv_print_proto_type(void *stream
, int column_offset
,
315 struct bgp_tea_subtlv_proto_type
*st
)
317 int (*fp
)(void *, const char *, ...);
320 const char *vty_newline
;
322 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
327 fp(out
, "%*s%s%s", column_offset
, "", "SubTLV: Encap(Proto Type)",
329 fp(out
, "%*s Proto %d (0x%x)%s", column_offset
, "", st
->proto
,
330 st
->proto
, vty_newline
);
333 static void subtlv_print_color(void *stream
, int column_offset
,
334 struct bgp_tea_subtlv_color
*st
)
336 int (*fp
)(void *, const char *, ...);
339 const char *vty_newline
;
341 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
346 fp(out
, "%*s%s%s", column_offset
, "", "SubTLV: Color", vty_newline
);
347 fp(out
, "%*s Color: %d (0x%x)", column_offset
, "", st
->color
,
348 st
->color
, vty_newline
);
351 static void subtlv_print_ipsec_ta(void *stream
, int column_offset
,
352 struct bgp_tea_subtlv_ipsec_ta
*st
)
354 int (*fp
)(void *, const char *, ...);
357 const char *vty_newline
;
359 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
364 fp(out
, "%*s%s%s", column_offset
, "", "SubTLV: IPSEC TA", vty_newline
);
365 fp(out
, "%*s Authenticator Type: %d (0x%x)", column_offset
, "",
366 st
->authenticator_type
, st
->authenticator_type
, vty_newline
);
367 fp(out
, "%*s Authenticator: (length %d)", column_offset
, "",
368 st
->authenticator_length
, vty_newline
);
371 /***********************************************************************
373 ***********************************************************************/
376 print_encap_type_l2tpv3overip(void *stream
, int column_offset
,
377 struct bgp_encap_type_l2tpv3_over_ip
*bet
)
379 const char *type
= "L2TPv3 over IP";
380 int (*fp
)(void *, const char *, ...);
383 const char *vty_newline
;
385 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
390 fp(out
, "%*sTEA type %s%s", column_offset
, "", type
, vty_newline
);
392 subtlv_print_encap_l2tpv3_over_ip(stream
, column_offset
+ 2,
394 subtlv_print_proto_type(stream
, column_offset
+ 2, &bet
->st_proto
);
395 subtlv_print_color(stream
, column_offset
+ 2, &bet
->st_color
);
398 static void print_encap_type_gre(void *stream
, int column_offset
,
399 struct bgp_encap_type_gre
*bet
)
401 const char *type
= "GRE";
402 int (*fp
)(void *, const char *, ...);
405 const char *vty_newline
;
407 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
412 fp(out
, "%*sTEA type %s%s", column_offset
, "", type
, vty_newline
);
414 subtlv_print_encap_gre(stream
, column_offset
+ 2, &bet
->st_encap
);
415 subtlv_print_proto_type(stream
, column_offset
+ 2, &bet
->st_proto
);
416 subtlv_print_color(stream
, column_offset
+ 2, &bet
->st_color
);
419 static void print_encap_type_ip_in_ip(void *stream
, int column_offset
,
420 struct bgp_encap_type_ip_in_ip
*bet
)
422 const char *type
= "IP in IP";
423 int (*fp
)(void *, const char *, ...);
426 const char *vty_newline
;
428 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
433 fp(out
, "%*sTEA type %s%s", column_offset
, "", type
, vty_newline
);
435 subtlv_print_proto_type(stream
, column_offset
+ 2, &bet
->st_proto
);
436 subtlv_print_color(stream
, column_offset
+ 2, &bet
->st_color
);
439 static void print_encap_type_transmit_tunnel_endpoint(
440 void *stream
, int column_offset
,
441 struct bgp_encap_type_transmit_tunnel_endpoint
*bet
)
443 const char *type
= "Transmit Tunnel Endpoint";
444 int (*fp
)(void *, const char *, ...);
447 const char *vty_newline
;
449 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
454 fp(out
, "%*sTEA type %s%s", column_offset
, "", type
, vty_newline
);
456 /* no subtlvs for this type */
459 static void print_encap_type_ipsec_in_tunnel_mode(
460 void *stream
, int column_offset
,
461 struct bgp_encap_type_ipsec_in_tunnel_mode
*bet
)
463 const char *type
= "IPSEC in Tunnel mode";
464 int (*fp
)(void *, const char *, ...);
467 const char *vty_newline
;
469 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
474 fp(out
, "%*sTEA type %s%s", column_offset
, "", type
, vty_newline
);
475 subtlv_print_ipsec_ta(stream
, column_offset
+ 2, &bet
->st_ipsec_ta
);
478 static void print_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode(
479 void *stream
, int column_offset
,
480 struct bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode
*bet
)
482 const char *type
= "IP in IP Tunnel with IPSEC transport mode";
483 int (*fp
)(void *, const char *, ...);
486 const char *vty_newline
;
488 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
493 fp(out
, "%*sTEA type %s%s", column_offset
, "", type
, vty_newline
);
495 subtlv_print_ipsec_ta(stream
, column_offset
+ 2, &bet
->st_ipsec_ta
);
498 static void print_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode(
499 void *stream
, int column_offset
,
500 struct bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode
*bet
)
502 const char *type
= "MPLS in IP Tunnel with IPSEC transport mode";
503 int (*fp
)(void *, const char *, ...);
506 const char *vty_newline
;
508 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
513 fp(out
, "%*sTEA type %s%s", column_offset
, "", type
, vty_newline
);
515 subtlv_print_ipsec_ta(stream
, column_offset
+ 2, &bet
->st_ipsec_ta
);
519 static void print_encap_type_pbb(void *stream
, int column_offset
,
520 struct bgp_encap_type_pbb
*bet
)
522 const char *type
= "PBB";
523 int (*fp
)(void *, const char *, ...);
526 const char *vty_newline
;
528 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
533 fp(out
, "%*sTEA type %s%s", column_offset
, "", type
, vty_newline
);
535 subtlv_print_encap_pbb(stream
, column_offset
+ 2, &bet
->st_encap
);
539 static void print_encap_type_vxlan(void *stream
, int column_offset
,
540 struct bgp_encap_type_vxlan
*bet
)
542 const char *type
= "VXLAN";
543 int (*fp
)(void *, const char *, ...);
546 const char *vty_newline
;
548 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
553 fp(out
, "%*sTEA type %s%s", column_offset
, "", type
, vty_newline
);
555 /* no subtlvs for this type */
559 static void print_encap_type_nvgre(void *stream
, int column_offset
,
560 struct bgp_encap_type_nvgre
*bet
)
562 const char *type
= "NVGRE";
563 int (*fp
)(void *, const char *, ...);
566 const char *vty_newline
;
568 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
573 fp(out
, "%*sTEA type %s%s", column_offset
, "", type
, vty_newline
);
575 /* no subtlvs for this type */
578 static void print_encap_type_mpls(void *stream
, int column_offset
,
579 struct bgp_encap_type_mpls
*bet
)
581 const char *type
= "MPLS";
582 int (*fp
)(void *, const char *, ...);
585 const char *vty_newline
;
587 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
592 fp(out
, "%*sTEA type %s%s", column_offset
, "", type
, vty_newline
);
594 /* no subtlvs for this type */
597 static void print_encap_type_mpls_in_gre(void *stream
, int column_offset
,
598 struct bgp_encap_type_mpls_in_gre
*bet
)
600 const char *type
= "MPLS in GRE";
601 int (*fp
)(void *, const char *, ...);
604 const char *vty_newline
;
606 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
611 fp(out
, "%*sTEA type %s%s", column_offset
, "", type
, vty_newline
);
613 /* no subtlvs for this type */
616 static void print_encap_type_vxlan_gpe(void *stream
, int column_offset
,
617 struct bgp_encap_type_vxlan_gpe
*bet
)
619 const char *type
= "VXLAN GPE";
620 int (*fp
)(void *, const char *, ...);
623 const char *vty_newline
;
625 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
630 fp(out
, "%*sTEA type %s%s", column_offset
, "", type
, vty_newline
);
632 /* no subtlvs for this type */
635 static void print_encap_type_mpls_in_udp(void *stream
, int column_offset
,
636 struct bgp_encap_type_mpls_in_udp
*bet
)
638 const char *type
= "MPLS in UDP";
639 int (*fp
)(void *, const char *, ...);
642 const char *vty_newline
;
644 if (rfapiStream2Vty(stream
, &fp
, &vty
, &out
, &vty_newline
) == 0)
649 fp(out
, "%*sTEA type %s%s", column_offset
, "", type
, vty_newline
);
651 /* no subtlvs for this type */
654 void rfapi_print_tunneltype_option(void *stream
, int column_offset
,
655 struct rfapi_tunneltype_option
*tto
)
658 case BGP_ENCAP_TYPE_L2TPV3_OVER_IP
:
659 print_encap_type_l2tpv3overip(stream
, column_offset
,
660 &tto
->bgpinfo
.l2tpv3_ip
);
663 case BGP_ENCAP_TYPE_GRE
:
664 print_encap_type_gre(stream
, column_offset
, &tto
->bgpinfo
.gre
);
667 case BGP_ENCAP_TYPE_TRANSMIT_TUNNEL_ENDPOINT
:
668 print_encap_type_transmit_tunnel_endpoint(
669 stream
, column_offset
,
670 &tto
->bgpinfo
.transmit_tunnel_endpoint
);
673 case BGP_ENCAP_TYPE_IPSEC_IN_TUNNEL_MODE
:
674 print_encap_type_ipsec_in_tunnel_mode(
675 stream
, column_offset
, &tto
->bgpinfo
.ipsec_tunnel
);
678 case BGP_ENCAP_TYPE_IP_IN_IP_TUNNEL_WITH_IPSEC_TRANSPORT_MODE
:
679 print_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode(
680 stream
, column_offset
, &tto
->bgpinfo
.ip_ipsec
);
683 case BGP_ENCAP_TYPE_MPLS_IN_IP_TUNNEL_WITH_IPSEC_TRANSPORT_MODE
:
684 print_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode(
685 stream
, column_offset
, &tto
->bgpinfo
.mpls_ipsec
);
688 case BGP_ENCAP_TYPE_IP_IN_IP
:
689 print_encap_type_ip_in_ip(stream
, column_offset
,
690 &tto
->bgpinfo
.ip_ip
);
693 case BGP_ENCAP_TYPE_VXLAN
:
694 print_encap_type_vxlan(stream
, column_offset
,
695 &tto
->bgpinfo
.vxlan
);
698 case BGP_ENCAP_TYPE_NVGRE
:
699 print_encap_type_nvgre(stream
, column_offset
,
700 &tto
->bgpinfo
.nvgre
);
703 case BGP_ENCAP_TYPE_MPLS
:
704 print_encap_type_mpls(stream
, column_offset
,
708 case BGP_ENCAP_TYPE_MPLS_IN_GRE
:
709 print_encap_type_mpls_in_gre(stream
, column_offset
,
710 &tto
->bgpinfo
.mpls_gre
);
713 case BGP_ENCAP_TYPE_VXLAN_GPE
:
714 print_encap_type_vxlan_gpe(stream
, column_offset
,
715 &tto
->bgpinfo
.vxlan_gpe
);
718 case BGP_ENCAP_TYPE_MPLS_IN_UDP
:
719 print_encap_type_mpls_in_udp(stream
, column_offset
,
720 &tto
->bgpinfo
.mpls_udp
);
723 case BGP_ENCAP_TYPE_PBB
:
724 print_encap_type_pbb(stream
, column_offset
, &tto
->bgpinfo
.pbb
);
727 case BGP_ENCAP_TYPE_RESERVED
:
728 assert(!"Cannot process BGP_ENCAP_TYPE_RESERVED");