mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-04-16 08:43:17 +00:00
Fixed some typo's in the comments.
This commit is contained in:
parent
ea0dc429a7
commit
1ad5537c9b
@ -110,7 +110,7 @@ timeout(void *arg)
|
||||
bufptr = (u_char *)pcapif->pkt;
|
||||
for(q = p; q != NULL; q = q->next) {
|
||||
/* Read enough bytes to fill this pbuf in the chain. The
|
||||
avaliable data in the pbuf is given by the q->len
|
||||
available data in the pbuf is given by the q->len
|
||||
variable. */
|
||||
/* read data into(q->payload, q->len); */
|
||||
bcopy(bufptr, q->payload, q->len);
|
||||
|
@ -205,7 +205,7 @@ low_level_input(struct tapif *tapif)
|
||||
bufptr = &buf[0];
|
||||
for(q = p; q != NULL; q = q->next) {
|
||||
/* Read enough bytes to fill this pbuf in the chain. The
|
||||
avaliable data in the pbuf is given by the q->len
|
||||
available data in the pbuf is given by the q->len
|
||||
variable. */
|
||||
/* read data into(q->payload, q->len); */
|
||||
memcpy(q->payload, bufptr, q->len);
|
||||
|
@ -179,7 +179,7 @@ low_level_input(struct tunif *tunif)
|
||||
bufptr = &buf[0];
|
||||
for(q = p; q != NULL; q = q->next) {
|
||||
/* Read enough bytes to fill this pbuf in the chain. The
|
||||
avaliable data in the pbuf is given by the q->len
|
||||
available data in the pbuf is given by the q->len
|
||||
variable. */
|
||||
/* read data into(q->payload, q->len); */
|
||||
bcopy(bufptr, q->payload, q->len);
|
||||
|
@ -357,7 +357,7 @@ static struct pbuf * low_level_input(struct xemacif *xemacif_ptr)
|
||||
* read the entire packet into the pbuf. */
|
||||
for(q = p; q != NULL; q = q->next) {
|
||||
/* Read enough bytes to fill this pbuf
|
||||
* in the chain. The avaliable data in
|
||||
* in the chain. The available data in
|
||||
* the pbuf is given by the q->len variable. */
|
||||
for (i = 0 ; i < q->len ; i++) {
|
||||
((u8_t *)q->payload)[i] = *(frame_bytes++);
|
||||
|
@ -232,7 +232,7 @@ ip_reass(struct pbuf *p)
|
||||
i = 0;
|
||||
for (q = p; q != NULL; q = q->next) {
|
||||
/* Copy enough bytes to fill this pbuf in the chain. The
|
||||
avaliable data in the pbuf is given by the q->len
|
||||
available data in the pbuf is given by the q->len
|
||||
variable. */
|
||||
DEBUGF(IP_REASS_DEBUG,
|
||||
("ip_reass: memcpy from %p (%d) to %p, %d bytes\n",
|
||||
|
@ -274,7 +274,7 @@ tcp_input(struct pbuf *p, struct netif *inp)
|
||||
} else {
|
||||
err = ERR_OK;
|
||||
/* If the application has registered a "sent" function to be
|
||||
called when new send buffer space is avaliable, we call it
|
||||
called when new send buffer space is available, we call it
|
||||
now. */
|
||||
if(pcb->acked > 0) {
|
||||
TCP_EVENT_SENT(pcb, pcb->acked, err);
|
||||
@ -356,7 +356,7 @@ tcp_listen_input(struct tcp_pcb_listen *pcb)
|
||||
npcb = tcp_alloc(pcb->prio);
|
||||
/* If a new PCB could not be created (probably due to lack of memory),
|
||||
we don't do anything, but rely on the sender will retransmit the
|
||||
SYN at a time when we have more memory avaliable. */
|
||||
SYN at a time when we have more memory available. */
|
||||
if(npcb == NULL) {
|
||||
DEBUGF(TCP_DEBUG, ("tcp_listen_input: could not allocate PCB\n"));
|
||||
#ifdef TCP_STATS
|
||||
|
@ -76,6 +76,7 @@ tcp_send_ctrl(struct tcp_pcb *pcb, u8_t flags)
|
||||
err_t
|
||||
tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t copy)
|
||||
{
|
||||
DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_write(pcb=%p, arg=%p, len=%u, copy=%d)\n", pcb, arg, len, copy));
|
||||
if(pcb->state == SYN_SENT ||
|
||||
pcb->state == SYN_RCVD ||
|
||||
pcb->state == ESTABLISHED ||
|
||||
@ -85,6 +86,7 @@ tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t copy)
|
||||
}
|
||||
return ERR_OK;
|
||||
} else {
|
||||
DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_write() called in invalid state\n"));
|
||||
return ERR_CONN;
|
||||
}
|
||||
}
|
||||
@ -101,6 +103,7 @@ tcp_enqueue(struct tcp_pcb *pcb, void *arg, u16_t len,
|
||||
void *ptr;
|
||||
u8_t queuelen;
|
||||
|
||||
DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_enqueue(pcb=%p, arg=%p, len=%u, flags=%x, copy=%d)\n", pcb, arg, len, flags, copy));
|
||||
left = len;
|
||||
ptr = arg;
|
||||
/* fail on too much data */
|
||||
@ -114,7 +117,7 @@ tcp_enqueue(struct tcp_pcb *pcb, void *arg, u16_t len,
|
||||
seqno = pcb->snd_lbb;
|
||||
|
||||
queue = NULL;
|
||||
DEBUGF(TCP_QLEN_DEBUG, ("tcp_enqueue: %d\n", pcb->snd_queuelen));
|
||||
DEBUGF(TCP_QLEN_DEBUG, ("tcp_enqueue: queuelen: %d\n", pcb->snd_queuelen));
|
||||
|
||||
/* Check if the queue length exceeds the configured maximum queue
|
||||
length. If so, we return an error. */
|
||||
@ -153,7 +156,8 @@ tcp_enqueue(struct tcp_pcb *pcb, void *arg, u16_t len,
|
||||
|
||||
if(queue == NULL) {
|
||||
queue = seg;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
/* Attach the segment to the end of the queued segments. */
|
||||
for(useg = queue; useg->next != NULL; useg = useg->next);
|
||||
useg->next = seg;
|
||||
@ -169,9 +173,10 @@ tcp_enqueue(struct tcp_pcb *pcb, void *arg, u16_t len,
|
||||
}
|
||||
++queuelen;
|
||||
seg->dataptr = seg->p->payload;
|
||||
} else if(copy) {
|
||||
}
|
||||
else if(copy) {
|
||||
if((seg->p = pbuf_alloc(PBUF_TRANSPORT, seglen, PBUF_RAM)) == NULL) {
|
||||
DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_enqueue: could not allocate memory for pbuf copy\n"));
|
||||
DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_enqueue: could not allocate memory for pbuf copy size %u\n", seglen));
|
||||
goto memerr;
|
||||
}
|
||||
++queuelen;
|
||||
@ -179,7 +184,8 @@ tcp_enqueue(struct tcp_pcb *pcb, void *arg, u16_t len,
|
||||
memcpy(seg->p->payload, ptr, seglen);
|
||||
}
|
||||
seg->dataptr = seg->p->payload;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
/* Do not copy the data. */
|
||||
|
||||
/* First, allocate a pbuf for holding the data. */
|
||||
@ -238,7 +244,8 @@ tcp_enqueue(struct tcp_pcb *pcb, void *arg, u16_t len,
|
||||
/* Copy the options into the header, if they are present. */
|
||||
if(optdata == NULL) {
|
||||
TCPH_OFFSET_SET(seg->tcphdr, 5 << 4);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
TCPH_OFFSET_SET(seg->tcphdr, (5 + optlen / 4) << 4);
|
||||
/* Copy options into data portion of segment.
|
||||
Options can thus only be sent in non data carrying
|
||||
@ -261,7 +268,8 @@ tcp_enqueue(struct tcp_pcb *pcb, void *arg, u16_t len,
|
||||
pcb->unsent queue. */
|
||||
if(pcb->unsent == NULL) {
|
||||
useg = NULL;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
for(useg = pcb->unsent; useg->next != NULL; useg = useg->next);
|
||||
}
|
||||
|
||||
@ -283,11 +291,13 @@ tcp_enqueue(struct tcp_pcb *pcb, void *arg, u16_t len,
|
||||
seg = NULL;
|
||||
}
|
||||
memp_free(MEMP_TCP_SEG, queue);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if(useg == NULL) {
|
||||
pcb->unsent = queue;
|
||||
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
useg->next = queue;
|
||||
}
|
||||
}
|
||||
@ -471,6 +481,7 @@ tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb)
|
||||
if(pcb->rcv_wnd < pcb->mss) {
|
||||
seg->tcphdr->wnd = 0;
|
||||
} else {
|
||||
/* advertise our receive window size in this TCP segment */
|
||||
seg->tcphdr->wnd = htons(pcb->rcv_wnd);
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
* $Id: udp.c,v 1.7 2003/01/08 10:09:42 likewise Exp $
|
||||
* $Id: udp.c,v 1.8 2003/01/13 13:24:11 likewise Exp $
|
||||
*/
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
@ -58,7 +58,7 @@
|
||||
|
||||
/* The list of UDP PCBs. */
|
||||
#if LWIP_UDP
|
||||
static struct udp_pcb *udp_pcbs = NULL;
|
||||
/*static*/ struct udp_pcb *udp_pcbs = NULL;
|
||||
|
||||
static struct udp_pcb *pcb_cache = NULL;
|
||||
#endif /* LWIP_UDP */
|
||||
@ -336,6 +336,7 @@ udp_send(struct udp_pcb *pcb, struct pbuf *p)
|
||||
|
||||
if(pcb->flags & UDP_FLAGS_UDPLITE) {
|
||||
DEBUGF(UDP_DEBUG, ("udp_send: UDP LITE packet length %u", p->tot_len));
|
||||
/* set UDP message length in UDP header */
|
||||
udphdr->len = htons(pcb->chksum_len);
|
||||
/* calculate checksum */
|
||||
udphdr->chksum = inet_chksum_pseudo(p, src_ip, &(pcb->remote_ip),
|
||||
|
@ -140,7 +140,7 @@ low_level_input(struct ethernetif *ethernetif)
|
||||
packet into the pbuf. */
|
||||
for(q = p; q != NULL; q = q->next) {
|
||||
/* Read enough bytes to fill this pbuf in the chain. The
|
||||
avaliable data in the pbuf is given by the q->len
|
||||
available data in the pbuf is given by the q->len
|
||||
variable. */
|
||||
read data into(q->payload, q->len);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user