/[lwip]/lwip/src/api/sockets.c
ViewVC logotype

Diff of /lwip/src/api/sockets.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by jani, Thu Jan 23 16:46:01 2003 UTC revision 1.6 by jani, Fri Jan 24 09:24:44 2003 UTC
# Line 87  lwip_accept(int s, struct sockaddr *addr Line 87  lwip_accept(int s, struct sockaddr *addr
87  {  {
88    struct lwip_socket *sock;    struct lwip_socket *sock;
89    struct netconn *newconn;    struct netconn *newconn;
90    struct ip_addr *naddr;    struct ip_addr naddr;
91    u16_t port;    u16_t port;
92    int newsock;    int newsock;
93    
# Line 101  lwip_accept(int s, struct sockaddr *addr Line 101  lwip_accept(int s, struct sockaddr *addr
101    /* get the IP address and port of the remote host */    /* get the IP address and port of the remote host */
102    netconn_peer(newconn, &naddr, &port);    netconn_peer(newconn, &naddr, &port);
103        
104    ((struct sockaddr_in *)addr)->sin_addr.s_addr = naddr->addr;    ((struct sockaddr_in *)addr)->sin_addr.s_addr = naddr.addr;
105    ((struct sockaddr_in *)addr)->sin_port = port;    ((struct sockaddr_in *)addr)->sin_port = port;
106    
107    newsock = alloc_socket(newconn);    newsock = alloc_socket(newconn);
# Line 345  lwip_sendto(int s, void *data, int size, Line 345  lwip_sendto(int s, void *data, int size,
345         struct sockaddr *to, int tolen)         struct sockaddr *to, int tolen)
346  {  {
347    struct lwip_socket *sock;    struct lwip_socket *sock;
348    struct ip_addr remote_addr, *addr;    struct ip_addr remote_addr, addr;
349    u16_t remote_port, port;    u16_t remote_port, port;
350    int ret,connected;    int ret,connected;
351    
# Line 366  lwip_sendto(int s, void *data, int size, Line 366  lwip_sendto(int s, void *data, int size,
366    /* reset the remote address and port number    /* reset the remote address and port number
367       of the connection */       of the connection */
368    if (connected)    if (connected)
369      netconn_connect(sock->conn, addr, port);      netconn_connect(sock->conn, &addr, port);
370    else    else
371      netconn_disconnect(sock->conn);            netconn_disconnect(sock->conn);      
372    return ret;    return ret;

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26