Fix GTP-U length header field in encoding
[vpp.git] / src / plugins / gtpu / gtpu.h
index 8686197..0520875 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *------------------------------------------------------------------
- * Copyright (c) 2016 Intel and/or its affiliates.
+ * Copyright (c) 2017 Intel and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
@@ -55,13 +55,15 @@ typedef struct
 {
   u8 ver_flags;
   u8 type;
-  u16 length;                  /* length in octets of the payload */
+  u16 length;                  /* length in octets of the data following the fixed part of the header */
   u32 teid;
   u16 sequence;
   u8 pdu_number;
   u8 next_ext_type;
 } gtpu_header_t;
 
+#define GTPU_V1_HDR_LEN   8
+
 #define GTPU_VER_MASK (7<<5)
 #define GTPU_PT_BIT   (1<<4)
 #define GTPU_E_BIT    (1<<2)
@@ -123,6 +125,9 @@ typedef CLIB_PACKED
 
 typedef struct
 {
+  /* Required for pool_get_aligned  */
+  CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
+
   /* Rewrite string */
   u8 *rewrite;
 
@@ -172,7 +177,9 @@ typedef struct
 
 #define foreach_gtpu_input_next        \
 _(DROP, "error-drop")                  \
-_(L2_INPUT, "l2-input")
+_(L2_INPUT, "l2-input")                \
+_(IP4_INPUT,  "ip4-input")             \
+_(IP6_INPUT, "ip6-input" )
 
 typedef enum
 {
@@ -226,7 +233,7 @@ typedef struct
   vnet_main_t *vnet_main;
 } gtpu_main_t;
 
-gtpu_main_t gtpu_main;
+extern gtpu_main_t gtpu_main;
 
 extern vlib_node_registration_t gtpu4_input_node;
 extern vlib_node_registration_t gtpu6_input_node;