]> Joshua Wise's Git repositories - netwatch.git/commitdiff
Merge nyus.joshuawise.com:/storage/git/netwatch
authorJoshua Wise <joshua@rebirth.joshuawise.com>
Sun, 14 Dec 2008 01:32:49 +0000 (20:32 -0500)
committerJoshua Wise <joshua@rebirth.joshuawise.com>
Sun, 14 Dec 2008 01:32:49 +0000 (20:32 -0500)
lwip/src/core/stats.c
lwip/src/include/arch/cc.h
lwip/src/include/lwipopts.h
net/rfb.c

index 0604468dd4d531373c70233fc0a80e39c3c5ea51..2d5c1e3a076f775517a00c0e132276a71460b3cd 100644 (file)
@@ -52,45 +52,45 @@ struct stats_ lwip_stats;
 void
 stats_display_proto(struct stats_proto *proto, char *name)
 {
-  LWIP_PLATFORM_DIAG(("\n%s\n\t", name));
-  LWIP_PLATFORM_DIAG(("xmit: %"STAT_COUNTER_F"\n\t", proto->xmit)); 
-  LWIP_PLATFORM_DIAG(("rexmit: %"STAT_COUNTER_F"\n\t", proto->rexmit)); 
-  LWIP_PLATFORM_DIAG(("recv: %"STAT_COUNTER_F"\n\t", proto->recv)); 
-  LWIP_PLATFORM_DIAG(("fw: %"STAT_COUNTER_F"\n\t", proto->fw)); 
-  LWIP_PLATFORM_DIAG(("drop: %"STAT_COUNTER_F"\n\t", proto->drop)); 
-  LWIP_PLATFORM_DIAG(("chkerr: %"STAT_COUNTER_F"\n\t", proto->chkerr)); 
-  LWIP_PLATFORM_DIAG(("lenerr: %"STAT_COUNTER_F"\n\t", proto->lenerr)); 
-  LWIP_PLATFORM_DIAG(("memerr: %"STAT_COUNTER_F"\n\t", proto->memerr)); 
-  LWIP_PLATFORM_DIAG(("rterr: %"STAT_COUNTER_F"\n\t", proto->rterr)); 
-  LWIP_PLATFORM_DIAG(("proterr: %"STAT_COUNTER_F"\n\t", proto->proterr)); 
-  LWIP_PLATFORM_DIAG(("opterr: %"STAT_COUNTER_F"\n\t", proto->opterr)); 
-  LWIP_PLATFORM_DIAG(("err: %"STAT_COUNTER_F"\n\t", proto->err)); 
-  LWIP_PLATFORM_DIAG(("cachehit: %"STAT_COUNTER_F"\n", proto->cachehit)); 
+  LWIP_PLATFORM_DIAG(("%s", name));
+  LWIP_PLATFORM_DIAG(("  xmit: %"STAT_COUNTER_F, proto->xmit)); 
+  LWIP_PLATFORM_DIAG(("  rexmit: %"STAT_COUNTER_F, proto->rexmit)); 
+  LWIP_PLATFORM_DIAG(("  recv: %"STAT_COUNTER_F, proto->recv)); 
+  LWIP_PLATFORM_DIAG(("  fw: %"STAT_COUNTER_F, proto->fw)); 
+  LWIP_PLATFORM_DIAG(("  drop: %"STAT_COUNTER_F, proto->drop)); 
+  LWIP_PLATFORM_DIAG(("  chkerr: %"STAT_COUNTER_F, proto->chkerr)); 
+  LWIP_PLATFORM_DIAG(("  lenerr: %"STAT_COUNTER_F, proto->lenerr)); 
+  LWIP_PLATFORM_DIAG(("  memerr: %"STAT_COUNTER_F, proto->memerr)); 
+  LWIP_PLATFORM_DIAG(("  rterr: %"STAT_COUNTER_F, proto->rterr)); 
+  LWIP_PLATFORM_DIAG(("  proterr: %"STAT_COUNTER_F, proto->proterr)); 
+  LWIP_PLATFORM_DIAG(("  opterr: %"STAT_COUNTER_F, proto->opterr)); 
+  LWIP_PLATFORM_DIAG(("  err: %"STAT_COUNTER_F, proto->err)); 
+  LWIP_PLATFORM_DIAG(("  cachehit: %"STAT_COUNTER_F, proto->cachehit)); 
 }
 
 void
 stats_display_igmp(struct stats_igmp *igmp)
 {
-  LWIP_PLATFORM_DIAG(("\nIGMP\n\t"));
-  LWIP_PLATFORM_DIAG(("lenerr: %"STAT_COUNTER_F"\n\t", igmp->lenerr)); 
-  LWIP_PLATFORM_DIAG(("chkerr: %"STAT_COUNTER_F"\n\t", igmp->chkerr)); 
-  LWIP_PLATFORM_DIAG(("v1_rxed: %"STAT_COUNTER_F"\n\t", igmp->v1_rxed)); 
-  LWIP_PLATFORM_DIAG(("join_sent: %"STAT_COUNTER_F"\n\t", igmp->join_sent)); 
-  LWIP_PLATFORM_DIAG(("leave_sent: %"STAT_COUNTER_F"\n\t", igmp->leave_sent)); 
-  LWIP_PLATFORM_DIAG(("unicast_query: %"STAT_COUNTER_F"\n\t", igmp->unicast_query)); 
-  LWIP_PLATFORM_DIAG(("report_sent: %"STAT_COUNTER_F"\n\t", igmp->report_sent)); 
-  LWIP_PLATFORM_DIAG(("report_rxed: %"STAT_COUNTER_F"\n\t", igmp->report_rxed)); 
-  LWIP_PLATFORM_DIAG(("group_query_rxed: %"STAT_COUNTER_F"\n", igmp->group_query_rxed));
+  LWIP_PLATFORM_DIAG(("IGMP"));
+  LWIP_PLATFORM_DIAG(("  lenerr: %"STAT_COUNTER_F, igmp->lenerr)); 
+  LWIP_PLATFORM_DIAG(("  chkerr: %"STAT_COUNTER_F, igmp->chkerr)); 
+  LWIP_PLATFORM_DIAG(("  v1_rxed: %"STAT_COUNTER_F, igmp->v1_rxed)); 
+  LWIP_PLATFORM_DIAG(("  join_sent: %"STAT_COUNTER_F, igmp->join_sent)); 
+  LWIP_PLATFORM_DIAG(("  leave_sent: %"STAT_COUNTER_F, igmp->leave_sent)); 
+  LWIP_PLATFORM_DIAG(("  unicast_query: %"STAT_COUNTER_F, igmp->unicast_query)); 
+  LWIP_PLATFORM_DIAG(("  report_sent: %"STAT_COUNTER_F, igmp->report_sent)); 
+  LWIP_PLATFORM_DIAG(("  report_rxed: %"STAT_COUNTER_F, igmp->report_rxed)); 
+  LWIP_PLATFORM_DIAG(("  group_query_rxed: %"STAT_COUNTER_F, igmp->group_query_rxed));
 }
 
 void
 stats_display_mem(struct stats_mem *mem, char *name)
 {
-  LWIP_PLATFORM_DIAG(("\nMEM %s\n\t", name));
-  LWIP_PLATFORM_DIAG(("avail: %"U32_F"\n\t", (u32_t)mem->avail)); 
-  LWIP_PLATFORM_DIAG(("used: %"U32_F"\n\t", (u32_t)mem->used)); 
-  LWIP_PLATFORM_DIAG(("max: %"U32_F"\n\t", (u32_t)mem->max)); 
-  LWIP_PLATFORM_DIAG(("err: %"U32_F"\n", (u32_t)mem->err));
+  LWIP_PLATFORM_DIAG(("MEM %s", name));
+  LWIP_PLATFORM_DIAG(("  avail: %"U32_F, (u32_t)mem->avail)); 
+  LWIP_PLATFORM_DIAG(("  used: %"U32_F, (u32_t)mem->used)); 
+  LWIP_PLATFORM_DIAG(("  max: %"U32_F, (u32_t)mem->max)); 
+  LWIP_PLATFORM_DIAG(("  err: %"U32_F, (u32_t)mem->err));
 }
 
 void
