]> mj.ucw.cz Git - netgrind.git/blobdiff - netgrind/netgrind.h
Added content-type to HTTP dump.
[netgrind.git] / netgrind / netgrind.h
index fca6c53d0b0f85841f74278106b4b398cc4b59c7..fae60718b22b5349e3a4606762d0088e2e7be6a1 100644 (file)
@@ -27,7 +27,7 @@ void ip_got_packet(struct pkt *p);
 
 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;
@@ -58,31 +58,56 @@ struct flow {
   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);