aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/packet-vxlan.c101
-rw-r--r--epan/dissectors/packet-wccp.c2
-rw-r--r--epan/tfs.c1
-rw-r--r--epan/tfs.h1
4 files changed, 44 insertions, 61 deletions
diff --git a/epan/dissectors/packet-vxlan.c b/epan/dissectors/packet-vxlan.c
index d7ea55691f..ddadf99a58 100644
--- a/epan/dissectors/packet-vxlan.c
+++ b/epan/dissectors/packet-vxlan.c
@@ -28,6 +28,7 @@
#include "config.h"
#include <epan/packet.h>
+#include <epan/tfs.h>
#define UDP_PORT_VXLAN 4789
@@ -37,15 +38,12 @@ void proto_reg_handoff_vxlan(void);
static int proto_vxlan = -1;
static int hf_vxlan_flags = -1;
-static int hf_vxlan_flag_b7 = -1;
-static int hf_vxlan_flag_b6 = -1;
-static int hf_vxlan_flag_b5 = -1;
-static int hf_vxlan_flag_b4 = -1;
+static int hf_vxlan_flags_reserved = -1;
+static int hf_vxlan_flag_a = -1;
+static int hf_vxlan_flag_d = -1;
static int hf_vxlan_flag_i = -1;
-static int hf_vxlan_flag_b2 = -1;
-static int hf_vxlan_flag_b1 = -1;
-static int hf_vxlan_flag_b0 = -1;
-static int hf_vxlan_reserved_24 = -1;
+static int hf_vxlan_flag_g = -1;
+static int hf_vxlan_gbp = -1;
static int hf_vxlan_vni = -1;
static int hf_vxlan_reserved_8 = -1;
@@ -53,6 +51,14 @@ static int hf_vxlan_reserved_8 = -1;
static int ett_vxlan = -1;
static int ett_vxlan_flgs = -1;
+static const int *flags_fields[] = {
+ &hf_vxlan_flag_g,
+ &hf_vxlan_flag_d,
+ &hf_vxlan_flag_i,
+ &hf_vxlan_flag_a,
+ &hf_vxlan_flags_reserved,
+ NULL
+ };
static dissector_handle_t eth_handle;
@@ -77,31 +83,24 @@ dissect_vxlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
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
VXLAN Header:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |R|R|R|R|I|R|R|R| Reserved |
+ |G|R|R|R|I|R|R|R|R|D|R|R|A|R|R|R| Group Policy ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| VXLAN Network Identifier (VNI) | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- /* Flags (8 bits) where the I flag MUST be set to 1 for a valid
- * VXLAN Network ID (VNI). The remaining 7 bits (designated "R") are
+ /* Flags (16 bits) where the I flag MUST be set to 1 for a valid
+ * VXLAN Network ID (VNI). The remaining 12 bits (designated "R") are
* reserved fields and MUST be set to zero.
*/
- flg_item = proto_tree_add_item(vxlan_tree, hf_vxlan_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
+ flg_item = proto_tree_add_item(vxlan_tree, hf_vxlan_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
flg_tree = proto_item_add_subtree(flg_item, ett_vxlan_flgs);
- proto_tree_add_item(flg_tree, hf_vxlan_flag_b7, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(flg_tree, hf_vxlan_flag_b6, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(flg_tree, hf_vxlan_flag_b5, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(flg_tree, hf_vxlan_flag_b4, tvb, offset, 1, ENC_BIG_ENDIAN);
-
- proto_tree_add_item(flg_tree, hf_vxlan_flag_i, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(flg_tree, hf_vxlan_flag_b2, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(flg_tree, hf_vxlan_flag_b1, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(flg_tree, hf_vxlan_flag_b0, tvb, offset, 1, ENC_BIG_ENDIAN);
- offset++;
+ proto_tree_add_bitmask(flg_tree, tvb, offset, hf_vxlan_flags,
+ ett_vxlan_flgs, flags_fields, ENC_BIG_ENDIAN);
+ offset+=2;
- proto_tree_add_item(vxlan_tree, hf_vxlan_reserved_24, tvb, offset, 3, ENC_BIG_ENDIAN);
- offset+=3;
+ proto_tree_add_item(vxlan_tree, hf_vxlan_gbp, tvb, offset, 2, ENC_BIG_ENDIAN);
+ offset+=2;
proto_tree_add_item(vxlan_tree, hf_vxlan_vni, tvb, offset, 3, ENC_BIG_ENDIAN);
offset+=3;
@@ -123,61 +122,43 @@ proto_register_vxlan(void)
static hf_register_info hf[] = {
{ &hf_vxlan_flags,
{ "Flags", "vxlan.flags",
- FT_UINT8, BASE_HEX, NULL, 0x00,
+ FT_UINT16, BASE_HEX, NULL, 0x00,
NULL, HFILL
},
},
- { &hf_vxlan_flag_b7,
- { "Reserved(R)", "vxlan.flag_b7",
- FT_BOOLEAN, 8, NULL, 0x80,
- NULL, HFILL,
- },
- },
- { &hf_vxlan_flag_b6,
- { "Reserved(R)", "vxlan.flag_b6",
- FT_BOOLEAN, 8, NULL, 0x40,
+ { &hf_vxlan_flags_reserved,
+ { "Reserved(R)", "vxlan.flags_reserved",
+ FT_BOOLEAN, 16, NULL, 0x77b7,
NULL, HFILL,
},
},
- { &hf_vxlan_flag_b5,
- { "Reserved(R)", "vxlan.flag_b5",
- FT_BOOLEAN, 8, NULL, 0x20,
- NULL, HFILL,
- },
- },
- { &hf_vxlan_flag_b4,
- { "Reserved(R)", "vxlan.flag_b4",
- FT_BOOLEAN, 8, NULL, 0x10,
+ { &hf_vxlan_flag_g,
+ { "GBP Extension", "vxlan.flag_g",
+ FT_BOOLEAN, 16, TFS(&tfs_defined_not_defined), 0x8000,
NULL, HFILL,
},
},
{ &hf_vxlan_flag_i,
- { "VXLAN Network ID(VNI)", "vxlan.flag_i",
- FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
- NULL, HFILL,
- },
- },
- { &hf_vxlan_flag_b2,
- { "Reserved(R)", "vxlan.flag_b2",
- FT_BOOLEAN, 8, NULL, 0x04,
+ { "VXLAN Network ID (VNI)", "vxlan.flag_i",
+ FT_BOOLEAN, 16, NULL, 0x0800,
NULL, HFILL,
},
},
- { &hf_vxlan_flag_b1,
- { "Reserved(R)", "vxlan.flag_b1",
- FT_BOOLEAN, 8, NULL, 0x02,
+ { &hf_vxlan_flag_d,
+ { "Don't Learn", "vxlan.flag_d",
+ FT_BOOLEAN, 16, NULL, 0x0040,
NULL, HFILL,
},
},
- { &hf_vxlan_flag_b0,
- { "Reserved(R)", "vxlan.flag_b0",
- FT_BOOLEAN, 8, NULL, 0x01,
+ { &hf_vxlan_flag_a,
+ { "Policy Applied", "vxlan.flag_a",
+ FT_BOOLEAN, 16, NULL, 0x0008,
NULL, HFILL,
},
},
- { &hf_vxlan_reserved_24,
- { "Reserved", "vxlan.reserved24",
- FT_UINT24, BASE_HEX, NULL, 0x00,
+ { &hf_vxlan_gbp,
+ { "Group Policy ID", "vxlan.gbp",
+ FT_UINT16, BASE_DEC, NULL, 0x00,
NULL, HFILL
},
},
diff --git a/epan/dissectors/packet-wccp.c b/epan/dissectors/packet-wccp.c
index a4b65ace69..61568d3b3d 100644
--- a/epan/dissectors/packet-wccp.c
+++ b/epan/dissectors/packet-wccp.c
@@ -28,6 +28,7 @@
#include <epan/ipproto.h>
#include <epan/expert.h>
#include "packet-wccp.h"
+ #include <epan/tfs.h>
void proto_register_wccp(void);
void proto_reg_handoff_wccp(void);
@@ -290,7 +291,6 @@ static const value_string wccp_version_val[] = {
{ 0, NULL}
};
-const true_false_string tfs_defined_not_defined = { "Defined", "Not defined" };
const true_false_string tfs_src_dest_port = { "Source port", "Destination port" };
const true_false_string tfs_redirect_protocol0 = { "Redirect only protocol 0 (IP)", "Redirect all traffic" };
const true_false_string tfs_historical_current = { "Historical", "Current" };
diff --git a/epan/tfs.c b/epan/tfs.c
index 0c09e85838..56e72ffbe3 100644
--- a/epan/tfs.c
+++ b/epan/tfs.c
@@ -86,4 +86,5 @@ const true_false_string tfs_protocol_sensative_bit_transparent = { "Protocol sen
const true_false_string tfs_full_half = { "Full", "Half" };
const true_false_string tfs_acknowledged_not_acknowledged = { "Acknowledged", "Not Acknowledged" };
const true_false_string tfs_response_request = { "Response", "Request" };
+const true_false_string tfs_defined_not_defined = { "Defined", "Not defined" };
diff --git a/epan/tfs.h b/epan/tfs.h
index 38501170a3..a1e00830bc 100644
--- a/epan/tfs.h
+++ b/epan/tfs.h
@@ -101,6 +101,7 @@ WS_DLL_PUBLIC const true_false_string tfs_protocol_sensative_bit_transparent;
WS_DLL_PUBLIC const true_false_string tfs_full_half;
WS_DLL_PUBLIC const true_false_string tfs_acknowledged_not_acknowledged;
WS_DLL_PUBLIC const true_false_string tfs_response_request;
+WS_DLL_PUBLIC const true_false_string tfs_defined_not_defined;
#ifdef __cplusplus
}