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

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

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

revision 1.3 by likewise, Wed Jan 8 10:09:40 2003 UTC revision 1.4 by jani, Wed Jan 22 16:18:05 2003 UTC
# Line 286  netconn_peer(struct netconn *conn, struc Line 286  netconn_peer(struct netconn *conn, struc
286    case NETCONN_UDPLITE:    case NETCONN_UDPLITE:
287    case NETCONN_UDPNOCHKSUM:    case NETCONN_UDPNOCHKSUM:
288    case NETCONN_UDP:    case NETCONN_UDP:
289        if ((conn->pcb.udp->flags & UDP_FLAGS_CONNECTED) == 0)
290         return -1;
291      *addr = &(conn->pcb.udp->remote_ip);      *addr = &(conn->pcb.udp->remote_ip);
292      *port = conn->pcb.udp->remote_port;      *port = conn->pcb.udp->remote_port;
293      break;      break;
# Line 345  netconn_bind(struct netconn *conn, struc Line 347  netconn_bind(struct netconn *conn, struc
347    memp_freep(MEMP_API_MSG, msg);    memp_freep(MEMP_API_MSG, msg);
348    return conn->err;    return conn->err;
349  }  }
350    
351  /*-----------------------------------------------------------------------------------*/  /*-----------------------------------------------------------------------------------*/
352  err_t  err_t
353  netconn_connect(struct netconn *conn, struct ip_addr *addr,  netconn_connect(struct netconn *conn, struct ip_addr *addr,
# Line 375  netconn_connect(struct netconn *conn, st Line 378  netconn_connect(struct netconn *conn, st
378    memp_freep(MEMP_API_MSG, msg);    memp_freep(MEMP_API_MSG, msg);
379    return conn->err;    return conn->err;
380  }  }
381    
382    err_t
383    netconn_disconnect(struct netconn *conn)
384    {
385      struct api_msg *msg;
386      
387      if(conn == NULL) {
388        return ERR_VAL;
389      }
390    
391      if((msg = memp_mallocp(MEMP_API_MSG)) == NULL) {
392        return ERR_MEM;
393      }
394      msg->type = API_MSG_DISCONNECT;
395      msg->msg.conn = conn;  
396      api_msg_post(msg);
397      memp_freep(MEMP_API_MSG, msg);
398      return conn->err;
399    
400    }
401  /*-----------------------------------------------------------------------------------*/  /*-----------------------------------------------------------------------------------*/
402  err_t  err_t
403  netconn_listen(struct netconn *conn)  netconn_listen(struct netconn *conn)

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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