diff options
author | Joseph Henry <joseph.henry@zerotier.com> | 2015-09-23 17:55:15 -0400 |
---|---|---|
committer | Joseph Henry <joseph.henry@zerotier.com> | 2015-09-23 17:55:15 -0400 |
commit | 02d5a318222f139ff245aea61f132883dfa9e2cc (patch) | |
tree | e87728cadc1cd6b2d174fda0c3367645ee59dad6 /netcon | |
parent | bbdb8eb0de698ebeecbb10a16e5c1bf4a102ca94 (diff) | |
download | infinitytier-02d5a318222f139ff245aea61f132883dfa9e2cc.tar.gz infinitytier-02d5a318222f139ff245aea61f132883dfa9e2cc.zip |
added lwip unix port lib files
Diffstat (limited to 'netcon')
-rw-r--r-- | netcon/NetconEthernetTap.cpp | 11 | ||||
-rwxr-xr-x | netcon/liblwip.so | bin | 220320 -> 195864 bytes | |||
-rwxr-xr-x | netcon/liblwip.so.debug | bin | 0 -> 220320 bytes |
3 files changed, 7 insertions, 4 deletions
diff --git a/netcon/NetconEthernetTap.cpp b/netcon/NetconEthernetTap.cpp index 6ca9d5df..976e018e 100644 --- a/netcon/NetconEthernetTap.cpp +++ b/netcon/NetconEthernetTap.cpp @@ -78,7 +78,7 @@ NetconEthernetTap::NetconEthernetTap( Utils::snprintf(sockPath,sizeof(sockPath),"/tmp/.ztnc_%.16llx",(unsigned long long)nwid); _dev = sockPath; - lwipstack = new LWIPStack("/root/dev/netcon/liblwip.so"); + lwipstack = new LWIPStack("netcon/liblwip.so"); if(!lwipstack) // TODO double check this check throw std::runtime_error("unable to load lwip lib."); lwipstack->lwip_init(); @@ -340,6 +340,10 @@ void NetconEthernetTap::threadMain() fprintf(stderr, "- IP_TMR_INTERVAL = %d\n", IP_TMR_INTERVAL); fprintf(stderr, "- DEFAULT_READ_BUFFER_SIZE = %d\n", DEFAULT_READ_BUFFER_SIZE); */ + + //fprintf(stderr, "- LWIP_DEBUG = %d\n", LWIP_DEBUG); + fprintf(stderr, "- TCP_DEBUG = %d\n", TCP_DEBUG); + // Main timer loop while (_run) { uint64_t now = OSUtils::now(); @@ -520,7 +524,7 @@ err_t NetconEthernetTap::nc_poll(void* arg, struct tcp_pcb *tpcb) NetconConnection *c = l->tap->getConnectionByPCB(tpcb); NetconEthernetTap *tap = l->tap; if(c && c->idx > 0){ - fprintf(stderr, "nc_poll(): calling handle_Write()\n"); + fprintf(stderr, "nc_poll(): calling handle_write()\n"); tap->handle_write(c); } return ERR_OK; @@ -563,7 +567,7 @@ err_t NetconEthernetTap::nc_accept(void *arg, struct tcp_pcb *newpcb, err_t err) int send_fd = tap->_phy.getDescriptor(client->rpc->sock); int n = write(larg_fd, "z", 1); if(n > 0) { - if(sock_fd_write(send_fd, fds[1]) < 0) { + if(sock_fd_write(send_fd, fds[1]) > 0) { client->unmapped_conn = new_conn; } else { @@ -628,7 +632,6 @@ err_t NetconEthernetTap::nc_recved(void *arg, struct tcp_pcb *tpcb, struct pbuf } q = p; while(p != NULL) { // Cycle through pbufs and write them to the socket - fprintf(stderr, "nc_recved(): writing pbufs to socket\n"); if(p->len <= 0) break; // ? if((n = tap->_phy.streamSend(c->sock,p->payload, p->len)) > 0) { diff --git a/netcon/liblwip.so b/netcon/liblwip.so Binary files differindex 86c36665..9c129959 100755 --- a/netcon/liblwip.so +++ b/netcon/liblwip.so diff --git a/netcon/liblwip.so.debug b/netcon/liblwip.so.debug Binary files differnew file mode 100755 index 00000000..86c36665 --- /dev/null +++ b/netcon/liblwip.so.debug |