Lines Matching refs:tcphdr

63 static struct tcp_hdr *tcphdr;
109 tcphdr = (struct tcp_hdr *)((u8_t *)p->payload + IPH_HL(iphdr) * 4);
112 tcp_debug_print(tcphdr);
138 tcp_debug_print(tcphdr);
147 hdrlen = TCPH_HDRLEN(tcphdr);
156 tcphdr->src = ntohs(tcphdr->src);
157 tcphdr->dest = ntohs(tcphdr->dest);
158 seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
159 ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
160 tcphdr->wnd = ntohs(tcphdr->wnd);
162 flags = TCPH_FLAGS(tcphdr);
174 if (pcb->remote_port == tcphdr->src &&
175 pcb->local_port == tcphdr->dest &&
199 if (pcb->remote_port == tcphdr->src &&
200 pcb->local_port == tcphdr->dest &&
217 if (lpcb->local_port == tcphdr->dest) {
266 tcp_debug_print_flags(TCPH_FLAGS(tcphdr));
283 inseg.tcphdr = tcphdr;
408 if (!(TCPH_FLAGS(tcphdr) & TCP_RST)) {
413 tcphdr->dest, tcphdr->src);
457 ip_current_src_addr(), tcphdr->dest, tcphdr->src);
459 LWIP_DEBUGF(TCP_DEBUG, ("TCP connection request %"U16_F" -> %"U16_F".\n", tcphdr->src, tcphdr->dest));
462 LWIP_DEBUGF(TCP_DEBUG, ("tcp_listen_input: listen backlog exceeded for port %"U16_F"\n", tcphdr->dest));
482 npcb->remote_port = tcphdr->src;
486 npcb->snd_wnd = tcphdr->wnd;
487 npcb->snd_wnd_max = tcphdr->wnd;
546 tcphdr->dest, tcphdr->src);
630 pcb->snd_nxt, ntohl(pcb->unacked->tcphdr->seqno)));
633 && ackno == ntohl(pcb->unacked->tcphdr->seqno) + 1) {
638 pcb->snd_wnd = tcphdr->wnd;
639 pcb->snd_wnd_max = tcphdr->wnd;
680 tcphdr->dest, tcphdr->src);
689 LWIP_DEBUGF(TCP_DEBUG, ("TCP connection established %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
723 tcphdr->dest, tcphdr->src);
744 ("TCP connection closed: FIN_WAIT_1 %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
761 LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed: FIN_WAIT_2 %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
772 LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed: CLOSING %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
782 LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed: LAST_ACK %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
804 if (TCPH_FLAGS(cseg->tcphdr) & TCP_FIN) {
814 (next->tcphdr->seqno + next->len))) {
816 if (TCPH_FLAGS(next->tcphdr) & TCP_FIN) {
817 TCPH_SET_FLAG(cseg->tcphdr, TCP_FIN);
824 TCP_SEQ_GT(seqno + cseg->len, next->tcphdr->seqno)) {
826 cseg->len = (u16_t)(next->tcphdr->seqno - seqno);
872 (pcb->snd_wl2 == ackno && tcphdr->wnd > pcb->snd_wnd)) {
873 pcb->snd_wnd = tcphdr->wnd;
876 if (pcb->snd_wnd_max < tcphdr->wnd) {
877 pcb->snd_wnd_max = tcphdr->wnd;
894 if (pcb->snd_wnd != tcphdr->wnd) {
1002 ntohl(pcb->unacked->tcphdr->seqno): 0,
1004 ntohl(pcb->unacked->tcphdr->seqno) + TCP_TCPLEN(pcb->unacked): 0));
1009 TCP_SEQ_LEQ(ntohl(pcb->unacked->tcphdr->seqno) +
1012 ntohl(pcb->unacked->tcphdr->seqno),
1013 ntohl(pcb->unacked->tcphdr->seqno) +
1022 if ((pcb->acked != 0) && ((TCPH_FLAGS(next->tcphdr) & TCP_FIN) != 0)) {
1056 TCP_SEQ_BETWEEN(ackno, ntohl(pcb->unsent->tcphdr->seqno) +
1059 ntohl(pcb->unsent->tcphdr->seqno), ntohl(pcb->unsent->tcphdr->seqno) +
1072 if ((pcb->acked != 0) && ((TCPH_FLAGS(next->tcphdr) & TCP_FIN) != 0)) {
1199 inseg.tcphdr->seqno = seqno = pcb->rcv_nxt;
1227 if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) {
1230 TCPH_FLAGS_SET(inseg.tcphdr, TCPH_FLAGS(inseg.tcphdr) &~ TCP_FIN);
1234 if (TCPH_FLAGS(inseg.tcphdr) & TCP_SYN) {
1247 if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) {
1264 next->tcphdr->seqno + next->len)) {
1266 if (TCPH_FLAGS(next->tcphdr) & TCP_FIN &&
1267 (TCPH_FLAGS(inseg.tcphdr) & TCP_SYN) == 0) {
1268 TCPH_SET_FLAG(inseg.tcphdr, TCP_FIN);
1279 next->tcphdr->seqno)) {
1281 inseg.len = (u16_t)(next->tcphdr->seqno - seqno);
1282 if (TCPH_FLAGS(inseg.tcphdr) & TCP_SYN) {
1288 (seqno + tcplen) == next->tcphdr->seqno);
1319 if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) {
1328 pcb->ooseq->tcphdr->seqno == pcb->rcv_nxt) {
1331 seqno = pcb->ooseq->tcphdr->seqno;
1350 if (TCPH_FLAGS(cseg->tcphdr) & TCP_FIN) {
1389 if (seqno == next->tcphdr->seqno) {
1416 if (TCP_SEQ_LT(seqno, next->tcphdr->seqno)) {
1429 /*if (TCP_SEQ_LT(prev->tcphdr->seqno, seqno) &&
1430 TCP_SEQ_LT(seqno, next->tcphdr->seqno)) {*/
1431 if (TCP_SEQ_BETWEEN(seqno, prev->tcphdr->seqno+1, next->tcphdr->seqno-1)) {
1439 if (TCP_SEQ_GT(prev->tcphdr->seqno + prev->len, seqno)) {
1441 prev->len = (u16_t)(seqno - prev->tcphdr->seqno);
1454 TCP_SEQ_GT(seqno, next->tcphdr->seqno)) {
1455 if (TCPH_FLAGS(next->tcphdr) & TCP_FIN) {
1461 if (TCP_SEQ_GT(next->tcphdr->seqno + next->len, seqno)) {
1463 next->len = (u16_t)(seqno - next->tcphdr->seqno);
1472 if (TCPH_FLAGS(next->next->tcphdr) & TCP_FIN) {
1475 TCPH_FLAGS_SET(next->next->tcphdr, TCPH_FLAGS(next->next->tcphdr) &~ TCP_FIN);
1551 opts = (u8_t *)tcphdr + TCP_HLEN;
1554 if(TCPH_HDRLEN(tcphdr) > 0x5) {
1555 max_c = (TCPH_HDRLEN(tcphdr) - 5) << 2;