aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ppp.c
diff options
context:
space:
mode:
authormartinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7>2007-11-17 22:08:27 +0000
committermartinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7>2007-11-17 22:08:27 +0000
commiteab5fb560fc72e27532dd896059f363c06c542d6 (patch)
tree53bb00aad87f7eb1945ae27fb7116e7223c6ab54 /epan/dissectors/packet-ppp.c
parent4a4fc04e65ab21c9357dfb01c2a94ba5b7aa9034 (diff)
Add ppp.direction field.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23481 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-ppp.c')
-rw-r--r--epan/dissectors/packet-ppp.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/epan/dissectors/packet-ppp.c b/epan/dissectors/packet-ppp.c
index f20c96ddf5..9487a70a23 100644
--- a/epan/dissectors/packet-ppp.c
+++ b/epan/dissectors/packet-ppp.c
@@ -51,6 +51,7 @@
#define ppp_min(a, b) ((a<b) ? a : b)
static int proto_ppp = -1;
+static int hf_ppp_direction = -1;
static int hf_ppp_address = -1;
static int hf_ppp_control = -1;
static int hf_ppp_protocol = -1;
@@ -206,6 +207,12 @@ static dissector_handle_t chdlc_handle;
static dissector_handle_t data_handle;
static dissector_handle_t eth_withfcs_handle;
+static const value_string ppp_direction_vals[] = {
+ { P2P_DIR_RECV, "DCE->DTE"},
+ { P2P_DIR_SENT, "DTE->DCE"},
+ { 2, "N/A"},
+ { 0, NULL }
+};
/* options */
static gint ppp_fcs_decode = 0; /* 0 = No FCS, 1 = 16 bit FCS, 2 = 32 bit FCS */
@@ -2778,6 +2785,13 @@ dissect_ppp_common( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int proto_len;
tvbuff_t *next_tvb;
+ /* Make direction information filterable */
+ if (tree) {
+ proto_item *direction_ti = proto_tree_add_uint(tree, hf_ppp_direction,
+ tvb, 0, 0, pinfo->p2p_dir);
+ PROTO_ITEM_SET_GENERATED(direction_ti);
+ }
+
ppp_prot = tvb_get_guint8(tvb, 0);
if (ppp_prot & PFC_BIT) {
/* Compressed protocol field - just the byte we fetched. */
@@ -3999,6 +4013,10 @@ void
proto_register_ppp(void)
{
static hf_register_info hf[] = {
+ { &hf_ppp_direction,
+ { "Direction", "ppp.direction", FT_UINT8, BASE_DEC,
+ VALS(ppp_direction_vals), 0x0, "PPP direction", HFILL }},
+
{ &hf_ppp_address,
{ "Address", "ppp.address", FT_UINT8, BASE_HEX,
NULL, 0x0, "", HFILL }},