diff options
author | Tetsuya Murakami <tetsuya.mrk@gmail.com> | 2020-03-04 16:27:14 -0800 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-03-21 12:49:12 +0000 |
commit | 9e722bd466383dd53b10d4c1de95ad18db939147 (patch) | |
tree | f870d7ad6b974798ac26a0b1580a67b2f61f12a7 /src/plugins/srv6-mobile/mobile.h | |
parent | 7a6f5a4fee17bd34f70f9eb25a094764be39d81b (diff) |
srv6-mobile: Support GTP4/6.DT and User Plane message mapping
Support the following new features in srv6-mobile.
1. GTP4.DT
2. GTP6.DT
3. User Plane Message encoding based on draft-murakami-dmm-user-plane-message-encoding-01
4. Add SRv6 mobile test cases
Type: feature
Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
Change-Id: I890e5171bf03513d54b4830f01b9dc7f47fe7c48
Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
Diffstat (limited to 'src/plugins/srv6-mobile/mobile.h')
-rw-r--r-- | src/plugins/srv6-mobile/mobile.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/plugins/srv6-mobile/mobile.h b/src/plugins/srv6-mobile/mobile.h index 460cbe17ef1..517e7c8f84c 100644 --- a/src/plugins/srv6-mobile/mobile.h +++ b/src/plugins/srv6-mobile/mobile.h @@ -42,6 +42,11 @@ #define SRV6_GTP6_DT6 2 #define SRV6_GTP6_DT46 3 +#define SRV6_GTP4_UNKNOW 0 +#define SRV6_GTP4_DT4 1 +#define SRV6_GTP4_DT6 2 +#define SRV6_GTP4_DT46 3 + #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ #define BITALIGN2(A,B) A; B #define BITALIGN3(A,B,C) A; B; C @@ -59,6 +64,19 @@ #define SRH_TAG_ERROR_INDICATION 0x0002 #define SRH_TAG_END_MARKER 0x0001 +#define GTPU_RECOVERY_IE_TYPE 0x0e + +#define GTPU_IE_MAX_SIZ 256 +#define SRH_TLV_USER_PLANE_CONTAINER 0x0a /* tentative */ + +/* *INDENT-OFF* */ +typedef struct +{ + u8 type; + u8 restart_counter; +} __attribute__ ((packed)) gtpu_recovery_ie; +/* *INDENT-ON* */ + /* *INDENT-OFF* */ typedef struct { @@ -145,6 +163,17 @@ typedef struct #define GTPU_PT_GTP (1<<4) +/* *INDENT-OFF* */ +typedef struct +{ + u8 type; + u8 length; + u8 value[0]; +} __attribute__ ((packed)) user_plane_sub_tlv_t; +/* *INDENT-ON* */ + +#define USER_PLANE_SUB_TLV_IE 0x01 + typedef struct srv6_end_gtp6_param_s { u8 nhtype; @@ -153,6 +182,24 @@ typedef struct srv6_end_gtp6_param_s u32 sr_prefixlen; } srv6_end_gtp6_param_t; +typedef struct srv6_end_gtp6_dt_param_s +{ + u8 type; + + u32 fib4_index; + u32 fib6_index; + u32 local_fib_index; +} srv6_end_gtp6_dt_param_t; + +typedef struct srv6_t_gtp4_dt_param_s +{ + u8 type; + + u32 fib4_index; + u32 fib6_index; + u32 local_fib_index; +} srv6_t_gtp4_dt_param_t; + typedef struct srv6_end_gtp4_param_s { u8 nhtype; @@ -238,6 +285,30 @@ typedef struct srv6_end_main_v6_decap_di_s extern srv6_end_main_v6_decap_di_t srv6_end_main_v6_decap_di; extern vlib_node_registration_t srv6_end_m_gtp6_d_di; +typedef struct srv6_end_main_v6_dt_s +{ + vlib_main_t *vlib_main; + vnet_main_t *vnet_main; + + u32 end_m_gtp6_dt_node_index; + u32 error_node_index; +} srv6_end_main_v6_dt_t; + +extern srv6_end_main_v6_dt_t srv6_end_main_v6_dt; +extern vlib_node_registration_t srv6_end_m_gtp6_dt; + +typedef struct srv6_t_main_v4_dt_s +{ + vlib_main_t *vlib_main; + vnet_main_t *vnet_main; + + u32 t_m_gtp4_dt_node_index; + u32 error_node_index; +} srv6_t_main_v4_dt_t; + +extern srv6_t_main_v4_dt_t srv6_t_main_v4_dt; +extern vlib_node_registration_t srv6_t_m_gtp4_dt; + #endif /* __included_srv6_end_h__ */ /* |