aboutsummaryrefslogtreecommitdiffstats
path: root/nsh-plugin/nsh/nsh_packet.h
diff options
context:
space:
mode:
authorHongjun Ni <hongjun.ni@intel.com>2017-09-29 01:03:31 +0800
committerHongjun Ni <hongjun.ni@intel.com>2017-09-29 23:11:36 +0800
commitfda07ec40401b719c7b316d244294a68d4e59684 (patch)
treee426a3c451247b10aa1e54e93421eb7bed1fbf68 /nsh-plugin/nsh/nsh_packet.h
parent9b3c3af8bee2f7c055a7d89d95fbbc577fb0739d (diff)
Add NSH TTL supportv18.01-rc0
Change-Id: Id2f8236cc997d08c53217fc92881b8bbf2c2f429 Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
Diffstat (limited to 'nsh-plugin/nsh/nsh_packet.h')
-rw-r--r--nsh-plugin/nsh/nsh_packet.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/nsh-plugin/nsh/nsh_packet.h b/nsh-plugin/nsh/nsh_packet.h
index 101652a..9d6237a 100644
--- a/nsh-plugin/nsh/nsh_packet.h
+++ b/nsh-plugin/nsh/nsh_packet.h
@@ -22,7 +22,7 @@
* 0 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * |Ver|O|C|R|R|R|R|R|R| Length | MD Type | Next Protocol |
+ * |Ver|O|C| TTL | Length | MD Type | Next Protocol |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
*
@@ -69,8 +69,8 @@
*/
typedef CLIB_PACKED(struct {
- u8 ver_o_c;
- u8 length;
+ u8 ver_o_c; //TTL: high 4 bit
+ u8 length; //TTL: low 2 bit
u8 md_type;
u8 next_protocol;
u32 nsp_nsi; // nsp 24 bits, nsi 8 bits
@@ -104,6 +104,10 @@ typedef CLIB_PACKED(struct {
#define NSH_O_BIT (1<<5)
#define NSH_C_BIT (1<<4)
+#define NSH_TTL_H4_MASK 0xF
+#define NSH_TTL_L2_MASK 0xC0
+#define NSH_LEN_MASK 0x3F
+
/* Network byte order shift / mask */
#define NSH_NSI_MASK 0xFF
#define NSH_NSP_MASK (0x00FFFFFF)