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0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
73 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
74 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
75 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
76 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
77 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
79 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
93 return format (s,
"SRv6-END-rewrite: src %U dst %U\n\tTEID: 0x%x",
95 clib_net_to_host_u32 (t->
teid));
106 "SRv6-END-rewrite: src %U dst %U\n\tTEID: 0x%x\n\tsr_prefix: %U/%d",
112 #define foreach_srv6_end_v4_error \ 113 _(M_GTP4_E_PACKETS, "srv6 End.M.GTP4.E packets") \ 114 _(M_GTP4_E_BAD_PACKETS, "srv6 End.M.GTP4.E bad packets") 116 #define foreach_srv6_t_v4_d_error \ 117 _(M_GTP4_D_PACKETS, "srv6 T.M.GTP4.D packets") \ 118 _(M_GTP4_D_BAD_PACKETS, "srv6 T.M.GTP4.D bad packets") 120 #define foreach_srv6_end_v6_e_error \ 121 _(M_GTP6_E_PACKETS, "srv6 End.M.GTP6.E packets") \ 122 _(M_GTP6_E_BAD_PACKETS, "srv6 End.M.GTP6.E bad packets") 124 #define foreach_srv6_end_v6_d_error \ 125 _(M_GTP6_D_PACKETS, "srv6 End.M.GTP6.D packets") \ 126 _(M_GTP6_D_BAD_PACKETS, "srv6 End.M.GTP6.D bad packets") 128 #define foreach_srv6_end_v6_d_di_error \ 129 _(M_GTP6_D_DI_PACKETS, "srv6 End.M.GTP6.D.DI packets") \ 130 _(M_GTP6_D_DI_BAD_PACKETS, "srv6 End.M.GTP6.D.DI bad packets") 134 #define _(sym,str) SRV6_END_ERROR_##sym, 142 #define _(sym,str) SRV6_T_ERROR_##sym, 150 #define _(sym,str) SRV6_END_ERROR_##sym, 158 #define _(sym,str) SRV6_END_ERROR_##sym, 166 #define _(sym,str) SRV6_END_ERROR_##sym, 173 #define _(sym,string) string, 179 #define _(sym,string) string, 185 #define _(sym,string) string, 191 #define _(sym,string) string, 197 #define _(sym,string) string, 243 return val[0] ^ val[1] ^ val[2] ^ val[3];
245 return val[0] ^ val[1];
254 val = clib_net_to_host_u16 (tag);
274 u32 n_left_from, next_index, *from, *to_next;
277 u32 good_n = 0, bad_n = 0;
280 n_left_from =
frame->n_vectors;
281 next_index =
node->cached_next_index;
283 while (n_left_from > 0)
289 while (n_left_from > 0 && n_left_to_next > 0)
339 u8 *teid8p = (
u8 *) & teid;
359 tag = ip6srv0->
sr.
tag;
384 qfi = dst0.
as_u8[offset + 4];
401 for (index = 0; index < 4; index++)
403 dst4.
as_u8[index] = dst0.
as_u8[offset + index] << shift;
405 dst0.
as_u8[offset + index + 1] >> (8 - shift);
408 qfi |= dst0.
as_u8[offset + 4] << shift;
409 qfi |= dst0.
as_u8[offset + 5] >> (8 - shift);
416 for (index = 0; index < 2; index++)
418 sp[index] = dst0.
as_u8[offset + 5 + index] << shift;
420 dst0.
as_u8[offset + 6 + index] >> (8 - shift);
425 for (index = 0; index < 4; index++)
427 *teid8p = dst0.
as_u8[offset + 5 + index] << shift;
429 dst0.
as_u8[offset + 6 + index] >> (8 - shift);
461 hdr0->
gtpu.
length = clib_host_to_net_u16 (len0);
509 for (index = 0; index < 4; index++)
512 src0.
as_u8[offset + index];
517 for (index = 0; index < 4; index++)
520 src0.
as_u8[offset + index] << shift;
522 src0.
as_u8[offset + index + 1] >> (8 - shift);
530 hdr0->
udp.
length = clib_host_to_net_u16 (len0 +
535 hdr0->
ip4.
length = clib_host_to_net_u16 (len0 +
563 n_left_to_next, bi0, next0);
570 SRV6_END_ERROR_M_GTP4_E_BAD_PACKETS, bad_n);
573 SRV6_END_ERROR_M_GTP4_E_PACKETS, good_n);
575 return frame->n_vectors;
585 u32 n_left_from, next_index, *from, *to_next;
587 u32 good_n = 0, bad_n = 0;
590 n_left_from =
frame->n_vectors;
591 next_index =
node->cached_next_index;
593 while (n_left_from > 0)
599 while (n_left_from > 0 && n_left_to_next > 0)
631 if (ip4->
protocol != IP_PROTOCOL_UDP
669 teidp = (
u8 *) & teid;
724 seg.
as_u8[offset + 4] = qfi;
740 for (index = 0; index < 4; index++)
742 seg.
as_u8[offset + index] |= dstp[index] >> shift;
743 seg.
as_u8[offset + index + 1] |=
744 dstp[index] << (8 - shift);
758 seg.
as_u8[offset + 4] |= qfi >> shift;
759 seg.
as_u8[offset + 5] |= qfi << (8 - shift);
766 for (index = 0; index < 2; index++)
768 seg.
as_u8[offset + 5 + index] |=
769 seqp[index] >> shift;
770 seg.
as_u8[offset + 6 + index] |=
771 seqp[index] << (8 - shift);
776 for (index = 0; index < 4; index++)
778 seg.
as_u8[offset + index + 5] |=
779 teidp[index] >> shift;
780 seg.
as_u8[offset + index + 6] |=
781 teidp[index] << (8 - shift);
797 for (index = 0; index < 4; index++)
799 src6.as_u8[offset + index] |= srcp[
offset] >> shift;
800 src6.as_u8[offset + index + 1] |=
801 srcp[
offset] << (8 - shift);
906 if ((clib_net_to_host_u32
916 if ((clib_net_to_host_u32
929 if ((clib_net_to_host_u32
975 if ((clib_net_to_host_u32
985 if ((clib_net_to_host_u32
998 if ((clib_net_to_host_u32
1018 clib_host_to_net_u16 (len0 + hdr_len -
sizeof (
ip6_header_t));
1036 n_left_to_next, bi0, next0);
1043 SRV6_T_ERROR_M_GTP4_D_BAD_PACKETS, bad_n);
1046 SRV6_T_ERROR_M_GTP4_D_PACKETS, good_n);
1048 return frame->n_vectors;
1053 .name =
"srv6-end-m-gtp4-e",.vector_size =
sizeof (
u32),.format_trace =
1065 .name =
"srv6-t-m-gtp4-d",.vector_size =
sizeof (
u32),.format_trace =
1082 u32 n_left_from, next_index, *from, *to_next;
1085 u32 good_n = 0, bad_n = 0;
1088 n_left_from =
frame->n_vectors;
1089 next_index =
node->cached_next_index;
1091 while (n_left_from > 0)
1097 while (n_left_from > 0 && n_left_to_next > 0)
1121 n_left_to_next -= 1;
1133 tag = ip6srv0->
sr.
tag;
1163 u8 *teid8p = (
u8 *) & teid;
1191 qfi = dst0.
as_u8[offset + 4];
1202 for (index = 0; index < 2; index++)
1204 sp[index] = dst0.
as_u8[offset + index] << shift;
1206 dst0.
as_u8[offset + index + 1] >> (8 - shift);
1211 for (index = 0; index < 4; index++)
1213 *teid8p = dst0.
as_u8[offset + index] << shift;
1215 dst0.
as_u8[offset + index + 1] >> (8 - shift);
1220 qfi |= dst0.
as_u8[offset + 4] << shift;
1221 qfi |= dst0.
as_u8[offset + 5] >> (8 - shift);
1247 hdr0->
gtpu.
length = clib_host_to_net_u16 (len0);
1289 hdr0->
udp.
length = clib_host_to_net_u16 (len0 +
1333 n_left_to_next, bi0, next0);
1340 SRV6_END_ERROR_M_GTP6_E_BAD_PACKETS, bad_n);
1343 SRV6_END_ERROR_M_GTP6_E_PACKETS, good_n);
1345 return frame->n_vectors;
1355 u32 n_left_from, next_index, *from, *to_next;
1358 u32 good_n = 0, bad_n = 0;
1361 n_left_from =
frame->n_vectors;
1362 next_index =
node->cached_next_index;
1364 while (n_left_from > 0)
1370 while (n_left_from > 0 && n_left_to_next > 0)
1401 n_left_to_next -= 1;
1433 teidp = (
u8 *) & teid;
1441 seqp = (
u8 *) & seq;
1451 qfip = (
u8 *) & qfi;
1491 seg0.
as_u8[offset + 4] = qfi;
1504 for (idx = 0; idx < 2; idx++)
1506 seg0.
as_u8[offset + idx] |= seqp[idx] >> shift;
1507 seg0.
as_u8[offset + idx + 1] |=
1508 seqp[idx] << (8 - shift);
1514 for (idx = 0; idx < 4; idx++)
1516 seg0.
as_u8[offset + idx] |= teidp[idx] >> shift;
1517 seg0.
as_u8[offset + idx + 1] |=
1518 teidp[idx] << (8 - shift);
1533 seg0.
as_u8[offset + 4] |= qfi >> shift;
1534 seg0.
as_u8[offset + 5] |= qfi << (8 - shift);
1623 ip6srv->
ip.
protocol = IP_PROTOCOL_IPV6_ROUTE;
1650 if ((clib_net_to_host_u32
1660 if ((clib_net_to_host_u32
1673 if ((clib_net_to_host_u32
1703 ip6srv->
ip.
protocol = IP_PROTOCOL_IPV6_ROUTE;
1720 if ((clib_net_to_host_u32
1728 if ((clib_net_to_host_u32
1741 if ((clib_net_to_host_u32
1759 clib_host_to_net_u16 (len0 + hdr_len -
sizeof (
ip6_header_t));
1787 n_left_to_next, bi0, next0);
1794 SRV6_END_ERROR_M_GTP6_D_BAD_PACKETS, bad_n);
1797 SRV6_END_ERROR_M_GTP6_D_PACKETS, good_n);
1799 return frame->n_vectors;
1809 u32 n_left_from, next_index, *from, *to_next;
1813 u32 good_n = 0, bad_n = 0;
1816 n_left_from =
frame->n_vectors;
1817 next_index =
node->cached_next_index;
1819 while (n_left_from > 0)
1825 while (n_left_from > 0 && n_left_to_next > 0)
1857 n_left_to_next -= 1;
1890 teidp = (
u8 *) & teid;
1898 seqp = (
u8 *) & seq;
1946 seg0.
as_u8[offset + 4] = qfi;
1959 for (idx = 0; idx < 2; idx++)
1961 seg0.
as_u8[offset + idx] |= seqp[idx] >> shift;
1962 seg0.
as_u8[offset + idx + 1] |=
1963 seqp[idx] << (8 - shift);
1969 for (idx = 0; idx < 4; idx++)
1971 seg0.
as_u8[offset + idx] |= teidp[idx] >> shift;
1972 seg0.
as_u8[offset + idx + 1] |=
1973 teidp[idx] << (8 - shift);
1988 seg0.
as_u8[offset + 4] |= qfi >> shift;
1989 seg0.
as_u8[offset + 5] |= qfi << (8 - shift);
2071 ip6srv->
ip.
protocol = IP_PROTOCOL_IPV6_ROUTE;
2118 clib_host_to_net_u16 (len0 + hdr_len -
sizeof (
ip6_header_t));
2119 ip6srv->
ip.
protocol = IP_PROTOCOL_IPV6_ROUTE;
2125 if ((clib_net_to_host_u32
2135 if ((clib_net_to_host_u32
2148 if ((clib_net_to_host_u32
2195 n_left_to_next, bi0, next0);
2202 SRV6_END_ERROR_M_GTP6_D_DI_BAD_PACKETS, bad_n);
2205 SRV6_END_ERROR_M_GTP6_D_DI_PACKETS, good_n);
2207 return frame->n_vectors;
2212 .name =
"srv6-end-m-gtp6-e",.vector_size =
sizeof (
u32),.format_trace =
2224 .name =
"srv6-end-m-gtp6-d",.vector_size =
sizeof (
u32),.format_trace =
2236 .name =
"srv6-end-m-gtp6-d-di",.vector_size =
sizeof (
u32),.format_trace =
#define GTPU_PDU_SESSION_P_BIT_MASK
union gtpu_pdu_session_t::@110 u
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
#define foreach_srv6_end_v6_d_di_error
static char * srv6_end_error_v6_e_strings[]
#define GTPU_EXTHDR_PDU_SESSION
#define SRH_TAG_ERROR_INDICATION
#define SRH_TAG_ECHO_REQUEST
#define foreach_srv6_end_v6_e_error
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 thread_index, u32 index, u64 n_packets, u64 n_bytes)
Increment a combined counter.
#define SRV6_GTP_UDP_DST_PORT
static u16 srh_tagfield[256]
#define clib_memcpy_fast(a, b, c)
static u8 gtpu_type_get(u16 tag)
vlib_node_registration_t srv6_end_m_gtp6_e
(constructor) VLIB_REGISTER_NODE (srv6_end_m_gtp6_e)
#define foreach_srv6_end_v6_d_error
ip6_address_t * segments
SIDs (key)
srv6_end_main_v6_decap_t srv6_end_main_v6_decap
#define ROUTING_HEADER_TYPE_SR
#define VLIB_NODE_FN(node)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
vlib_combined_counter_main_t sr_ls_invalid_counters
vlib_combined_counter_main_t sr_ls_valid_counters
srv6_end_main_v6_t srv6_end_main_v6
#define clib_memcpy(d, s, n)
vlib_node_registration_t srv6_end_m_gtp6_d
(constructor) VLIB_REGISTER_NODE (srv6_end_m_gtp6_d)
#define GTPU_TYPE_END_MARKER
u32 end_m_gtp6_d_node_index
#define SRH_TAG_END_MARKER
SR Segment List (SID list)
#define SRV6_NHTYPE_NON_IP
#define IPPROTO_IPV6_ROUTE
static char * srv6_end_error_v6_d_di_strings[]
u32 end_m_gtp6_d_di_node_index
vl_api_fib_path_type_t type
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define SRV6_PDU_SESSION_U_BIT_MASK
static char * srv6_end_error_v4_strings[]
#define GTPU_PDU_SESSION_QFI_MASK
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define GTPU_TYPE_ECHO_REPLY
static u8 * format_srv6_end_rewrite_trace(u8 *s, va_list *args)
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
#define SRV6_PDU_SESSION_R_BIT_MASK
#define foreach_srv6_end_v4_error
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
static u8 * format_srv6_end_rewrite_trace6(u8 *s, va_list *args)
ip6_sr_localsid_t * localsids
#define SRH_TAG_ECHO_REPLY
vlib_node_registration_t srv6_end_m_gtp6_d_di
(constructor) VLIB_REGISTER_NODE (srv6_end_m_gtp6_d_di)
#define VLIB_REGISTER_NODE(x,...)
u32 end_m_gtp4_e_node_index
ip6_address_t v6src_prefix
#define GTPU_TYPE_ECHO_REQUEST
srv6_end_main_v6_decap_di_t srv6_end_main_v6_decap_di
#define foreach_srv6_t_v4_d_error
vlib_node_registration_t srv6_t_m_gtp4_d
(constructor) VLIB_REGISTER_NODE (srv6_t_m_gtp4_d)
u32 * segments_lists
SID lists indexes (vector)
vlib_node_registration_t srv6_end_m_gtp4_e
(constructor) VLIB_REGISTER_NODE (srv6_end_m_gtp4_e)
u32 t_m_gtp4_d_node_index
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
srv6_t_main_v4_decap_t srv6_t_main_v4_decap
vlib_main_t vlib_node_runtime_t * node
static u16 hash_uword_to_u16(uword *key)
#define GTPU_PDU_SESSION_R_BIT_MASK
ip4_gtpu_header_t cache_hdr
ip6_gtpu_header_t cache_hdr
srv6_end_main_v4_t srv6_end_main_v4
u32 end_m_gtp6_e_node_index
static uword * mhash_get(mhash_t *h, const void *key)
void * plugin_mem
Memory to be used by the plugin callback functions.
uword hash_memory(void *p, word n_bytes, uword state)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
mhash_t sr_policies_index_hash
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
ip6_address_t sr_pr_encaps_src
#define SRV6_PDU_SESSION_QFI_MASK
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
ip6_sr_policy_t * sr_policies
static char * srv6_t_error_v4_d_strings[]
u8 * rewrite
Precomputed rewrite header.
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
srv6_end_m_gtp6_d_di_next_t
struct clib_bihash_value offset
template key/value backing page structure
Segment Routing main datastructure.
#define vec_foreach(var, vec)
Vector iterator.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
#define VLIB_NODE_FLAG_TRACE
#define GTPU_TYPE_ERROR_INDICATION
static char * srv6_end_error_v6_d_strings[]
ip6srv_combo_header_t cache_hdr
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static u16 ip4_header_checksum(ip4_header_t *i)