159 |
time. The size of the data in each pbuf is kept in the ->len |
time. The size of the data in each pbuf is kept in the ->len |
160 |
variable. */ |
variable. */ |
161 |
/* send data from(q->payload, q->len); */ |
/* send data from(q->payload, q->len); */ |
162 |
bcopy(q->payload, bufptr, q->len); |
memcpy(bufptr, q->payload, q->len); |
163 |
bufptr += q->len; |
bufptr += q->len; |
164 |
} |
} |
165 |
|
|
197 |
|
|
198 |
|
|
199 |
/* We allocate a pbuf chain of pbufs from the pool. */ |
/* We allocate a pbuf chain of pbufs from the pool. */ |
200 |
p = pbuf_alloc(PBUF_LINK, len, PBUF_POOL); |
p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL); |
201 |
|
|
202 |
if(p != NULL) { |
if(p != NULL) { |
203 |
/* We iterate over the pbuf chain until we have read the entire |
/* We iterate over the pbuf chain until we have read the entire |
208 |
avaliable data in the pbuf is given by the q->len |
avaliable data in the pbuf is given by the q->len |
209 |
variable. */ |
variable. */ |
210 |
/* read data into(q->payload, q->len); */ |
/* read data into(q->payload, q->len); */ |
211 |
bcopy(bufptr, q->payload, q->len); |
memcpy(q->payload, bufptr, q->len); |
212 |
bufptr += q->len; |
bufptr += q->len; |
213 |
} |
} |
214 |
/* acknowledge that packet has been read(); */ |
/* acknowledge that packet has been read(); */ |