? Makefile
? buildit.sh
? config.h
? config.h.in
? config.log
? config.status
? configure
Index: softflowd.c
===================================================================
RCS file: /var/cvs/softflowd/softflowd.c,v
retrieving revision 1.80
diff -u -p -r1.80 softflowd.c
--- softflowd.c	10 Jan 2005 01:50:07 -0000	1.80
+++ softflowd.c	29 Apr 2005 23:05:24 -0000
@@ -894,11 +894,12 @@ delete_all_flows(struct FLOWTRACK *ft)
  * and the tree of expiry events.
  */
 static int
-statistics(struct FLOWTRACK *ft, FILE *out)
+statistics(struct FLOWTRACK *ft, FILE *out, pcap_t *pcap)
 {
 	int i;
 	struct protoent *pe;
 	char proto[32];
+	struct pcap_stat ps;
 
 	fprintf(out, "Number of active flows: %d\n", ft->num_flows);
 	fprintf(out, "Packets processed: %llu\n", ft->total_packets);
@@ -910,6 +911,15 @@ statistics(struct FLOWTRACK *ft, FILE *o
 	fprintf(out, "Flows exported: %llu in %llu packets (%llu failures)\n",
 	    ft->flows_exported, ft->packets_sent, ft->flows_dropped);
 
+	if (pcap_stats(pcap, &ps) == 0) {
+		fprintf(out, "pcap packets received: %lu\n",
+		    (unsigned long)ps.ps_recv);
+		fprintf(out, "pcap packets dropped: %lu\n",
+		    (unsigned long)ps.ps_drop);
+		fprintf(out, "pcap packets dropped by interface: %lu\n",
+		    (unsigned long)ps.ps_ifdrop);
+	}
+
 	fprintf(out, "\n");
 
 	if (ft->flows_expired != 0) {
@@ -1069,7 +1079,7 @@ print_timeouts(struct FLOWTRACK *ft, FIL
 
 static int
 accept_control(int lsock, struct NETFLOW_TARGET *target, struct FLOWTRACK *ft,
-    int *exit_request, int *stop_collection_flag)
+    pcap_t *pcap, int *exit_request, int *stop_collection_flag)
 {
 	unsigned char buf[64], *p;
 	FILE *ctlf;
@@ -1124,7 +1134,7 @@ accept_control(int lsock, struct NETFLOW
 	} else if (strcmp(buf, "statistics") == 0) {
 		fprintf(ctlf, "softflowd[%u]: Accumulated statistics:\n", 
 		    getpid());
-		statistics(ft, ctlf);
+		statistics(ft, ctlf, pcap);
 		ret = 0;
 	} else if (strcmp(buf, "debug+") == 0) {
 		fprintf(ctlf, "softflowd[%u]: Debug level increased.\n",
@@ -1773,7 +1783,7 @@ main(int argc, char **argv)
 
 		/* Accept connection on control socket if present */
 		if (ctlsock != -1 && pl[1].revents != 0) {
-			if (accept_control(ctlsock, &target, &flowtrack, 
+			if (accept_control(ctlsock, &target, &flowtrack, pcap,
 			    &exit_request, &stop_collection_flag) != 0)
 				break;
 		}
@@ -1838,7 +1848,7 @@ expiry_check:
 		logit(LOG_ERR, "Exiting immediately on internal error");
 		
 	if (capfile != NULL && dontfork_flag)
-		statistics(&flowtrack, stdout);
+		statistics(&flowtrack, stdout, pcap);
 
 	pcap_close(pcap);
 	
