Version of http://mbed.org/cookbook/NetServicesTribute with setting set the same for LPC2368

Dependents:   UDPSocketExample 24LCxx_I2CApp WeatherPlatform_pachube HvZServerLib ... more

Committer:
simon
Date:
Tue Nov 23 14:15:36 2010 +0000
Revision:
0:350011bf8be7
Experimental version for testing UDP

Who changed what in which revision?

UserRevisionLine numberNew contents of line
simon 0:350011bf8be7 1 /**
simon 0:350011bf8be7 2 * @file
simon 0:350011bf8be7 3 * SLIP Interface
simon 0:350011bf8be7 4 *
simon 0:350011bf8be7 5 */
simon 0:350011bf8be7 6
simon 0:350011bf8be7 7 /*
simon 0:350011bf8be7 8 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
simon 0:350011bf8be7 9 * All rights reserved.
simon 0:350011bf8be7 10 *
simon 0:350011bf8be7 11 * Redistribution and use in source and binary forms, with or without
simon 0:350011bf8be7 12 * modification, are permitted provided that the following conditions
simon 0:350011bf8be7 13 * are met:
simon 0:350011bf8be7 14 * 1. Redistributions of source code must retain the above copyright
simon 0:350011bf8be7 15 * notice, this list of conditions and the following disclaimer.
simon 0:350011bf8be7 16 * 2. Redistributions in binary form must reproduce the above copyright
simon 0:350011bf8be7 17 * notice, this list of conditions and the following disclaimer in the
simon 0:350011bf8be7 18 * documentation and/or other materials provided with the distribution.
simon 0:350011bf8be7 19 * 3. Neither the name of the Institute nor the names of its contributors
simon 0:350011bf8be7 20 * may be used to endorse or promote products derived from this software
simon 0:350011bf8be7 21 * without specific prior written permission.
simon 0:350011bf8be7 22 *
simon 0:350011bf8be7 23 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
simon 0:350011bf8be7 24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
simon 0:350011bf8be7 25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
simon 0:350011bf8be7 26 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
simon 0:350011bf8be7 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
simon 0:350011bf8be7 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
simon 0:350011bf8be7 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
simon 0:350011bf8be7 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
simon 0:350011bf8be7 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
simon 0:350011bf8be7 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
simon 0:350011bf8be7 33 * SUCH DAMAGE.
simon 0:350011bf8be7 34 *
simon 0:350011bf8be7 35 * This file is built upon the file: src/arch/rtxc/netif/sioslip.c
simon 0:350011bf8be7 36 *
simon 0:350011bf8be7 37 * Author: Magnus Ivarsson <magnus.ivarsson(at)volvo.com>
simon 0:350011bf8be7 38 */
simon 0:350011bf8be7 39
simon 0:350011bf8be7 40 /*
simon 0:350011bf8be7 41 * This is an arch independent SLIP netif. The specific serial hooks must be
simon 0:350011bf8be7 42 * provided by another file. They are sio_open, sio_read/sio_tryread and sio_send
simon 0:350011bf8be7 43 */
simon 0:350011bf8be7 44
simon 0:350011bf8be7 45 #include "netif/slipif.h"
simon 0:350011bf8be7 46 #include "lwip/opt.h"
simon 0:350011bf8be7 47
simon 0:350011bf8be7 48 #if LWIP_HAVE_SLIPIF
simon 0:350011bf8be7 49
simon 0:350011bf8be7 50 #include "lwip/def.h"
simon 0:350011bf8be7 51 #include "lwip/pbuf.h"
simon 0:350011bf8be7 52 #include "lwip/sys.h"
simon 0:350011bf8be7 53 #include "lwip/stats.h"
simon 0:350011bf8be7 54 #include "lwip/snmp.h"
simon 0:350011bf8be7 55 #include "lwip/sio.h"
simon 0:350011bf8be7 56
simon 0:350011bf8be7 57 #define SLIP_BLOCK 1
simon 0:350011bf8be7 58 #define SLIP_DONTBLOCK 0
simon 0:350011bf8be7 59
simon 0:350011bf8be7 60 #define SLIP_END 0300 /* 0xC0 */
simon 0:350011bf8be7 61 #define SLIP_ESC 0333 /* 0xDB */
simon 0:350011bf8be7 62 #define SLIP_ESC_END 0334 /* 0xDC */
simon 0:350011bf8be7 63 #define SLIP_ESC_ESC 0335 /* 0xDD */
simon 0:350011bf8be7 64
simon 0:350011bf8be7 65 #define SLIP_MAX_SIZE 1500
simon 0:350011bf8be7 66
simon 0:350011bf8be7 67 enum slipif_recv_state {
simon 0:350011bf8be7 68 SLIP_RECV_NORMAL,
simon 0:350011bf8be7 69 SLIP_RECV_ESCAPE,
simon 0:350011bf8be7 70 };
simon 0:350011bf8be7 71
simon 0:350011bf8be7 72 struct slipif_priv {
simon 0:350011bf8be7 73 sio_fd_t sd;
simon 0:350011bf8be7 74 /* q is the whole pbuf chain for a packet, p is the current pbuf in the chain */
simon 0:350011bf8be7 75 struct pbuf *p, *q;
simon 0:350011bf8be7 76 enum slipif_recv_state state;
simon 0:350011bf8be7 77 u16_t i, recved;
simon 0:350011bf8be7 78 };
simon 0:350011bf8be7 79
simon 0:350011bf8be7 80 /**
simon 0:350011bf8be7 81 * Send a pbuf doing the necessary SLIP encapsulation
simon 0:350011bf8be7 82 *
simon 0:350011bf8be7 83 * Uses the serial layer's sio_send()
simon 0:350011bf8be7 84 *
simon 0:350011bf8be7 85 * @param netif the lwip network interface structure for this slipif
simon 0:350011bf8be7 86 * @param p the pbuf chaing packet to send
simon 0:350011bf8be7 87 * @param ipaddr the ip address to send the packet to (not used for slipif)
simon 0:350011bf8be7 88 * @return always returns ERR_OK since the serial layer does not provide return values
simon 0:350011bf8be7 89 */
simon 0:350011bf8be7 90 err_t
simon 0:350011bf8be7 91 slipif_output(struct netif *netif, struct pbuf *p, ip_addr_t *ipaddr)
simon 0:350011bf8be7 92 {
simon 0:350011bf8be7 93 struct slipif_priv *priv;
simon 0:350011bf8be7 94 struct pbuf *q;
simon 0:350011bf8be7 95 u16_t i;
simon 0:350011bf8be7 96 u8_t c;
simon 0:350011bf8be7 97
simon 0:350011bf8be7 98 LWIP_ASSERT("netif != NULL", (netif != NULL));
simon 0:350011bf8be7 99 LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
simon 0:350011bf8be7 100 LWIP_ASSERT("p != NULL", (p != NULL));
simon 0:350011bf8be7 101
simon 0:350011bf8be7 102 LWIP_UNUSED_ARG(ipaddr);
simon 0:350011bf8be7 103
simon 0:350011bf8be7 104 priv = netif->state;
simon 0:350011bf8be7 105
simon 0:350011bf8be7 106 /* Send pbuf out on the serial I/O device. */
simon 0:350011bf8be7 107 sio_send(SLIP_END, priv->sd);
simon 0:350011bf8be7 108
simon 0:350011bf8be7 109 for (q = p; q != NULL; q = q->next) {
simon 0:350011bf8be7 110 for (i = 0; i < q->len; i++) {
simon 0:350011bf8be7 111 c = ((u8_t *)q->payload)[i];
simon 0:350011bf8be7 112 switch (c) {
simon 0:350011bf8be7 113 case SLIP_END:
simon 0:350011bf8be7 114 sio_send(SLIP_ESC, priv->sd);
simon 0:350011bf8be7 115 sio_send(SLIP_ESC_END, priv->sd);
simon 0:350011bf8be7 116 break;
simon 0:350011bf8be7 117 case SLIP_ESC:
simon 0:350011bf8be7 118 sio_send(SLIP_ESC, priv->sd);
simon 0:350011bf8be7 119 sio_send(SLIP_ESC_ESC, priv->sd);
simon 0:350011bf8be7 120 break;
simon 0:350011bf8be7 121 default:
simon 0:350011bf8be7 122 sio_send(c, priv->sd);
simon 0:350011bf8be7 123 break;
simon 0:350011bf8be7 124 }
simon 0:350011bf8be7 125 }
simon 0:350011bf8be7 126 }
simon 0:350011bf8be7 127 sio_send(SLIP_END, priv->sd);
simon 0:350011bf8be7 128 return ERR_OK;
simon 0:350011bf8be7 129 }
simon 0:350011bf8be7 130
simon 0:350011bf8be7 131 /**
simon 0:350011bf8be7 132 * Static function for easy use of blockig or non-blocking
simon 0:350011bf8be7 133 * sio_read
simon 0:350011bf8be7 134 *
simon 0:350011bf8be7 135 * @param fd serial device handle
simon 0:350011bf8be7 136 * @param data pointer to data buffer for receiving
simon 0:350011bf8be7 137 * @param len maximum length (in bytes) of data to receive
simon 0:350011bf8be7 138 * @param block if 1, call sio_read; if 0, call sio_tryread
simon 0:350011bf8be7 139 * @return return value of sio_read of sio_tryread
simon 0:350011bf8be7 140 */
simon 0:350011bf8be7 141 static u32_t
simon 0:350011bf8be7 142 slip_sio_read(sio_fd_t fd, u8_t* data, u32_t len, u8_t block)
simon 0:350011bf8be7 143 {
simon 0:350011bf8be7 144 if (block) {
simon 0:350011bf8be7 145 return sio_read(fd, data, len);
simon 0:350011bf8be7 146 } else {
simon 0:350011bf8be7 147 return sio_tryread(fd, data, len);
simon 0:350011bf8be7 148 }
simon 0:350011bf8be7 149 }
simon 0:350011bf8be7 150
simon 0:350011bf8be7 151 /**
simon 0:350011bf8be7 152 * Handle the incoming SLIP stream character by character
simon 0:350011bf8be7 153 *
simon 0:350011bf8be7 154 * Poll the serial layer by calling sio_read() or sio_tryread().
simon 0:350011bf8be7 155 *
simon 0:350011bf8be7 156 * @param netif the lwip network interface structure for this slipif
simon 0:350011bf8be7 157 * @param block if 1, block until data is received; if 0, return when all data
simon 0:350011bf8be7 158 * from the buffer is received (multiple calls to this function will
simon 0:350011bf8be7 159 * return a complete packet, NULL is returned before - used for polling)
simon 0:350011bf8be7 160 * @return The IP packet when SLIP_END is received
simon 0:350011bf8be7 161 */
simon 0:350011bf8be7 162 static struct pbuf *
simon 0:350011bf8be7 163 slipif_input(struct netif *netif, u8_t block)
simon 0:350011bf8be7 164 {
simon 0:350011bf8be7 165 struct slipif_priv *priv;
simon 0:350011bf8be7 166 u8_t c;
simon 0:350011bf8be7 167 struct pbuf *t;
simon 0:350011bf8be7 168
simon 0:350011bf8be7 169 LWIP_ASSERT("netif != NULL", (netif != NULL));
simon 0:350011bf8be7 170 LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
simon 0:350011bf8be7 171
simon 0:350011bf8be7 172 priv = netif->state;
simon 0:350011bf8be7 173
simon 0:350011bf8be7 174 while (slip_sio_read(priv->sd, &c, 1, block) > 0) {
simon 0:350011bf8be7 175 switch (priv->state) {
simon 0:350011bf8be7 176 case SLIP_RECV_NORMAL:
simon 0:350011bf8be7 177 switch (c) {
simon 0:350011bf8be7 178 case SLIP_END:
simon 0:350011bf8be7 179 if (priv->recved > 0) {
simon 0:350011bf8be7 180 /* Received whole packet. */
simon 0:350011bf8be7 181 /* Trim the pbuf to the size of the received packet. */
simon 0:350011bf8be7 182 pbuf_realloc(priv->q, priv->recved);
simon 0:350011bf8be7 183
simon 0:350011bf8be7 184 LINK_STATS_INC(link.recv);
simon 0:350011bf8be7 185
simon 0:350011bf8be7 186 LWIP_DEBUGF(SLIP_DEBUG, ("slipif: Got packet\n"));
simon 0:350011bf8be7 187 t = priv->q;
simon 0:350011bf8be7 188 priv->p = priv->q = NULL;
simon 0:350011bf8be7 189 priv->i = priv->recved = 0;
simon 0:350011bf8be7 190 return t;
simon 0:350011bf8be7 191 }
simon 0:350011bf8be7 192 continue;
simon 0:350011bf8be7 193 case SLIP_ESC:
simon 0:350011bf8be7 194 priv->state = SLIP_RECV_ESCAPE;
simon 0:350011bf8be7 195 continue;
simon 0:350011bf8be7 196 }
simon 0:350011bf8be7 197 break;
simon 0:350011bf8be7 198 case SLIP_RECV_ESCAPE:
simon 0:350011bf8be7 199 switch (c) {
simon 0:350011bf8be7 200 case SLIP_ESC_END:
simon 0:350011bf8be7 201 c = SLIP_END;
simon 0:350011bf8be7 202 break;
simon 0:350011bf8be7 203 case SLIP_ESC_ESC:
simon 0:350011bf8be7 204 c = SLIP_ESC;
simon 0:350011bf8be7 205 break;
simon 0:350011bf8be7 206 }
simon 0:350011bf8be7 207 priv->state = SLIP_RECV_NORMAL;
simon 0:350011bf8be7 208 /* FALLTHROUGH */
simon 0:350011bf8be7 209 }
simon 0:350011bf8be7 210
simon 0:350011bf8be7 211 /* byte received, packet not yet completely received */
simon 0:350011bf8be7 212 if (priv->p == NULL) {
simon 0:350011bf8be7 213 /* allocate a new pbuf */
simon 0:350011bf8be7 214 LWIP_DEBUGF(SLIP_DEBUG, ("slipif_input: alloc\n"));
simon 0:350011bf8be7 215 priv->p = pbuf_alloc(PBUF_LINK, (PBUF_POOL_BUFSIZE - PBUF_LINK_HLEN), PBUF_POOL);
simon 0:350011bf8be7 216
simon 0:350011bf8be7 217 if (priv->p == NULL) {
simon 0:350011bf8be7 218 LINK_STATS_INC(link.drop);
simon 0:350011bf8be7 219 LWIP_DEBUGF(SLIP_DEBUG, ("slipif_input: no new pbuf! (DROP)\n"));
simon 0:350011bf8be7 220 /* don't process any further since we got no pbuf to receive to */
simon 0:350011bf8be7 221 break;
simon 0:350011bf8be7 222 }
simon 0:350011bf8be7 223
simon 0:350011bf8be7 224 if (priv->q != NULL) {
simon 0:350011bf8be7 225 /* 'chain' the pbuf to the existing chain */
simon 0:350011bf8be7 226 pbuf_cat(priv->q, priv->p);
simon 0:350011bf8be7 227 } else {
simon 0:350011bf8be7 228 /* p is the first pbuf in the chain */
simon 0:350011bf8be7 229 priv->q = priv->p;
simon 0:350011bf8be7 230 }
simon 0:350011bf8be7 231 }
simon 0:350011bf8be7 232
simon 0:350011bf8be7 233 /* this automatically drops bytes if > SLIP_MAX_SIZE */
simon 0:350011bf8be7 234 if ((priv->p != NULL) && (priv->recved <= SLIP_MAX_SIZE)) {
simon 0:350011bf8be7 235 ((u8_t *)priv->p->payload)[priv->i] = c;
simon 0:350011bf8be7 236 priv->recved++;
simon 0:350011bf8be7 237 priv->i++;
simon 0:350011bf8be7 238 if (priv->i >= priv->p->len) {
simon 0:350011bf8be7 239 /* on to the next pbuf */
simon 0:350011bf8be7 240 priv->i = 0;
simon 0:350011bf8be7 241 if (priv->p->next != NULL && priv->p->next->len > 0) {
simon 0:350011bf8be7 242 /* p is a chain, on to the next in the chain */
simon 0:350011bf8be7 243 priv->p = priv->p->next;
simon 0:350011bf8be7 244 } else {
simon 0:350011bf8be7 245 /* p is a single pbuf, set it to NULL so next time a new
simon 0:350011bf8be7 246 * pbuf is allocated */
simon 0:350011bf8be7 247 priv->p = NULL;
simon 0:350011bf8be7 248 }
simon 0:350011bf8be7 249 }
simon 0:350011bf8be7 250 }
simon 0:350011bf8be7 251 }
simon 0:350011bf8be7 252
simon 0:350011bf8be7 253 return NULL;
simon 0:350011bf8be7 254 }
simon 0:350011bf8be7 255
simon 0:350011bf8be7 256 #if !NO_SYS
simon 0:350011bf8be7 257 /**
simon 0:350011bf8be7 258 * The SLIP input thread.
simon 0:350011bf8be7 259 *
simon 0:350011bf8be7 260 * Feed the IP layer with incoming packets
simon 0:350011bf8be7 261 *
simon 0:350011bf8be7 262 * @param nf the lwip network interface structure for this slipif
simon 0:350011bf8be7 263 */
simon 0:350011bf8be7 264 static void
simon 0:350011bf8be7 265 slipif_loop_thread(void *nf)
simon 0:350011bf8be7 266 {
simon 0:350011bf8be7 267 struct pbuf *p;
simon 0:350011bf8be7 268 struct netif *netif = (struct netif *)nf;
simon 0:350011bf8be7 269
simon 0:350011bf8be7 270 while (1) {
simon 0:350011bf8be7 271 p = slipif_input(netif, SLIP_BLOCK);
simon 0:350011bf8be7 272 if (p != NULL) {
simon 0:350011bf8be7 273 if (netif->input(p, netif) != ERR_OK) {
simon 0:350011bf8be7 274 pbuf_free(p);
simon 0:350011bf8be7 275 p = NULL;
simon 0:350011bf8be7 276 }
simon 0:350011bf8be7 277 }
simon 0:350011bf8be7 278 }
simon 0:350011bf8be7 279 }
simon 0:350011bf8be7 280 #endif /* !NO_SYS */
simon 0:350011bf8be7 281
simon 0:350011bf8be7 282 /**
simon 0:350011bf8be7 283 * SLIP netif initialization
simon 0:350011bf8be7 284 *
simon 0:350011bf8be7 285 * Call the arch specific sio_open and remember
simon 0:350011bf8be7 286 * the opened device in the state field of the netif.
simon 0:350011bf8be7 287 *
simon 0:350011bf8be7 288 * @param netif the lwip network interface structure for this slipif
simon 0:350011bf8be7 289 * @return ERR_OK if serial line could be opened,
simon 0:350011bf8be7 290 * ERR_MEM if no memory could be allocated,
simon 0:350011bf8be7 291 * ERR_IF is serial line couldn't be opened
simon 0:350011bf8be7 292 *
simon 0:350011bf8be7 293 * @note netif->num must contain the number of the serial port to open
simon 0:350011bf8be7 294 * (0 by default)
simon 0:350011bf8be7 295 */
simon 0:350011bf8be7 296 err_t
simon 0:350011bf8be7 297 slipif_init(struct netif *netif)
simon 0:350011bf8be7 298 {
simon 0:350011bf8be7 299 struct slipif_priv *priv;
simon 0:350011bf8be7 300
simon 0:350011bf8be7 301 LWIP_DEBUGF(SLIP_DEBUG, ("slipif_init: netif->num=%"U16_F"\n", (u16_t)netif->num));
simon 0:350011bf8be7 302
simon 0:350011bf8be7 303 /* Allocate private data */
simon 0:350011bf8be7 304 priv = mem_malloc(sizeof(struct slipif_priv));
simon 0:350011bf8be7 305 if (!priv) {
simon 0:350011bf8be7 306 return ERR_MEM;
simon 0:350011bf8be7 307 }
simon 0:350011bf8be7 308
simon 0:350011bf8be7 309 netif->name[0] = 's';
simon 0:350011bf8be7 310 netif->name[1] = 'l';
simon 0:350011bf8be7 311 netif->output = slipif_output;
simon 0:350011bf8be7 312 netif->mtu = SLIP_MAX_SIZE;
simon 0:350011bf8be7 313 netif->flags |= NETIF_FLAG_POINTTOPOINT;
simon 0:350011bf8be7 314
simon 0:350011bf8be7 315 /* Try to open the serial port (netif->num contains the port number). */
simon 0:350011bf8be7 316 priv->sd = sio_open(netif->num);
simon 0:350011bf8be7 317 if (!priv->sd) {
simon 0:350011bf8be7 318 /* Opening the serial port failed. */
simon 0:350011bf8be7 319 mem_free(priv);
simon 0:350011bf8be7 320 return ERR_IF;
simon 0:350011bf8be7 321 }
simon 0:350011bf8be7 322
simon 0:350011bf8be7 323 /* Initialize private data */
simon 0:350011bf8be7 324 priv->p = NULL;
simon 0:350011bf8be7 325 priv->q = NULL;
simon 0:350011bf8be7 326 priv->state = SLIP_RECV_NORMAL;
simon 0:350011bf8be7 327 priv->i = 0;
simon 0:350011bf8be7 328 priv->recved = 0;
simon 0:350011bf8be7 329
simon 0:350011bf8be7 330 netif->state = priv;
simon 0:350011bf8be7 331
simon 0:350011bf8be7 332 /* initialize the snmp variables and counters inside the struct netif
simon 0:350011bf8be7 333 * ifSpeed: no assumption can be made without knowing more about the
simon 0:350011bf8be7 334 * serial line!
simon 0:350011bf8be7 335 */
simon 0:350011bf8be7 336 NETIF_INIT_SNMP(netif, snmp_ifType_slip, 0);
simon 0:350011bf8be7 337
simon 0:350011bf8be7 338 /* Create a thread to poll the serial line. */
simon 0:350011bf8be7 339 sys_thread_new(SLIPIF_THREAD_NAME, slipif_loop_thread, netif,
simon 0:350011bf8be7 340 SLIPIF_THREAD_STACKSIZE, SLIPIF_THREAD_PRIO);
simon 0:350011bf8be7 341 return ERR_OK;
simon 0:350011bf8be7 342 }
simon 0:350011bf8be7 343
simon 0:350011bf8be7 344 /**
simon 0:350011bf8be7 345 * Polls the serial device and feeds the IP layer with incoming packets.
simon 0:350011bf8be7 346 *
simon 0:350011bf8be7 347 * @param netif The lwip network interface structure for this slipif
simon 0:350011bf8be7 348 */
simon 0:350011bf8be7 349 void
simon 0:350011bf8be7 350 slipif_poll(struct netif *netif)
simon 0:350011bf8be7 351 {
simon 0:350011bf8be7 352 struct pbuf *p;
simon 0:350011bf8be7 353 struct slipif_priv *priv;
simon 0:350011bf8be7 354
simon 0:350011bf8be7 355 LWIP_ASSERT("netif != NULL", (netif != NULL));
simon 0:350011bf8be7 356 LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
simon 0:350011bf8be7 357
simon 0:350011bf8be7 358 priv = netif->state;
simon 0:350011bf8be7 359
simon 0:350011bf8be7 360 while ((p = slipif_input(netif, SLIP_DONTBLOCK)) != NULL) {
simon 0:350011bf8be7 361 if (netif->input(p, netif) != ERR_OK) {
simon 0:350011bf8be7 362 pbuf_free(p);
simon 0:350011bf8be7 363 }
simon 0:350011bf8be7 364 }
simon 0:350011bf8be7 365 }
simon 0:350011bf8be7 366
simon 0:350011bf8be7 367 #endif /* LWIP_HAVE_SLIPIF */