index df50e8d0b5640bf779e12d4bbbf82b4096ed85a5..7878080fb64577bc2b6eabb743984c88f843d869 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <stdint.h>
 #include <vga-overlay.h>
+#include <output.h>
 #include <minilib.h>
 
 typedef uint8_t u8_t;
@@ -28,7 +29,7 @@ typedef uint32_t mem_ptr_t;
 #define LWIP_PLATFORM_HTONS(x) htons(x)
 #define LWIP_PLATFORM_HTONL(x) htonl(x)
 
-#define LWIP_PLATFORM_DIAG(x) dolog(x)
+#define LWIP_PLATFORM_DIAG(x) outputf x
 #define LWIP_PLATFORM_ASSERT(x) dologf("ASSERT FAILED: %s\n", (x));
 
 #endif
index ec5a614460d04a4f7c01d701bee4f3a82220adb4..368bf869f8cf821826049b73a0c25cfe9f843ebc 100644 (file)
@@ -23,7 +23,13 @@ extern void _memcpy(void *dest, const void *src, int bytes);
 #define TCP_SND_BUF     (16 * TCP_MSS)
 #define TCP_SND_QUEUELEN 16
 
-#define MEMP_NUM_PBUF  128
-#define PBUF_POOL_SIZE  96
+#define MEMP_NUM_PBUF  256
+#define PBUF_POOL_SIZE  128
+#define PBUF_POOL_BUFSIZE 512
+
+#define LWIP_STATS 1
+#define LWIP_STATS_DISPLAY 1
+#define U16_F "d"
+#define U32_F "d"
 
 #endif
index 5fe1a1100cf36228f248cbadbc3a22ce3329264a..70d2c05325742c47ec32a5d683c89a75dea52a10 100644 (file)
--- a/net/rfb.c
+++ b/net/rfb.c
@@ -6,6 +6,7 @@
 #include "../aseg-paging/keyboard.h"
 
 #include "lwip/tcp.h"
+#include "lwip/stats.h"
 
 #include "rfb.h"
 
@@ -322,6 +323,13 @@ static err_t rfb_sent(void *arg, struct tcp_pcb *pcb, uint16_t len) {
        return ERR_OK;
 }
 
+static err_t rfb_poll(void *arg, struct tcp_pcb *pcb) {
+       struct rfb_state *state = arg;
+       send_fsm(pcb, state);
+       stats_display();
+       return ERR_OK;
+}
+
 static void close_conn(struct tcp_pcb *pcb, struct rfb_state *state) {
        tcp_arg(pcb, NULL);
        tcp_sent(pcb, NULL);
@@ -591,9 +599,9 @@ static err_t rfb_accept(void *arg, struct tcp_pcb *pcb, err_t err) {
        tcp_arg(pcb, state);
        tcp_recv(pcb, rfb_recv);
        tcp_sent(pcb, rfb_sent);
+       tcp_poll(pcb, rfb_poll, 1);
 /*
        tcp_err(pcb, rfb_err);
-       tcp_poll(pcb, rfb_poll, 2);
 */
        tcp_write(pcb, "RFB 003.008\n", 12, 0);
        tcp_output(pcb);
This page took 0.0384 seconds and 4 git commands to generate.