X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=netgrind%2Fnetgrind.h;h=fae60718b22b5349e3a4606762d0088e2e7be6a1;hb=ba88711ac603ab3c2a7bca470659e25d60eef9f5;hp=2f53adf2a367e444846ffbefc7bba2e608356bab;hpb=e0e4394dc85b026147d4b8b056428c8c4172692a;p=netgrind.git diff --git a/netgrind/netgrind.h b/netgrind/netgrind.h index 2f53adf..fae6071 100644 --- a/netgrind/netgrind.h +++ b/netgrind/netgrind.h @@ -70,9 +70,12 @@ enum close_cause { CAUSE_MAX }; +extern byte *flow_state_names[]; +extern byte *flow_cause_names[], *flow_cause_names_short[]; + struct appl_hooks { void (*open)(struct flow *f, u64 when); - void (*input)(struct flow *f, int dir, struct pkt *p); /* dir0 = sent by initiator */ + void (*input)(struct flow *f, int dir, struct pkt *p); /* dir0 = sent by initiator, pkt_len(p)==0 for close */ void (*close)(struct flow *f, int cause, u64 when); }; @@ -93,3 +96,18 @@ extern byte *save_dir; void sink_open(struct flow *f, u64 when); void sink_close(struct flow *f, int cause, u64 when); void sink_input(struct flow *f, int dir, struct pkt *p); + +#define TIMESTAMP_LEN 32 +void format_timestamp(byte *buf, u64 time); + +/* http.c */ + +extern struct appl_hooks appl_http; + +/* histogram.c */ + +void histogram_init(byte *name); +void histogram_add_stat(byte *name, struct pkt_stats *stat); +void histogram_add_int(byte *name, int *var); +void histogram_step(uns time); +void histogram_cleanup(void);