aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2007-11-15 18:37:50 +0000
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2007-11-15 18:37:50 +0000
commitfe11ad092b95f30c1676b85492f23a73df88c989 (patch)
tree8e38e1308a47032fd84134277d2d231f4baf7d97 /epan
parentd572ee6403945deb12e78d49b134ca15aa5bf946 (diff)
Add a generated lapd.direction field/filter.
svn path=/trunk/; revision=23462
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-lapd.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/epan/dissectors/packet-lapd.c b/epan/dissectors/packet-lapd.c
index 6abc270015..25a8554500 100644
--- a/epan/dissectors/packet-lapd.c
+++ b/epan/dissectors/packet-lapd.c
@@ -46,6 +46,7 @@
*/
static int proto_lapd = -1;
+static int hf_lapd_direction = -1;
static int hf_lapd_address = -1;
static int hf_lapd_sapi = -1;
static int hf_lapd_gsm_sapi = -1;
@@ -91,6 +92,12 @@ static dissector_handle_t tei_handle;
#define LAPD_TEI_SHIFT 1
#define LAPD_EA2 0x0001 /* Second Address Extension bit */
+static const value_string lapd_direction_vals[] = {
+ { P2P_DIR_RECV, "Network->User"},
+ { P2P_DIR_SENT, "User->Network"},
+ { 0, NULL }
+};
+
static const value_string lapd_sapi_vals[] = {
{ LAPD_SAPI_Q931, "Q.931 Call control procedure" },
{ LAPD_SAPI_PM_Q931, "Packet mode Q.931 Call control procedure" },
@@ -215,10 +222,16 @@ dissect_lapd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_RES_DL_DST, dstname);
if (tree) {
+ proto_item *direction_ti;
+
lapd_ti = proto_tree_add_item(tree, proto_lapd, tvb, 0, -1,
FALSE);
lapd_tree = proto_item_add_subtree(lapd_ti, ett_lapd);
+ direction_ti = proto_tree_add_uint(lapd_tree, hf_lapd_direction,
+ tvb, 0, 0, pinfo->p2p_dir);
+ PROTO_ITEM_SET_GENERATED(direction_ti);
+
addr_ti = proto_tree_add_uint(lapd_tree, hf_lapd_address, tvb,
0, 2, address);
addr_tree = proto_item_add_subtree(addr_ti, ett_lapd_address);
@@ -279,6 +292,11 @@ void
proto_register_lapd(void)
{
static hf_register_info hf[] = {
+
+ { &hf_lapd_direction,
+ { "Direction", "lapd.direction", FT_UINT8, BASE_DEC, VALS(lapd_direction_vals), 0x0,
+ "Direction", HFILL }},
+
{ &hf_lapd_address,
{ "Address Field", "lapd.address", FT_UINT16, BASE_HEX, NULL, 0x0,
"Address", HFILL }},