git.samba.org
/
obnox
/
wireshark
/
wip.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
replace *a lot* of file related calls by their GLib counterparts. This is necessary...
[obnox/wireshark/wip.git]
/
tap-protohierstat.c
diff --git
a/tap-protohierstat.c
b/tap-protohierstat.c
index f52dfca00e973d8ff8099f28c178b5c3cbfd2ddf..7b79a70a8bf1e0a50914d79c4760373e4dad8353 100644
(file)
--- a/
tap-protohierstat.c
+++ b/
tap-protohierstat.c
@@
-39,6
+39,7
@@
#include "epan/epan_dissect.h"
#include "epan/proto.h"
#include <epan/tap.h>
#include "epan/epan_dissect.h"
#include "epan/proto.h"
#include <epan/tap.h>
+#include <epan/stat_cmd_args.h>
#include "register.h"
typedef struct _phs_t {
#include "register.h"
typedef struct _phs_t {
@@
-135,17
+136,23
@@
protohierstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const v
static void
phs_draw(phs_t *rs, int indentation)
{
static void
phs_draw(phs_t *rs, int indentation)
{
- int i;
- char str[80];
+ int i, stroff;
+#define MAXPHSLINE 80
+ char str[MAXPHSLINE];
for(;rs;rs=rs->sibling){
if(rs->protocol==-1){
return;
}
str[0]=0;
for(;rs;rs=rs->sibling){
if(rs->protocol==-1){
return;
}
str[0]=0;
+ stroff=0;
for(i=0;i<indentation;i++){
for(i=0;i<indentation;i++){
- strcat(str," ");
+ if(i>15){
+ stroff+=g_snprintf(str+stroff, MAXPHSLINE-stroff, "...");
+ break;
+ }
+ stroff+=g_snprintf(str+stroff, MAXPHSLINE-stroff, " ");
}
}
- str
cat(str
, rs->proto_name);
+ str
off+=g_snprintf(str+stroff, MAXPHSLINE-stroff
, rs->proto_name);
printf("%-40s frames:%d bytes:%d\n",str, rs->frames, rs->bytes);
phs_draw(rs->child, indentation+1);
}
printf("%-40s frames:%d bytes:%d\n",str, rs->frames, rs->bytes);
phs_draw(rs->child, indentation+1);
}
@@
-166,11
+173,11
@@
protohierstat_draw(void *prs)
static void
static void
-protohierstat_init(char *optarg)
+protohierstat_init(c
onst c
har *optarg)
{
phs_t *rs;
int pos=0;
{
phs_t *rs;
int pos=0;
- char *filter=NULL;
+ c
onst c
har *filter=NULL;
GString *error_string;
if(!strcmp("io,phs",optarg)){
GString *error_string;
if(!strcmp("io,phs",optarg)){
@@
-216,6
+223,6
@@
protohierstat_init(char *optarg)
void
register_tap_listener_protohierstat(void)
{
void
register_tap_listener_protohierstat(void)
{
- register_
tap_listener
_cmd_arg("io,phs", protohierstat_init);
+ register_
stat
_cmd_arg("io,phs", protohierstat_init);
}
}