summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-beep.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-beep.c')
-rw-r--r--epan/dissectors/packet-beep.c106
1 files changed, 53 insertions, 53 deletions
diff --git a/epan/dissectors/packet-beep.c b/epan/dissectors/packet-beep.c
index 56e4685e..e0306a83 100644
--- a/epan/dissectors/packet-beep.c
+++ b/epan/dissectors/packet-beep.c
@@ -33,33 +33,33 @@ void proto_reg_handoff_beep(void);
static dissector_handle_t beep_handle;
-static range_t *global_beep_tcp_ports = NULL;
-static int global_beep_strict_term = TRUE;
-
-static int proto_beep = -1;
-
-static int hf_beep_req = -1;
-static int hf_beep_cmd = -1;
-static int hf_beep_req_chan = -1;
-/* static int hf_beep_rsp_chan = -1; */
-static int hf_beep_seq_chan = -1;
-/* static int hf_beep_rsp = -1; */
-static int hf_beep_more = -1;
-static int hf_beep_msgno = -1;
-static int hf_beep_ansno = -1;
-static int hf_beep_seqno = -1;
-static int hf_beep_size = -1;
-static int hf_beep_channel = -1;
-static int hf_beep_mime_header = -1;
-static int hf_beep_header = -1;
+static range_t *global_beep_tcp_ports;
+static bool global_beep_strict_term = true;
+
+static int proto_beep;
+
+static int hf_beep_req;
+static int hf_beep_cmd;
+static int hf_beep_req_chan;
+/* static int hf_beep_rsp_chan; */
+static int hf_beep_seq_chan;
+/* static int hf_beep_rsp; */
+static int hf_beep_more;
+static int hf_beep_msgno;
+static int hf_beep_ansno;
+static int hf_beep_seqno;
+static int hf_beep_size;
+static int hf_beep_channel;
+static int hf_beep_mime_header;
+static int hf_beep_header;
#if 0
-static int hf_beep_status = -1;
+static int hf_beep_status;
#endif
-static int hf_beep_ackno = -1;
-static int hf_beep_window = -1;
-static int hf_beep_payload = -1;
-static int hf_beep_payload_undissected = -1;
-static int hf_beep_crlf_terminator = -1;
+static int hf_beep_ackno;
+static int hf_beep_window;
+static int hf_beep_payload;
+static int hf_beep_payload_undissected;
+static int hf_beep_crlf_terminator;
#if 0
static const value_string beep_status_vals[] = {
@@ -98,15 +98,15 @@ static int *seq_chan_hfa[] = { &hf_beep_channel, &hf_beep_seq_chan, NULL };
static int *seq_ackno_hfa[] = { &hf_beep_ackno, NULL };
static int *seq_window_hfa[] = { &hf_beep_window, NULL };
-static int ett_beep = -1;
-static int ett_mime_header = -1;
-static int ett_header = -1;
-static int ett_trailer = -1;
+static int ett_beep;
+static int ett_mime_header;
+static int ett_header;
+static int ett_trailer;
-static expert_field ei_beep_more = EI_INIT;
-static expert_field ei_beep_cr_terminator = EI_INIT;
-static expert_field ei_beep_lf_terminator = EI_INIT;
-static expert_field ei_beep_invalid_terminator = EI_INIT;
+static expert_field ei_beep_more;
+static expert_field ei_beep_cr_terminator;
+static expert_field ei_beep_lf_terminator;
+static expert_field ei_beep_invalid_terminator;
/* Get the state of the more flag ... */
@@ -135,11 +135,11 @@ struct beep_proto_data {
*/
struct beep_request_key {
- guint32 conversation;
+ uint32_t conversation;
};
struct beep_request_val {
- guint16 processed; /* Have we processed this conversation? */
+ uint16_t processed; /* Have we processed this conversation? */
int size; /* Size of the message */
/* We need an indication in each dirn of
* whether on not a mime header is expected
@@ -147,11 +147,11 @@ struct beep_request_val {
int c_mime_hdr, s_mime_hdr;
};
-static wmem_map_t *beep_request_hash = NULL;
+static wmem_map_t *beep_request_hash;
/* Hash Functions */
-static gint
-beep_equal(gconstpointer v, gconstpointer w)
+static int
+beep_equal(const void *v, const void *w)
{
const struct beep_request_key *v1 = (const struct beep_request_key *)v;
const struct beep_request_key *v2 = (const struct beep_request_key *)w;
@@ -168,11 +168,11 @@ beep_equal(gconstpointer v, gconstpointer w)
}
-static guint
-beep_hash(gconstpointer v)
+static unsigned
+beep_hash(const void *v)
{
const struct beep_request_key *key = (const struct beep_request_key *)v;
- guint val;
+ unsigned val;
val = key->conversation;
@@ -197,7 +197,7 @@ dissect_beep_more(tvbuff_t *tvb, packet_info *pinfo, int offset,
{
proto_item *hidden_item;
int ret = 0;
- guint8 more = tvb_get_guint8(tvb, offset);
+ uint8_t more = tvb_get_uint8(tvb, offset);
hidden_item = proto_tree_add_item(tree, hf_beep_more, tvb, offset, 1, ENC_ASCII|ENC_NA);
proto_item_set_hidden(hidden_item);
@@ -233,7 +233,7 @@ static int num_len(tvbuff_t *tvb, int offset)
{
unsigned int i = 0;
- while (g_ascii_isdigit(tvb_get_guint8(tvb, offset + i))) i++;
+ while (g_ascii_isdigit(tvb_get_uint8(tvb, offset + i))) i++;
return i;
@@ -257,22 +257,22 @@ check_term(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree)
* dissection ... so-be-it!
*/
- if ((tvb_get_guint8(tvb, offset) == 0x0d &&
- tvb_get_guint8(tvb, offset + 1) == 0x0a)){ /* Correct terminator */
+ if ((tvb_get_uint8(tvb, offset) == 0x0d &&
+ tvb_get_uint8(tvb, offset + 1) == 0x0a)){ /* Correct terminator */
proto_tree_add_item(tree, hf_beep_crlf_terminator, tvb, offset, 2, ENC_NA);
return 2;
}
- if ((tvb_get_guint8(tvb, offset) == 0x0d) && !global_beep_strict_term) {
+ if ((tvb_get_uint8(tvb, offset) == 0x0d) && !global_beep_strict_term) {
proto_tree_add_expert(tree, pinfo, &ei_beep_cr_terminator, tvb, offset, 1);
return 1;
}
- if ((tvb_get_guint8(tvb, offset) == 0x0a) && !global_beep_strict_term) {
+ if ((tvb_get_uint8(tvb, offset) == 0x0a) && !global_beep_strict_term) {
proto_tree_add_expert(tree, pinfo, &ei_beep_lf_terminator, tvb, offset, 1);
return 1;
@@ -287,7 +287,7 @@ check_term(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree)
static int header_len(tvbuff_t *tvb, int offset)
{
int i = 0;
- guint8 sc;
+ uint8_t sc;
/* FIXME: Have to make sure we stop looking at the end of the tvb ... */
@@ -297,8 +297,8 @@ static int header_len(tvbuff_t *tvb, int offset)
while (1) {
- if ((sc = tvb_get_guint8(tvb, offset + i)) == 0x0d
- && tvb_get_guint8(tvb, offset + i + 1) == 0x0a)
+ if ((sc = tvb_get_uint8(tvb, offset + i)) == 0x0d
+ && tvb_get_uint8(tvb, offset + i + 1) == 0x0a)
return i; /* Done here ... */
if (!global_beep_strict_term && (sc == 0x0d || sc == 0x0a))
@@ -474,7 +474,7 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* Include space */
proto_item_set_len(ti, 4);
- proto_tree_add_boolean(hdr, hf_beep_req, tvb, offset, 3, TRUE);
+ proto_tree_add_boolean(hdr, hf_beep_req, tvb, offset, 3, true);
}
offset += 4;
@@ -495,7 +495,7 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
*/
set_mime_hdr_flags(more, request_val, beep_frame_data, pinfo);
}
- else { /* Protocol violation, so dissect rest as undisectable */
+ else { /* Protocol violation, so dissect rest as undissectable */
if (tree && (tvb_reported_length_remaining(tvb, offset) > 0)) {
proto_tree_add_item(tree, hf_beep_payload_undissected, tvb, offset,
tvb_reported_length_remaining(tvb, offset), ENC_NA|ENC_ASCII);
@@ -944,7 +944,7 @@ proto_register_beep(void)
{ &hf_beep_crlf_terminator,
{ "Terminator: CRLF", "beep.crlf_terminator", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
};
- static gint *ett[] = {
+ static int *ett[] = {
&ett_beep,
&ett_mime_header,
&ett_header,