FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
pppoe_decap.c
Go to the documentation of this file.
1 /*
2  * decap.c: pppoe session decap packet processing
3  *
4  * Copyright (c) 2017 Intel and/or its affiliates.
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #include <vlib/vlib.h>
19 #include <vnet/ppp/packet.h>
20 #include <pppoe/pppoe.h>
21 
22 typedef struct {
28 
29 static u8 * format_pppoe_rx_trace (u8 * s, va_list * args)
30 {
31  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
32  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
33  pppoe_rx_trace_t * t = va_arg (*args, pppoe_rx_trace_t *);
34 
35  if (t->session_index != ~0)
36  {
37  s = format (s, "PPPoE decap from pppoe_session%d session_id %d next %d error %d",
38  t->session_index, t->session_id, t->next_index, t->error);
39  }
40  else
41  {
42  s = format (s, "PPPoE decap error - session for session_id %d does not exist",
43  t->session_id);
44  }
45  return s;
46 }
47 
51 {
52  u32 n_left_from, next_index, * from, * to_next;
53  pppoe_main_t * pem = &pppoe_main;
54  vnet_main_t * vnm = pem->vnet_main;
56  u32 pkts_decapsulated = 0;
58  u32 stats_sw_if_index, stats_n_packets, stats_n_bytes;
59  pppoe_entry_key_t cached_key;
60  pppoe_entry_result_t cached_result;
61 
63  n_left_from = from_frame->n_vectors;
64 
65  /* Clear the one-entry cache in case session table was updated */
66  cached_key.raw = ~0;
67  cached_result.raw = ~0; /* warning be gone */
68 
69  next_index = node->cached_next_index;
70  stats_sw_if_index = node->runtime_data[0];
71  stats_n_packets = stats_n_bytes = 0;
72 
73  while (n_left_from > 0)
74  {
75  u32 n_left_to_next;
76 
78  to_next, n_left_to_next);
79  while (n_left_from >= 4 && n_left_to_next >= 2)
80  {
81  u32 bi0, bi1;
82  vlib_buffer_t * b0, * b1;
83  u32 next0, next1;
84  ethernet_header_t *h0, *h1;
85  ethernet_vlan_header_t *vlan0 = 0, *vlan1 = 0;
86  pppoe_header_t * pppoe0, * pppoe1;
87  u16 ppp_proto0 = 0, ppp_proto1 = 0;
88  pppoe_session_t * t0, * t1;
89  u32 error0 = 0, error1 = 0;
90  u32 sw_if_index0, sw_if_index1, len0, len1;
91  pppoe_entry_key_t key0, key1;
92  pppoe_entry_result_t result0, result1;
93  u32 bucket0, bucket1;
94  u16 type0, type1;
95 
96  /* Prefetch next iteration. */
97  {
98  vlib_buffer_t * p2, * p3;
99 
100  p2 = vlib_get_buffer (vm, from[2]);
101  p3 = vlib_get_buffer (vm, from[3]);
102 
103  vlib_prefetch_buffer_header (p2, LOAD);
104  vlib_prefetch_buffer_header (p3, LOAD);
105 
108  }
109 
110  bi0 = from[0];
111  bi1 = from[1];
112  to_next[0] = bi0;
113  to_next[1] = bi1;
114  from += 2;
115  to_next += 2;
116  n_left_to_next -= 2;
117  n_left_from -= 2;
118 
119  b0 = vlib_get_buffer (vm, bi0);
120  b1 = vlib_get_buffer (vm, bi1);
121  error0 = 0;
122  error1 = 0;
123 
124  /* get client mac */
125  vlib_buffer_reset(b0);
126  h0 = vlib_buffer_get_current (b0);
127 
128  /* get pppoe header */
129  type0 = clib_net_to_host_u16(h0->type);
130  if(type0 == ETHERNET_TYPE_VLAN){
131  vlan0 = (ethernet_vlan_header_t *)(h0+1);
132  type0 = clib_net_to_host_u16(vlan0->type);
133  pppoe0 = (pppoe_header_t*)(vlan0+1);
134  if( type0 != ETHERNET_TYPE_PPPOE_DISCOVERY && type0 != ETHERNET_TYPE_PPPOE_SESSION ) {
135  error0 = PPPOE_ERROR_BAD_VER_TYPE;
136  next0 = PPPOE_INPUT_NEXT_DROP;
137  goto trace0;
138  }
139  } else {
140  pppoe0 = (pppoe_header_t*)(h0+1);
141  }
142 
143  ppp_proto0 = clib_net_to_host_u16(pppoe0->ppp_proto);
144 
145  /* Manipulate packet 0 */
146  if ((ppp_proto0 != PPP_PROTOCOL_ip4)
147  && (ppp_proto0 != PPP_PROTOCOL_ip6))
148  {
149  vlan0 == 0 ?
150  vlib_buffer_advance(b0, sizeof(*h0))
151  :
152  vlib_buffer_advance(b0, sizeof(*h0)+sizeof(*vlan0));
153  error0 = PPPOE_ERROR_CONTROL_PLANE;
154  next0 = PPPOE_INPUT_NEXT_CP_INPUT;
155  goto trace0;
156  }
157 
158 
159  pppoe_lookup_1 (&pem->session_table, &cached_key, &cached_result,
160  h0->src_address, pppoe0->session_id,
161  &key0, &bucket0, &result0);
162  if (PREDICT_FALSE (result0.fields.session_index == ~0))
163  {
164  error0 = PPPOE_ERROR_NO_SUCH_SESSION;
165  next0 = PPPOE_INPUT_NEXT_DROP;
166  goto trace0;
167  }
168 
169  t0 = pool_elt_at_index (pem->sessions,
170  result0.fields.session_index);
171 
172  /* Pop Eth and PPPoE header */
173  vlan0 == 0 ?
174  vlib_buffer_advance(b0, sizeof(*h0)+sizeof(*pppoe0))
175  :
176  vlib_buffer_advance(b0, sizeof(*h0)+sizeof(*vlan0)+sizeof(*pppoe0));
177 
178  next0 = (ppp_proto0==PPP_PROTOCOL_ip4)?
179  PPPOE_INPUT_NEXT_IP4_INPUT
180  : PPPOE_INPUT_NEXT_IP6_INPUT;
181 
182  sw_if_index0 = t0->sw_if_index;
183  len0 = vlib_buffer_length_in_chain (vm, b0);
184  vnet_buffer(b0)->sw_if_index[VLIB_RX] = sw_if_index0;
185 
186  pkts_decapsulated ++;
187  stats_n_packets += 1;
188  stats_n_bytes += len0;
189 
190  /* Batch stats increment on the same pppoe session so counter
191  is not incremented per packet */
192  if (PREDICT_FALSE (sw_if_index0 != stats_sw_if_index))
193  {
194  stats_n_packets -= 1;
195  stats_n_bytes -= len0;
196  if (stats_n_packets)
199  thread_index, stats_sw_if_index,
200  stats_n_packets, stats_n_bytes);
201  stats_n_packets = 1;
202  stats_n_bytes = len0;
203  stats_sw_if_index = sw_if_index0;
204  }
205 
206  trace0:
207  b0->error = error0 ? node->errors[error0] : 0;
208 
209  if (PREDICT_FALSE(b0->flags & VLIB_BUFFER_IS_TRACED))
210  {
211  pppoe_rx_trace_t *tr
212  = vlib_add_trace (vm, node, b0, sizeof (*tr));
213  tr->next_index = next0;
214  tr->error = error0;
215  tr->session_index = result0.fields.session_index;
216  tr->session_id = clib_net_to_host_u32(pppoe0->session_id);
217  }
218 
219  /* get client mac */
220  vlib_buffer_reset(b1);
221  h1 = vlib_buffer_get_current (b1);
222 
223  /* get pppoe header */
224  type1 = clib_net_to_host_u16(h1->type);
225  if(type1 == ETHERNET_TYPE_VLAN){
226  vlan1 = (ethernet_vlan_header_t *)(h1+1);
227  type1 = clib_net_to_host_u16(vlan1->type);
228  pppoe1 = (pppoe_header_t*)(vlan1+1);
229  if( type1 != ETHERNET_TYPE_PPPOE_DISCOVERY && type1 != ETHERNET_TYPE_PPPOE_SESSION ) {
230  error1 = PPPOE_ERROR_BAD_VER_TYPE;
231  next1 = PPPOE_INPUT_NEXT_DROP;
232  goto trace1;
233  }
234  } else {
235  pppoe1 = (pppoe_header_t*)(h1+1);
236  }
237 
238  ppp_proto1 = clib_net_to_host_u16(pppoe1->ppp_proto);
239 
240  /* Manipulate packet 1 */
241  if ((ppp_proto1 != PPP_PROTOCOL_ip4)
242  && (ppp_proto1 != PPP_PROTOCOL_ip6))
243  {
244  vlan1 == 0 ?
245  vlib_buffer_advance(b1, sizeof(*h1))
246  :
247  vlib_buffer_advance(b1, sizeof(*h1)+sizeof(*vlan1));
248  error1 = PPPOE_ERROR_CONTROL_PLANE;
249  next1 = PPPOE_INPUT_NEXT_CP_INPUT;
250  goto trace1;
251  }
252 
253  pppoe_lookup_1 (&pem->session_table, &cached_key, &cached_result,
254  h1->src_address, pppoe1->session_id,
255  &key1, &bucket1, &result1);
256  if (PREDICT_FALSE (result1.fields.session_index == ~0))
257  {
258  error1 = PPPOE_ERROR_NO_SUCH_SESSION;
259  next1 = PPPOE_INPUT_NEXT_DROP;
260  goto trace1;
261  }
262 
263  t1 = pool_elt_at_index (pem->sessions,
264  result1.fields.session_index);
265 
266  /* Pop Eth and PPPoE header */
267  vlan1 == 0 ?
268  vlib_buffer_advance(b1, sizeof(*h1)+sizeof(*pppoe1))
269  :
270  vlib_buffer_advance(b1, sizeof(*h1)+sizeof(*vlan1)+sizeof(*pppoe1));
271 
272  next1 = (ppp_proto1==PPP_PROTOCOL_ip4)?
273  PPPOE_INPUT_NEXT_IP4_INPUT
274  : PPPOE_INPUT_NEXT_IP6_INPUT;
275 
276  sw_if_index1 = t1->sw_if_index;
277  len1 = vlib_buffer_length_in_chain (vm, b1);
278  vnet_buffer(b1)->sw_if_index[VLIB_RX] = sw_if_index1;
279 
280  pkts_decapsulated ++;
281  stats_n_packets += 1;
282  stats_n_bytes += len1;
283 
284  /* Batch stats increment on the same pppoe session so counter
285  is not incremented per packet */
286  if (PREDICT_FALSE (sw_if_index1 != stats_sw_if_index))
287  {
288  stats_n_packets -= 1;
289  stats_n_bytes -= len1;
290  if (stats_n_packets)
293  thread_index, stats_sw_if_index,
294  stats_n_packets, stats_n_bytes);
295  stats_n_packets = 1;
296  stats_n_bytes = len1;
297  stats_sw_if_index = sw_if_index1;
298  }
299 
300  trace1:
301  b1->error = error1 ? node->errors[error1] : 0;
302 
303  if (PREDICT_FALSE(b1->flags & VLIB_BUFFER_IS_TRACED))
304  {
305  pppoe_rx_trace_t *tr
306  = vlib_add_trace (vm, node, b1, sizeof (*tr));
307  tr->next_index = next1;
308  tr->error = error1;
309  tr->session_index = result1.fields.session_index;
310  tr->session_id = clib_net_to_host_u32(pppoe1->session_id);
311  }
312 
314  to_next, n_left_to_next,
315  bi0, bi1, next0, next1);
316  }
317 
318  while (n_left_from > 0 && n_left_to_next > 0)
319  {
320  u32 bi0;
321  vlib_buffer_t * b0;
322  u32 next0;
323  ethernet_header_t *h0;
324  ethernet_vlan_header_t *vlan0 = 0;
325  pppoe_header_t * pppoe0;
326  u16 ppp_proto0 = 0;
327  pppoe_session_t * t0;
328  u32 error0;
329  u32 sw_if_index0, len0;
330  pppoe_entry_key_t key0;
331  pppoe_entry_result_t result0;
332  u32 bucket0;
333  u32 type0;
334 
335  bi0 = from[0];
336  to_next[0] = bi0;
337  from += 1;
338  to_next += 1;
339  n_left_from -= 1;
340  n_left_to_next -= 1;
341 
342  b0 = vlib_get_buffer (vm, bi0);
343  error0 = 0;
344 
345  /* get client mac */
346  vlib_buffer_reset(b0);
347  h0 = vlib_buffer_get_current (b0);
348 
349  /* get pppoe header */
350  type0 = clib_net_to_host_u16(h0->type);
351  if(type0 == ETHERNET_TYPE_VLAN){
352  vlan0 = (ethernet_vlan_header_t *)(h0+1);
353  type0 = clib_net_to_host_u16(vlan0->type);
354  pppoe0 = (pppoe_header_t*)(vlan0+1);
355  if( type0 != ETHERNET_TYPE_PPPOE_DISCOVERY && type0 != ETHERNET_TYPE_PPPOE_SESSION ) {
356  error0 = PPPOE_ERROR_BAD_VER_TYPE;
357  next0 = PPPOE_INPUT_NEXT_DROP;
358  goto trace00;
359  }
360  } else {
361  pppoe0 = (pppoe_header_t*)(h0+1);
362  }
363 
364  ppp_proto0 = clib_net_to_host_u16(pppoe0->ppp_proto);
365 
366  if ((ppp_proto0 != PPP_PROTOCOL_ip4)
367  && (ppp_proto0 != PPP_PROTOCOL_ip6))
368  {
369  vlan0 == 0 ?
370  vlib_buffer_advance(b0, sizeof(*h0))
371  :
372  vlib_buffer_advance(b0, sizeof(*h0)+sizeof(*vlan0));
373  error0 = PPPOE_ERROR_CONTROL_PLANE;
374  next0 = PPPOE_INPUT_NEXT_CP_INPUT;
375  goto trace00;
376  }
377 
378  pppoe_lookup_1 (&pem->session_table, &cached_key, &cached_result,
379  h0->src_address, pppoe0->session_id,
380  &key0, &bucket0, &result0);
381  if (PREDICT_FALSE (result0.fields.session_index == ~0))
382  {
383  error0 = PPPOE_ERROR_NO_SUCH_SESSION;
384  next0 = PPPOE_INPUT_NEXT_DROP;
385  goto trace00;
386  }
387 
388  t0 = pool_elt_at_index (pem->sessions,
389  result0.fields.session_index);
390 
391  /* Pop Eth and PPPoE header */
392  vlan0 == 0 ?
393  vlib_buffer_advance(b0, sizeof(*h0)+sizeof(*pppoe0))
394  :
395  vlib_buffer_advance(b0, sizeof(*h0)+sizeof(*vlan0)+sizeof(*pppoe0));
396 
397  next0 = (ppp_proto0==PPP_PROTOCOL_ip4)?
398  PPPOE_INPUT_NEXT_IP4_INPUT
399  : PPPOE_INPUT_NEXT_IP6_INPUT;
400 
401  sw_if_index0 = t0->sw_if_index;
402  len0 = vlib_buffer_length_in_chain (vm, b0);
403  vnet_buffer(b0)->sw_if_index[VLIB_RX] = sw_if_index0;
404 
405  pkts_decapsulated ++;
406  stats_n_packets += 1;
407  stats_n_bytes += len0;
408 
409  /* Batch stats increment on the same pppoe session so counter
410  is not incremented per packet */
411  if (PREDICT_FALSE (sw_if_index0 != stats_sw_if_index))
412  {
413  stats_n_packets -= 1;
414  stats_n_bytes -= len0;
415  if (stats_n_packets)
418  thread_index, stats_sw_if_index,
419  stats_n_packets, stats_n_bytes);
420  stats_n_packets = 1;
421  stats_n_bytes = len0;
422  stats_sw_if_index = sw_if_index0;
423  }
424 
425  trace00:
426  b0->error = error0 ? node->errors[error0] : 0;
427 
428  if (PREDICT_FALSE(b0->flags & VLIB_BUFFER_IS_TRACED))
429  {
430  pppoe_rx_trace_t *tr
431  = vlib_add_trace (vm, node, b0, sizeof (*tr));
432  tr->next_index = next0;
433  tr->error = error0;
434  tr->session_index = result0.fields.session_index;
435  tr->session_id = clib_net_to_host_u16(pppoe0->session_id);
436  }
438  to_next, n_left_to_next,
439  bi0, next0);
440  }
441 
442  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
443  }
444  /* Do we still need this now that session tx stats is kept? */
446  PPPOE_ERROR_DECAPSULATED,
447  pkts_decapsulated);
448 
449  /* Increment any remaining batch stats */
450  if (stats_n_packets)
451  {
454  thread_index, stats_sw_if_index, stats_n_packets, stats_n_bytes);
455  node->runtime_data[0] = stats_sw_if_index;
456  }
457 
458  return from_frame->n_vectors;
459 }
460 
461 #ifndef CLIB_MARCH_VARIANT
463 #define pppoe_error(n,s) s,
464 #include <pppoe/pppoe_error.def>
465 #undef pppoe_error
466 #undef _
467 };
468 #endif /* CLIB_MARCH_VARIANT */
469 
471  .name = "pppoe-input",
472  /* Takes a vector of packets. */
473  .vector_size = sizeof (u32),
474 
475  .n_errors = PPPOE_N_ERROR,
476  .error_strings = pppoe_error_strings,
477 
478  .n_next_nodes = PPPOE_INPUT_N_NEXT,
479  .next_nodes = {
480 #define _(s,n) [PPPOE_INPUT_NEXT_##s] = n,
482 #undef _
483  },
484 
485  .format_trace = format_pppoe_rx_trace,
486 };
487 
488 /* *INDENT-OFF* */
490 {
491  .arc_name = "device-input",
492  .node_name = "pppoe-input",
493  .runs_before = VNET_FEATURES ("ethernet-input"),
494 };
495 /* *INDENT-ON */
vlib.h
PPPOE_N_ERROR
@ PPPOE_N_ERROR
Definition: pppoe.h:94
im
vnet_interface_main_t * im
Definition: interface_output.c:395
format_pppoe_rx_trace
static u8 * format_pppoe_rx_trace(u8 *s, va_list *args)
Definition: pppoe_decap.c:29
thread_index
u32 thread_index
Definition: nat44_ei_hairpinning.c:492
pppoe_header_t::ppp_proto
u16 ppp_proto
Definition: pppoe.h:43
vlib_prefetch_buffer_header
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
Definition: buffer.h:231
VNET_FEATURE_INIT
VNET_FEATURE_INIT(pppoe_input_node, static)
next_index
nat44_ei_hairpin_src_next_t next_index
Definition: nat44_ei_hairpinning.c:412
vlib_get_buffer
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:111
pppoe_entry_result_t
Definition: pppoe.h:136
ethernet_vlan_header_t
Definition: packet.h:128
pppoe_entry_result_t::fields
struct pppoe_entry_result_t::@766::@768 fields
pool_elt_at_index
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:553
pppoe_rx_trace_t::error
u32 error
Definition: pppoe_decap.c:26
ethernet_header_t::src_address
u8 src_address[6]
Definition: packet.h:56
node
vlib_main_t vlib_node_runtime_t * node
Definition: nat44_ei.c:3047
pppoe_rx_trace_t
Definition: pppoe_decap.c:22
vnet_interface_main_t
Definition: interface.h:989
pppoe_main_t::vnet_main
vnet_main_t * vnet_main
Definition: pppoe.h:177
u16
unsigned short u16
Definition: types.h:57
ethernet_header_t::type
u16 type
Definition: packet.h:59
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
VLIB_RX
@ VLIB_RX
Definition: defs.h:46
from_frame
vlib_main_t vlib_node_runtime_t vlib_frame_t * from_frame
Definition: esp_encrypt.c:1328
vlib_frame_t
Definition: node.h:372
vlib_buffer_length_in_chain
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
Definition: buffer_funcs.h:433
pppoe_error_strings
char * pppoe_error_strings[]
Definition: pppoe_decap.c:462
CLIB_PREFETCH
#define CLIB_PREFETCH(addr, size, type)
Definition: cache.h:80
pppoe_main_t
Definition: pppoe.h:152
vlib_buffer_advance
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
Definition: buffer.h:276
vlib_buffer_t::error
vlib_error_t error
Error code for buffers to be enqueued to error handler.
Definition: buffer.h:145
VLIB_NODE_FN
#define VLIB_NODE_FN(node)
Definition: node.h:202
CLIB_UNUSED
#define CLIB_UNUSED(x)
Definition: clib.h:90
vnet_buffer
#define vnet_buffer(b)
Definition: buffer.h:437
PREDICT_FALSE
#define PREDICT_FALSE(x)
Definition: clib.h:124
vlib_get_thread_index
static_always_inline uword vlib_get_thread_index(void)
Definition: threads.h:208
vlib_frame_vector_args
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Definition: node_funcs.h:301
ethernet_header_t
Definition: packet.h:52
vlib_node_increment_counter
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
Definition: node_funcs.h:1244
pppoe_header_t::session_id
u16 session_id
Definition: pppoe.h:41
pppoe_entry_result_t::raw
u64 raw
Definition: pppoe.h:147
VNET_INTERFACE_COUNTER_RX
@ VNET_INTERFACE_COUNTER_RX
Definition: interface.h:914
CLIB_CACHE_LINE_BYTES
#define CLIB_CACHE_LINE_BYTES
Definition: cache.h:59
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
vnet_interface_main_t::combined_sw_if_counters
vlib_combined_counter_main_t * combined_sw_if_counters
Definition: interface.h:1023
pppoe_lookup_1
static_always_inline void pppoe_lookup_1(BVT(clib_bihash) *table, pppoe_entry_key_t *cached_key, pppoe_entry_result_t *cached_result, u8 *mac0, u16 session_id0, pppoe_entry_key_t *key0, u32 *bucket0, pppoe_entry_result_t *result0)
Definition: pppoe.h:277
pppoe_session_t
Definition: pppoe.h:49
pppoe_rx_trace_t::session_index
u32 session_index
Definition: pppoe_decap.c:24
vnet_main_t
Definition: vnet.h:76
vlib_validate_buffer_enqueue_x1
#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.
Definition: buffer_node.h:224
pppoe_entry_key_t::raw
u64 raw
Definition: pppoe.h:127
format
description fragment has unexpected format
Definition: map.api:433
pppoe_rx_trace_t::next_index
u32 next_index
Definition: pppoe_decap.c:23
vlib_put_next_frame
vlib_put_next_frame(vm, node, next_index, 0)
pppoe_header_t
Definition: pppoe.h:37
u32
unsigned int u32
Definition: types.h:88
PPPOE_INPUT_N_NEXT
@ PPPOE_INPUT_N_NEXT
Definition: pppoe.h:86
packet.h
pppoe_rx_trace_t::session_id
u32 session_id
Definition: pppoe_decap.c:25
pppoe_error.def
vlib_main_t
Definition: main.h:102
vlib_node_t
Definition: node.h:247
foreach_pppoe_input_next
#define foreach_pppoe_input_next
Definition: pppoe.h:75
vlib_add_trace
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
Definition: trace.c:628
VNET_FEATURES
#define VNET_FEATURES(...)
Definition: feature.h:470
u8
unsigned char u8
Definition: types.h:56
vlib_buffer_get_current
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
Definition: buffer.h:257
vlib_buffer_t::data
u8 data[]
Packet data.
Definition: buffer.h:204
ethernet_vlan_header_t::type
u16 type
Definition: packet.h:136
vlib_validate_buffer_enqueue_x2
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
Finish enqueueing two buffers forward in the graph.
Definition: buffer_node.h:70
vlib_node_runtime_t
Definition: node.h:454
vlib_buffer_reset
static void vlib_buffer_reset(vlib_buffer_t *b)
Reset current header & length to state they were in when packet was received.
Definition: buffer.h:305
pppoe_main_t::sessions
pppoe_session_t * sessions
Definition: pppoe.h:155
from
from
Definition: nat44_ei_hairpinning.c:415
vlib_get_next_frame
#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).
Definition: node_funcs.h:395
pppoe_main
pppoe_main_t pppoe_main
Definition: pppoe.c:38
n_left_from
n_left_from
Definition: nat44_ei_hairpinning.c:416
vnet_main_t::interface_main
vnet_interface_main_t interface_main
Definition: vnet.h:81
vlib_increment_combined_counter
vlib_increment_combined_counter(ccm, ti, sw_if_index, n_buffers, n_bytes)
pppoe.h
pppoe_input_node
vlib_node_registration_t pppoe_input_node
(constructor) VLIB_REGISTER_NODE (pppoe_input_node)
Definition: pppoe_decap.c:470
pppoe_entry_key_t
Definition: pppoe.h:113
vlib_buffer_t::flags
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
Definition: buffer.h:133
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111
VLIB_REGISTER_NODE
#define VLIB_REGISTER_NODE(x,...)
Definition: node.h:169
pppoe_session_t::sw_if_index
u32 sw_if_index
Definition: pppoe.h:70