diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-10-18 01:27:01 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-10-18 01:27:01 +0000 |
commit | bd128abe648c4834a6921bc46f81254fd9117cfc (patch) | |
tree | 076cdac42ca632681ec3449404bcf0e6d8bdb1e5 /epan/dissectors | |
parent | 431332092de51e3cc40148caefc2e7b7ae49cf4f (diff) |
From Roberto Morro via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6451 :
The patch fixes a bug in the PCEP Objective Function (OF) object tree
visualization (it didn't recognize the object and showed it as "Unknown
object").
Also fixes a small bug.
From me: remove a couple of unnecessary includes.
svn path=/trunk/; revision=39454
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-pcep.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/epan/dissectors/packet-pcep.c b/epan/dissectors/packet-pcep.c index fc94036511..372578e24f 100644 --- a/epan/dissectors/packet-pcep.c +++ b/epan/dissectors/packet-pcep.c @@ -31,10 +31,6 @@ #include "config.h" #endif -#include <stdlib.h> - -#include <glib.h> - #include <epan/packet.h> #include <epan/dissectors/packet-tcp.h> @@ -235,6 +231,7 @@ static gint ett_pcep_obj_close = -1; static gint ett_pcep_obj_path_key = -1; static gint ett_pcep_obj_xro = -1; static gint pcep_xro_flags_f= -1; +static gint ett_pcep_obj_of = -1; static gint pcep_subobj_flags_lpa= -1; static gint pcep_subobj_flags_lpu= -1; static gint pcep_subobj_label_flags_gl= -1; @@ -348,7 +345,7 @@ static const value_string pcep_route_u_obj_vals[] = { static const value_string pcep_notification_types_vals[] = { {NOT_REQ_CANCEL, "Pending Request Cancelled" }, {PCEP_CONGESTION, "PCE Congestion" }, - {0, NULL } + {0, NULL } }; /*Values of Notification value for Notification Type=1*/ @@ -561,6 +558,7 @@ enum pcep_filter_keys{ PCEPF_OBJ_CLOSE, PCEPF_OBJ_PATH_KEY, PCEPF_OBJ_XRO, + PCEPF_OBJ_OF, PCEPF_SUBOBJ, PCEPF_SUBOBJ_IPv4, PCEPF_SUBOBJ_IPv6, @@ -600,6 +598,7 @@ static gint *ett[] = { &ett_pcep_obj_close, &ett_pcep_obj_path_key, &ett_pcep_obj_xro, + &ett_pcep_obj_of, &ett_pcep_obj_unknown }; @@ -647,7 +646,7 @@ dissect_pcep_tlvs(proto_tree *pcep_obj, tvbuff_t *tvb, int offset, gint length, case 4: /* OF TLV */ for (i=0; i<tlv_length/2; i++) proto_tree_add_text(tlv, tvb, offset+4+j+i*2, 2, "OF-Code #%d: %s (%u)", - i+1, val_to_str(tvb_get_ntohs(tvb, offset+4+j+i), pcep_of_vals, "Unknown"), + i+1, val_to_str(tvb_get_ntohs(tvb, offset+4+j+i*2), pcep_of_vals, "Unknown"), tvb_get_ntohs(tvb, offset+4+j+i*2)); break; @@ -2171,6 +2170,11 @@ dissect_pcep_obj_tree(proto_tree *pcep_tree, tvbuff_t *tvb, int len, int offset, pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_xro); break; + case PCEP_OF_OBJ: + pcep_object_item = proto_tree_add_item(pcep_tree, pcep_filter[PCEPF_OBJ_OF], tvb, offset, -1, FALSE); + pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_of); + break; + default: pcep_object_item = proto_tree_add_text(pcep_tree, tvb, offset, -1, "Unknown object (%u)", obj_class); pcep_object_tree = proto_item_add_subtree(pcep_object_item, ett_pcep_obj_unknown); @@ -2563,6 +2567,9 @@ proto_register_pcep(void){ {&pcep_filter[PCEPF_OBJ_XRO], { "EXCLUDE ROUTE object (XRO)", "pcep.obj.xro", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + {&pcep_filter[PCEPF_OBJ_OF], + { "OBJECTIVE FUNCTION object (OF)", "pcep.obj.of", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, /*Subobjects*/ {&pcep_filter[PCEPF_SUBOBJ], |