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

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

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

revision 1.6 by jani, Fri Feb 21 16:43:46 2003 UTC revision 1.7 by jani, Wed Mar 19 11:23:46 2003 UTC
# Line 78  tcpip_thread(void *arg) Line 78  tcpip_thread(void *arg)
78  {  {
79    struct tcpip_msg *msg;    struct tcpip_msg *msg;
80    
81      (void)arg;
82    
83    ip_init();    ip_init();
84    udp_init();    udp_init();
85    tcp_init();    tcp_init();
# Line 97  tcpip_thread(void *arg) Line 99  tcpip_thread(void *arg)
99        DEBUGF(TCPIP_DEBUG, ("tcpip_thread: IP packet %p\n", (void *)msg));        DEBUGF(TCPIP_DEBUG, ("tcpip_thread: IP packet %p\n", (void *)msg));
100        ip_input(msg->msg.inp.p, msg->msg.inp.netif);        ip_input(msg->msg.inp.p, msg->msg.inp.netif);
101        break;        break;
102      case TCPIP_MSG_LINK:      case TCPIP_MSG_CALLBACK:
103        DEBUGF(TCPIP_DEBUG, ("tcpip_thread: LINK packet %p\n", (void *)msg));        DEBUGF(TCPIP_DEBUG, ("tcpip_thread: CALLBACK %p\n", (void *)msg));
104        msg->msg.inp.netif->input(msg->msg.inp.p, msg->msg.inp.netif);        msg->msg.cb.f(msg->msg.cb.ctx);
105        break;        break;
106      default:      default:
107        break;        break;
# Line 127  tcpip_input(struct pbuf *p, struct netif Line 129  tcpip_input(struct pbuf *p, struct netif
129  }  }
130  /*-----------------------------------------------------------------------------------*/  /*-----------------------------------------------------------------------------------*/
131  err_t  err_t
132  tcpip_link_input(struct pbuf *p, struct netif *inp)  tcpip_callback(void (*f)(void *ctx), void *ctx)
133  {  {
134    struct tcpip_msg *msg;    struct tcpip_msg *msg;
135        
136    msg = memp_mallocp(MEMP_TCPIP_MSG);    msg = memp_mallocp(MEMP_TCPIP_MSG);
137    if(msg == NULL) {    if(msg == NULL) {
     pbuf_free(p);      
138      return ERR_MEM;        return ERR_MEM;  
139    }    }
140        
141    msg->type = TCPIP_MSG_LINK;    msg->type = TCPIP_MSG_CALLBACK;
142    msg->msg.inp.p = p;    msg->msg.cb.f = f;
143    msg->msg.inp.netif = inp;    msg->msg.cb.ctx = ctx;
144    sys_mbox_post(mbox, msg);    sys_mbox_post(mbox, msg);
145    return ERR_OK;    return ERR_OK;
146  }  }

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

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