seg6_local.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*
  2. * SR-IPv6 implementation
  3. *
  4. * Author:
  5. * David Lebrun <david.lebrun@uclouvain.be>
  6. *
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version
  11. * 2 of the License, or (at your option) any later version.
  12. */
  13. #ifndef _LINUX_SEG6_LOCAL_H
  14. #define _LINUX_SEG6_LOCAL_H
  15. #include <linux/seg6.h>
  16. enum {
  17. SEG6_LOCAL_UNSPEC,
  18. SEG6_LOCAL_ACTION,
  19. SEG6_LOCAL_SRH,
  20. SEG6_LOCAL_TABLE,
  21. SEG6_LOCAL_NH4,
  22. SEG6_LOCAL_NH6,
  23. SEG6_LOCAL_IIF,
  24. SEG6_LOCAL_OIF,
  25. SEG6_LOCAL_BPF,
  26. SEG6_LOCAL_VRFTABLE,
  27. SEG6_LOCAL_COUNTERS,
  28. SEG6_LOCAL_FLAVORS,
  29. __SEG6_LOCAL_MAX,
  30. };
  31. #define SEG6_LOCAL_MAX (__SEG6_LOCAL_MAX - 1)
  32. enum {
  33. SEG6_LOCAL_ACTION_UNSPEC = 0,
  34. /* node segment */
  35. SEG6_LOCAL_ACTION_END = 1,
  36. /* adjacency segment (IPv6 cross-connect) */
  37. SEG6_LOCAL_ACTION_END_X = 2,
  38. /* lookup of next seg NH in table */
  39. SEG6_LOCAL_ACTION_END_T = 3,
  40. /* decap and L2 cross-connect */
  41. SEG6_LOCAL_ACTION_END_DX2 = 4,
  42. /* decap and IPv6 cross-connect */
  43. SEG6_LOCAL_ACTION_END_DX6 = 5,
  44. /* decap and IPv4 cross-connect */
  45. SEG6_LOCAL_ACTION_END_DX4 = 6,
  46. /* decap and lookup of DA in v6 table */
  47. SEG6_LOCAL_ACTION_END_DT6 = 7,
  48. /* decap and lookup of DA in v4 table */
  49. SEG6_LOCAL_ACTION_END_DT4 = 8,
  50. /* binding segment with insertion */
  51. SEG6_LOCAL_ACTION_END_B6 = 9,
  52. /* binding segment with encapsulation */
  53. SEG6_LOCAL_ACTION_END_B6_ENCAP = 10,
  54. /* binding segment with MPLS encap */
  55. SEG6_LOCAL_ACTION_END_BM = 11,
  56. /* lookup last seg in table */
  57. SEG6_LOCAL_ACTION_END_S = 12,
  58. /* forward to SR-unaware VNF with static proxy */
  59. SEG6_LOCAL_ACTION_END_AS = 13,
  60. /* forward to SR-unaware VNF with masquerading */
  61. SEG6_LOCAL_ACTION_END_AM = 14,
  62. /* custom BPF action */
  63. SEG6_LOCAL_ACTION_END_BPF = 15,
  64. /* decap and lookup of DA in v4 or v6 table */
  65. SEG6_LOCAL_ACTION_END_DT46 = 16,
  66. __SEG6_LOCAL_ACTION_MAX,
  67. };
  68. #define SEG6_LOCAL_ACTION_MAX (__SEG6_LOCAL_ACTION_MAX - 1)
  69. enum {
  70. SEG6_LOCAL_BPF_PROG_UNSPEC,
  71. SEG6_LOCAL_BPF_PROG,
  72. SEG6_LOCAL_BPF_PROG_NAME,
  73. __SEG6_LOCAL_BPF_PROG_MAX,
  74. };
  75. #define SEG6_LOCAL_BPF_PROG_MAX (__SEG6_LOCAL_BPF_PROG_MAX - 1)
  76. /* SRv6 Behavior counters are encoded as netlink attributes guaranteeing the
  77. * correct alignment.
  78. * Each counter is identified by a different attribute type (i.e.
  79. * SEG6_LOCAL_CNT_PACKETS).
  80. *
  81. * - SEG6_LOCAL_CNT_PACKETS: identifies a counter that counts the number of
  82. * packets that have been CORRECTLY processed by an SRv6 Behavior instance
  83. * (i.e., packets that generate errors or are dropped are NOT counted).
  84. *
  85. * - SEG6_LOCAL_CNT_BYTES: identifies a counter that counts the total amount
  86. * of traffic in bytes of all packets that have been CORRECTLY processed by
  87. * an SRv6 Behavior instance (i.e., packets that generate errors or are
  88. * dropped are NOT counted).
  89. *
  90. * - SEG6_LOCAL_CNT_ERRORS: identifies a counter that counts the number of
  91. * packets that have NOT been properly processed by an SRv6 Behavior instance
  92. * (i.e., packets that generate errors or are dropped).
  93. */
  94. enum {
  95. SEG6_LOCAL_CNT_UNSPEC,
  96. SEG6_LOCAL_CNT_PAD, /* pad for 64 bits values */
  97. SEG6_LOCAL_CNT_PACKETS,
  98. SEG6_LOCAL_CNT_BYTES,
  99. SEG6_LOCAL_CNT_ERRORS,
  100. __SEG6_LOCAL_CNT_MAX,
  101. };
  102. #define SEG6_LOCAL_CNT_MAX (__SEG6_LOCAL_CNT_MAX - 1)
  103. /* SRv6 End* Flavor attributes */
  104. enum {
  105. SEG6_LOCAL_FLV_UNSPEC,
  106. SEG6_LOCAL_FLV_OPERATION,
  107. SEG6_LOCAL_FLV_LCBLOCK_BITS,
  108. SEG6_LOCAL_FLV_LCNODE_FN_BITS,
  109. __SEG6_LOCAL_FLV_MAX,
  110. };
  111. #define SEG6_LOCAL_FLV_MAX (__SEG6_LOCAL_FLV_MAX - 1)
  112. /* Designed flavor operations for SRv6 End* Behavior */
  113. enum {
  114. SEG6_LOCAL_FLV_OP_UNSPEC,
  115. SEG6_LOCAL_FLV_OP_PSP,
  116. SEG6_LOCAL_FLV_OP_USP,
  117. SEG6_LOCAL_FLV_OP_USD,
  118. SEG6_LOCAL_FLV_OP_NEXT_CSID,
  119. __SEG6_LOCAL_FLV_OP_MAX
  120. };
  121. #define SEG6_LOCAL_FLV_OP_MAX (__SEG6_LOCAL_FLV_OP_MAX - 1)
  122. #endif