• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /barrelfish-2018-10-04/lib/lwip/src/core/

Lines Matching refs:seg

61 static void tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb);
163 struct tcp_seg *seg, *useg, *queue;
227 useg = queue = seg = NULL;
237 seg = memp_malloc(MEMP_TCP_SEG);
238 if (seg == NULL) {
243 seg->next = NULL;
244 seg->p = NULL;
251 queue = seg;
257 useg->next = seg;
260 useg = seg;
268 if ((seg->p =
276 (seg->p->len >= seglen + optlen));
277 queuelen += pbuf_clen(seg->p);
279 MEMCPY((char *) seg->p->payload + optlen, ptr, seglen);
281 seg->dataptr = seg->p->payload;
288 if ((seg->p = pbuf_alloc(PBUF_TRANSPORT, optlen, PBUF_RAM)) == NULL) {
293 queuelen += pbuf_clen(seg->p);
303 pbuf_free(seg->p);
304 seg->p = NULL;
312 seg->dataptr = ptr;
315 pbuf_cat(seg->p /*header */ , p /*data */ );
331 seg->len = seglen;
334 if (pbuf_header(seg->p, TCP_HLEN)) {
340 seg->tcphdr = seg->p->payload;
341 seg->tcphdr->src = htons(pcb->local_port);
342 seg->tcphdr->dest = htons(pcb->remote_port);
343 seg->tcphdr->seqno = htonl(seqno);
344 seg->tcphdr->urgp = 0;
345 TCPH_FLAGS_SET(seg->tcphdr, flags);
348 seg->flags = optflags;
351 TCPH_HDRLEN_SET(seg->tcphdr, (5 + optlen / 4));
354 ")\n", ntohl(seg->tcphdr->seqno),
355 ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg),
379 /* fit within max seg size */
408 if (seg == queue) {
409 seg = useg;
446 if (seg != NULL && seglen > 0 && seg->tcphdr != NULL
448 TCPH_SET_FLAG(seg->tcphdr, TCP_PSH);
497 struct tcp_seg *seg, *useg;
515 seg = pcb->unsent;
530 (seg == NULL ||
531 ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > wnd)) {
582 if (seg == NULL) {
588 if (seg == NULL) {
591 ", seg == NULL, ack %" U32_F "\n",
599 ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len,
600 ntohl(seg->tcphdr->seqno), pcb->lastack));
604 while (seg != NULL &&
605 ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len <= wnd) {
607 (TCPH_FLAGS(seg->tcphdr) & TCP_RST) == 0);
612 * either seg->next != NULL or pcb->unacked == NULL;
624 ntohl(seg->tcphdr->seqno) + seg->len - pcb->lastack,
625 ntohl(seg->tcphdr->seqno), pcb->lastack, i));
629 pcb->unsent = seg->next;
632 TCPH_SET_FLAG(seg->tcphdr, TCP_ACK);
636 tcp_output_segment(seg, pcb);
637 snd_nxt = ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg);
642 if (TCP_TCPLEN(seg) > 0) {
643 seg->next = NULL;
646 pcb->unacked = seg;
647 useg = seg;
654 (ntohl(seg->tcphdr->seqno), ntohl(useg->tcphdr->seqno))) {
660 ntohl(seg->tcphdr->seqno))) {
663 seg->next = (*cur_seg);
664 (*cur_seg) = seg;
667 useg->next = seg;
673 tcp_seg_free(seg);
675 seg = pcb->unsent;
678 if (seg != NULL && pcb->persist_backoff == 0 &&
679 ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > pcb->snd_wnd) {
692 * @param seg the tcp_seg to send
695 static void tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb)
706 seg->tcphdr->ackno = htonl(pcb->rcv_nxt);
709 seg->tcphdr->wnd = htons(pcb->rcv_ann_wnd);
715 opts = (u32_t *) (seg->tcphdr + 1);
716 if (seg->flags & TF_SEG_OPTS_MSS) {
723 if (seg->flags & TF_SEG_OPTS_TS) {
745 pcb->rtseq = ntohl(seg->tcphdr->seqno);
752 htonl(seg->tcphdr->seqno),
753 htonl(seg->tcphdr->seqno) + seg->len));
755 len = (u16_t) ((u8_t *) seg->tcphdr - (u8_t *) seg->p->payload);
757 seg->p->len -= len;
758 seg->p->tot_len -= len;
760 seg->p->payload = seg->tcphdr;
762 seg->tcphdr->chksum = 0;
766 seg->p->nicflags |= NETIF_TXFLAG_TCPCHECKSUM;
767 seg->p->nicflags |=
768 TCPH_HDRLEN(seg->tcphdr) << NETIF_TXFLAG_TCPHDRLEN_SHIFT;
769 seg->tcphdr->chksum = (~inet_chksum_pseudo_partial(seg->p,
772 IP_PROTO_TCP, seg->p->tot_len,
775 seg->tcphdr->chksum = inet_chksum_pseudo(seg->p,
778 IP_PROTO_TCP, seg->p->tot_len);
784 ip_output_hinted(seg->p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl,
787 ip_output(seg->p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
863 struct tcp_seg *seg;
870 for (seg = pcb->unacked; seg->next != NULL; seg = seg->next);
872 seg->next = pcb->unsent;
897 struct tcp_seg *seg;
906 seg = pcb->unacked;
907 pcb->unacked = seg->next;
912 ntohl(seg->tcphdr->seqno))) {
915 seg->next = *cur_seg;
916 *cur_seg = seg;
998 struct tcp_seg *seg;
1011 seg = pcb->unacked;
1013 if (seg == NULL)
1014 seg = pcb->unsent;
1016 if (seg == NULL)
1028 tcphdr = tcp_output_set_header(pcb, p, 0, seg->tcphdr->seqno);
1031 *((char *) p->payload + sizeof(struct tcp_hdr)) = *(char *) seg->dataptr;