aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2009-11-19 15:30:06 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2009-11-19 15:30:06 +0000
commit005049bebbd86341066dcdc99541dbcc9b8eedac (patch)
treeb96244019a8c917319025a4451aec294c2066ef1 /epan
parenta1c8cdcc7c1d443fee1a072107889432856f59c8 (diff)
Changed hf_ip_proto to use ipproto_val[].
Removed some unneeded includes. svn path=/trunk/; revision=31017
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-ip.c5
-rw-r--r--epan/ipproto.c4
-rw-r--r--epan/ipproto.h1
3 files changed, 5 insertions, 5 deletions
diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c
index 0ddb403649..d5d07fa962 100644
--- a/epan/dissectors/packet-ip.c
+++ b/epan/dissectors/packet-ip.c
@@ -1474,8 +1474,7 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
iph->ip_p = tvb_get_guint8(tvb, offset + 9);
if (tree) {
- proto_tree_add_uint_format(ip_tree, hf_ip_proto, tvb, offset + 9, 1, iph->ip_p,
- "Protocol: %s (0x%02x)", ipprotostr(iph->ip_p), iph->ip_p);
+ proto_tree_add_item(ip_tree, hf_ip_proto, tvb, offset + 9, 1, FALSE);
}
iph->ip_sum = tvb_get_ntohs(tvb, offset + 10);
@@ -1895,7 +1894,7 @@ proto_register_ip(void)
NULL, HFILL }},
{ &hf_ip_proto,
- { "Protocol", "ip.proto", FT_UINT8, BASE_HEX, NULL, 0x0,
+ { "Protocol", "ip.proto", FT_UINT8, BASE_HEX, VALS(ipproto_val), 0x0,
NULL, HFILL }},
{ &hf_ip_checksum,
diff --git a/epan/ipproto.c b/epan/ipproto.c
index aa49c03a71..289530f088 100644
--- a/epan/ipproto.c
+++ b/epan/ipproto.c
@@ -32,13 +32,13 @@
#include <glib.h>
-#include <epan/ipproto.h>
#include <epan/packet.h>
+#include <epan/ipproto.h>
#include <epan/addr_resolv.h>
#include <epan/dissectors/packet-ip.h>
#include <epan/strutil.h>
-static const value_string ipproto_val[] = {
+const value_string ipproto_val[] = {
#if 0
{ IP_PROTO_IP, "IPv4" },
#endif
diff --git a/epan/ipproto.h b/epan/ipproto.h
index 50ac589e92..f0b7b925a9 100644
--- a/epan/ipproto.h
+++ b/epan/ipproto.h
@@ -190,6 +190,7 @@
#define IP_PROTO_AX4000 173 /* AX/4000 Testblock - non IANA */
#define IP_PROTO_NCS_HEARTBEAT 224 /* Novell NCS Heartbeat - http://support.novell.com/cgi-bin/search/searchtid.cgi?/10071158.htm */
+extern const value_string ipproto_val[];
extern const char *ipprotostr(int proto);
#endif /* ipproto.h */