extern struct pkt_stats stat_tcp_in, stat_tcp_invalid, stat_tcp_badsum, stat_tcp_unmatched,
stat_tcp_on_closed, stat_tcp_bad_state;
-extern uns tcp_total_flows, tcp_num_flows, tcp_max_flows;
+extern uns cnt_tcp_flows, cnt_tcp_causes[], tcp_num_flows, tcp_max_flows;
/* config switches */
extern uns tcp_arrival_times;
void *appl_data;
struct pipe pipe[2];
struct pkt_stats stat_raw;
+ uns cnt_unexpected;
};
enum close_cause {
CAUSE_CLOSE,
CAUSE_RESET,
CAUSE_TIMEOUT,
- CAUSE_DOOMSDAY
+ CAUSE_DOOMSDAY,
+ CAUSE_CORRUPT,
+ 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);
};
struct iphdr;
void tcp_init(void);
-void tcp_cleanup(void);
+void tcp_cleanup(u64 timestamp);
void tcp_got_packet(struct iphdr *iph, struct pkt *p);
extern struct appl_hooks *tcp_default_appl;
/* save.c */
-extern struct appl_hooks appl_sink, appl_save, appl_asave;
+extern struct appl_hooks appl_sink, appl_save, appl_asave, appl_summary;
extern uns asave_width;
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);