diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:26 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:26 +0000 |
commit | c4e8a3222648fcf22ca207f1815ebbf7cd144eeb (patch) | |
tree | 93d5c6aa93d9987680dd1adad5685e2ad698f223 /epan/dissectors/packet-icap.c | |
parent | Adding upstream version 4.2.6. (diff) | |
download | wireshark-upstream.tar.xz wireshark-upstream.zip |
Adding upstream version 4.4.0.upstream/4.4.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/packet-icap.c')
-rw-r--r-- | epan/dissectors/packet-icap.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/epan/dissectors/packet-icap.c b/epan/dissectors/packet-icap.c index b1d5e299..09020e49 100644 --- a/epan/dissectors/packet-icap.c +++ b/epan/dissectors/packet-icap.c @@ -29,19 +29,19 @@ typedef enum _icap_type { ICAP_OTHER } icap_type_t; -static int proto_icap = -1; -static int hf_icap_response = -1; -static int hf_icap_reqmod = -1; -static int hf_icap_respmod = -1; -static int hf_icap_options = -1; -/* static int hf_icap_other = -1; */ +static int proto_icap; +static int hf_icap_response; +static int hf_icap_reqmod; +static int hf_icap_respmod; +static int hf_icap_options; +/* static int hf_icap_other; */ -static gint ett_icap = -1; +static int ett_icap; static dissector_handle_t http_handle; #define TCP_PORT_ICAP 1344 -static int is_icap_message(const guchar *data, int linelen, icap_type_t *type); +static int is_icap_message(const unsigned char *data, int linelen, icap_type_t *type); static int dissect_icap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { @@ -49,12 +49,12 @@ dissect_icap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ proto_item *ti = NULL; proto_item *hidden_item; tvbuff_t *new_tvb; - gint offset = 0; - const guchar *line; - gint next_offset; - const guchar *linep, *lineend; + int offset = 0; + const unsigned char *line; + int next_offset; + const unsigned char *linep, *lineend; int linelen; - guchar c; + unsigned char c; icap_type_t icap_type; int datalen; @@ -70,7 +70,7 @@ dissect_icap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ * is not longer than what's in the buffer, so the * "tvb_get_ptr()" call won't throw an exception. */ - linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE); + linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, false); line = tvb_get_ptr(tvb, offset, linelen); icap_type = ICAP_OTHER; /* type not known yet */ if (is_icap_message(line, linelen, &icap_type)) @@ -90,13 +90,13 @@ dissect_icap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ */ icap_type = ICAP_OTHER; /* type not known yet */ while (tvb_offset_exists(tvb, offset)) { - gboolean is_icap = FALSE; - gboolean loop_done = FALSE; + bool is_icap = false; + bool loop_done = false; /* * Find the end of the line. */ linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, - FALSE); + false); /* * Get a buffer that refers to the line. @@ -122,7 +122,7 @@ dissect_icap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ * No. Does it look like a header? */ linep = line; - loop_done = FALSE; + loop_done = false; while (linep < lineend && (!loop_done)) { c = *linep++; @@ -134,7 +134,7 @@ dissect_icap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ * lines of a header? */ if (!g_ascii_isprint(c)) { - is_icap = FALSE; + is_icap = false; break; } @@ -167,8 +167,8 @@ dissect_icap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ * XXX - what about ' '? HTTP's checks * check for that. */ - is_icap = FALSE; - loop_done = TRUE; + is_icap = false; + loop_done = true; break; case ':': @@ -239,13 +239,13 @@ is_icap_header: static int -is_icap_message(const guchar *data, int linelen, icap_type_t *type) +is_icap_message(const unsigned char *data, int linelen, icap_type_t *type) { #define ICAP_COMPARE(string, length, msgtype) { \ if (strncmp(data, string, length) == 0) { \ if (*type == ICAP_OTHER) \ *type = msgtype; \ - return TRUE; \ + return true; \ } \ } /* @@ -261,7 +261,7 @@ is_icap_message(const guchar *data, int linelen, icap_type_t *type) ICAP_COMPARE("OPTIONS ", 8, ICAP_OPTIONS); /* options */ ICAP_COMPARE("RESPMOD ", 8, ICAP_RESPMOD); /* response mod */ } - return FALSE; + return false; #undef ICAP_COMPARE } @@ -272,27 +272,27 @@ proto_register_icap(void) { &hf_icap_response, { "Response", "icap.response", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "TRUE if ICAP response", HFILL }}, + "true if ICAP response", HFILL }}, { &hf_icap_reqmod, { "Reqmod", "icap.reqmod", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "TRUE if ICAP reqmod", HFILL }}, + "true if ICAP reqmod", HFILL }}, { &hf_icap_respmod, { "Respmod", "icap.respmod", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "TRUE if ICAP respmod", HFILL }}, + "true if ICAP respmod", HFILL }}, { &hf_icap_options, { "Options", "icap.options", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "TRUE if ICAP options", HFILL }}, + "true if ICAP options", HFILL }}, #if 0 { &hf_icap_other, { "Other", "icap.other", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "TRUE if ICAP other", HFILL }}, + "true if ICAP other", HFILL }}, #endif }; - static gint *ett[] = { + static int *ett[] = { &ett_icap, }; |