wip

Dependents:   EthernetInterface_vz

Fork of lwip by VZTECH

Files at this revision

API Documentation at this revision

Comitter:
klauss
Date:
Tue Apr 07 14:27:01 2015 +0000
Parent:
29:da6f39d13880
Commit message:
wip

Changed in this revision

api/sockets.c Show annotated file Show diff for this revision Revisions of this file
diff -r da6f39d13880 -r cb9095482c25 api/sockets.c
--- a/api/sockets.c	Thu Jan 08 23:42:30 2015 +0000
+++ b/api/sockets.c	Tue Apr 07 14:27:01 2015 +0000
@@ -60,6 +60,9 @@
 
 #define NUM_SOCKETS MEMP_NUM_NETCONN
 
+extern int lwip_sock_portando_ntohs;
+extern int lwip_sock_portando_local_port;
+
 /** Contains all internal pointers and states used for a socket */
 struct lwip_sock {
   /** sockets currently are built on netconns, each socket has one netconn */
@@ -420,11 +423,15 @@
   inet_addr_to_ipaddr(&local_addr, &name_in->sin_addr);
   local_port = name_in->sin_port;
 
+  lwip_sock_portando_local_port = local_port
+
   LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_bind(%d, addr=", s));
   ip_addr_debug_print(SOCKETS_DEBUG, &local_addr);
   LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F")\n", ntohs(local_port)));
 
   err = netconn_bind(sock->conn, &local_addr, ntohs(local_port));
+  
+  lwip_sock_portando_ntohs = ntohs(local_port);
 
   if (err != ERR_OK) {
     LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_bind(%d) failed, err=%d\n", s, err));