فهرست منبع

fixed flowid and traffic class in ipv6 header

wangyu- 7 سال پیش
والد
کامیت
b78dc6673f
1فایلهای تغییر یافته به همراه11 افزوده شده و 10 حذف شده
  1. 11 10
      network.h

+ 11 - 10
network.h

@@ -33,21 +33,22 @@ extern int g_packet_buf_cnt;
 struct my_ip6hdr
   {
 #if __BYTE_ORDER == __LITTLE_ENDIAN
-    u_int32_t traffic_class_high:4;
-    u_int32_t version:4;
-    u_int32_t traffic_class_low:4;
-    u_int32_t flow_label:20;
+    uint8_t traffic_class_high:4;
+    uint8_t version:4;
+    uint8_t flow_label_high:4;
+    uint8_t traffic_class_low:4;
 #elif __BYTE_ORDER == __BIG_ENDIAN
-    u_int32_t flow_label:20;
-    u_int32_t traffic_class_low:4;
-	u_int32_t version:4;
-    u_int32_t traffic_class_high:4;
+    uint8_t version:4;
+    uint8_t traffic_class_high:4;
+    uint8_t traffic_class_low:4;
+    uint8_t flow_label_high:4;
 #else
 # error	"Please fix this"
 #endif
+    u_int16_t flow_label_low;
     u_int16_t payload_len;
-    unsigned char next_header;
-    unsigned char hop_limit;
+    uint8_t next_header;
+    uint8_t hop_limit;
 
     struct in6_addr src;
     struct in6_addr dst;