Other "related" dissectors weren't manipulating pinfo->private_data, so it doesn't make sense for them to bother saving/restore it (now that q_bit_set isn't being used)
svn path=/trunk/; revision=52894
int kiss_param_len;
const char *frame_type_text;
char *info_buffer;
- void *saved_private_data;
tvbuff_t *next_tvb = NULL;
info_buffer = (char *)wmem_alloc( wmem_packet_scope(), STRLEN );
proto_tree_add_uint( kiss_tree, hf_ax25_kiss_cmd, tvb, offset, KISS_HEADER_SIZE,
kiss_cmd );
proto_tree_add_uint( kiss_tree, hf_ax25_kiss_port, tvb, offset, KISS_HEADER_SIZE,
- kiss_cmd );
+ kiss_port );
offset += KISS_HEADER_SIZE;
switch ( kiss_type )
if ( kiss_type == KISS_DATA_FRAME )
{
- saved_private_data = pinfo->private_data;
next_tvb = tvb_new_subset_remaining( tvb, offset );
call_dissector( ax25_handle, next_tvb, pinfo, parent_tree );
- pinfo->private_data = saved_private_data;
}
}
proto_tree *ax25_nol3_tree;
char *info_buffer;
int offset;
- void *saved_private_data;
tvbuff_t *next_tvb = NULL;
guint8 dti = 0;
gboolean dissected;
"AX.25 No Layer 3 - (%s)", info_buffer );
ax25_nol3_tree = proto_item_add_subtree( ti, ett_ax25_nol3 );
- saved_private_data = pinfo->private_data;
next_tvb = tvb_new_subset_remaining(tvb, offset);
-
dissected = FALSE;
if ( gPREF_APRS )
{
if ( ! dissected )
call_dissector( default_handle , next_tvb, pinfo, ax25_nol3_tree );
- pinfo->private_data = saved_private_data;
}
}
guint8 pid = AX25_P_NO_L3;
guint8 src_ssid;
guint8 dst_ssid;
- void *saved_private_data;
tvbuff_t *next_tvb = NULL;
proto_item_set_end(ti, tvb, offset);
- saved_private_data = pinfo->private_data;
-
next_tvb = tvb_new_subset_remaining(tvb, offset);
if (!dissector_try_uint(ax25_dissector_table, pid, next_tvb, pinfo, parent_tree))
{
call_dissector(data_handle, next_tvb, pinfo, parent_tree);
}
-
- pinfo->private_data = saved_private_data;
}
else
proto_item_set_end(ti, tvb, offset);
proto_tree *bpq_tree;
int offset;
guint16 bpq_len;
- void *saved_private_data;
tvbuff_t *next_tvb;
offset += BPQ_HEADER_SIZE;
- saved_private_data = pinfo->private_data;
/* XXX - use the length */
next_tvb = tvb_new_subset_remaining( tvb, offset );
call_dissector( ax25_handle, next_tvb, pinfo, parent_tree );
- pinfo->private_data = saved_private_data;
}
void
static void
dissect_flexnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
{
- void *saved_private_data;
tvbuff_t *next_tvb;
col_set_str( pinfo->cinfo, COL_PROTOCOL, "Flexnet");
/* Call sub-dissectors here */
- saved_private_data = pinfo->private_data;
next_tvb = tvb_new_subset_remaining(tvb, FLEXNET_HDRLEN);
-
call_dissector( default_handle , next_tvb, pinfo, parent_tree );
-
- pinfo->private_data = saved_private_data;
}
void
guint8 op_code;
guint8 cct_index;
guint8 cct_id;
- void *saved_private_data;
tvbuff_t *next_tvb = NULL;
col_set_str( pinfo->cinfo, COL_PROTOCOL, "NET/ROM" );
/* Call sub-dissectors here */
- saved_private_data = pinfo->private_data;
next_tvb = tvb_new_subset_remaining(tvb, offset);
switch ( op_code )
call_dissector( default_handle , next_tvb, pinfo, tree );
break;
}
-
- pinfo->private_data = saved_private_data;
}
static void
dissect_netrom_routing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- void *saved_private_data;
tvbuff_t *next_tvb;
col_set_str( pinfo->cinfo, COL_PROTOCOL, "NET/ROM");
proto_tree_add_item( netrom_tree, hf_netrom_mnemonic, tvb, 1, 6, ENC_ASCII|ENC_NA );
}
- saved_private_data = pinfo->private_data;
next_tvb = tvb_new_subset_remaining(tvb, 7);
call_dissector( default_handle , next_tvb, pinfo, tree );
-
- pinfo->private_data = saved_private_data;
-
}
/* Code to actually dissect the packets */
};
-static void
-dissect_qllc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_qllc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
- proto_tree *qllc_tree = NULL;
- proto_item *qllc_ti = NULL;
- gboolean *q_bit_set = (gboolean *)pinfo->private_data;
+ proto_tree *qllc_tree;
+ proto_item *qllc_ti;
+ gboolean *q_bit_set = (gboolean *)data;
guint8 addr, ctrl;
gboolean command = FALSE;
* If the Q bit isn't set, this is just SNA data.
*/
if (!(*q_bit_set)) {
- call_dissector(sna_handle, tvb, pinfo, tree);
- return;
+ call_dissector(sna_handle, tvb, pinfo, tree);
+ return tvb_length(tvb);
}
/* Summary information */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "QLLC");
col_clear(pinfo->cinfo, COL_INFO);
- if (tree) {
- qllc_ti = proto_tree_add_item(tree, proto_qllc, tvb, 0, -1, ENC_NA);
- qllc_tree = proto_item_add_subtree(qllc_ti, ett_qllc);
- }
+ qllc_ti = proto_tree_add_item(tree, proto_qllc, tvb, 0, -1, ENC_NA);
+ qllc_tree = proto_item_add_subtree(qllc_ti, ett_qllc);
/* Get the address; we need it to determine if this is a
* COMMAND or a RESPONSE */
addr = tvb_get_guint8(tvb, 0);
- if (tree) {
proto_tree_add_item(qllc_tree, hf_qllc_address, tvb, 0, 1, ENC_BIG_ENDIAN);
- }
/* The address field equals X'FF' in commands (except QRR)
* and anything in responses. */
* a COMMAND or RESPONSE. */
if (ctrl == QRD_QDISC_VALUE) {
if (command) {
- col_set_str(pinfo->cinfo, COL_INFO, QDISC_TEXT);
+ col_set_str(pinfo->cinfo, COL_INFO, QDISC_TEXT);
if (tree) {
proto_tree_add_text(qllc_tree, tvb,
1, 1, "Control Field: %s (0x%02x)", QDISC_TEXT, ctrl);
}
}
else {
- col_set_str(pinfo->cinfo, COL_INFO, QRD_TEXT);
+ col_set_str(pinfo->cinfo, COL_INFO, QRD_TEXT);
if (tree) {
proto_tree_add_text(qllc_tree, tvb,
1, 1, "Control Field: %s (0x%02x)", QRD_TEXT, ctrl);
if (ctrl == QXID || ctrl == QTEST || ctrl == QFRMR) {
/* yes */
}
+
+ return tvb_length(tvb);
}
void
&ett_qllc,
};
- proto_qllc = proto_register_protocol("Qualified Logical Link Control",
- "QLLC", "qllc");
+ proto_qllc = proto_register_protocol("Qualified Logical Link Control", "QLLC", "qllc");
proto_register_field_array(proto_qllc, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("qllc", dissect_qllc, proto_qllc);
+ new_register_dissector("qllc", dissect_qllc, proto_qllc);
}
void
guint x25_pkt_len;
int modulo;
guint16 vc;
- dissector_handle_t dissect = NULL;
+ dissector_handle_t dissect;
gboolean toa; /* TOA/NPI address format */
guint16 bytes0_1;
guint8 pkt_type;
gboolean m_bit_set;
gint payload_len;
guint32 frag_key;
- void *saved_private_data;
fragment_head *fd_head;
*/
dissect = dissector_get_uint_handle(x25_subdissector_table, spi);
if (dissect != NULL)
- x25_hash_add_proto_start(vc, pinfo->fd->num, dissect);
+ x25_hash_add_proto_start(vc, pinfo->fd->num, dissect);
}
/*
if (!next_tvb)
next_tvb = tvb_new_subset_remaining(tvb, localoffset);
- saved_private_data = pinfo->private_data;
- pinfo->private_data = &q_bit_set;
-
/* See if there's already a dissector for this circuit. */
if (try_circuit_dissector(CT_X25, vc, pinfo->fd->num, next_tvb, pinfo,
- tree, NULL)) {
- pinfo->private_data = saved_private_data;
- return; /* found it and dissected it */
+ tree, &q_bit_set)) {
+ return; /* found it and dissected it */
}
/* Did the user suggest QLLC/SNA? */
/* Yes - dissect it as QLLC/SNA. */
if (!pinfo->fd->flags.visited)
x25_hash_add_proto_start(vc, pinfo->fd->num, qllc_handle);
- call_dissector(qllc_handle, next_tvb, pinfo, tree);
- pinfo->private_data = saved_private_data;
+ call_dissector_with_data(qllc_handle, next_tvb, pinfo, tree, &q_bit_set);
return;
}
if (!pinfo->fd->flags.visited)
x25_hash_add_proto_start(vc, pinfo->fd->num, ositp_handle);
call_dissector(ositp_handle, next_tvb, pinfo, tree);
- pinfo->private_data = saved_private_data;
return;
}
}
if (!pinfo->fd->flags.visited)
x25_hash_add_proto_start(vc, pinfo->fd->num, ip_handle);
call_dissector(ip_handle, next_tvb, pinfo, tree);
- pinfo->private_data = saved_private_data;
return;
case NLPID_ISO8473_CLNP:
if (!pinfo->fd->flags.visited)
x25_hash_add_proto_start(vc, pinfo->fd->num, clnp_handle);
call_dissector(clnp_handle, next_tvb, pinfo, tree);
- pinfo->private_data = saved_private_data;
return;
}
}
/* Try the heuristic dissectors. */
if (dissector_try_heuristic(x25_heur_subdissector_list, next_tvb, pinfo,
tree, NULL)) {
- pinfo->private_data = saved_private_data;
return;
}
/* All else failed; dissect it as raw data */
call_dissector(data_handle, next_tvb, pinfo, tree);
- pinfo->private_data = saved_private_data;
}
/*
{ 0, NULL },
};
-static void
-dissect_x29(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_x29(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
int offset = 0;
- proto_tree *x29_tree = NULL;
+ proto_tree *x29_tree;
proto_item *ti;
- gboolean *q_bit_set = (gboolean *)pinfo->private_data;
+ gboolean *q_bit_set = (gboolean *)data;
guint8 msg_code;
guint8 error_type;
guint8 type_ref;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "X.29");
col_clear(pinfo->cinfo, COL_INFO);
- if (tree) {
- ti = proto_tree_add_item(tree, proto_x29, tvb, offset, -1,
- ENC_NA);
- x29_tree = proto_item_add_subtree(ti, ett_x29);
- }
+ ti = proto_tree_add_item(tree, proto_x29, tvb, offset, -1, ENC_NA);
+ x29_tree = proto_item_add_subtree(ti, ett_x29);
if (*q_bit_set) {
/*
}
}
}
+
+ return tvb_length(tvb);
}
void
{
dissector_handle_t x29_handle;
- x29_handle = create_dissector_handle(dissect_x29, proto_x29);
+ x29_handle = new_create_dissector_handle(dissect_x29, proto_x29);
dissector_add_uint("x.25.spi", NLPID_SPI_X_29, x29_handle);
}