aboutsummaryrefslogtreecommitdiffstats
path: root/packet-q931.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2000-05-11 08:18:09 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2000-05-11 08:18:09 +0000
commit292e38e2c61edcd14bfa30ca3c72bacda1bcbe32 (patch)
treedb4edef02456a48d0f6d505166ac7d70f6c0f644 /packet-q931.c
parent162800efb308901e0c302517be01226130e39b19 (diff)
Add tvbuff class.
Add exceptions routines. Convert proto_tree_add_*() routines to require tvbuff_t* argument. Convert all dissectors to pass NULL argument ("NullTVB" macro == NULL) as the tvbuff_t* argument to proto_tree_add_*() routines. dissect_packet() creates a tvbuff_t, wraps the next dissect call in a TRY block, will print "Short Frame" on the proto_tree if a BoundsError exception is caught. The FDDI dissector is converted to use tvbuff's. svn path=/trunk/; revision=1939
Diffstat (limited to 'packet-q931.c')
-rw-r--r--packet-q931.c264
1 files changed, 132 insertions, 132 deletions
diff --git a/packet-q931.c b/packet-q931.c
index bb568c236f..001f33afb2 100644
--- a/packet-q931.c
+++ b/packet-q931.c
@@ -2,7 +2,7 @@
* Routines for Q.931 frame disassembly
* Guy Harris <guy@alum.mit.edu>
*
- * $Id: packet-q931.c,v 1.13 2000/01/13 05:41:21 guy Exp $
+ * $Id: packet-q931.c,v 1.14 2000/05/11 08:15:39 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -314,20 +314,20 @@ dissect_q931_segmented_message_ie(const u_char *pd, int offset, int len,
proto_tree *tree)
{
if (len != 2) {
- proto_tree_add_text(tree, offset, len,
+ proto_tree_add_text(tree, NullTVB, offset, len,
"Segmented message: length is %d, should be 2\n", len);
return;
}
if (pd[offset] & 0x80) {
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"First segment: %u segments remaining",
pd[offset] & 0x7F);
} else {
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Not first segment: %u segments remaining",
pd[offset] & 0x7F);
}
- proto_tree_add_text(tree, offset + 1, 1,
+ proto_tree_add_text(tree, NullTVB, offset + 1, 1,
"Segmented message type: %u\n", pd[offset + 1]);
}
@@ -522,7 +522,7 @@ dissect_q931_bearer_capability_ie(const u_char *pd, int offset, int len,
return;
octet = pd[offset];
coding_standard = octet & 0x60;
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Coding standard: %s",
val_to_str(coding_standard, q931_bc_coding_standard_vals, NULL));
if (coding_standard != Q931_ITU_STANDARDIZED_CODING) {
@@ -530,11 +530,11 @@ dissect_q931_bearer_capability_ie(const u_char *pd, int offset, int len,
* We don't know how the bearer capability is encoded,
* so just dump it as data and be done with it.
*/
- proto_tree_add_text(tree, offset,
+ proto_tree_add_text(tree, NullTVB, offset,
len, "Data: %s", bytes_to_str(&pd[offset], len));
return;
}
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Information transfer capability: %s",
val_to_str(octet & 0x1F, q931_information_transfer_capability_vals,
"Unknown (0x%02X)"));
@@ -548,7 +548,7 @@ dissect_q931_bearer_capability_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Out-band negotiation %spossible",
(octet & 0x40) ? "" : "not ");
offset += 1;
@@ -558,12 +558,12 @@ dissect_q931_bearer_capability_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Transfer mode: %s",
val_to_str(octet & 0x60, q931_transfer_mode_vals,
"Unknown (0x%02X)"));
it_rate = octet & 0x1F;
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Information transfer rate: %s",
val_to_str(it_rate, q931_information_transfer_rate_vals,
"Unknown (0x%02X)"));
@@ -573,7 +573,7 @@ dissect_q931_bearer_capability_ie(const u_char *pd, int offset, int len,
if (it_rate == Q931_IT_RATE_MULTIRATE) {
if (len == 0)
return;
- proto_tree_add_text(tree, offset, 1, "Rate multiplier: %u", pd[offset]);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Rate multiplier: %u", pd[offset]);
offset += 1;
len -= 1;
}
@@ -585,7 +585,7 @@ dissect_q931_bearer_capability_ie(const u_char *pd, int offset, int len,
/*
* Layer 1 information.
*/
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"User information layer 1 protocol: %s",
val_to_str(octet & 0x1F, q931_uil1_vals,
"Unknown (0x%02X)"));
@@ -597,13 +597,13 @@ dissect_q931_bearer_capability_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Layer 1 is %s",
(octet & 0x40) ? "Asynchronous" : "Synchronous");
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Layer 1 in-band negotiation is %spossible",
(octet & 0x20) ? "" : "not ");
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"User rate: %s",
val_to_str(octet & 0x1F, q931_l1_user_rate_vals,
"Unknown (0x%02X)"));
@@ -615,20 +615,20 @@ dissect_q931_bearer_capability_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Intermediate rate: %s",
val_to_str(octet & 0x60, q931_l1_intermediate_rate_vals,
"Unknown (0x%X)"));
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"%s to send data with network independent clock",
(octet & 0x10) ? "Required" : "Not required");
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"%s accept data with network independent clock",
(octet & 0x08) ? "Can" : "Cannot");
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"%s to send data with flow control mechanism",
(octet & 0x04) ? "Required" : "Not required");
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"%s accept data with flow control mechanism",
(octet & 0x02) ? "Can" : "Cannot");
offset += 1;
@@ -639,22 +639,22 @@ dissect_q931_bearer_capability_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Rate adaption header %sincluded",
(octet & 0x40) ? "" : "not ");
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Multiple frame establishment %ssupported",
(octet & 0x20) ? "" : "not ");
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"%s mode of operation",
(octet & 0x10) ? "Protocol sensitive" : "Bit transparent");
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
(octet & 0x08) ?
"Full protocol negotiation" : "LLI = 256 only");
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Message originator is %s",
(octet & 0x04) ? "Assignor only" : "Default assignee");
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Negotiation is done %s",
(octet & 0x02) ? "in-band" : "out-of-band");
offset += 1;
@@ -665,15 +665,15 @@ dissect_q931_bearer_capability_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Stop bits: %s",
val_to_str(octet & 0x60, q931_l1_stop_bits_vals,
"Unknown (0x%X)"));
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Data bits: %s",
val_to_str(octet & 0x18, q931_l1_data_bits_vals,
"Unknown (0x%X)"));
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Parity: %s",
val_to_str(octet & 0x08, q931_l1_parity_vals,
"Unknown (0x%X)"));
@@ -683,19 +683,19 @@ dissect_q931_bearer_capability_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"%s duplex",
(octet & 0x40) ? "Full" : "Half");
modem_type = octet & 0x3F;
if (modem_type <= 0x5 ||
(modem_type >= 0x20 && modem_type <= 0x2F)) {
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Modem type: National use 0x%02X", modem_type);
} else if (modem_type >= 0x30) {
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Modem type: User specified 0x%02X", modem_type);
} else {
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Modem type: %s",
val_to_str(modem_type, q931_l1_modem_type_vals,
NULL));
@@ -714,7 +714,7 @@ l1_done:
* Layer 2 information.
*/
uil2_protocol = octet & 0x1F;
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"User information layer 2 protocol: %s",
val_to_str(uil2_protocol, q931_uil2_vals,
"Unknown (0x%02X)"));
@@ -730,11 +730,11 @@ l1_done:
return;
octet = pd[offset];
if (uil2_protocol == Q931_UIL2_USER_SPEC) {
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"User-specified layer 2 protocol information: 0x%02X",
octet & 0x7F);
} else {
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Mode: %s",
val_to_str(octet & 0x60, q931_mode_vals,
"Unknown (0x%02X)"));
@@ -747,7 +747,7 @@ l1_done:
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Window size: %u k", octet & 0x7F);
offset += 1;
len -= 1;
@@ -763,7 +763,7 @@ l2_done:
* Layer 3 information.
*/
uil3_protocol = octet & 0x1F;
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"User information layer 3 protocol: %s",
val_to_str(uil3_protocol, q931_uil3_vals,
"Unknown (0x%02X)"));
@@ -784,7 +784,7 @@ l2_done:
case Q931_UIL3_X25_PL:
case Q931_UIL3_ISO_8208:
case Q931_UIL3_X223:
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Mode: %s",
val_to_str(octet & 0x60, q931_mode_vals,
"Unknown (0x%02X)"));
@@ -796,7 +796,7 @@ l2_done:
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Default packet size: %u", octet & 0x0F);
offset += 1;
len -= 1;
@@ -806,14 +806,14 @@ l2_done:
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Packet window size: %u", octet & 0x7F);
offset += 1;
len -= 1;
break;
case Q931_UIL3_USER_SPEC:
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Default packet size: %u octets",
1 << (octet & 0x0F));
offset += 1;
@@ -828,7 +828,7 @@ l2_done:
return;
octet = pd[offset + 1];
add_l3_info |= (octet & 0x0F);
- proto_tree_add_text(tree, offset, 2,
+ proto_tree_add_text(tree, NullTVB, offset, 2,
"Additional layer 3 protocol information: %s",
val_to_str(add_l3_info, nlpid_vals,
"Unknown (0x%02X)"));
@@ -976,7 +976,7 @@ dissect_q931_cause_ie(const u_char *pd, int offset, int len,
return;
octet = pd[offset];
coding_standard = octet & 0x60;
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Coding standard: %s",
val_to_str(coding_standard, q931_cause_coding_standard_vals, NULL));
if (coding_standard != Q931_ITU_STANDARDIZED_CODING) {
@@ -984,11 +984,11 @@ dissect_q931_cause_ie(const u_char *pd, int offset, int len,
* We don't know how the cause is encoded,
* so just dump it as data and be done with it.
*/
- proto_tree_add_text(tree, offset,
+ proto_tree_add_text(tree, NullTVB, offset,
len, "Data: %s", bytes_to_str(&pd[offset], len));
return;
}
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Location: %s",
val_to_str(octet & 0x0F, q931_cause_location_vals,
"Unknown (0x%X)"));
@@ -999,7 +999,7 @@ dissect_q931_cause_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Recommendation: %s",
val_to_str(octet & 0x7F, q931_cause_recommendation_vals,
"Unknown (0x%X)"));
@@ -1010,7 +1010,7 @@ dissect_q931_cause_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Cause value: %s",
val_to_str(octet & 0x7F, q931_cause_code_vals,
"Unknown (0x%X)"));
@@ -1019,7 +1019,7 @@ dissect_q931_cause_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
- proto_tree_add_text(tree, offset, len,
+ proto_tree_add_text(tree, NullTVB, offset, len,
"Diagnostics: %s",
bytes_to_str(&pd[offset], len));
}
@@ -1068,7 +1068,7 @@ dissect_q931_call_state_ie(const u_char *pd, int offset, int len,
return;
octet = pd[offset];
coding_standard = octet & 0x60;
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Coding standard: %s",
val_to_str(coding_standard, q931_coding_standard_vals, NULL));
if (coding_standard != Q931_ITU_STANDARDIZED_CODING) {
@@ -1076,11 +1076,11 @@ dissect_q931_call_state_ie(const u_char *pd, int offset, int len,
* We don't know how the call state is encoded,
* so just dump it as data and be done with it.
*/
- proto_tree_add_text(tree, offset,
+ proto_tree_add_text(tree, NullTVB, offset,
len, "Data: %s", bytes_to_str(&pd[offset], len));
return;
}
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Call state: %s",
val_to_str(octet & 0x3F, q931_call_state_vals,
"Unknown (0x%02X)"));
@@ -1129,25 +1129,25 @@ dissect_q931_channel_identification_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Interface %s identified",
(octet & Q931_INTERFACE_IDENTIFIED) ? "explicitly" : "implicitly");
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"%s interface",
(octet & Q931_NOT_BASIC_CHANNEL) ? "Not basic" : "Basic");
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Indicated channel is %s",
(octet & 0x08) ? "required" : "preferred");
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Indicated channel is %sthe D-channel",
(octet & 0x04) ? "" : "not ");
if (octet & Q931_NOT_BASIC_CHANNEL) {
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Channel selection: %s",
val_to_str(octet & 0x03, q931_not_basic_channel_selection_vals,
NULL));
} else {
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Channel selection: %s",
val_to_str(octet & 0x03, q931_basic_channel_selection_vals,
NULL));
@@ -1172,7 +1172,7 @@ dissect_q931_channel_identification_ie(const u_char *pd, int offset, int len,
* last octet of the interface identifier?
*/
if (identifier_len != 0) {
- proto_tree_add_text(tree, identifier_offset,
+ proto_tree_add_text(tree, NullTVB, identifier_offset,
identifier_len, "Interface identifier: %s",
bytes_to_str(&pd[identifier_offset],
identifier_len));
@@ -1184,7 +1184,7 @@ dissect_q931_channel_identification_ie(const u_char *pd, int offset, int len,
return;
octet = pd[offset];
coding_standard = octet & 0x60;
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Coding standard: %s",
val_to_str(coding_standard, q931_coding_standard_vals,
NULL));
@@ -1194,14 +1194,14 @@ dissect_q931_channel_identification_ie(const u_char *pd, int offset, int len,
* encoded, so just dump it as data and be done
* with it.
*/
- proto_tree_add_text(tree, offset,
+ proto_tree_add_text(tree, NullTVB, offset,
len, "Data: %s", bytes_to_str(&pd[offset], len));
return;
}
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Channel is indicated by %s",
(octet & Q931_IS_SLOT_MAP) ? "slot map" : "number");
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"%s type: %s",
(octet & Q931_IS_SLOT_MAP) ? "Map element" : "Channel",
val_to_str(octet & 0x0F, q931_element_type_vals,
@@ -1237,7 +1237,7 @@ dissect_q931_progress_indicator_ie(const u_char *pd, int offset, int len,
return;
octet = pd[offset];
coding_standard = octet & 0x60;
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Coding standard: %s",
val_to_str(coding_standard, q931_cause_coding_standard_vals, NULL));
if (coding_standard != Q931_ITU_STANDARDIZED_CODING) {
@@ -1245,11 +1245,11 @@ dissect_q931_progress_indicator_ie(const u_char *pd, int offset, int len,
* We don't know how the progress indicator is encoded,
* so just dump it as data and be done with it.
*/
- proto_tree_add_text(tree, offset,
+ proto_tree_add_text(tree, NullTVB, offset,
len, "Data: %s", bytes_to_str(&pd[offset], len));
return;
}
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Location: %s",
val_to_str(octet & 0x0F, q931_cause_location_vals,
"Unknown (0x%X)"));
@@ -1259,7 +1259,7 @@ dissect_q931_progress_indicator_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Progress description: %s",
val_to_str(octet & 0x7F, q931_progress_description_vals,
"Unknown (0x%02X)"));
@@ -1294,7 +1294,7 @@ dissect_q931_ns_facilities_ie(const u_char *pd, int offset, int len,
return;
octet = pd[offset];
netid_len = octet & 0x7F;
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Network identification length: %u",
netid_len);
offset += 1;
@@ -1303,11 +1303,11 @@ dissect_q931_ns_facilities_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Type of network identification: %s",
val_to_str(octet & 0x70, q931_netid_type_vals,
"Unknown (0x%02X)"));
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Network identification plan: %s",
val_to_str(octet & 0x0F, q931_netid_plan_vals,
"Unknown (0x%02X)"));
@@ -1320,7 +1320,7 @@ dissect_q931_ns_facilities_ie(const u_char *pd, int offset, int len,
if (netid_len > len)
netid_len = len;
if (netid_len != 0) {
- proto_tree_add_text(tree, offset, netid_len,
+ proto_tree_add_text(tree, NullTVB, offset, netid_len,
"Network identification: %.*s",
netid_len, &pd[offset]);
offset += netid_len;
@@ -1334,7 +1334,7 @@ dissect_q931_ns_facilities_ie(const u_char *pd, int offset, int len,
*/
if (len == 0)
return;
- proto_tree_add_text(tree, offset,
+ proto_tree_add_text(tree, NullTVB, offset,
len, "Network-specific facility specification: %s",
bytes_to_str(&pd[offset], len));
}
@@ -1358,7 +1358,7 @@ dissect_q931_notification_indicator_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Notification description: %s",
val_to_str(octet & 0x7F, q931_notification_description_vals,
"Unknown (0x%02X)"));
@@ -1372,7 +1372,7 @@ dissect_q931_date_time_ie(const u_char *pd, int offset, int len,
proto_tree *tree)
{
if (len != 6) {
- proto_tree_add_text(tree, offset, len,
+ proto_tree_add_text(tree, NullTVB, offset, len,
"Date/time: length is %d, should be 6\n", len);
return;
}
@@ -1380,7 +1380,7 @@ dissect_q931_date_time_ie(const u_char *pd, int offset, int len,
* XXX - what is "year" relative to? Is "month" 0-origin or
* 1-origin? Q.931 doesn't say....
*/
- proto_tree_add_text(tree, offset, 6,
+ proto_tree_add_text(tree, NullTVB, offset, 6,
"Date/time: %02u-%02u-%02u %02u:%02u:%02u",
pd[offset + 0], pd[offset + 1], pd[offset + 2],
pd[offset + 3], pd[offset + 4], pd[offset + 5]);
@@ -1418,11 +1418,11 @@ dissect_q931_signal_ie(const u_char *pd, int offset, int len,
proto_tree *tree)
{
if (len != 1) {
- proto_tree_add_text(tree, offset, len,
+ proto_tree_add_text(tree, NullTVB, offset, len,
"Signal: length is %d, should be 1\n", len);
return;
}
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Signal: %s",
val_to_str(pd[offset], q931_signal_vals, "Unknown (0x%02X)"));
}
@@ -1450,23 +1450,23 @@ dissect_q931_information_rate_ie(const u_char *pd, int offset, int len,
proto_tree *tree)
{
if (len != 4) {
- proto_tree_add_text(tree, offset, len,
+ proto_tree_add_text(tree, NullTVB, offset, len,
"Information rate: length is %d, should be 4\n", len);
return;
}
- proto_tree_add_text(tree, offset + 0, 1,
+ proto_tree_add_text(tree, NullTVB, offset + 0, 1,
"Incoming information rate: %s",
val_to_str(pd[offset + 0] & 0x1F, q931_throughput_class_vals,
"Unknown (0x%02X)"));
- proto_tree_add_text(tree, offset + 1, 1,
+ proto_tree_add_text(tree, NullTVB, offset + 1, 1,
"Outgoing information rate: %s",
val_to_str(pd[offset + 1] & 0x1F, q931_throughput_class_vals,
"Unknown (0x%02X)"));
- proto_tree_add_text(tree, offset + 2, 1,
+ proto_tree_add_text(tree, NullTVB, offset + 2, 1,
"Minimum incoming information rate: %s",
val_to_str(pd[offset + 2] & 0x1F, q931_throughput_class_vals,
"Unknown (0x%02X)"));
- proto_tree_add_text(tree, offset + 3, 1,
+ proto_tree_add_text(tree, NullTVB, offset + 3, 1,
"Minimum outgoing information rate: %s",
val_to_str(pd[offset + 3] & 0x1F, q931_throughput_class_vals,
"Unknown (0x%02X)"));
@@ -1530,17 +1530,17 @@ dissect_q931_guint16_value(const u_char *pd, int offset, int len,
len -= 1;
value_len++;
- proto_tree_add_text(tree, offset, value_len, "%s: %u ms", label,
+ proto_tree_add_text(tree, NullTVB, offset, value_len, "%s: %u ms", label,
value);
return value_len;
past_end:
- proto_tree_add_text(tree, offset, len,
+ proto_tree_add_text(tree, NullTVB, offset, len,
"%s goes past end of information element", label);
return -1;
bad_length:
- proto_tree_add_text(tree, offset, len, "%s isn't 3 octets long",
+ proto_tree_add_text(tree, NullTVB, offset, len, "%s isn't 3 octets long",
label);
return -1;
}
@@ -1611,18 +1611,18 @@ dissect_q931_pl_binary_parameters_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Fast select: %s",
val_to_str(octet & 0x18, q931_fast_selected_vals,
NULL));
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"%s",
(octet & 0x04) ? "No request/request denied" :
"Request indicated/request accepted");
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"%s confirmation",
(octet & 0x02) ? "Link-by-link" : "End-to-end");
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Modulus %u sequencing",
(octet & 0x01) ? 8 : 128);
}
@@ -1636,14 +1636,14 @@ dissect_q931_pl_window_size_ie(const u_char *pd, int offset, int len,
{
if (len == 0)
return;
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Forward value: %u", pd[offset] & 0x7F);
offset += 1;
len -= 1;
if (len == 0)
return;
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Backward value: %u", pd[offset] & 0x7F);
}
@@ -1656,14 +1656,14 @@ dissect_q931_packet_size_ie(const u_char *pd, int offset, int len,
{
if (len == 0)
return;
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Forward value: %u", pd[offset] & 0x7F);
offset += 1;
len -= 1;
if (len == 0)
return;
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Backward value: %u", pd[offset] & 0x7F);
}
@@ -1681,7 +1681,7 @@ dissect_q931_cug_ie(const u_char *pd, int offset, int len, proto_tree *tree)
{
if (len == 0)
return;
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"CUG indication: %s",
val_to_str(pd[offset] & 0x07, q931_cug_indication_vals,
"Unknown (0x%02X)"));
@@ -1690,7 +1690,7 @@ dissect_q931_cug_ie(const u_char *pd, int offset, int len, proto_tree *tree)
if (len == 0)
return;
- proto_tree_add_text(tree, offset, len, "CUG index code: %.*s", len,
+ proto_tree_add_text(tree, NullTVB, offset, len, "CUG index code: %.*s", len,
&pd[offset]);
}
@@ -1708,7 +1708,7 @@ dissect_q931_reverse_charge_ind_ie(const u_char *pd, int offset, int len,
{
if (len == 0)
return;
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Reverse charging indication: %s",
val_to_str(pd[offset] & 0x07, q931_reverse_charging_indication_vals,
"Unknown (0x%02X)"));
@@ -1772,11 +1772,11 @@ dissect_q931_number_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Type of number: %s",
val_to_str(octet & 0x70, q931_number_type_vals,
"Unknown (0x%02X)"));
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Numbering plan: %s",
val_to_str(octet & 0x0F, q931_numbering_plan_vals,
"Unknown (0x%02X)"));
@@ -1787,11 +1787,11 @@ dissect_q931_number_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Presentation indicator: %s",
val_to_str(octet & 0x60, q931_presentation_indicator_vals,
"Unknown (0x%X)"));
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Screening indicator: %s",
val_to_str(octet & 0x03, q931_screening_indicator_vals,
"Unknown (0x%X)"));
@@ -1806,7 +1806,7 @@ dissect_q931_number_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Reason for redirection: %s",
val_to_str(octet & 0x0F, q931_redirection_reason_vals,
"Unknown (0x%X)"));
@@ -1816,7 +1816,7 @@ dissect_q931_number_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
- proto_tree_add_text(tree, offset, len, "Number: %.*s",
+ proto_tree_add_text(tree, NullTVB, offset, len, "Number: %.*s",
len, &pd[offset]);
}
@@ -1844,11 +1844,11 @@ dissect_q931_party_subaddr_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Type of subaddress: %s",
val_to_str(octet & 0x70, q931_subaddress_type_vals,
"Unknown (0x%02X)"));
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Odd/even indicator: %s",
val_to_str(octet & 0x10, q931_odd_even_indicator_vals,
NULL));
@@ -1857,7 +1857,7 @@ dissect_q931_party_subaddr_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
- proto_tree_add_text(tree, offset, len, "Subaddress: %s",
+ proto_tree_add_text(tree, NullTVB, offset, len, "Subaddress: %s",
bytes_to_str(&pd[offset], len));
}
@@ -1876,11 +1876,11 @@ dissect_q931_restart_indicator_ie(const u_char *pd, int offset, int len,
proto_tree *tree)
{
if (len != 1) {
- proto_tree_add_text(tree, offset, len,
+ proto_tree_add_text(tree, NullTVB, offset, len,
"Restart indicator: length is %d, should be 1\n", len);
return;
}
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Restart indicator: %s",
val_to_str(pd[offset] & 0x07, q931_restart_indicator_class_vals,
"Unknown (0x%02X)"));
@@ -1930,7 +1930,7 @@ dissect_q931_high_layer_compat_ie(const u_char *pd, int offset, int len,
return;
octet = pd[offset];
coding_standard = octet & 0x60;
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Coding standard: %s",
val_to_str(coding_standard, q931_coding_standard_vals, NULL));
if (coding_standard != Q931_ITU_STANDARDIZED_CODING) {
@@ -1938,7 +1938,7 @@ dissect_q931_high_layer_compat_ie(const u_char *pd, int offset, int len,
* We don't know how the call state is encoded,
* so just dump it as data and be done with it.
*/
- proto_tree_add_text(tree, offset,
+ proto_tree_add_text(tree, NullTVB, offset,
len, "Data: %s", bytes_to_str(&pd[offset], len));
return;
}
@@ -1947,7 +1947,7 @@ dissect_q931_high_layer_compat_ie(const u_char *pd, int offset, int len,
return;
octet = pd[offset];
characteristics = octet & 0x7F;
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"High layer characteristics identification: %s",
val_to_str(characteristics, q931_high_layer_characteristics_vals,
NULL));
@@ -1959,12 +1959,12 @@ dissect_q931_high_layer_compat_ie(const u_char *pd, int offset, int len,
return;
octet = pd[offset];
if (characteristics == Q931_AUDIOVISUAL) {
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Extended audiovisual characteristics identification: %s",
val_to_str(octet & 0x7F, q931_audiovisual_characteristics_vals,
NULL));
} else {
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Extended high layer characteristics identification: %s",
val_to_str(octet & 0x7F, q931_high_layer_characteristics_vals,
NULL));
@@ -1998,7 +1998,7 @@ dissect_q931_user_user_ie(const u_char *pd, int offset, int len,
if (len == 0)
return;
octet = pd[offset];
- proto_tree_add_text(tree, offset, 1,
+ proto_tree_add_text(tree, NullTVB, offset, 1,
"Protocol discriminator: %s",
val_to_str(octet, q931_protocol_discriminator_vals,
"Unknown (0x%02x)"));
@@ -2010,12 +2010,12 @@ dissect_q931_user_user_ie(const u_char *pd, int offset, int len,
switch (octet) {
case Q931_PROTOCOL_DISCRIMINATOR_IA5:
- proto_tree_add_text(tree, offset, len, "User information: %.*s",
+ proto_tree_add_text(tree, NullTVB, offset, len, "User information: %.*s",
len, &pd[offset]);
break;
default:
- proto_tree_add_text(tree, offset, len, "User information: %s",
+ proto_tree_add_text(tree, NullTVB, offset, len, "User information: %s",
bytes_to_str(&pd[offset], len));
break;
}
@@ -2029,7 +2029,7 @@ dissect_q931_ia5_ie(const u_char *pd, int offset, int len, proto_tree *tree,
char *label)
{
if (len != 0) {
- proto_tree_add_text(tree, offset, len, "%s: %.*s", label, len,
+ proto_tree_add_text(tree, NullTVB, offset, len, "%s: %.*s", label, len,
&pd[offset]);
}
}
@@ -2061,22 +2061,22 @@ dissect_q931(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
col_add_str(fd, COL_PROTOCOL, "Q.931");
if (tree) {
- ti = proto_tree_add_item(tree, proto_q931, offset,
+ ti = proto_tree_add_item(tree, proto_q931, NullTVB, offset,
END_OF_FRAME, NULL);
q931_tree = proto_item_add_subtree(ti, ett_q931);
- proto_tree_add_item(q931_tree, hf_q931_discriminator, offset, 1, pd[offset]);
+ proto_tree_add_item(q931_tree, hf_q931_discriminator, NullTVB, offset, 1, pd[offset]);
}
offset += 1;
call_ref_len = pd[offset] & 0xF; /* XXX - do as a bit field? */
if (q931_tree != NULL)
- proto_tree_add_item(q931_tree, hf_q931_call_ref_len, offset, 1, call_ref_len);
+ proto_tree_add_item(q931_tree, hf_q931_call_ref_len, NullTVB, offset, 1, call_ref_len);
offset += 1;
if (call_ref_len != 0) {
/* XXX - split this into flag and value */
memcpy(call_ref, &pd[offset], call_ref_len);
if (q931_tree != NULL)
- proto_tree_add_item(q931_tree, hf_q931_call_ref, offset, call_ref_len, call_ref);
+ proto_tree_add_item(q931_tree, hf_q931_call_ref, NullTVB, offset, call_ref_len, call_ref);
offset += call_ref_len;
}
message_type = pd[offset];
@@ -2086,7 +2086,7 @@ dissect_q931(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
"Unknown message type (0x%02X)"));
}
if (q931_tree != NULL)
- proto_tree_add_item(q931_tree, hf_q931_message_type, offset, 1, message_type);
+ proto_tree_add_item(q931_tree, hf_q931_message_type, NullTVB, offset, 1, message_type);
offset += 1;
/*
@@ -2107,7 +2107,7 @@ dissect_q931(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
!(info_element & Q931_IE_SHIFT_LOCKING);
codeset = info_element & Q931_IE_SHIFT_CODESET;
if (q931_tree != NULL) {
- proto_tree_add_text(q931_tree, offset, 1,
+ proto_tree_add_text(q931_tree, NullTVB, offset, 1,
"%s shift to codeset %u: %s",
(non_locking_shift ? "Non-locking" : "Locking"),
codeset,
@@ -2122,21 +2122,21 @@ dissect_q931(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
case Q931_IE_MORE_DATA:
if (q931_tree != NULL) {
- proto_tree_add_text(q931_tree, offset, 1,
+ proto_tree_add_text(q931_tree, NullTVB, offset, 1,
"More data");
}
break;
case Q931_IE_SENDING_COMPLETE:
if (q931_tree != NULL) {
- proto_tree_add_text(q931_tree, offset, 1,
+ proto_tree_add_text(q931_tree, NullTVB, offset, 1,
"Sending complete");
}
break;
default:
if (q931_tree != NULL) {
- proto_tree_add_text(q931_tree, offset, 1,
+ proto_tree_add_text(q931_tree, NullTVB, offset, 1,
"Unknown information element (0x%02X",
info_element);
}
@@ -2149,7 +2149,7 @@ dissect_q931(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
case Q931_IE_CONGESTION_LEVEL:
if (q931_tree != NULL) {
- proto_tree_add_text(q931_tree, offset, 1,
+ proto_tree_add_text(q931_tree, NullTVB, offset, 1,
"Congestion level: %s",
val_to_str(info_element & Q931_IE_SO_IE_MASK,
q931_congestion_level_vals,
@@ -2162,7 +2162,7 @@ dissect_q931(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
case Q931_IE_REPEAT_INDICATOR:
if (q931_tree != NULL) {
- proto_tree_add_text(q931_tree, offset, 1,
+ proto_tree_add_text(q931_tree, NullTVB, offset, 1,
"Repeat indicator: %s",
val_to_str(info_element & Q931_IE_SO_IE_MASK,
q931_repeat_indication_vals,
@@ -2186,16 +2186,16 @@ dissect_q931(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
if (!BYTES_ARE_IN_FRAME(offset + 2, info_element_len))
break; /* ran past end of frame */
if (q931_tree != NULL) {
- ti = proto_tree_add_text(q931_tree, offset,
+ ti = proto_tree_add_text(q931_tree, NullTVB, offset,
1+1+info_element_len, "%s",
val_to_str(info_element, q931_info_element_vals,
"Unknown information element (0x%02X)"));
ie_tree = proto_item_add_subtree(ti, ett_q931_ie);
- proto_tree_add_text(ie_tree, offset, 1,
+ proto_tree_add_text(ie_tree, NullTVB, offset, 1,
"Information element: %s",
val_to_str(info_element, q931_info_element_vals,
"Unknown (0x%02X)"));
- proto_tree_add_text(ie_tree, offset + 1, 1,
+ proto_tree_add_text(ie_tree, NullTVB, offset + 1, 1,
"Length: %u", info_element_len);
switch (info_element) {
@@ -2333,7 +2333,7 @@ dissect_q931(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
break;
default:
- proto_tree_add_text(ie_tree, offset + 2,
+ proto_tree_add_text(ie_tree, NullTVB, offset + 2,
info_element_len, "Data: %s",
bytes_to_str(&pd[offset + 2],
info_element_len));