aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-aodv.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2012-08-10 22:55:02 +0000
committerBill Meier <wmeier@newsguy.com>2012-08-10 22:55:02 +0000
commit638d74d43f9baf45dc3641939eec36f801414187 (patch)
tree5bfcabbb83a6e7359cfc302cdc604264560d66a0 /epan/dissectors/packet-aodv.c
parente6ffe7b59b9f36c534d3b2d6cc78b05dfe517f67 (diff)
Use val_to_str_const() where appropriate;
Also (for a few files): - create/use some extended value strings; - remove unneeded #include files; - remove unneeded variable initialization; - re-order fcns slightly so prefs_reg_handoff...() at end, etc svn path=/trunk/; revision=44438
Diffstat (limited to 'epan/dissectors/packet-aodv.c')
-rw-r--r--epan/dissectors/packet-aodv.c130
1 files changed, 65 insertions, 65 deletions
diff --git a/epan/dissectors/packet-aodv.c b/epan/dissectors/packet-aodv.c
index ce660d9beb..81ed8f5b15 100644
--- a/epan/dissectors/packet-aodv.c
+++ b/epan/dissectors/packet-aodv.c
@@ -57,10 +57,10 @@
#define UDP_PORT_AODV 654
/* Message Types */
-#define RREQ 1
-#define RREP 2
-#define RERR 3
-#define RREP_ACK 4
+#define RREQ 1
+#define RREP 2
+#define RERR 3
+#define RREP_ACK 4
#define DRAFT_01_V6_RREQ 16
#define DRAFT_01_V6_RREP 17
#define DRAFT_01_V6_RERR 18
@@ -151,7 +151,7 @@ dissect_aodv_ext(tvbuff_t * tvb, int offset, proto_tree * tree)
{
proto_tree *ext_tree;
proto_item *ti;
- guint8 type, len;
+ guint8 type, len;
if (!tree)
return;
@@ -168,7 +168,7 @@ dissect_aodv_ext(tvbuff_t * tvb, int offset, proto_tree * tree)
proto_tree_add_text(ext_tree, tvb, offset, 1,
"Type: %u (%s)", type,
- val_to_str(type, exttype_vals, "Unknown"));
+ val_to_str_const(type, exttype_vals, "Unknown"));
if (len == 0) {
proto_tree_add_text(ext_tree, tvb, offset + 1, 1,
@@ -203,19 +203,19 @@ static void
dissect_aodv_rreq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aodv_tree,
proto_item *ti, gboolean is_ipv6)
{
- int offset = 1;
- proto_item *tj;
- proto_tree *aodv_flags_tree;
- guint8 flags;
- guint8 hop_count;
- guint32 rreq_id;
- guint32 dest_addr_v4;
- struct e_in6_addr dest_addr_v6;
- guint32 dest_seqno;
- guint32 orig_addr_v4;
- struct e_in6_addr orig_addr_v6;
- guint32 orig_seqno;
- int extlen;
+ int offset = 1;
+ proto_item *tj;
+ proto_tree *aodv_flags_tree;
+ guint8 flags;
+ guint8 hop_count;
+ guint32 rreq_id;
+ guint32 dest_addr_v4;
+ struct e_in6_addr dest_addr_v6;
+ guint32 dest_seqno;
+ guint32 orig_addr_v4;
+ struct e_in6_addr orig_addr_v6;
+ guint32 orig_seqno;
+ int extlen;
flags = tvb_get_guint8(tvb, offset);
if (aodv_tree) {
@@ -332,19 +332,19 @@ static void
dissect_aodv_rrep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aodv_tree,
proto_item *ti, gboolean is_ipv6)
{
- int offset = 1;
- proto_item *tj;
- proto_tree *aodv_flags_tree;
- guint8 flags;
- guint8 prefix_sz;
- guint8 hop_count;
- guint32 dest_addr_v4;
- struct e_in6_addr dest_addr_v6;
- guint32 dest_seqno;
- guint32 orig_addr_v4;
- struct e_in6_addr orig_addr_v6;
- guint32 lifetime;
- int extlen;
+ int offset = 1;
+ proto_item *tj;
+ proto_tree *aodv_flags_tree;
+ guint8 flags;
+ guint8 prefix_sz;
+ guint8 hop_count;
+ guint32 dest_addr_v4;
+ struct e_in6_addr dest_addr_v6;
+ guint32 dest_seqno;
+ guint32 orig_addr_v4;
+ struct e_in6_addr orig_addr_v6;
+ guint32 lifetime;
+ int extlen;
flags = tvb_get_guint8(tvb, offset);
if (aodv_tree) {
@@ -452,13 +452,13 @@ static void
dissect_aodv_rerr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aodv_tree,
gboolean is_ipv6)
{
- int offset = 1;
+ int offset = 1;
proto_item *tj;
proto_tree *aodv_flags_tree;
proto_tree *aodv_unreach_dest_tree;
- guint8 flags;
- guint8 dest_count;
- int i;
+ guint8 flags;
+ guint8 dest_count;
+ int i;
flags = tvb_get_guint8(tvb, offset);
if (aodv_tree) {
@@ -512,17 +512,17 @@ static void
dissect_aodv_draft_01_v6_rreq(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *aodv_tree, proto_item *ti)
{
- int offset = 1;
- proto_item *tj;
- proto_tree *aodv_flags_tree;
- guint8 flags;
- guint8 hop_count;
- guint32 rreq_id;
- guint32 dest_seqno;
- guint32 orig_seqno;
- struct e_in6_addr dest_addr_v6;
- struct e_in6_addr orig_addr_v6;
- int extlen;
+ int offset = 1;
+ proto_item *tj;
+ proto_tree *aodv_flags_tree;
+ guint8 flags;
+ guint8 hop_count;
+ guint32 rreq_id;
+ guint32 dest_seqno;
+ guint32 orig_seqno;
+ struct e_in6_addr dest_addr_v6;
+ struct e_in6_addr orig_addr_v6;
+ int extlen;
flags = tvb_get_guint8(tvb, offset);
if (aodv_tree) {
@@ -615,17 +615,17 @@ static void
dissect_aodv_draft_01_v6_rrep(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *aodv_tree, proto_item *ti)
{
- int offset = 1;
- proto_item *tj;
- proto_tree *aodv_flags_tree;
- guint8 flags;
- guint8 prefix_sz;
- guint8 hop_count;
- guint32 dest_seqno;
- struct e_in6_addr dest_addr_v6;
- struct e_in6_addr orig_addr_v6;
- guint32 lifetime;
- int extlen;
+ int offset = 1;
+ proto_item *tj;
+ proto_tree *aodv_flags_tree;
+ guint8 flags;
+ guint8 prefix_sz;
+ guint8 hop_count;
+ guint32 dest_seqno;
+ struct e_in6_addr dest_addr_v6;
+ struct e_in6_addr orig_addr_v6;
+ guint32 lifetime;
+ int extlen;
flags = tvb_get_guint8(tvb, offset);
if (aodv_tree) {
@@ -708,13 +708,13 @@ static void
dissect_aodv_draft_01_v6_rerr(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *aodv_tree)
{
- int offset = 1;
+ int offset = 1;
proto_item *tj;
proto_tree *aodv_flags_tree;
proto_tree *aodv_unreach_dest_tree;
- guint8 flags;
- guint8 dest_count;
- int i;
+ guint8 flags;
+ guint8 dest_count;
+ int i;
flags = tvb_get_guint8(tvb, offset);
if (aodv_tree) {
@@ -754,10 +754,10 @@ dissect_aodv_draft_01_v6_rerr(tvbuff_t *tvb, packet_info *pinfo,
static int
dissect_aodv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- proto_item *ti = NULL;
+ proto_item *ti = NULL;
proto_tree *aodv_tree = NULL;
- gboolean is_ipv6;
- guint8 type;
+ gboolean is_ipv6;
+ guint8 type;
/* Make entries in Protocol column and Info column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "AODV");