summaryrefslogtreecommitdiffstats
path: root/ui/cli/tap-follow.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui/cli/tap-follow.c')
-rw-r--r--ui/cli/tap-follow.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/ui/cli/tap-follow.c b/ui/cli/tap-follow.c
index 51f8f0f7..97983dee 100644
--- a/ui/cli/tap-follow.c
+++ b/ui/cli/tap-follow.c
@@ -45,8 +45,8 @@ typedef struct _cli_follow_info {
register_follow_t* follower;
/* range */
- guint32 chunkMin;
- guint32 chunkMax;
+ uint32_t chunkMin;
+ uint32_t chunkMax;
/* filter */
int stream_index;
@@ -54,7 +54,7 @@ typedef struct _cli_follow_info {
int port[2];
address addr[2];
union {
- guint32 addrBuf_v4;
+ uint32_t addrBuf_v4;
ws_in6_addr addrBuf_v6;
} addrBuf[2];
} cli_follow_info_t;
@@ -117,12 +117,12 @@ follow_free(follow_info_t *follow_info)
static const char bin2hex[] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
-static void follow_print_hex(const char *prefixp, guint32 offset, void *datap, int len)
+static void follow_print_hex(const char *prefixp, uint32_t offset, void *datap, int len)
{
int ii;
int jj;
int kk;
- guint8 val;
+ uint8_t val;
char line[LINE_LEN + 1];
for (ii = 0, jj = 0, kk = 0; ii < len; )
@@ -141,7 +141,7 @@ static void follow_print_hex(const char *prefixp, guint32 offset, void *datap, i
kk = ASCII_START;
}
- val = ((guint8 *)datap)[ii];
+ val = ((uint8_t *)datap)[ii];
line[jj++] = bin2hex[val >> 4];
line[jj++] = bin2hex[val & 0xf];
@@ -177,17 +177,17 @@ static void follow_draw(void *contextp)
follow_info_t *follow_info = (follow_info_t*)contextp;
cli_follow_info_t* cli_follow_info = (cli_follow_info_t*)follow_info->gui_data;
- gchar buf[WS_INET6_ADDRSTRLEN];
- guint32 global_client_pos = 0, global_server_pos = 0;
- guint32 *global_pos;
- guint32 ii, jj;
+ char buf[WS_INET6_ADDRSTRLEN];
+ uint32_t global_client_pos = 0, global_server_pos = 0;
+ uint32_t *global_pos;
+ uint32_t ii, jj;
char *buffer;
wmem_strbuf_t *strbuf;
GList *cur;
follow_record_t *follow_record;
- guint chunk;
- gchar *b64encoded;
- const guint32 base64_raw_len = 57; /* Encodes to 76 bytes, common in RFCs */
+ unsigned chunk;
+ char *b64encoded;
+ const uint32_t base64_raw_len = 57; /* Encodes to 76 bytes, common in RFCs */
/* Print header */
switch (cli_follow_info->show_type)
@@ -342,7 +342,7 @@ static void follow_draw(void *contextp)
printf(" data: !!binary |\n");
ii = 0;
while (ii < follow_record->data->len) {
- guint32 len = ii + base64_raw_len < follow_record->data->len
+ uint32_t len = ii + base64_raw_len < follow_record->data->len
? base64_raw_len
: follow_record->data->len - ii;
b64encoded = g_base64_encode(&follow_record->data->data[ii], len);
@@ -369,16 +369,16 @@ static void follow_draw(void *contextp)
}
}
-static gboolean follow_arg_strncmp(const char **opt_argp, const char *strp)
+static bool follow_arg_strncmp(const char **opt_argp, const char *strp)
{
size_t len = strlen(strp);
if (strncmp(*opt_argp, strp, len) == 0)
{
*opt_argp += len;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
static void
@@ -431,7 +431,7 @@ follow_arg_filter(const char **opt_argp, follow_info_t *follow_info)
unsigned int ii;
char addr[ADDR_LEN];
cli_follow_info_t* cli_follow_info = (cli_follow_info_t*)follow_info->gui_data;
- gboolean is_ipv6;
+ bool is_ipv6;
if (sscanf(*opt_argp, ",%d%n", &cli_follow_info->stream_index, &len) == 1 &&
((*opt_argp)[len] == 0 || (*opt_argp)[len] == ','))
@@ -448,22 +448,22 @@ follow_arg_filter(const char **opt_argp, follow_info_t *follow_info)
}
else
{
- for (ii = 0; ii < sizeof cli_follow_info->addr/sizeof *cli_follow_info->addr; ii++)
+ for (ii = 0; ii < array_length(cli_follow_info->addr); ii++)
{
if (sscanf(*opt_argp, ADDRv6_FMT, addr, &cli_follow_info->port[ii], &len) == 2)
{
- is_ipv6 = TRUE;
+ is_ipv6 = true;
}
else if (sscanf(*opt_argp, ADDRv4_FMT, addr, &cli_follow_info->port[ii], &len) == 2)
{
- is_ipv6 = FALSE;
+ is_ipv6 = false;
}
else
{
follow_exit("Invalid address.");
}
- if (cli_follow_info->port[ii] <= 0 || cli_follow_info->port[ii] > G_MAXUINT16)
+ if (cli_follow_info->port[ii] <= 0 || cli_follow_info->port[ii] > UINT16_MAX)
{
follow_exit("Invalid port.");
}
@@ -503,7 +503,7 @@ static void follow_arg_range(const char **opt_argp, cli_follow_info_t* cli_follo
if (**opt_argp == 0)
{
cli_follow_info->chunkMin = 1;
- cli_follow_info->chunkMax = G_MAXUINT32;
+ cli_follow_info->chunkMax = UINT32_MAX;
}
else
{
@@ -605,7 +605,7 @@ follow_register(const void *key _U_, void *value, void *userdata _U_)
{
register_follow_t *follower = (register_follow_t*)value;
stat_tap_ui follow_ui;
- gchar *cli_string;
+ char *cli_string;
cli_string = follow_get_stat_tap_string(follower);
follow_ui.group = REGISTER_STAT_GROUP_GENERIC;
@@ -616,7 +616,7 @@ follow_register(const void *key _U_, void *value, void *userdata _U_)
follow_ui.params = NULL;
register_stat_tap_ui(&follow_ui, follower);
g_free(cli_string);
- return FALSE;
+ return false;
}
void