summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-git.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-git.c')
-rw-r--r--epan/dissectors/packet-git.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/epan/dissectors/packet-git.c b/epan/dissectors/packet-git.c
index a9644ac1..f2796b8b 100644
--- a/epan/dissectors/packet-git.c
+++ b/epan/dissectors/packet-git.c
@@ -28,20 +28,20 @@ void proto_reg_handoff_git(void);
static dissector_handle_t git_handle;
-static int proto_git = -1;
-static expert_field ei_git_bad_pkt_len = EI_INIT;
-static expert_field ei_git_malformed = EI_INIT;
+static int proto_git;
+static expert_field ei_git_bad_pkt_len;
+static expert_field ei_git_malformed;
-static gint ett_git = -1;
+static int ett_git;
-static gint hf_git_protocol_version = -1;
-static gint hf_git_packet_type = -1;
-static gint hf_git_packet_len = -1;
-static gint hf_git_packet_data = -1;
-static gint hf_git_sideband_control_code = -1;
-static gint hf_git_upload_pack_adv = -1;
-static gint hf_git_upload_pack_req = -1;
-static gint hf_git_upload_pack_res = -1;
+static int hf_git_protocol_version;
+static int hf_git_packet_type;
+static int hf_git_packet_len;
+static int hf_git_packet_data;
+static int hf_git_sideband_control_code;
+static int hf_git_upload_pack_adv;
+static int hf_git_upload_pack_req;
+static int hf_git_upload_pack_res;
#define PNAME "Git Smart Protocol"
#define PSNAME "Git"
@@ -73,22 +73,22 @@ static const value_string sideband_vals[] = {
};
/* desegmentation of Git over TCP */
-static gboolean git_desegment = TRUE;
+static bool git_desegment = true;
-static gboolean get_packet_length(tvbuff_t *tvb, int offset,
- guint16 *length)
+static bool get_packet_length(tvbuff_t *tvb, int offset,
+ uint16_t *length)
{
- guint8 *lenstr;
+ uint8_t *lenstr;
lenstr = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 4, ENC_ASCII);
return (sscanf(lenstr, "%hx", length) == 1);
}
-static guint
+static unsigned
get_git_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
{
- guint16 plen;
+ uint16_t plen;
if (!get_packet_length(tvb, offset, &plen))
return 0; /* No idea what this is */
@@ -110,15 +110,15 @@ get_git_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U
* offset, and returns to the caller for subsequent processing of the
* remainder of the data.
*/
-static gboolean
+static bool
dissect_pkt_line(tvbuff_t *tvb, packet_info *pinfo, proto_tree *git_tree,
int *offset)
{
- guint16 plen;
+ uint16_t plen;
// what type of pkt-line is it?
if (!get_packet_length(tvb, *offset, &plen))
- return FALSE;
+ return false;
if (plen < 4) { // a special packet (e.g., flush-pkt)
proto_item *ti =
proto_tree_add_uint(git_tree, hf_git_packet_type, tvb,
@@ -127,7 +127,7 @@ dissect_pkt_line(tvbuff_t *tvb, packet_info *pinfo, proto_tree *git_tree,
if (!try_val_to_str(plen, packet_type_vals))
expert_add_info(pinfo, ti, &ei_git_bad_pkt_len);
- return TRUE;
+ return true;
}
proto_tree_add_uint(git_tree, hf_git_packet_len, tvb, *offset, 4, plen);
@@ -154,7 +154,7 @@ dissect_pkt_line(tvbuff_t *tvb, packet_info *pinfo, proto_tree *git_tree,
* lacking that, let's assume for now that all pkt-lines starting with \1, \2, or \3
* are using sideband.
*/
- int sideband_code = tvb_get_guint8(tvb, *offset);
+ int sideband_code = tvb_get_uint8(tvb, *offset);
if (1 <= sideband_code && sideband_code <= 3) {
proto_tree_add_uint(git_tree, hf_git_sideband_control_code, tvb, *offset, 1,
@@ -165,7 +165,7 @@ dissect_pkt_line(tvbuff_t *tvb, packet_info *pinfo, proto_tree *git_tree,
proto_tree_add_item(git_tree, hf_git_packet_data, tvb, *offset, plen, ENC_NA);
*offset += plen;
- return TRUE;
+ return true;
}
static int
@@ -296,7 +296,7 @@ proto_register_git(void)
},
};
- static gint *ett[] = {
+ static int *ett[] = {
&ett_git,
};