aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-lwres.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-lwres.c')
-rw-r--r--epan/dissectors/packet-lwres.c161
1 files changed, 81 insertions, 80 deletions
diff --git a/epan/dissectors/packet-lwres.c b/epan/dissectors/packet-lwres.c
index 05371c2113..ad700a57eb 100644
--- a/epan/dissectors/packet-lwres.c
+++ b/epan/dissectors/packet-lwres.c
@@ -22,6 +22,8 @@
void proto_register_lwres(void);
void proto_reg_handoff_lwres(void);
+static dissector_handle_t lwres_handle;
+
#define LWRES_LWPACKET_LENGTH (4 * 5 + 2 * 4)
#define LWRES_LWPACKETFLAG_RESPONSE 0x0001U /* if set, pkt is a response */
#define LWRES_LWPACKETVERSION_0 0
@@ -100,79 +102,79 @@ static const value_string result_values[] = {
{ 0, NULL },
};
-static int hf_length = -1;
-static int hf_version = -1;
-static int hf_flags = -1;
-static int hf_serial = -1;
-static int hf_opcode = -1;
-static int hf_result = -1;
-static int hf_recvlen = -1;
-static int hf_authtype = -1;
-static int hf_authlen = -1;
-
-static int hf_rflags = -1;
-static int hf_rdclass = -1;
-static int hf_rdtype = -1;
-static int hf_namelen = -1;
-static int hf_req_name = -1;
-
-static int hf_ttl = -1;
-static int hf_nrdatas = -1;
-static int hf_nsigs = -1;
-static int hf_realnamelen = -1;
-static int hf_realname = -1;
-
-
-static int hf_a_record = -1;
-static int hf_a_rec_len = -1;
-static int hf_srv_prio = -1;
-static int hf_srv_weight = -1;
-static int hf_srv_port = -1;
-static int hf_srv_dname = -1;
-
-static int hf_adn_flags = -1;
-static int hf_adn_addrtype = -1;
-static int hf_adn_namelen = -1;
-static int hf_adn_name = -1;
-
-static int hf_adn_realname = -1;
-static int hf_adn_aliasname = -1;
-
-static int hf_adn_naddrs = -1;
-static int hf_adn_naliases = -1;
-static int hf_adn_family = -1;
-static int hf_adn_addr_len = -1;
-static int hf_adn_addr_addr = -1;
-
-static int hf_ns_dname = -1;
-
-static int ett_lwres = -1;
-static int ett_rdata_req = -1;
-static int ett_rdata_resp = -1;
-static int ett_a_rec = -1;
-static int ett_a_rec_addr = -1;
-static int ett_srv_rec = -1;
-static int ett_srv_rec_item = -1;
-static int ett_adn_request = -1;
-static int ett_adn_resp = -1;
-static int ett_adn_alias = -1;
-static int ett_adn_addr = -1;
-static int ett_nba_request = -1;
-static int ett_nba_resp = -1;
-static int ett_noop = -1;
-
-static int ett_mx_rec = -1;
-static int ett_mx_rec_item = -1;
-
-static int ett_ns_rec = -1;
-static int ett_ns_rec_item = -1;
+static int hf_length;
+static int hf_version;
+static int hf_flags;
+static int hf_serial;
+static int hf_opcode;
+static int hf_result;
+static int hf_recvlen;
+static int hf_authtype;
+static int hf_authlen;
+
+static int hf_rflags;
+static int hf_rdclass;
+static int hf_rdtype;
+static int hf_namelen;
+static int hf_req_name;
+
+static int hf_ttl;
+static int hf_nrdatas;
+static int hf_nsigs;
+static int hf_realnamelen;
+static int hf_realname;
+
+
+static int hf_a_record;
+static int hf_a_rec_len;
+static int hf_srv_prio;
+static int hf_srv_weight;
+static int hf_srv_port;
+static int hf_srv_dname;
+
+static int hf_adn_flags;
+static int hf_adn_addrtype;
+static int hf_adn_namelen;
+static int hf_adn_name;
+
+static int hf_adn_realname;
+static int hf_adn_aliasname;
+
+static int hf_adn_naddrs;
+static int hf_adn_naliases;
+static int hf_adn_family;
+static int hf_adn_addr_len;
+static int hf_adn_addr_addr;
+
+static int hf_ns_dname;
+
+static int ett_lwres;
+static int ett_rdata_req;
+static int ett_rdata_resp;
+static int ett_a_rec;
+static int ett_a_rec_addr;
+static int ett_srv_rec;
+static int ett_srv_rec_item;
+static int ett_adn_request;
+static int ett_adn_resp;
+static int ett_adn_alias;
+static int ett_adn_addr;
+static int ett_nba_request;
+static int ett_nba_resp;
+static int ett_noop;
+
+static int ett_mx_rec;
+static int ett_mx_rec_item;
+
+static int ett_ns_rec;
+static int ett_ns_rec_item;
#define LWRES_UDP_PORT 921 /* Not IANA registered */
/* Define the lwres proto */
-static int proto_lwres = -1;
+static int proto_lwres;
/* Define many many headers for mgcp */
@@ -259,7 +261,7 @@ static void dissect_getnamebyaddr_response(tvbuff_t* tvb, packet_info *pinfo, pr
tvb,
LWRES_LWPACKET_LENGTH + 8,
realnamelen,
- ENC_ASCII|ENC_NA);
+ ENC_ASCII);
offset=LWRES_LWPACKET_LENGTH + 8 + realnamelen;
@@ -285,7 +287,7 @@ static void dissect_getnamebyaddr_response(tvbuff_t* tvb, packet_info *pinfo, pr
tvb,
offset + 2,
aliaslen,
- ENC_ASCII|ENC_NA);
+ ENC_ASCII);
offset+=(2 + aliaslen + 1);
}
@@ -334,7 +336,7 @@ static void dissect_getaddrsbyname_request(tvbuff_t* tvb, proto_tree* lwres_tree
tvb,
LWRES_LWPACKET_LENGTH+10,
namelen,
- ENC_ASCII|ENC_NA);
+ ENC_ASCII);
}
@@ -377,7 +379,7 @@ static void dissect_getaddrsbyname_response(tvbuff_t* tvb, packet_info *pinfo, p
LWRES_LWPACKET_LENGTH + 8, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(adn_resp_tree, hf_adn_realname, tvb,
- LWRES_LWPACKET_LENGTH + 10, realnamelen, ENC_ASCII|ENC_NA);
+ LWRES_LWPACKET_LENGTH + 10, realnamelen, ENC_ASCII);
offset = LWRES_LWPACKET_LENGTH + 10 + realnamelen + 1;
@@ -395,7 +397,7 @@ static void dissect_getaddrsbyname_response(tvbuff_t* tvb, packet_info *pinfo, p
offset, 2, aliaslen);
proto_tree_add_item(alias_tree, hf_adn_aliasname, tvb,
- offset + 2, aliaslen, ENC_ASCII|ENC_NA);
+ offset + 2, aliaslen, ENC_ASCII);
offset+=(2 + aliaslen + 1);
}
@@ -665,7 +667,7 @@ static void dissect_rdata_request(tvbuff_t* tvb, proto_tree* lwres_tree)
tvb,
LWRES_LWPACKET_LENGTH+10,
namelen,
- ENC_ASCII|ENC_NA);
+ ENC_ASCII);
}
@@ -741,7 +743,7 @@ static void dissect_rdata_response(tvbuff_t* tvb, packet_info *pinfo, proto_tree
tvb,
LWRES_LWPACKET_LENGTH+18,
realnamelen,
- ENC_ASCII|ENC_NA);
+ ENC_ASCII);
switch(rdtype)
{
@@ -1043,11 +1045,11 @@ proto_register_lwres(void)
"lwres srv weight", HFILL }},
{ &hf_srv_port,
- { "Port" , "lwres.srv.port", FT_UINT16, BASE_DEC, NULL, 0x0,
+ { "Port", "lwres.srv.port", FT_UINT16, BASE_DEC, NULL, 0x0,
"lwres srv port", HFILL }},
{ &hf_srv_dname,
- { "DNAME" , "lwres.srv.dname", FT_STRING, BASE_NONE, NULL, 0x0,
+ { "DNAME", "lwres.srv.dname", FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
{ &hf_adn_flags,
@@ -1095,7 +1097,7 @@ proto_register_lwres(void)
"lwres adn addr addr", HFILL }},
{ &hf_ns_dname,
- { "Name" , "lwres.ns.dname", FT_STRING, BASE_NONE, NULL, 0x0,
+ { "Name", "lwres.ns.dname", FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
/* Add more fields here */
@@ -1126,15 +1128,14 @@ proto_register_lwres(void)
proto_register_field_array(proto_lwres, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+
+ lwres_handle = register_dissector("lwres", dissect_lwres, proto_lwres);
}
/* The registration hand-off routine */
void
proto_reg_handoff_lwres(void)
{
- dissector_handle_t lwres_handle;
-
- lwres_handle = create_dissector_handle(dissect_lwres, proto_lwres);
dissector_add_uint_with_preference("udp.port", LWRES_UDP_PORT, lwres_handle);
}