summaryrefslogtreecommitdiff
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.c153
1 files changed, 83 insertions, 70 deletions
diff --git a/ui/cli/tap-follow.c b/ui/cli/tap-follow.c
index 90a4cf360e..fa729bf0d9 100644
--- a/ui/cli/tap-follow.c
+++ b/ui/cli/tap-follow.c
@@ -87,8 +87,8 @@ typedef struct
guint32 chunkMax;
/* stream chunk file */
- FILE * filep;
- gchar * filenamep;
+ FILE *filep;
+ gchar *filenamep;
} follow_t;
#define STR_FOLLOW "follow,"
@@ -102,7 +102,7 @@ typedef struct
static void
followExit(
- const char * strp
+ const char *strp
)
{
fprintf(stderr, "tshark: follow - %s\n", strp);
@@ -111,7 +111,7 @@ followExit(
static const char *
followStrType(
- const follow_t * fp
+ const follow_t *fp
)
{
switch (fp->type)
@@ -128,7 +128,7 @@ followStrType(
static const char *
followStrMode(
- const follow_t * fp
+ const follow_t *fp
)
{
switch (fp->mode)
@@ -145,12 +145,12 @@ followStrMode(
static const char *
followStrFilter(
- const follow_t * fp
+ const follow_t *fp
)
{
static char filter[512];
int len = 0;
- const gchar * verp;
+ const gchar *verp;
gchar ip0[MAX_IP6_STR_LEN];
gchar ip1[MAX_IP6_STR_LEN];
@@ -219,7 +219,7 @@ followStrFilter(
static void
followFileClose(
- follow_t * fp
+ follow_t *fp
)
{
if (fp->filep != NULL)
@@ -242,11 +242,11 @@ followFileClose(
static void
followFileOpen(
- follow_t * fp
+ follow_t *fp
)
{
- int fd;
- char * tempfilep;
+ int fd;
+ char *tempfilep;
if (fp->type == type_TCP && data_out_file != NULL)
{
@@ -290,7 +290,7 @@ followAlloc(
type_e type
)
{
- follow_t * fp;
+ follow_t *fp;
fp = (follow_t *)g_malloc0(sizeof *fp);
@@ -303,7 +303,7 @@ followAlloc(
static void
followFree(
- follow_t * fp
+ follow_t *fp
)
{
followFileClose(fp);
@@ -312,16 +312,16 @@ followFree(
static int
followUdpPacket(
- void * contextp,
- packet_info * pip,
- epan_dissect_t * edp _U_,
- const void * datap
+ void *contextp,
+ packet_info *pip,
+ epan_dissect_t *edp _U_,
+ const void *datap
)
{
- follow_t * fp = (follow_t *)contextp;
- const tvbuff_t * tvbp = (const tvbuff_t *)datap;
- tcp_stream_chunk sc;
- size_t size;
+ follow_t *fp = (follow_t *)contextp;
+ const tvbuff_t *tvbp = (const tvbuff_t *)datap;
+ tcp_stream_chunk sc;
+ size_t size;
if (tvbp->length > 0)
{
@@ -348,18 +348,18 @@ followUdpPacket(
static int
followSslPacket(
- void * contextp,
- packet_info * pip,
- epan_dissect_t * edp _U_,
- const void * datap
+ void *contextp,
+ packet_info *pip,
+ epan_dissect_t *edp _U_,
+ const void *datap
)
{
- follow_t * fp = (follow_t *)contextp;
- SslPacketInfo * spip = (SslPacketInfo *)p_get_proto_data(wmem_file_scope(), pip, GPOINTER_TO_INT(datap), 0);
- SslDataInfo * sdip;
- gint length;
- tcp_stream_chunk sc;
- size_t size;
+ follow_t *fp = (follow_t *)contextp;
+ SslPacketInfo *spip = (SslPacketInfo *)p_get_proto_data(wmem_file_scope(), pip, GPOINTER_TO_INT(datap), 0);
+ SslDataInfo *sdip;
+ gint length;
+ tcp_stream_chunk sc;
+ size_t size;
if (spip == NULL)
{
@@ -432,10 +432,10 @@ static const char bin2hex[] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
static void
followPrintHex(
- const char * prefixp,
- guint32 offset,
- void * datap,
- int len
+ const char *prefixp,
+ guint32 offset,
+ void *datap,
+ int len
)
{
int ii;
@@ -491,25 +491,25 @@ followPrintHex(
static void
followDraw(
- void * contextp
+ void *contextp
)
{
static const char separator[] =
"===================================================================\n";
- follow_t * fp = (follow_t *)contextp;
- tcp_stream_chunk sc;
- int node;
- const address * addr[2];
- int port[2];
- gchar buf[MAX_IP6_STR_LEN];
- guint32 ii;
- guint32 jj;
- guint32 len;
- guint32 chunk;
- guint32 offset[2];
- guint8 bin[4096];
- char data[(sizeof bin * 2) + 2];
+ follow_t *fp = (follow_t *)contextp;
+ tcp_stream_chunk sc;
+ int node;
+ const address *addr[2];
+ int port[2];
+ gchar buf[MAX_IP6_STR_LEN];
+ guint32 ii;
+ guint32 jj;
+ guint32 len;
+ guint32 chunk;
+ guint32 offset[2];
+ guint8 bin[4096];
+ char data[(sizeof bin * 2) + 2];
g_assert(sizeof bin % BYTES_PER_LINE == 0);
@@ -721,8 +721,8 @@ done:
static gboolean
followArgStrncmp(
- const char ** opt_argp,
- const char * strp
+ const char **opt_argp,
+ const char *strp
)
{
int len = (guint32)strlen(strp);
@@ -737,8 +737,8 @@ followArgStrncmp(
static void
followArgMode(
- const char ** opt_argp,
- follow_t * fp
+ const char **opt_argp,
+ follow_t *fp
)
{
if (followArgStrncmp(opt_argp, STR_HEX))
@@ -761,8 +761,8 @@ followArgMode(
static void
followArgFilter(
- const char ** opt_argp,
- follow_t * fp
+ const char **opt_argp,
+ follow_t *fp
)
{
#define _STRING(s) # s
@@ -823,8 +823,8 @@ followArgFilter(
static void
followArgRange(
- const char ** opt_argp,
- follow_t * fp
+ const char **opt_argp,
+ follow_t *fp
)
{
int len;
@@ -859,7 +859,7 @@ followArgRange(
static void
followArgDone(
- const char * opt_argp
+ const char *opt_argp
)
{
if (*opt_argp != 0)
@@ -870,12 +870,12 @@ followArgDone(
static void
followTcp(
- const char * opt_argp,
- void * userdata _U_
+ const char *opt_argp,
+ void *userdata _U_
)
{
- follow_t * fp;
- GString * errp;
+ follow_t *fp;
+ GString *errp;
opt_argp += strlen(STR_FOLLOW_TCP);
@@ -917,12 +917,12 @@ followTcp(
static void
followUdp(
- const char * opt_argp,
- void * userdata _U_
+ const char *opt_argp,
+ void *userdata _U_
)
{
- follow_t * fp;
- GString * errp;
+ follow_t *fp;
+ GString *errp;
opt_argp += strlen(STR_FOLLOW_UDP);
@@ -952,12 +952,12 @@ followUdp(
static void
followSsl(
- const char * opt_argp,
- void * userdata _U_
+ const char *opt_argp,
+ void *userdata _U_
)
{
- follow_t * fp;
- GString * errp;
+ follow_t *fp;
+ GString *errp;
opt_argp += strlen(STR_FOLLOW_SSL);
@@ -992,3 +992,16 @@ register_tap_listener_follow(void)
register_stat_cmd_arg(STR_FOLLOW_UDP, followUdp, NULL);
register_stat_cmd_arg(STR_FOLLOW_SSL, followSsl, NULL);
}
+
+/*
+ * Editor modelines - http://www.wireshark.org/tools/modelines.html
+ *
+ * Local Variables:
+ * c-basic-offset: 2
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * ex: set shiftwidth=2 tabstop=8 expandtab:
+ * :indentSize=2:tabSize=8:noTabs=true:
+ */