summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-lapsat.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-lapsat.c')
-rw-r--r--epan/dissectors/packet-lapsat.c112
1 files changed, 56 insertions, 56 deletions
diff --git a/epan/dissectors/packet-lapsat.c b/epan/dissectors/packet-lapsat.c
index ce3f8446..0e6161f5 100644
--- a/epan/dissectors/packet-lapsat.c
+++ b/epan/dissectors/packet-lapsat.c
@@ -27,53 +27,53 @@
void proto_register_lapsat(void);
-static int proto_lapsat = -1;
+static int proto_lapsat;
static reassembly_table lapsat_reassembly_table;
static dissector_table_t lapsat_sapi_dissector_table;
-static gint ett_lapsat = -1;
-static gint ett_lapsat_address = -1;
-static gint ett_lapsat_control = -1;
-static gint ett_lapsat_fragment = -1;
-static gint ett_lapsat_fragments = -1;
-
-static int hf_lapsat_addr = -1;
-static int hf_lapsat_addr_sst = -1;
-static int hf_lapsat_addr_cr = -1;
-static int hf_lapsat_addr_sapi = -1;
-static int hf_lapsat_addr_si = -1;
-static int hf_lapsat_addr_lpd = -1;
-static int hf_lapsat_addr_lfi = -1;
-
-static int hf_lapsat_ctl = -1;
-static int hf_lapsat_ctl_ftype_i = -1;
-static int hf_lapsat_ctl_ftype_s_u = -1;
-static int hf_lapsat_ctl_s_ftype = -1;
-static int hf_lapsat_ctl_u_modifier_cmd = -1;
-static int hf_lapsat_ctl_u_modifier_resp = -1;
-static int hf_lapsat_ctl_n_r = -1;
-static int hf_lapsat_ctl_n_s = -1;
-static int hf_lapsat_ctl_p = -1;
-static int hf_lapsat_ctl_f = -1;
-static int hf_lapsat_ctl_mii = -1;
-
-static int hf_lapsat_payload_last_nibble = -1;
-
-static int hf_lapsat_len = -1;
-
-static int hf_lapsat_fragment_data = -1;
-static int hf_lapsat_fragments = -1;
-static int hf_lapsat_fragment = -1;
-static int hf_lapsat_fragment_overlap = -1;
-static int hf_lapsat_fragment_overlap_conflicts = -1;
-static int hf_lapsat_fragment_multiple_tails = -1;
-static int hf_lapsat_fragment_too_long_fragment = -1;
-static int hf_lapsat_fragment_error = -1;
-static int hf_lapsat_fragment_count = -1;
-static int hf_lapsat_reassembled_in = -1;
-static int hf_lapsat_reassembled_length = -1;
+static int ett_lapsat;
+static int ett_lapsat_address;
+static int ett_lapsat_control;
+static int ett_lapsat_fragment;
+static int ett_lapsat_fragments;
+
+static int hf_lapsat_addr;
+static int hf_lapsat_addr_sst;
+static int hf_lapsat_addr_cr;
+static int hf_lapsat_addr_sapi;
+static int hf_lapsat_addr_si;
+static int hf_lapsat_addr_lpd;
+static int hf_lapsat_addr_lfi;
+
+static int hf_lapsat_ctl;
+static int hf_lapsat_ctl_ftype_i;
+static int hf_lapsat_ctl_ftype_s_u;
+static int hf_lapsat_ctl_s_ftype;
+static int hf_lapsat_ctl_u_modifier_cmd;
+static int hf_lapsat_ctl_u_modifier_resp;
+static int hf_lapsat_ctl_n_r;
+static int hf_lapsat_ctl_n_s;
+static int hf_lapsat_ctl_p;
+static int hf_lapsat_ctl_f;
+static int hf_lapsat_ctl_mii;
+
+static int hf_lapsat_payload_last_nibble;
+
+static int hf_lapsat_len;
+
+static int hf_lapsat_fragment_data;
+static int hf_lapsat_fragments;
+static int hf_lapsat_fragment;
+static int hf_lapsat_fragment_overlap;
+static int hf_lapsat_fragment_overlap_conflicts;
+static int hf_lapsat_fragment_multiple_tails;
+static int hf_lapsat_fragment_too_long_fragment;
+static int hf_lapsat_fragment_error;
+static int hf_lapsat_fragment_count;
+static int hf_lapsat_reassembled_in;
+static int hf_lapsat_reassembled_length;
#define LAPSAT_HEADER_LEN 3
@@ -232,12 +232,12 @@ static const fragment_items lapsat_frag_items = {
* Main dissection functions
*/
-static guint16
+static uint16_t
dissect_control(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int is_response)
{
proto_tree *ctl_tree;
proto_item *ctl_ti;
- guint16 ctl, poll_final;
+ uint16_t ctl, poll_final;
const char *frame_type;
char *info;
@@ -323,7 +323,7 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int is_
/* Create item & subtree */
ctl_ti = proto_tree_add_uint_format_value(
tree, hf_lapsat_ctl,
- tvb, 1, 2, (guint32)ctl,
+ tvb, 1, 2, (uint32_t)ctl,
"%s (0x%03x)", info, ctl
);
@@ -407,8 +407,8 @@ dissect_lapsat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dissec
proto_tree *lapsat_tree, *addr_tree;
proto_item *lapsat_ti, *addr_ti;
tvbuff_t *payload;
- guint8 addr, sapi, cr;
- guint16 control;
+ uint8_t addr, sapi, cr;
+ uint16_t control;
unsigned int hlen, is_response = 0, plen;
/* Check that there's enough data */
@@ -419,16 +419,16 @@ dissect_lapsat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dissec
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LAPSat");
/* Grab a couple of fields */
- addr = tvb_get_guint8(tvb, 0);
+ addr = tvb_get_uint8(tvb, 0);
sapi = (addr & LAPSAT_SAPI_MSK) >> LAPSAT_SAPI_SHIFT;
cr = addr & LAPSAT_CR;
if (pinfo->p2p_dir == P2P_DIR_RECV) {
- is_response = cr ? FALSE : TRUE;
+ is_response = cr ? false : true;
}
else if (pinfo->p2p_dir == P2P_DIR_SENT) {
- is_response = cr ? TRUE : FALSE;
+ is_response = cr ? true : false;
}
hlen = LAPSAT_HEADER_LEN;
@@ -468,15 +468,15 @@ dissect_lapsat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dissec
/* Get the payload */
plen = (addr & LAPSAT_LFI) ?
- tvb_get_guint8(tvb, 3) : tvb_captured_length(tvb) - hlen;
+ tvb_get_uint8(tvb, 3) : tvb_captured_length(tvb) - hlen;
if (!plen)
return 3; /* No point in doing more if there is no payload */
if ((plen + hlen) == tvb_captured_length(tvb)) {
/* Need to integrate the last nibble */
- guint8 *data = (guint8 *)tvb_memdup(pinfo->pool, tvb, hlen, plen);
- data[plen-1] |= tvb_get_guint8(tvb, 2) << 4;
+ uint8_t *data = (uint8_t *)tvb_memdup(pinfo->pool, tvb, hlen, plen);
+ data[plen-1] |= tvb_get_uint8(tvb, 2) << 4;
payload = tvb_new_child_real_data(tvb, data, plen, plen);
} else {
/* Last nibble doesn't need merging */
@@ -492,8 +492,8 @@ dissect_lapsat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dissec
*/
fragment_head *fd_m = NULL;
tvbuff_t *reassembled = NULL;
- guint32 fragment_id;
- gboolean save_fragmented = pinfo->fragmented;
+ uint32_t fragment_id;
+ bool save_fragmented = pinfo->fragmented;
/* Is this a fragment ? */
pinfo->fragmented = !!(addr & LAPSAT_SI);
@@ -715,7 +715,7 @@ proto_register_lapsat(void)
},
};
- static gint *ett[] = {
+ static int *ett[] = {
&ett_lapsat,
&ett_lapsat_address,
&ett_lapsat_control,