forked from osmocom/wireshark
Move dissect_pn_uint16_ret_item() to packet-pn.c, to be with its sibling
dissect_pn_uint16(). Declare it in packet-pn.h. svn path=/trunk/; revision=54733
This commit is contained in:
parent
4a09abdf67
commit
40791d0c4c
|
@ -117,28 +117,6 @@ static const value_string pn_mrp_prio_vals[] = {
|
|||
};
|
||||
#endif
|
||||
|
||||
/* routine disecting an uint16 and returning that item as well */
|
||||
/* dissect a 16 bit unsigned integer */
|
||||
int
|
||||
dissect_pn_uint16_ret_item(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
|
||||
proto_tree *tree, int hfindex, guint16 *pdata, proto_item ** new_item)
|
||||
{
|
||||
guint16 data;
|
||||
proto_item *item = NULL;
|
||||
|
||||
data = tvb_get_ntohs (tvb, offset);
|
||||
|
||||
if (tree) {
|
||||
item = proto_tree_add_uint(tree, hfindex, tvb, offset, 2, data);
|
||||
}
|
||||
if (pdata)
|
||||
*pdata = data;
|
||||
if (new_item)
|
||||
*new_item = item;
|
||||
return offset + 2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int
|
||||
dissect_PNMRP_Common(tvbuff_t *tvb, int offset,
|
||||
|
|
|
@ -61,6 +61,26 @@ dissect_pn_uint8(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
|
|||
return offset + 1;
|
||||
}
|
||||
|
||||
/* dissect a 16 bit unsigned integer; return the item through a pointer as well */
|
||||
int
|
||||
dissect_pn_uint16_ret_item(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
|
||||
proto_tree *tree, int hfindex, guint16 *pdata, proto_item ** new_item)
|
||||
{
|
||||
guint16 data;
|
||||
proto_item *item = NULL;
|
||||
|
||||
data = tvb_get_ntohs (tvb, offset);
|
||||
|
||||
if (tree) {
|
||||
item = proto_tree_add_uint(tree, hfindex, tvb, offset, 2, data);
|
||||
}
|
||||
if (pdata)
|
||||
*pdata = data;
|
||||
if (new_item)
|
||||
*new_item = item;
|
||||
return offset + 2;
|
||||
}
|
||||
|
||||
/* dissect a 16 bit unsigned integer */
|
||||
int
|
||||
dissect_pn_uint16(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
|
||||
|
|
|
@ -33,6 +33,8 @@ extern void init_pn(int proto);
|
|||
extern int dissect_pn_uint8(tvbuff_t *tvb, gint offset, packet_info *pinfo,
|
||||
proto_tree *tree, int hfindex, guint8 *pdata);
|
||||
|
||||
extern int dissect_pn_uint16_ret_item(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
|
||||
proto_tree *tree, int hfindex, guint16 *pdata, proto_item ** new_item);
|
||||
extern int dissect_pn_uint16(tvbuff_t *tvb, gint offset, packet_info *pinfo,
|
||||
proto_tree *tree, int hfindex, guint16 *pdata);
|
||||
|
||||
|
|
Loading…
Reference in New Issue