Minor cleanup:
- Initialize a few static global variables; - Remove two unnecessary calls to g_hash_table_foreach_remove; - Do whitespace cleanup and use consistent indentation; - Fix a few typos and fix up several comments. svn path=/trunk/; revision=35183
This commit is contained in:
parent
6003c15d6f
commit
62e44e3f66
File diff suppressed because it is too large
Load Diff
|
@ -111,16 +111,16 @@ static int hf_fw1_trailer = -1;
|
|||
/* Initialize the subtree pointers */
|
||||
static gint ett_fw1 = -1;
|
||||
|
||||
#define ETH_HEADER_SIZE 14
|
||||
#define ETH_HEADER_SIZE 14
|
||||
|
||||
#define MAX_INTERFACES 20
|
||||
static char *p_interfaces[MAX_INTERFACES];
|
||||
static int interface_anzahl=0;
|
||||
#define MAX_INTERFACES 20
|
||||
static char *p_interfaces[MAX_INTERFACES];
|
||||
static int interface_anzahl=0;
|
||||
|
||||
static void
|
||||
fw1_init(void)
|
||||
{
|
||||
int i;
|
||||
int i;
|
||||
|
||||
for (i=0; i<interface_anzahl; i++) {
|
||||
g_free(p_interfaces[i]);
|
||||
|
@ -134,15 +134,15 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
/* Set up structures needed to add the protocol subtree and manage it */
|
||||
proto_item *ti;
|
||||
proto_tree *volatile fh_tree = NULL;
|
||||
char direction;
|
||||
char chain;
|
||||
char *interface_name;
|
||||
guint32 iface_len = 10;
|
||||
guint16 etype;
|
||||
emem_strbuf_t *header;
|
||||
int i;
|
||||
gboolean found;
|
||||
static const char fw1_header[] = "FW1 Monitor";
|
||||
char direction;
|
||||
char chain;
|
||||
char *interface_name;
|
||||
guint32 iface_len = 10;
|
||||
guint16 etype;
|
||||
emem_strbuf_t *header;
|
||||
int i;
|
||||
gboolean found;
|
||||
static const char fw1_header[] = "FW1 Monitor";
|
||||
|
||||
header = ep_strbuf_new_label(fw1_header);
|
||||
|
||||
|
@ -157,12 +157,12 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
direction = tvb_get_guint8(tvb, 0);
|
||||
|
||||
if (!fw1_iflist_with_chain)
|
||||
chain = ' ';
|
||||
chain = ' ';
|
||||
else
|
||||
chain = tvb_get_guint8(tvb, 1);
|
||||
chain = tvb_get_guint8(tvb, 1);
|
||||
|
||||
if (fw1_with_uuid)
|
||||
iface_len = 6;
|
||||
iface_len = 6;
|
||||
|
||||
interface_name=ep_alloc(iface_len+1);
|
||||
tvb_get_nstringz0(tvb, 2, iface_len+1, interface_name);
|
||||
|
@ -183,15 +183,15 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
/* display all interfaces always in the same order */
|
||||
for (i=0; i<interface_anzahl; i++) {
|
||||
if ( strcmp(p_interfaces[i], interface_name) == 0 ) {
|
||||
ep_strbuf_append_printf(header, " %c%c %s %c%c",
|
||||
direction == 'i' ? 'i' : (direction == 'O' ? 'O' : ' '),
|
||||
(direction == 'i' || direction == 'O') ? chain : ' ',
|
||||
p_interfaces[i],
|
||||
direction == 'I' ? 'I' : (direction == 'o' ? 'o' : ' '),
|
||||
(direction == 'I' || direction == 'o') ? chain : ' '
|
||||
);
|
||||
ep_strbuf_append_printf(header, " %c%c %s %c%c",
|
||||
direction == 'i' ? 'i' : (direction == 'O' ? 'O' : ' '),
|
||||
(direction == 'i' || direction == 'O') ? chain : ' ',
|
||||
p_interfaces[i],
|
||||
direction == 'I' ? 'I' : (direction == 'o' ? 'o' : ' '),
|
||||
(direction == 'I' || direction == 'o') ? chain : ' '
|
||||
);
|
||||
} else {
|
||||
ep_strbuf_append_printf(header, " %s ", p_interfaces[i]);
|
||||
ep_strbuf_append_printf(header, " %s ", p_interfaces[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -227,28 +227,29 @@ void
|
|||
proto_register_fw1(void)
|
||||
{
|
||||
static hf_register_info hf[] = {
|
||||
{ &hf_fw1_direction,
|
||||
{ "Direction", "fw1.direction", FT_STRING, BASE_NONE, NULL, 0x0,
|
||||
NULL, HFILL }},
|
||||
{ &hf_fw1_chain,
|
||||
{ "Chain Position", "fw1.chain", FT_STRING, BASE_NONE, NULL, 0x0,
|
||||
NULL, HFILL }},
|
||||
{ &hf_fw1_interface,
|
||||
{ "Interface", "fw1.interface", FT_STRING, BASE_NONE, NULL, 0x0,
|
||||
NULL, HFILL }},
|
||||
{ &hf_fw1_uuid,
|
||||
{ "UUID", "fw1.uuid", FT_UINT32, BASE_DEC, NULL, 0x0,
|
||||
NULL, HFILL }},
|
||||
/* registered here but handled in ethertype.c */
|
||||
{ &hf_fw1_type,
|
||||
{ "Type", "fw1.type", FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0,
|
||||
NULL, HFILL }},
|
||||
{ &hf_fw1_direction,
|
||||
{ "Direction", "fw1.direction", FT_STRING, BASE_NONE, NULL, 0x0,
|
||||
NULL, HFILL }},
|
||||
{ &hf_fw1_chain,
|
||||
{ "Chain Position", "fw1.chain", FT_STRING, BASE_NONE, NULL, 0x0,
|
||||
NULL, HFILL }},
|
||||
{ &hf_fw1_interface,
|
||||
{ "Interface", "fw1.interface", FT_STRING, BASE_NONE, NULL, 0x0,
|
||||
NULL, HFILL }},
|
||||
{ &hf_fw1_uuid,
|
||||
{ "UUID", "fw1.uuid", FT_UINT32, BASE_DEC, NULL, 0x0,
|
||||
NULL, HFILL }},
|
||||
/* registered here but handled in ethertype.c */
|
||||
{ &hf_fw1_type,
|
||||
{ "Type", "fw1.type", FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0,
|
||||
NULL, HFILL }},
|
||||
};
|
||||
/* Setup protocol subtree array */
|
||||
static gint *ett[] = {
|
||||
&ett_fw1,
|
||||
&ett_fw1,
|
||||
};
|
||||
module_t *fw1_module;
|
||||
int i;
|
||||
|
||||
/* Register the protocol name and description */
|
||||
proto_fw1 = proto_register_protocol("Checkpoint FW-1", "FW-1", "fw1");
|
||||
|
@ -259,19 +260,22 @@ proto_register_fw1(void)
|
|||
/* Register configuration preferences */
|
||||
fw1_module = prefs_register_protocol(proto_fw1, NULL);
|
||||
prefs_register_bool_preference(fw1_module, "summary_in_tree",
|
||||
"Show FireWall-1 summary in protocol tree",
|
||||
"Whether the FireWall-1 summary line should be shown in the protocol tree",
|
||||
&fw1_summary_in_tree);
|
||||
"Show FireWall-1 summary in protocol tree",
|
||||
"Whether the FireWall-1 summary line should be shown in the protocol tree",
|
||||
&fw1_summary_in_tree);
|
||||
prefs_register_bool_preference(fw1_module, "with_uuid",
|
||||
"Monitor file includes UUID",
|
||||
"Whether the Firewall-1 monitor file includes UUID information",
|
||||
&fw1_with_uuid);
|
||||
"Monitor file includes UUID",
|
||||
"Whether the Firewall-1 monitor file includes UUID information",
|
||||
&fw1_with_uuid);
|
||||
prefs_register_bool_preference(fw1_module, "iflist_with_chain",
|
||||
"Interface list includes chain position",
|
||||
"Whether the interface list includes the chain position",
|
||||
&fw1_iflist_with_chain);
|
||||
"Interface list includes chain position",
|
||||
"Whether the interface list includes the chain position",
|
||||
&fw1_iflist_with_chain);
|
||||
|
||||
register_dissector("fw1", dissect_fw1, proto_fw1);
|
||||
|
||||
for (i=0; i<interface_anzahl; i++) {
|
||||
p_interfaces[i] = NULL;
|
||||
}
|
||||
register_init_routine(fw1_init);
|
||||
}
|
||||
|
|
|
@ -398,10 +398,10 @@ static const value_string message_type[] = {
|
|||
{GTP_MSG_NODE_ALIVE_RESP, "Node alive response"},
|
||||
{GTP_MSG_REDIR_REQ, "Redirection request"},
|
||||
{GTP_MSG_REDIR_RESP, "Redirection response"},
|
||||
/*
|
||||
* 8-15 For future use. Shall not be sent. If received,
|
||||
* shall be treated as an Unknown message.
|
||||
*/
|
||||
/*
|
||||
* 8-15 For future use. Shall not be sent. If received,
|
||||
* shall be treated as an Unknown message.
|
||||
*/
|
||||
#if 0
|
||||
{ 8, "Unknown message(For future use)"},
|
||||
{ 9, "Unknown message(For future use)"},
|
||||
|
@ -412,7 +412,7 @@ static const value_string message_type[] = {
|
|||
{ 14, "Unknown message(For future use)"},
|
||||
{ 15, "Unknown message(For future use)"},
|
||||
#endif
|
||||
{GTP_MSG_CREATE_PDP_REQ, "Create PDP context request"},
|
||||
{GTP_MSG_CREATE_PDP_REQ, "Create PDP context request"},
|
||||
{GTP_MSG_CREATE_PDP_RESP, "Create PDP context response"},
|
||||
{GTP_MSG_UPDATE_PDP_REQ, "Update PDP context request"},
|
||||
{GTP_MSG_UPDATE_PDP_RESP, "Update PDP context response"},
|
||||
|
@ -434,9 +434,9 @@ static const value_string message_type[] = {
|
|||
{GTP_MSG_FAIL_REP_RESP, "Failure report response"},
|
||||
{GTP_MSG_MS_PRESENT_REQ, "Note MS GPRS present request"},
|
||||
{GTP_MSG_MS_PRESENT_RESP, "Note MS GPRS present response"},
|
||||
/* 38-47 For future use. Shall not be sent. If received,
|
||||
* shall be treated as an Unknown message.
|
||||
*/
|
||||
/* 38-47 For future use. Shall not be sent. If received,
|
||||
* shall be treated as an Unknown message.
|
||||
*/
|
||||
#if 0
|
||||
{ 38, "Unknown message(For future use)"},
|
||||
{ 39, "Unknown message(For future use)"},
|
||||
|
@ -462,9 +462,9 @@ static const value_string message_type[] = {
|
|||
{GTP_MSG_FORW_SRNS_CNTXT, "Forward SRNS context"},
|
||||
{GTP_MSG_FORW_RELOC_ACK, "Forward relocation complete acknowledge"},
|
||||
{GTP_MSG_FORW_SRNS_CNTXT_ACK, "Forward SRNS context acknowledge"},
|
||||
/* 61-69 For future use. Shall not be sent. If received,
|
||||
* shall be treated as an Unknown message.
|
||||
*/
|
||||
/* 61-69 For future use. Shall not be sent. If received,
|
||||
* shall be treated as an Unknown message.
|
||||
*/
|
||||
#if 0
|
||||
{ 61, "Unknown message(For future use)"},
|
||||
{ 62, "Unknown message(For future use)"},
|
||||
|
@ -477,9 +477,9 @@ static const value_string message_type[] = {
|
|||
{ 69, "Unknown message(For future use)"},
|
||||
#endif
|
||||
{GTP_MSG_RAN_INFO_RELAY, "RAN Information Relay"},
|
||||
/* 71-95 For future use. Shall not be sent. If received,
|
||||
* shall be treated as an Unknown message.
|
||||
*/
|
||||
/* 71-95 For future use. Shall not be sent. If received,
|
||||
* shall be treated as an Unknown message.
|
||||
*/
|
||||
#if 0
|
||||
{ 71, "Unknown message(For future use)"},
|
||||
{ 72, "Unknown message(For future use)"},
|
||||
|
@ -517,9 +517,9 @@ static const value_string message_type[] = {
|
|||
{GTP_UPD_MBMS_CNTXT_RES, "Update MBMS Context Response"},
|
||||
{GTP_DEL_MBMS_CNTXT_REQ, "Delete MBMS Context Request"},
|
||||
{GTP_DEL_MBMS_CNTXT_RES, "Delete MBMS Context Response"},
|
||||
/* 106 - 111 For future use. Shall not be sent. If received,
|
||||
* shall be treated as an Unknown message.
|
||||
*/
|
||||
/* 106 - 111 For future use. Shall not be sent. If received,
|
||||
* shall be treated as an Unknown message.
|
||||
*/
|
||||
{GTP_MBMS_REG_REQ, "MBMS Registration Request"},
|
||||
{GTP_MBMS_REG_RES, "MBMS Registration Response"},
|
||||
{GTP_MBMS_DE_REG_REQ, "MBMS De-Registration Request"},
|
||||
|
@ -536,13 +536,13 @@ static const value_string message_type[] = {
|
|||
{GTP_MS_INFO_CNG_NOT_REQ, "MS Info Change Notification Request"},
|
||||
{GTP_MS_INFO_CNG_NOT_RES, "MS Info Change Notification Response"},
|
||||
/* 130-239 For future use. Shall not be sent. If received,
|
||||
* shall be treated as an Unknown message.
|
||||
*/
|
||||
* shall be treated as an Unknown message.
|
||||
*/
|
||||
{GTP_MSG_DATA_TRANSF_REQ, "Data record transfer request"},
|
||||
{GTP_MSG_DATA_TRANSF_RESP, "Data record transfer response"},
|
||||
/* 242-253 For future use. Shall not be sent. If received,
|
||||
* shall be treated as an Unknown message.
|
||||
*/
|
||||
/* 242-253 For future use. Shall not be sent. If received,
|
||||
* shall be treated as an Unknown message.
|
||||
*/
|
||||
{GTP_MSG_END_MARKER, "End Marker"},
|
||||
{GTP_MSG_TPDU, "T-PDU"},
|
||||
{0, NULL}
|
||||
|
@ -887,26 +887,26 @@ static const value_string cause_type[] = {
|
|||
{ 3, "No identity needed"},
|
||||
{ 4, "MS refuses"},
|
||||
{ 5, "MS is not GPRS responding"},
|
||||
/* For future use 6-48 */
|
||||
/* Cause values reserved for GPRS charging
|
||||
* protocol use (see GTP' in 3GPP TS 32.295 [33])
|
||||
* 49-63
|
||||
*/
|
||||
/* For future use 6-48 */
|
||||
/* Cause values reserved for GPRS charging
|
||||
* protocol use (see GTP' in 3GPP TS 32.295 [33])
|
||||
* 49-63
|
||||
*/
|
||||
{ 59, "System failure"}, /* charging */
|
||||
{ 60, "The transmit buffers are becoming full"}, /* charging */
|
||||
{ 61, "The receive buffers are becoming full"}, /* charging */
|
||||
{ 62, "Another node is about to go down"}, /* charging */
|
||||
{ 63, "This node is about to go down"}, /* charging */
|
||||
/* For future use 64-127 */
|
||||
/* For future use 64-127 */
|
||||
{128, "Request accepted"},
|
||||
{129, "New PDP type due to network preference"},
|
||||
{130, "New PDP type due to single address bearer only"},
|
||||
/* For future use 131-176 */
|
||||
/* Cause values reserved for GPRS charging
|
||||
* protocol use (see GTP' in 3GPP TS 32.295 [33])
|
||||
* 177-191
|
||||
*/
|
||||
{192, "Non-existent"},
|
||||
/* For future use 131-176 */
|
||||
/* Cause values reserved for GPRS charging
|
||||
* protocol use (see GTP' in 3GPP TS 32.295 [33])
|
||||
* 177-191
|
||||
*/
|
||||
{192, "Non-existent"},
|
||||
{193, "Invalid message format"},
|
||||
{194, "IMSI not known"},
|
||||
{195, "MS is GPRS detached"},
|
||||
|
@ -943,11 +943,11 @@ static const value_string cause_type[] = {
|
|||
{226, "MBMS Bearer Context Superseded"},
|
||||
{227, "Bearer Control Mode violation"},
|
||||
{228, "Collision with network initiated request"},
|
||||
/* For future use 229-240 */
|
||||
/* Cause values reserved for GPRS charging
|
||||
* protocol use (see GTP' in 3GPP TS 32.295 [33])
|
||||
* 241-255
|
||||
*/
|
||||
/* For future use 229-240 */
|
||||
/* Cause values reserved for GPRS charging
|
||||
* protocol use (see GTP' in 3GPP TS 32.295 [33])
|
||||
* 241-255
|
||||
*/
|
||||
{252, "Request related to possibly duplicated packets already fulfilled"}, /* charging */
|
||||
{253, "Request already fulfilled"}, /* charging */
|
||||
{254, "Sequence numbers of released/cancelled packets IE incorrect"}, /* charging */
|
||||
|
@ -2738,7 +2738,7 @@ typedef struct gtp_conv_info_t {
|
|||
GHashTable *matched;
|
||||
} gtp_conv_info_t;
|
||||
|
||||
static gtp_conv_info_t *gtp_info_items;
|
||||
static gtp_conv_info_t *gtp_info_items = NULL;
|
||||
|
||||
static guint gtp_sn_hash(gconstpointer k)
|
||||
{
|
||||
|
@ -6476,18 +6476,18 @@ static void dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree *
|
|||
tf = proto_tree_add_uint(gtp_tree, hf_gtp_flags, tvb, 0, 1, gtp_hdr.flags);
|
||||
flags_tree = proto_item_add_subtree(tf, ett_gtp_flags);
|
||||
|
||||
if(gtp_prime==0){
|
||||
proto_tree_add_uint(flags_tree, hf_gtp_flags_ver, tvb, 0, 1, gtp_hdr.flags);
|
||||
}else{
|
||||
proto_tree_add_uint(flags_tree, hf_gtp_prime_flags_ver, tvb, 0, 1, gtp_hdr.flags);
|
||||
}
|
||||
if(gtp_prime==0){
|
||||
proto_tree_add_uint(flags_tree, hf_gtp_flags_ver, tvb, 0, 1, gtp_hdr.flags);
|
||||
}else{
|
||||
proto_tree_add_uint(flags_tree, hf_gtp_prime_flags_ver, tvb, 0, 1, gtp_hdr.flags);
|
||||
}
|
||||
|
||||
proto_tree_add_uint(flags_tree, hf_gtp_flags_pt, tvb, 0, 1, gtp_hdr.flags);
|
||||
|
||||
if((gtp_prime==1)||(gtp_version==0)){
|
||||
proto_tree_add_uint(flags_tree, hf_gtp_flags_spare1, tvb, 0, 1, gtp_hdr.flags);
|
||||
proto_tree_add_boolean(flags_tree, hf_gtp_flags_snn, tvb, 0, 1, gtp_hdr.flags);
|
||||
}else{
|
||||
}else{
|
||||
proto_tree_add_uint(flags_tree, hf_gtp_flags_spare2, tvb, 0, 1, gtp_hdr.flags);
|
||||
proto_tree_add_boolean(flags_tree, hf_gtp_flags_e, tvb, 0, 1, gtp_hdr.flags);
|
||||
proto_tree_add_boolean(flags_tree, hf_gtp_flags_s, tvb, 0, 1, gtp_hdr.flags);
|
||||
|
@ -6690,31 +6690,31 @@ static void dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree *
|
|||
static void dissect_gtpprim(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
|
||||
{
|
||||
|
||||
dissect_gtp_common(tvb, pinfo, tree);
|
||||
dissect_gtp_common(tvb, pinfo, tree);
|
||||
}
|
||||
|
||||
static void dissect_gtp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
|
||||
{
|
||||
guint8 version;
|
||||
/*
|
||||
* If this is GTPv2-C call the gtpv2 dissector if present
|
||||
* Should this be moved to after the conversation stuff to retain that functionality for GTPv2 ???
|
||||
*/
|
||||
version = tvb_get_guint8(tvb,0)>>5;
|
||||
if (version==2) {
|
||||
/* GTPv2-C 3GPP TS 29.274 */
|
||||
if (gtpv2_handle) {
|
||||
call_dissector(gtpv2_handle, tvb, pinfo, tree);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(version>2){
|
||||
proto_tree_add_text(tree, tvb, 0, -1, "No WS dissector for GTP version %u %s", version,
|
||||
val_to_str_const(version, ver_types, "Unknown"));
|
||||
return;
|
||||
guint8 version;
|
||||
/*
|
||||
* If this is GTPv2-C call the gtpv2 dissector if present
|
||||
* Should this be moved to after the conversation stuff to retain that functionality for GTPv2 ???
|
||||
*/
|
||||
version = tvb_get_guint8(tvb,0)>>5;
|
||||
if (version==2) {
|
||||
/* GTPv2-C 3GPP TS 29.274 */
|
||||
if (gtpv2_handle) {
|
||||
call_dissector(gtpv2_handle, tvb, pinfo, tree);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(version>2){
|
||||
proto_tree_add_text(tree, tvb, 0, -1, "No WS dissector for GTP version %u %s", version,
|
||||
val_to_str_const(version, ver_types, "Unknown"));
|
||||
return;
|
||||
}
|
||||
|
||||
dissect_gtp_common(tvb, pinfo, tree);
|
||||
dissect_gtp_common(tvb, pinfo, tree);
|
||||
|
||||
}
|
||||
|
||||
|
@ -6781,7 +6781,7 @@ void proto_register_gtp(void)
|
|||
{"Version", "gtp.prim.flags.version",
|
||||
FT_UINT8, BASE_DEC,NULL, GTP_VER_MASK,
|
||||
"GTP' Version", HFILL}
|
||||
},
|
||||
},
|
||||
{&hf_gtp_flags_pt,
|
||||
{"Protocol type", "gtp.flags.payload",
|
||||
FT_UINT8, BASE_DEC, VALS(pt_types), GTP_PT_MASK,
|
||||
|
@ -7218,7 +7218,7 @@ void proto_reg_handoff_gtp(void)
|
|||
|
||||
if (!Initialized) {
|
||||
gtp_handle = find_dissector("gtp");
|
||||
gtp_prim_handle = find_dissector("gtpprim");
|
||||
gtp_prim_handle = find_dissector("gtpprim");
|
||||
ppp_subdissector_table = find_dissector_table("ppp.protocol");
|
||||
|
||||
radius_register_avp_dissector(VENDOR_THE3GPP, 5, dissect_radius_qos_umts);
|
||||
|
|
|
@ -4640,9 +4640,9 @@ dissect_mmie(proto_tree *tree, tvbuff_t *tvb, int offset, guint32 tag_len)
|
|||
|
||||
proto_tree_add_item(tree, hf_ieee80211_tag_mmie_keyid, tvb, offset, 2, TRUE);
|
||||
proto_tree_add_item(tree, hf_ieee80211_tag_mmie_ipn, tvb, offset + 2, 6,
|
||||
TRUE);
|
||||
TRUE);
|
||||
proto_tree_add_item(tree, hf_ieee80211_tag_mmie_mic, tvb, offset + 8, 8,
|
||||
FALSE);
|
||||
FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -5483,7 +5483,7 @@ add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int of
|
|||
break;
|
||||
|
||||
case TAG_DS_PARAMETER:
|
||||
/* The length of the dot11CurrentChannelNumber parameter is 1 octet */
|
||||
/* The length of the dot11CurrentChannelNumber parameter is 1 octet */
|
||||
if (tag_len != 1)
|
||||
{
|
||||
proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u wrong, must be = 1",
|
||||
|
@ -6124,14 +6124,14 @@ add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int of
|
|||
#endif /* MESH_OVERRIDES */
|
||||
|
||||
case TAG_SUPPORTED_CHANNELS:
|
||||
/* 7.3.2.19 Supported Channels element */
|
||||
/* 7.3.2.19 Supported Channels element */
|
||||
{
|
||||
proto_item *chan_item;
|
||||
proto_tree *chan_tree;
|
||||
guint i;
|
||||
|
||||
offset += 2;
|
||||
if (tag_len % 2 == 1) {
|
||||
if (tag_len % 2 == 1) {
|
||||
proto_tree_add_text (tree, tvb, offset -1, 1,
|
||||
"Supported Channels: Error: Tag length %u must be even",tag_len);
|
||||
}
|
||||
|
@ -6727,7 +6727,7 @@ add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int of
|
|||
{
|
||||
guint tag_offset;
|
||||
guint8 current_field;
|
||||
guint i;
|
||||
guint i;
|
||||
|
||||
if (tag_len < 2) {
|
||||
proto_tree_add_text (tree, tvb, offset + 2, tag_len,
|
||||
|
@ -7680,8 +7680,8 @@ dissect_ieee80211_common (tvbuff_t * tvb, packet_info * pinfo,
|
|||
|
||||
#ifdef MESH_OVERRIDES
|
||||
if (tree &&
|
||||
(FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4 ||
|
||||
FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T2))
|
||||
(FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4 ||
|
||||
FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T2))
|
||||
{
|
||||
proto_item *msh_fields;
|
||||
proto_tree *msh_tree;
|
||||
|
@ -8713,12 +8713,6 @@ wlan_defragment_init(void)
|
|||
}
|
||||
|
||||
/* ------------- */
|
||||
static gboolean
|
||||
free_all(gpointer key_arg _U_, gpointer value _U_, gpointer user_data _U_)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static guint
|
||||
retransmit_hash(gconstpointer k)
|
||||
{
|
||||
|
@ -8766,13 +8760,11 @@ static void
|
|||
wlan_retransmit_init(void)
|
||||
{
|
||||
if ( fc_analyse_retransmit_table ){
|
||||
g_hash_table_foreach_remove(fc_analyse_retransmit_table,free_all, NULL);
|
||||
g_hash_table_destroy(fc_analyse_retransmit_table);
|
||||
fc_analyse_retransmit_table = NULL;
|
||||
}
|
||||
|
||||
if( fc_first_frame_table ){
|
||||
g_hash_table_foreach_remove(fc_first_frame_table,free_all, NULL);
|
||||
g_hash_table_destroy(fc_first_frame_table);
|
||||
fc_first_frame_table = NULL;
|
||||
}
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Patch by Polystar (Peter Vestman, Petter Edblom):
|
||||
Corrected rfci handling in rate control messages
|
||||
Added crc6 and crc10 checks for header and payload
|
||||
Corrected rfci handling in rate control messages
|
||||
Added crc6 and crc10 checks for header and payload
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -58,7 +58,7 @@ typedef struct _iuup_rfci_t {
|
|||
} iuup_rfci_t;
|
||||
|
||||
typedef struct {
|
||||
guint32 id;
|
||||
guint32 id;
|
||||
guint num_of_subflows;
|
||||
iuup_rfci_t* rfcis;
|
||||
iuup_rfci_t* last_rfci;
|
||||
|
@ -68,7 +68,7 @@ static int proto_iuup = -1;
|
|||
|
||||
static int hf_iuup_direction = -1;
|
||||
static int hf_iuup_circuit_id = -1;
|
||||
|
||||
|
||||
static int hf_iuup_pdu_type = -1;
|
||||
static int hf_iuup_frame_number = -1;
|
||||
static int hf_iuup_fqc = -1;
|
||||
|
@ -124,7 +124,7 @@ static int hf_iuup_init_rfci_flow_len[64][8] = {
|
|||
{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1}
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1}
|
||||
};
|
||||
|
||||
static int hf_iuup_init_rfci_li[] = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
|
||||
|
@ -139,7 +139,7 @@ static int hf_iuup_rfci_subflow[64][8] = {
|
|||
{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1}
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1}
|
||||
};
|
||||
|
||||
static int hf_iuup_rfci_ratectl[] = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
|
||||
|
@ -330,23 +330,23 @@ iuup_proto_tree_add_bits(proto_tree* tree, int hf, tvbuff_t* tvb, int offset, in
|
|||
int i;
|
||||
|
||||
DISSECTOR_ASSERT(bit_offset < 8);
|
||||
|
||||
|
||||
shifted_buffer = ep_tvb_memdup(tvb,offset,len+1);
|
||||
|
||||
|
||||
for(i = 0; i < len; i++) {
|
||||
shifted_buffer[i] <<= bit_offset;
|
||||
shifted_buffer[i] |= (shifted_buffer[i+1] & masks[bit_offset]) >> (8 - bit_offset);
|
||||
shifted_buffer[i] |= (shifted_buffer[i+1] & masks[bit_offset]) >> (8 - bit_offset);
|
||||
}
|
||||
|
||||
shifted_buffer[len] <<= bit_offset;
|
||||
shifted_buffer[len] &= masks[(bits + bit_offset)%8];
|
||||
|
||||
|
||||
if (buf)
|
||||
*buf = shifted_buffer;
|
||||
|
||||
|
||||
pi = proto_tree_add_bytes(tree, hf, tvb, offset, len + ((bits + bit_offset) % 8 ? 1 : 0) , shifted_buffer);
|
||||
proto_item_append_text(pi, " (%i Bits)", bits);
|
||||
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
|
@ -356,9 +356,9 @@ static void dissect_iuup_payload(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tr
|
|||
int last_offset = tvb_length(tvb) - 1;
|
||||
guint bit_offset = 0;
|
||||
proto_item* pi;
|
||||
|
||||
|
||||
pi = proto_tree_add_item(tree,hf_iuup_payload,tvb,offset,-1,FALSE);
|
||||
|
||||
|
||||
if ( ! dissect_fields ) {
|
||||
return;
|
||||
} else if ( ! pinfo->circuit_id
|
||||
|
@ -366,11 +366,11 @@ static void dissect_iuup_payload(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tr
|
|||
proto_item_set_expert_flags(pi, PI_UNDECODED, PI_WARN);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
for(rfci = iuup_circuit->rfcis; rfci; rfci = rfci->next)
|
||||
if ( rfci->id == rfci_id )
|
||||
break;
|
||||
|
||||
|
||||
if (!rfci) {
|
||||
proto_item_set_expert_flags(pi, PI_UNDECODED, PI_WARN);
|
||||
return;
|
||||
|
@ -383,28 +383,28 @@ static void dissect_iuup_payload(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tr
|
|||
guint i;
|
||||
guint subflows = rfci->num_of_subflows;
|
||||
proto_tree* flow_tree;
|
||||
|
||||
|
||||
pi = proto_tree_add_text(tree,tvb,offset,-1,"Payload Frame");
|
||||
flow_tree = proto_item_add_subtree(pi,ett_payload_subflows);
|
||||
|
||||
bit_offset = 0;
|
||||
|
||||
for(i = 0; i < subflows; i++) {
|
||||
|
||||
|
||||
if (! rfci->subflow[i].len)
|
||||
continue;
|
||||
|
||||
|
||||
iuup_proto_tree_add_bits(flow_tree, hf_iuup_rfci_subflow[rfci->id][i], tvb,
|
||||
offset + (bit_offset/8),
|
||||
bit_offset % 8,
|
||||
rfci->subflow[i].len,
|
||||
NULL);
|
||||
|
||||
|
||||
bit_offset += rfci->subflow[i].len;
|
||||
}
|
||||
|
||||
|
||||
offset += (bit_offset / 8) + (bit_offset % 8 ? 1 : 0);
|
||||
|
||||
|
||||
} while (offset <= last_offset);
|
||||
}
|
||||
|
||||
|
@ -418,53 +418,53 @@ static guint dissect_rfcis(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tr
|
|||
do {
|
||||
iuup_rfci_t *rfci = se_alloc0(sizeof(iuup_rfci_t));
|
||||
guint len = 0;
|
||||
|
||||
|
||||
DISSECTOR_ASSERT(c < 64);
|
||||
|
||||
pi = proto_tree_add_item(tree,hf_iuup_init_rfci_ind,tvb,*offset,-1,FALSE);
|
||||
pt = proto_item_add_subtree(pi,ett_rfci);
|
||||
|
||||
|
||||
proto_tree_add_item(pt,hf_iuup_init_rfci_lri[c],tvb,*offset,1,FALSE);
|
||||
proto_tree_add_item(pt,hf_iuup_init_rfci_li[c],tvb,*offset,1,FALSE);
|
||||
proto_tree_add_item(pt,hf_iuup_init_rfci[c],tvb,*offset,1,FALSE);
|
||||
|
||||
|
||||
oct = tvb_get_guint8(tvb,*offset);
|
||||
rfci->id = oct & 0x3f;
|
||||
rfci->num_of_subflows = iuup_circuit->num_of_subflows;
|
||||
|
||||
|
||||
len = (oct & 0x40) ? 2 : 1;
|
||||
proto_item_set_text(pi,"RFCI %i Initialization",rfci->id);
|
||||
proto_item_set_len(pi,(len*iuup_circuit->num_of_subflows)+1);
|
||||
|
||||
|
||||
(*offset)++;
|
||||
|
||||
|
||||
for(i = 0; i < iuup_circuit->num_of_subflows; i++) {
|
||||
guint subflow_len;
|
||||
|
||||
|
||||
if (len == 2) {
|
||||
subflow_len = tvb_get_ntohs(tvb,*offset);
|
||||
} else {
|
||||
subflow_len = tvb_get_guint8(tvb,*offset);
|
||||
}
|
||||
|
||||
|
||||
rfci->subflow[i].len = subflow_len;
|
||||
rfci->sum_len += subflow_len;
|
||||
|
||||
|
||||
proto_tree_add_uint(pt,hf_iuup_init_rfci_flow_len[c][i],tvb,*offset,len,subflow_len);
|
||||
|
||||
(*offset) += len;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (iuup_circuit->last_rfci) {
|
||||
iuup_circuit->last_rfci = iuup_circuit->last_rfci->next = rfci;
|
||||
} else {
|
||||
iuup_circuit->last_rfci = iuup_circuit->rfcis = rfci;
|
||||
}
|
||||
|
||||
|
||||
c++;
|
||||
} while ( ! (oct & 0x80) );
|
||||
|
||||
|
||||
return c - 1;
|
||||
}
|
||||
|
||||
|
@ -479,71 +479,71 @@ static void dissect_iuup_init(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tre
|
|||
proto_tree* support_tree = NULL;
|
||||
proto_tree* iptis_tree;
|
||||
iuup_circuit_t* iuup_circuit = NULL;
|
||||
|
||||
|
||||
if (pinfo->circuit_id) {
|
||||
iuup_circuit = g_hash_table_lookup(circuits,GUINT_TO_POINTER(pinfo->circuit_id));
|
||||
|
||||
|
||||
if (iuup_circuit) {
|
||||
g_hash_table_remove(circuits,GUINT_TO_POINTER(pinfo->circuit_id));
|
||||
}
|
||||
|
||||
|
||||
iuup_circuit = se_alloc0(sizeof(iuup_circuit_t));
|
||||
} else {
|
||||
iuup_circuit = ep_alloc0(sizeof(iuup_circuit_t));
|
||||
}
|
||||
|
||||
|
||||
iuup_circuit->id = pinfo->circuit_id;
|
||||
iuup_circuit->num_of_subflows = n;
|
||||
iuup_circuit->rfcis = NULL;
|
||||
iuup_circuit->last_rfci = NULL;
|
||||
|
||||
|
||||
if (pinfo->circuit_id) {
|
||||
g_hash_table_insert(circuits,GUINT_TO_POINTER(iuup_circuit->id),iuup_circuit);
|
||||
}
|
||||
|
||||
|
||||
if (tree) {
|
||||
proto_tree_add_item(tree,hf_iuup_spare_e0,tvb,offset,1,FALSE);
|
||||
proto_tree_add_item(tree,hf_iuup_init_ti,tvb,offset,1,FALSE);
|
||||
proto_tree_add_item(tree,hf_iuup_init_subflows_per_rfci,tvb,offset,1,FALSE);
|
||||
proto_tree_add_item(tree,hf_iuup_init_chain_ind,tvb,offset,1,FALSE);
|
||||
}
|
||||
|
||||
|
||||
offset++;
|
||||
|
||||
rfcis = dissect_rfcis(tvb, pinfo, tree, &offset, iuup_circuit);
|
||||
|
||||
if (!tree) return;
|
||||
|
||||
|
||||
if (ti) {
|
||||
pi = proto_tree_add_text(tree,tvb,offset,(rfcis/2)+(rfcis%2),"IPTIs");
|
||||
iptis_tree = proto_item_add_subtree(pi,ett_ipti);
|
||||
|
||||
|
||||
for (i = 0; i <= rfcis; i++) {
|
||||
proto_tree_add_item(iptis_tree,hf_iuup_init_ipti[i],tvb,offset,1,FALSE);
|
||||
if ((i%2)) {
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((i%2)) {
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (tree) {
|
||||
pi = proto_tree_add_item(tree,hf_iuup_mode_versions,tvb,offset,2,FALSE);
|
||||
support_tree = proto_item_add_subtree(pi,ett_support);
|
||||
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
proto_tree_add_item(support_tree,hf_iuup_mode_versions_a[i],tvb,offset,2,FALSE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
offset += 2;
|
||||
|
||||
|
||||
proto_tree_add_item(tree,hf_iuup_data_pdu_type,tvb,offset,1,FALSE);
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void dissect_iuup_ratectl(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree) {
|
||||
|
@ -552,15 +552,15 @@ static void dissect_iuup_ratectl(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tr
|
|||
proto_item* pi;
|
||||
proto_tree* inds_tree;
|
||||
int offset = 4;
|
||||
|
||||
|
||||
pi = proto_tree_add_item(tree,hf_iuup_num_rfci_ind,tvb,4,1,FALSE);
|
||||
inds_tree = proto_item_add_subtree(pi,ett_rfciinds);
|
||||
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
if (! (i % 8) ) offset++;
|
||||
proto_tree_add_item(inds_tree,hf_iuup_rfci_ratectl[i],tvb,offset,1,FALSE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
static proto_item *add_hdr_crc(tvbuff_t* tvb, packet_info* pinfo, proto_item* iuup_tree, guint16 crccheck)
|
||||
|
@ -608,60 +608,60 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
|
|||
guint16 hdrcrc6;
|
||||
guint16 crccheck;
|
||||
tvbuff_t* tvb = tvb_in;
|
||||
|
||||
|
||||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IuUP");
|
||||
|
||||
if (two_byte_pseudoheader) {
|
||||
int len = tvb_length(tvb_in) - 2;
|
||||
|
||||
|
||||
phdr = tvb_get_ntohs(tvb,0);
|
||||
|
||||
proto_tree_add_item(tree,hf_iuup_direction,tvb,0,2,FALSE);
|
||||
proto_tree_add_item(tree,hf_iuup_circuit_id,tvb,0,2,FALSE);
|
||||
|
||||
|
||||
phdr &= 0x7fff;
|
||||
|
||||
|
||||
pinfo->circuit_id = phdr;
|
||||
|
||||
|
||||
tvb = tvb_new_subset(tvb_in,2,len,len);
|
||||
}
|
||||
|
||||
|
||||
first_octet = tvb_get_guint8(tvb,0);
|
||||
second_octet = tvb_get_guint8(tvb,1);
|
||||
hdrcrc6 = tvb_get_guint8(tvb, 2) >> 2;
|
||||
crccheck = update_crc6_by_bytes(hdrcrc6, first_octet, second_octet);
|
||||
|
||||
|
||||
pdutype = ( first_octet & PDUTYPE_MASK ) >> 4;
|
||||
|
||||
|
||||
if (tree) {
|
||||
iuup_item = proto_tree_add_item(tree,proto_iuup,tvb,0,-1,FALSE);
|
||||
iuup_tree = proto_item_add_subtree(iuup_item,ett_iuup);
|
||||
|
||||
|
||||
pdutype_item = proto_tree_add_item(iuup_tree,hf_iuup_pdu_type,tvb,0,1,FALSE);
|
||||
}
|
||||
|
||||
if (check_col(pinfo->cinfo, COL_INFO)) {
|
||||
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(pdutype, iuup_colinfo_pdu_types, "Unknown PDU Type(%u) "));
|
||||
}
|
||||
|
||||
|
||||
switch(pdutype) {
|
||||
case PDUTYPE_DATA_WITH_CRC:
|
||||
if (check_col(pinfo->cinfo, COL_INFO)) {
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO,"FN: %x RFCI: %u", (guint)(first_octet & 0x0f) ,(guint)(second_octet & 0x3f));
|
||||
}
|
||||
|
||||
|
||||
if (!tree) return;
|
||||
proto_tree_add_item(iuup_tree,hf_iuup_frame_number,tvb,0,1,FALSE);
|
||||
pi = proto_tree_add_item(iuup_tree,hf_iuup_fqc,tvb,1,1,FALSE);
|
||||
|
||||
|
||||
if (first_octet & FQC_MASK) {
|
||||
proto_item_set_expert_flags(pi, PI_RESPONSE_CODE, PI_WARN);
|
||||
proto_item_set_expert_flags(iuup_item, PI_RESPONSE_CODE, PI_WARN);
|
||||
}
|
||||
|
||||
|
||||
proto_tree_add_item(iuup_tree,hf_iuup_rfci,tvb,1,1,FALSE);
|
||||
add_hdr_crc(tvb, pinfo, iuup_tree, crccheck);
|
||||
add_payload_crc(tvb, pinfo, iuup_tree);
|
||||
add_hdr_crc(tvb, pinfo, iuup_tree, crccheck);
|
||||
add_payload_crc(tvb, pinfo, iuup_tree);
|
||||
dissect_iuup_payload(tvb,pinfo,iuup_tree,second_octet & 0x3f,4);
|
||||
return;
|
||||
case PDUTYPE_DATA_NO_CRC:
|
||||
|
@ -676,9 +676,9 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
|
|||
proto_item_set_expert_flags(pi, PI_RESPONSE_CODE, PI_WARN);
|
||||
proto_item_set_expert_flags(iuup_item, PI_RESPONSE_CODE, PI_WARN);
|
||||
}
|
||||
|
||||
|
||||
proto_tree_add_item(iuup_tree,hf_iuup_rfci,tvb,1,1,FALSE);
|
||||
add_hdr_crc(tvb, pinfo, iuup_tree, crccheck);
|
||||
add_hdr_crc(tvb, pinfo, iuup_tree, crccheck);
|
||||
dissect_iuup_payload(tvb,pinfo,iuup_tree,second_octet & 0x3f,3);
|
||||
return;
|
||||
case PDUTYPE_DATA_CONTROL_PROC:
|
||||
|
@ -687,19 +687,19 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
|
|||
proto_tree_add_item(iuup_tree,hf_iuup_frame_number_t14,tvb,0,1,FALSE);
|
||||
proto_tree_add_item(iuup_tree,hf_iuup_mode_version,tvb,1,1,FALSE);
|
||||
proc_item = proto_tree_add_item(iuup_tree,hf_iuup_procedure_indicator,tvb,1,1,FALSE);
|
||||
add_hdr_crc(tvb, pinfo, iuup_tree, crccheck);
|
||||
add_hdr_crc(tvb, pinfo, iuup_tree, crccheck);
|
||||
}
|
||||
|
||||
|
||||
if (check_col(pinfo->cinfo, COL_INFO)) {
|
||||
col_append_str(pinfo->cinfo, COL_INFO,
|
||||
val_to_str(first_octet & ACKNACK_MASK,
|
||||
iuup_colinfo_acknack_vals, "[action:%u] "));
|
||||
|
||||
|
||||
col_append_str(pinfo->cinfo, COL_INFO,
|
||||
val_to_str(second_octet & PROCEDURE_MASK,
|
||||
iuup_colinfo_procedures, "[proc:%u] "));
|
||||
}
|
||||
|
||||
|
||||
switch ( first_octet & ACKNACK_MASK ) {
|
||||
case ACKNACK_ACK:
|
||||
switch(second_octet & PROCEDURE_MASK) {
|
||||
|
@ -709,9 +709,9 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
|
|||
proto_tree_add_item(iuup_tree,hf_iuup_spare_ff,tvb,3,1,FALSE);
|
||||
return;
|
||||
case PROC_RATE:
|
||||
if (!tree) return;
|
||||
dissect_iuup_ratectl(tvb,pinfo,iuup_tree);
|
||||
return;
|
||||
if (!tree) return;
|
||||
dissect_iuup_ratectl(tvb,pinfo,iuup_tree);
|
||||
return;
|
||||
case PROC_TIME:
|
||||
case PROC_ERROR:
|
||||
break;
|
||||
|
@ -733,7 +733,7 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
|
|||
case ACKNACK_PROC:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
switch( second_octet & PROCEDURE_MASK ) {
|
||||
case PROC_INIT:
|
||||
if (tree) add_payload_crc(tvb, pinfo, iuup_tree);
|
||||
|
@ -752,10 +752,10 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
|
|||
if (!tree) return;
|
||||
|
||||
ta = tvb_get_guint8(tvb,4);
|
||||
|
||||
|
||||
pi = proto_tree_add_item(iuup_tree,hf_iuup_time_align,tvb,4,1,FALSE);
|
||||
time_tree = proto_item_add_subtree(pi,ett_time);
|
||||
|
||||
|
||||
if (ta >= 1 && ta <= 80) {
|
||||
pi = proto_tree_add_uint(time_tree,hf_iuup_delay,tvb,4,1,ta * 500);
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
|
@ -769,7 +769,7 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
|
|||
} else {
|
||||
proto_item_set_expert_flags(pi, PI_MALFORMED, PI_ERROR);
|
||||
}
|
||||
|
||||
|
||||
proto_tree_add_item(iuup_tree,hf_iuup_spare_bytes,tvb,5,-1,FALSE);
|
||||
return;
|
||||
}
|
||||
|
@ -798,13 +798,13 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree)
|
|||
|
||||
static gboolean dissect_iuup_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
|
||||
int len = tvb_length(tvb);
|
||||
|
||||
|
||||
guint8 first_octet = tvb_get_guint8(tvb,0);
|
||||
guint8 second_octet = tvb_get_guint8(tvb,1);
|
||||
guint16 hdrcrc6 = tvb_get_guint8(tvb, 2) >> 2;
|
||||
|
||||
|
||||
if (update_crc6_by_bytes(hdrcrc6, first_octet, second_octet)) return FALSE;
|
||||
|
||||
|
||||
switch ( first_octet & 0xf0 ) {
|
||||
case 0x00: {
|
||||
if (len<7) return FALSE;
|
||||
|
@ -821,7 +821,7 @@ static gboolean dissect_iuup_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
dissect_iuup(tvb, pinfo, tree);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -830,7 +830,7 @@ static gboolean dissect_iuup_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
static void find_iuup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
|
||||
int len = tvb_length(tvb);
|
||||
int offset = 0;
|
||||
|
||||
|
||||
while (len > 3) {
|
||||
if ( dissect_iuup_heur(tvb_new_subset_remaining(tvb,offset), pinfo, tree) )
|
||||
return;
|
||||
|
@ -838,7 +838,7 @@ static void find_iuup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
|
|||
offset++;
|
||||
len--;
|
||||
}
|
||||
|
||||
|
||||
call_dissector(data_handle, tvb, pinfo, tree);
|
||||
}
|
||||
|
||||
|
@ -866,7 +866,7 @@ void proto_reg_handoff_iuup(void) {
|
|||
}
|
||||
|
||||
saved_dynamic_payload_type = global_dynamic_payload_type;
|
||||
|
||||
|
||||
if ( global_dynamic_payload_type > 95 ) {
|
||||
dissector_add("rtp.pt", global_dynamic_payload_type, iuup_handle);
|
||||
}
|
||||
|
@ -906,8 +906,8 @@ void proto_register_iuup(void) {
|
|||
{ &hf_iuup_frame_number, { "Frame Number", "iuup.framenum", FT_UINT8, BASE_DEC, NULL,0x0F,NULL,HFILL}},
|
||||
{ &hf_iuup_fqc, { "FQC", "iuup.fqc", FT_UINT8, BASE_DEC, VALS(iuup_fqcs),0xc0,"Frame Quality Classification",HFILL}},
|
||||
{ &hf_iuup_rfci, { "RFCI", "iuup.rfci", FT_UINT8, BASE_HEX, NULL, 0x3f, "RAB sub-Flow Combination Indicator",HFILL}},
|
||||
{ &hf_iuup_hdr_crc, { "Header CRC", "iuup.header_crc", FT_UINT8, BASE_HEX, NULL,0xfc,NULL,HFILL}},
|
||||
{ &hf_iuup_hdr_crc_error, { "Header CRC [incorrect]", "iuup.header_crc", FT_UINT8, BASE_HEX, NULL,0xfc,NULL,HFILL}},
|
||||
{ &hf_iuup_hdr_crc, { "Header CRC", "iuup.header_crc", FT_UINT8, BASE_HEX, NULL,0xfc,NULL,HFILL}},
|
||||
{ &hf_iuup_hdr_crc_error, { "Header CRC [incorrect]", "iuup.header_crc", FT_UINT8, BASE_HEX, NULL,0xfc,NULL,HFILL}},
|
||||
{ &hf_iuup_payload_crc, { "Payload CRC", "iuup.payload_crc", FT_UINT16, BASE_HEX, NULL,0x03FF,NULL,HFILL}},
|
||||
{ &hf_iuup_payload_crc_error, { "Payload CRC [incorrect]", "iuup.payload_crc", FT_UINT16, BASE_HEX, NULL,0x03FF,NULL,HFILL}},
|
||||
{ &hf_iuup_ack_nack, { "Ack/Nack", "iuup.ack", FT_UINT8, BASE_DEC, VALS(iuup_acknack_vals),0x0c,NULL,HFILL}},
|
||||
|
@ -926,7 +926,7 @@ void proto_register_iuup(void) {
|
|||
{ &hf_iuup_spare_e0, { "Spare", "iuup.spare", FT_UINT8, BASE_HEX, NULL,0xe0,NULL,HFILL}},
|
||||
{ &hf_iuup_spare_ff, { "Spare", "iuup.spare", FT_UINT8, BASE_HEX, NULL,0xff,NULL,HFILL}},
|
||||
{ &hf_iuup_spare_bytes, { "Spare", "iuup.spare_bytes", FT_BYTES, BASE_NONE, NULL,0x0,NULL,HFILL}},
|
||||
|
||||
|
||||
{ &hf_iuup_delay, { "Delay", "iuup.delay", FT_UINT32, BASE_HEX, NULL,0x0,NULL,HFILL}},
|
||||
{ &hf_iuup_advance, { "Advance", "iuup.advance", FT_UINT32, BASE_HEX, NULL,0x0,NULL,HFILL}},
|
||||
{ &hf_iuup_delta, { "Delta Time", "iuup.delta", FT_FLOAT, BASE_NONE, NULL,0x0,NULL,HFILL}},
|
||||
|
@ -938,7 +938,7 @@ void proto_register_iuup(void) {
|
|||
|
||||
|
||||
{ &hf_iuup_mode_versions, { "Iu UP Mode Versions Supported", "iuup.support_mode", FT_UINT16, BASE_HEX, NULL,0x0,NULL,HFILL}},
|
||||
|
||||
|
||||
{ &hf_iuup_mode_versions_a[ 0], { "Version 16", "iuup.support_mode.version16", FT_UINT16, BASE_HEX, VALS(iuup_mode_version_support),0x8000,NULL,HFILL}},
|
||||
{ &hf_iuup_mode_versions_a[ 1], { "Version 15", "iuup.support_mode.version15", FT_UINT16, BASE_HEX, VALS(iuup_mode_version_support),0x4000,NULL,HFILL}},
|
||||
{ &hf_iuup_mode_versions_a[ 2], { "Version 14", "iuup.support_mode.version14", FT_UINT16, BASE_HEX, VALS(iuup_mode_version_support),0x2000,NULL,HFILL}},
|
||||
|
@ -954,7 +954,7 @@ void proto_register_iuup(void) {
|
|||
{ &hf_iuup_mode_versions_a[12], { "Version 4", "iuup.support_mode.version4", FT_UINT16, BASE_HEX, VALS(iuup_mode_version_support),0x0008,NULL,HFILL}},
|
||||
{ &hf_iuup_mode_versions_a[13], { "Version 3", "iuup.support_mode.version3", FT_UINT16, BASE_HEX, VALS(iuup_mode_version_support),0x0004,NULL,HFILL}},
|
||||
{ &hf_iuup_mode_versions_a[14], { "Version 2", "iuup.support_mode.version2", FT_UINT16, BASE_HEX, VALS(iuup_mode_version_support),0x0002,NULL,HFILL}},
|
||||
{ &hf_iuup_mode_versions_a[15], { "Version 1", "iuup.support_mode.version1", FT_UINT16, BASE_HEX, VALS(iuup_mode_version_support),0x0001,NULL,HFILL}},
|
||||
{ &hf_iuup_mode_versions_a[15], { "Version 1", "iuup.support_mode.version1", FT_UINT16, BASE_HEX, VALS(iuup_mode_version_support),0x0001,NULL,HFILL}},
|
||||
|
||||
{ &hf_iuup_num_rfci_ind, { "Number of RFCI Indicators", "iuup.p", FT_UINT8, BASE_HEX, NULL,0x3f,NULL,HFILL}},
|
||||
{ &hf_iuup_init_rfci_ind, { "RFCI Initialization", "iuup.rfci.init", FT_BYTES, BASE_NONE, NULL,0x0,NULL,HFILL}},
|
||||
|
@ -967,9 +967,9 @@ void proto_register_iuup(void) {
|
|||
HFS_RFCI(40),HFS_RFCI(41),HFS_RFCI(42),HFS_RFCI(43),HFS_RFCI(44),HFS_RFCI(45),HFS_RFCI(46),HFS_RFCI(47),
|
||||
HFS_RFCI(48),HFS_RFCI(49),HFS_RFCI(50),HFS_RFCI(51),HFS_RFCI(52),HFS_RFCI(53),HFS_RFCI(54),HFS_RFCI(55),
|
||||
HFS_RFCI(56),HFS_RFCI(57),HFS_RFCI(58),HFS_RFCI(59),HFS_RFCI(60),HFS_RFCI(61),HFS_RFCI(62),HFS_RFCI(63)
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
gint* ett[] = {
|
||||
&ett_iuup,
|
||||
|
@ -984,31 +984,31 @@ void proto_register_iuup(void) {
|
|||
|
||||
module_t* iuup_module;
|
||||
|
||||
|
||||
|
||||
proto_iuup = proto_register_protocol("IuUP", "IuUP", "iuup");
|
||||
proto_register_field_array(proto_iuup, hf, array_length(hf));
|
||||
proto_register_subtree_array(ett, array_length(ett));
|
||||
register_dissector("iuup", dissect_iuup, proto_iuup);
|
||||
register_dissector("find_iuup", find_iuup, proto_iuup);
|
||||
|
||||
|
||||
register_init_routine(&init_iuup);
|
||||
|
||||
|
||||
iuup_module = prefs_register_protocol(proto_iuup, proto_reg_handoff_iuup);
|
||||
|
||||
|
||||
prefs_register_bool_preference(iuup_module, "dissect_payload",
|
||||
"Dissect IuUP Payload bits",
|
||||
"Whether IuUP Payload bits should be dissected",
|
||||
&dissect_fields);
|
||||
|
||||
|
||||
prefs_register_bool_preference(iuup_module, "two_byte_pseudoheader",
|
||||
"Two byte pseudoheader",
|
||||
"The payload contains a two byte pseudoheader indicating direction and circuit_id",
|
||||
&two_byte_pseudoheader);
|
||||
|
||||
|
||||
prefs_register_uint_preference(iuup_module, "dynamic.payload.type",
|
||||
"IuUP dynamic payload type",
|
||||
"The dynamic payload type which will be interpreted as IuUP",
|
||||
10,
|
||||
&global_dynamic_payload_type);
|
||||
"IuUP dynamic payload type",
|
||||
"The dynamic payload type which will be interpreted as IuUP",
|
||||
10,
|
||||
&global_dynamic_payload_type);
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -598,13 +598,13 @@ dissect_zbee_aps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
/* Get the FCF */
|
||||
fcf = tvb_get_guint8(tvb, offset);
|
||||
packet.type = zbee_get_bit_field(fcf, ZBEE_APS_FCF_FRAME_TYPE);
|
||||
packet.delivery = zbee_get_bit_field(fcf, ZBEE_APS_FCF_DELIVERY_MODE);
|
||||
packet.type = zbee_get_bit_field(fcf, ZBEE_APS_FCF_FRAME_TYPE);
|
||||
packet.delivery = zbee_get_bit_field(fcf, ZBEE_APS_FCF_DELIVERY_MODE);
|
||||
packet.indirect_mode = zbee_get_bit_field(fcf, ZBEE_APS_FCF_INDIRECT_MODE);
|
||||
packet.ack_format = zbee_get_bit_field(fcf, ZBEE_APS_FCF_ACK_FORMAT);
|
||||
packet.security = zbee_get_bit_field(fcf, ZBEE_APS_FCF_SECURITY);
|
||||
packet.ack_req = zbee_get_bit_field(fcf, ZBEE_APS_FCF_ACK_REQ);
|
||||
packet.ext_header = zbee_get_bit_field(fcf, ZBEE_APS_FCF_EXT_HEADER);
|
||||
packet.ack_format = zbee_get_bit_field(fcf, ZBEE_APS_FCF_ACK_FORMAT);
|
||||
packet.security = zbee_get_bit_field(fcf, ZBEE_APS_FCF_SECURITY);
|
||||
packet.ack_req = zbee_get_bit_field(fcf, ZBEE_APS_FCF_ACK_REQ);
|
||||
packet.ext_header = zbee_get_bit_field(fcf, ZBEE_APS_FCF_EXT_HEADER);
|
||||
|
||||
/* Display the frame type to the proto root and info column. */
|
||||
if (tree) {
|
||||
|
@ -1169,7 +1169,7 @@ dissect_zbee_aps_transport_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
|
|||
{
|
||||
guint8 key_type;
|
||||
guint8 key[ZBEE_APS_CMD_KEY_LENGTH];
|
||||
GSList **nwk_keyring;
|
||||
GSList **nwk_keyring;
|
||||
key_record_t key_record;
|
||||
zbee_nwk_hints_t *nwk_hints;
|
||||
guint i;
|
||||
|
@ -1191,16 +1191,16 @@ dissect_zbee_aps_transport_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
|
|||
proto_tree_add_item(tree, hf_zbee_aps_cmd_key, tvb, offset, ZBEE_APS_CMD_KEY_LENGTH, ENC_BIG_ENDIAN);
|
||||
}
|
||||
offset += ZBEE_APS_CMD_KEY_LENGTH;
|
||||
|
||||
|
||||
/* Update the key ring for this pan */
|
||||
if ( !pinfo->fd->flags.visited && (nwk_hints = (zbee_nwk_hints_t *)p_get_proto_data(pinfo->fd,
|
||||
proto_get_id_by_filter_name(ZBEE_PROTOABBREV_NWK)))) {
|
||||
|
||||
nwk_keyring = (GSList **)g_hash_table_lookup(zbee_table_nwk_keyring, &nwk_hints->src_pan);
|
||||
if ( !nwk_keyring ) {
|
||||
/* Create an empty key ring for this pan. Use g_alloc() because we must free
|
||||
* GSLists after a capture is closed and wireshark freed seasonal memory
|
||||
* with se_free_all()
|
||||
/* Create an empty key ring for this pan. Use g_malloc0() because we must free
|
||||
* GSLists after a capture is closed and wireshark frees seasonal memory
|
||||
* with se_free_all() before calling the registered init routine.
|
||||
*/
|
||||
nwk_keyring = (GSList **)g_malloc0(sizeof(GSList**));
|
||||
g_hash_table_insert(zbee_table_nwk_keyring,
|
||||
|
|
Loading…
Reference in New Issue