bgp_encap_tlv.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /*
  2. * Copyright 2015, LabN Consulting, L.L.C.
  3. *
  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.
  8. *
  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.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. *
  18. */
  19. #ifndef _QUAGGA_BGP_ENCAP_TLV_H
  20. #define _QUAGGA_BGP_ENCAP_TLV_H
  21. /***********************************************************************
  22. * TUNNEL TYPE-SPECIFIC TLV ENCODE
  23. ***********************************************************************/
  24. extern void
  25. bgp_encap_type_l2tpv3overip_to_tlv(
  26. struct bgp_encap_type_l2tpv3_over_ip *bet,
  27. struct attr *attr);
  28. extern void
  29. bgp_encap_type_gre_to_tlv(
  30. struct bgp_encap_type_gre *bet,
  31. struct attr *attr);
  32. extern void
  33. bgp_encap_type_ip_in_ip_to_tlv(
  34. struct bgp_encap_type_ip_in_ip *bet,
  35. struct attr *attr);
  36. extern void
  37. bgp_encap_type_transmit_tunnel_endpoint(
  38. struct bgp_encap_type_transmit_tunnel_endpoint *bet,
  39. struct attr *attr);
  40. extern void
  41. bgp_encap_type_ipsec_in_tunnel_mode_to_tlv(
  42. struct bgp_encap_type_ipsec_in_tunnel_mode *bet,
  43. struct attr *attr);
  44. extern void
  45. bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode_to_tlv(
  46. struct bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode *bet,
  47. struct attr *attr);
  48. extern void
  49. bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode_to_tlv(
  50. struct bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode *bet,
  51. struct attr *attr);
  52. extern void
  53. bgp_encap_type_pbb_to_tlv(
  54. struct bgp_encap_type_pbb *bet,
  55. struct attr *attr);
  56. extern void
  57. bgp_encap_type_vxlan_to_tlv(
  58. struct bgp_encap_type_vxlan *bet,
  59. struct attr *attr);
  60. extern void
  61. bgp_encap_type_nvgre_to_tlv(
  62. struct bgp_encap_type_nvgre *bet,
  63. struct attr *attr);
  64. extern void
  65. bgp_encap_type_mpls_to_tlv(
  66. struct bgp_encap_type_mpls *bet,
  67. struct attr *attr);
  68. extern void
  69. bgp_encap_type_mpls_in_gre_to_tlv(
  70. struct bgp_encap_type_mpls_in_gre *bet,
  71. struct attr *attr);
  72. extern void
  73. bgp_encap_type_vxlan_gpe_to_tlv(
  74. struct bgp_encap_type_vxlan_gpe *bet,
  75. struct attr *attr);
  76. extern void
  77. bgp_encap_type_mpls_in_udp_to_tlv(
  78. struct bgp_encap_type_mpls_in_udp *bet,
  79. struct attr *attr);
  80. /***********************************************************************
  81. * TUNNEL TYPE-SPECIFIC TLV DECODE
  82. ***********************************************************************/
  83. extern int
  84. tlv_to_bgp_encap_type_l2tpv3overip(
  85. struct bgp_attr_encap_subtlv *stlv, /* subtlv chain */
  86. struct bgp_encap_type_l2tpv3_over_ip *bet); /* caller-allocated */
  87. extern int
  88. tlv_to_bgp_encap_type_gre(
  89. struct bgp_attr_encap_subtlv *stlv, /* subtlv chain */
  90. struct bgp_encap_type_gre *bet); /* caller-allocated */
  91. extern int
  92. tlv_to_bgp_encap_type_ip_in_ip(
  93. struct bgp_attr_encap_subtlv *stlv, /* subtlv chain */
  94. struct bgp_encap_type_ip_in_ip *bet); /* caller-allocated */
  95. extern int
  96. tlv_to_bgp_encap_type_transmit_tunnel_endpoint(
  97. struct bgp_attr_encap_subtlv *stlv,
  98. struct bgp_encap_type_transmit_tunnel_endpoint *bet);
  99. extern int
  100. tlv_to_bgp_encap_type_ipsec_in_tunnel_mode(
  101. struct bgp_attr_encap_subtlv *stlv, /* subtlv chain */
  102. struct bgp_encap_type_ipsec_in_tunnel_mode *bet); /* caller-allocated */
  103. extern int
  104. tlv_to_bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode(
  105. struct bgp_attr_encap_subtlv *stlv,
  106. struct bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode *bet);
  107. extern int
  108. tlv_to_bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode(
  109. struct bgp_attr_encap_subtlv *stlv,
  110. struct bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode *bet);
  111. extern int
  112. tlv_to_bgp_encap_type_vxlan(
  113. struct bgp_attr_encap_subtlv *stlv,
  114. struct bgp_encap_type_vxlan *bet);
  115. extern int
  116. tlv_to_bgp_encap_type_nvgre(
  117. struct bgp_attr_encap_subtlv *stlv,
  118. struct bgp_encap_type_nvgre *bet);
  119. extern int
  120. tlv_to_bgp_encap_type_mpls(
  121. struct bgp_attr_encap_subtlv *stlv,
  122. struct bgp_encap_type_mpls *bet);
  123. extern int
  124. tlv_to_bgp_encap_type_mpls(
  125. struct bgp_attr_encap_subtlv *stlv,
  126. struct bgp_encap_type_mpls *bet);
  127. extern int
  128. tlv_to_bgp_encap_type_mpls_in_gre(
  129. struct bgp_attr_encap_subtlv *stlv,
  130. struct bgp_encap_type_mpls_in_gre *bet);
  131. extern int
  132. tlv_to_bgp_encap_type_vxlan_gpe(
  133. struct bgp_attr_encap_subtlv *stlv,
  134. struct bgp_encap_type_vxlan_gpe *bet);
  135. extern int
  136. tlv_to_bgp_encap_type_mpls_in_udp(
  137. struct bgp_attr_encap_subtlv *stlv,
  138. struct bgp_encap_type_mpls_in_udp *bet);
  139. extern int
  140. tlv_to_bgp_encap_type_pbb(
  141. struct bgp_attr_encap_subtlv *stlv, /* subtlv chain */
  142. struct bgp_encap_type_pbb *bet); /* caller-allocated */
  143. #endif /* _QUAGGA_BGP_ENCAP_TLV_H */