亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? uip.c

?? freertosV4.40 是一種small的嵌入式系統(tǒng)。利于嵌入式開好者入門學習嵌入式操作系統(tǒng)。通過對于源碼的學習可以很好的掌握freertos的運行機制。
?? C
?? 第 1 頁 / 共 4 頁
字號:
  }  
#endif /* UIP_UDP_CHECKSUMS */

  /* Demultiplex this UDP packet between the UDP "connections". */
  for(uip_udp_conn = &uip_udp_conns[0];
      uip_udp_conn < &uip_udp_conns[UIP_UDP_CONNS];
      ++uip_udp_conn) {
    if(uip_udp_conn->lport != 0 &&
       UDPBUF->destport == uip_udp_conn->lport &&
       (uip_udp_conn->rport == 0 ||
        UDPBUF->srcport == uip_udp_conn->rport) &&
       BUF->srcipaddr[0] == uip_udp_conn->ripaddr[0] &&
       BUF->srcipaddr[1] == uip_udp_conn->ripaddr[1]) {
      goto udp_found; 
    }
  }
  goto drop;
  
 udp_found:
  uip_len = uip_len - 28;
  uip_appdata = &uip_buf[UIP_LLH_LEN + 28];
  uip_flags = UIP_NEWDATA;
  uip_slen = 0;
  UIP_UDP_APPCALL();
 udp_send:
  if(uip_slen == 0) {
    goto drop;      
  }
  uip_len = uip_slen + 28;

  BUF->len[0] = (uip_len >> 8);
  BUF->len[1] = (uip_len & 0xff);
  
  BUF->proto = UIP_PROTO_UDP;

  UDPBUF->udplen = HTONS(uip_slen + 8);
  UDPBUF->udpchksum = 0;
#if UIP_UDP_CHECKSUMS 
  /* Calculate UDP checksum. */
  UDPBUF->udpchksum = ~(uip_udpchksum());
  if(UDPBUF->udpchksum == 0) {
    UDPBUF->udpchksum = 0xffff;
  }
#endif /* UIP_UDP_CHECKSUMS */

  BUF->srcport  = uip_udp_conn->lport;
  BUF->destport = uip_udp_conn->rport;

  BUF->srcipaddr[0] = uip_hostaddr[0];
  BUF->srcipaddr[1] = uip_hostaddr[1];
  BUF->destipaddr[0] = uip_udp_conn->ripaddr[0];
  BUF->destipaddr[1] = uip_udp_conn->ripaddr[1];
 
  uip_appdata = &uip_buf[UIP_LLH_LEN + 40];
  goto ip_send_nolen;
#endif /* UIP_UDP */
  
  /* TCP input processing. */  
 tcp_input:
  UIP_STAT(++uip_stat.tcp.recv);

  /* Start of TCP input header processing code. */
  
#if 1  // FIXME
  if(uip_tcpchksum() != 0xffff) {   /* Compute and check the TCP
				       checksum. */
    UIP_STAT(++uip_stat.tcp.drop);
    UIP_STAT(++uip_stat.tcp.chkerr);
    UIP_LOG("tcp: bad checksum.");    
    goto drop;
  }
#endif
  
  /* Demultiplex this segment. */
  /* First check any active connections. */
  for(uip_connr = &uip_conns[0]; uip_connr < &uip_conns[UIP_CONNS]; ++uip_connr) {
    if(uip_connr->tcpstateflags != CLOSED &&
       BUF->destport == uip_connr->lport &&
       BUF->srcport == uip_connr->rport &&
       BUF->srcipaddr[0] == uip_connr->ripaddr[0] &&
       BUF->srcipaddr[1] == uip_connr->ripaddr[1]) {
      goto found;    
    }
  }

  /* If we didn't find and active connection that expected the packet,
     either this packet is an old duplicate, or this is a SYN packet
     destined for a connection in LISTEN. If the SYN flag isn't set,
     it is an old packet and we send a RST. */
  if((BUF->flags & TCP_CTL) != TCP_SYN)
    goto reset;
  
  tmp16 = BUF->destport;
  /* Next, check listening connections. */  
  for(c = 0; c < UIP_LISTENPORTS; ++c) {
    if(tmp16 == uip_listenports[c])
      goto found_listen;
  }
  
  /* No matching connection found, so we send a RST packet. */
  UIP_STAT(++uip_stat.tcp.synrst);
 reset:

  /* We do not send resets in response to resets. */
  if(BUF->flags & TCP_RST) 
    goto drop;

  UIP_STAT(++uip_stat.tcp.rst);
  
  BUF->flags = TCP_RST | TCP_ACK;
  uip_len = 40;
  BUF->tcpoffset = 5 << 4;

  /* Flip the seqno and ackno fields in the TCP header. */
  c = BUF->seqno[3];
  BUF->seqno[3] = BUF->ackno[3];  
  BUF->ackno[3] = c;
  
  c = BUF->seqno[2];
  BUF->seqno[2] = BUF->ackno[2];  
  BUF->ackno[2] = c;
  
  c = BUF->seqno[1];
  BUF->seqno[1] = BUF->ackno[1];
  BUF->ackno[1] = c;
  
  c = BUF->seqno[0];
  BUF->seqno[0] = BUF->ackno[0];  
  BUF->ackno[0] = c;

  /* We also have to increase the sequence number we are
     acknowledging. If the least significant byte overflowed, we need
     to propagate the carry to the other bytes as well. */
  if(++BUF->ackno[3] == 0) {
    if(++BUF->ackno[2] == 0) {
      if(++BUF->ackno[1] == 0) {
	++BUF->ackno[0];
      }
    }
  }
 
  /* Swap port numbers. */
  tmp16 = BUF->srcport;
  BUF->srcport = BUF->destport;
  BUF->destport = tmp16;
  
  /* Swap IP addresses. */
  tmp16 = BUF->destipaddr[0];
  BUF->destipaddr[0] = BUF->srcipaddr[0];
  BUF->srcipaddr[0] = tmp16;
  tmp16 = BUF->destipaddr[1];
  BUF->destipaddr[1] = BUF->srcipaddr[1];
  BUF->srcipaddr[1] = tmp16;

  
  /* And send out the RST packet! */
  goto tcp_send_noconn;

  /* This label will be jumped to if we matched the incoming packet
     with a connection in LISTEN. In that case, we should create a new
     connection and send a SYNACK in return. */
 found_listen:
  /* First we check if there are any connections avaliable. Unused
     connections are kept in the same table as used connections, but
     unused ones have the tcpstate set to CLOSED. Also, connections in
     TIME_WAIT are kept track of and we'll use the oldest one if no
     CLOSED connections are found. Thanks to Eddie C. Dost for a very
     nice algorithm for the TIME_WAIT search. */
  uip_connr = 0;
  for(c = 0; c < UIP_CONNS; ++c) {
    if(uip_conns[c].tcpstateflags == CLOSED) {
      uip_connr = &uip_conns[c];
      break;
    }
    if(uip_conns[c].tcpstateflags == TIME_WAIT) {
      if(uip_connr == 0 ||
	 uip_conns[c].timer > uip_connr->timer) {
	uip_connr = &uip_conns[c];
      }
    }
  }

  if(uip_connr == 0) {
    /* All connections are used already, we drop packet and hope that
       the remote end will retransmit the packet at a time when we
       have more spare connections. */
    UIP_STAT(++uip_stat.tcp.syndrop);
    UIP_LOG("tcp: found no unused connections.");
    goto drop;
  }
  uip_conn = uip_connr;
  
  /* Fill in the necessary fields for the new connection. */
  uip_connr->rto = uip_connr->timer = UIP_RTO;
  uip_connr->sa = 0;
  uip_connr->sv = 4;  
  uip_connr->nrtx = 0;
  uip_connr->lport = BUF->destport;
  uip_connr->rport = BUF->srcport;
  uip_connr->ripaddr[0] = BUF->srcipaddr[0];
  uip_connr->ripaddr[1] = BUF->srcipaddr[1];
  uip_connr->tcpstateflags = SYN_RCVD;

  uip_connr->snd_nxt[0] = iss[0];
  uip_connr->snd_nxt[1] = iss[1];
  uip_connr->snd_nxt[2] = iss[2];
  uip_connr->snd_nxt[3] = iss[3];
  uip_connr->len = 1;

  /* rcv_nxt should be the seqno from the incoming packet + 1. */
  uip_connr->rcv_nxt[3] = BUF->seqno[3];
  uip_connr->rcv_nxt[2] = BUF->seqno[2];
  uip_connr->rcv_nxt[1] = BUF->seqno[1];
  uip_connr->rcv_nxt[0] = BUF->seqno[0];
  uip_add_rcv_nxt(1);

  /* Parse the TCP MSS option, if present. */
  if((BUF->tcpoffset & 0xf0) > 0x50) {
    for(c = 0; c < ((BUF->tcpoffset >> 4) - 5) << 2 ;) {
      opt = uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + c];
      if(opt == 0x00) {
	/* End of options. */	
	break;
      } else if(opt == 0x01) {
	++c;
	/* NOP option. */
      } else if(opt == 0x02 &&
		uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 1 + c] == 0x04) {
	/* An MSS option with the right option length. */	
	tmp16 = ((u16_t)uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 2 + c] << 8) |
	  (u16_t)uip_buf[40 + UIP_LLH_LEN + 3 + c];
	uip_connr->initialmss = uip_connr->mss =
	  tmp16 > UIP_TCP_MSS? UIP_TCP_MSS: tmp16;
	
	/* And we are done processing options. */
	break;
      } else {
	/* All other options have a length field, so that we easily
	   can skip past them. */
	if(uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 1 + c] == 0) {
	  /* If the length field is zero, the options are malformed
	     and we don't process them further. */
	  break;
	}
	c += uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 1 + c];
      }      
    }
  }
  
  /* Our response will be a SYNACK. */
#if UIP_ACTIVE_OPEN
 tcp_send_synack:
  BUF->flags = TCP_ACK;    
  
 tcp_send_syn:
  BUF->flags |= TCP_SYN;    
#else /* UIP_ACTIVE_OPEN */
 tcp_send_synack:
  BUF->flags = TCP_SYN | TCP_ACK;    
#endif /* UIP_ACTIVE_OPEN */
  
  /* We send out the TCP Maximum Segment Size option with our
     SYNACK. */
  BUF->optdata[0] = 2;
  BUF->optdata[1] = 4;
  BUF->optdata[2] = (UIP_TCP_MSS) / 256;
  BUF->optdata[3] = (UIP_TCP_MSS) & 255;
  uip_len = 44;
  BUF->tcpoffset = 6 << 4;
  goto tcp_send;

  /* This label will be jumped to if we found an active connection. */
 found:
  uip_conn = uip_connr;
  uip_flags = 0;

  /* We do a very naive form of TCP reset processing; we just accept
     any RST and kill our connection. We should in fact check if the
     sequence number of this reset is wihtin our advertised window
     before we accept the reset. */
  if(BUF->flags & TCP_RST) {
    uip_connr->tcpstateflags = CLOSED;
    UIP_LOG("tcp: got reset, aborting connection.");
    uip_flags = UIP_ABORT;
    UIP_APPCALL();
    goto drop;
  }      
  /* Calculated the length of the data, if the application has sent
     any data to us. */
  c = (BUF->tcpoffset >> 4) << 2;
  /* uip_len will contain the length of the actual TCP data. This is
     calculated by subtracing the length of the TCP header (in
     c) and the length of the IP header (20 bytes). */
  uip_len = uip_len - c - 20;

  /* First, check if the sequence number of the incoming packet is
     what we're expecting next. If not, we send out an ACK with the
     correct numbers in. */
  if(uip_len > 0 &&
     (BUF->seqno[0] != uip_connr->rcv_nxt[0] ||
      BUF->seqno[1] != uip_connr->rcv_nxt[1] ||
      BUF->seqno[2] != uip_connr->rcv_nxt[2] ||
      BUF->seqno[3] != uip_connr->rcv_nxt[3])) {
    goto tcp_send_ack;
  }

  /* Next, check if the incoming segment acknowledges any outstanding
     data. If so, we update the sequence number, reset the length of
     the outstanding data, calculate RTT estimations, and reset the
     retransmission timer. */
  if((BUF->flags & TCP_ACK) && uip_outstanding(uip_connr)) {
    uip_add32(uip_connr->snd_nxt, uip_connr->len);
    if(BUF->ackno[0] == uip_acc32[0] &&
       BUF->ackno[1] == uip_acc32[1] &&
       BUF->ackno[2] == uip_acc32[2] &&
       BUF->ackno[3] == uip_acc32[3]) {
      /* Update sequence number. */
      uip_connr->snd_nxt[0] = uip_acc32[0];
      uip_connr->snd_nxt[1] = uip_acc32[1];
      uip_connr->snd_nxt[2] = uip_acc32[2];
      uip_connr->snd_nxt[3] = uip_acc32[3];
	

      /* Do RTT estimation, unless we have done retransmissions. */
      if(uip_connr->nrtx == 0) {
	signed char m;
	m = uip_connr->rto - uip_connr->timer;
	/* This is taken directly from VJs original code in his paper */
	m = m - (uip_connr->sa >> 3);
	uip_connr->sa += m;
	if(m < 0) {
	  m = -m;
	}
	m = m - (uip_connr->sv >> 2);
	uip_connr->sv += m;
	uip_connr->rto = (uip_connr->sa >> 3) + uip_connr->sv;

      }
      /* Set the acknowledged flag. */
      uip_flags = UIP_ACKDATA;
      /* Reset the retransmission timer. */
      uip_connr->timer = uip_connr->rto;
    }
    
  }

  /* Do different things depending on in what state the connection is. */
  switch(uip_connr->tcpstateflags & TS_MASK) {
    /* CLOSED and LISTEN are not handled here. CLOSE_WAIT is not
	implemented, since we force the application to close when the
	peer sends a FIN (hence the application goes directly from
	ESTABLISHED to LAST_ACK). */
  case SYN_RCVD:
    /* In SYN_RCVD we have sent out a SYNACK in response to a SYN, and
       we are waiting for an ACK that acknowledges the data we sent
       out the last time. Therefore, we want to have the UIP_ACKDATA
       flag set. If so, we enter the ESTABLISHED state. */
    if(uip_flags & UIP_ACKDATA) {
      uip_connr->tcpstateflags = ESTABLISHED;
      uip_flags = UIP_CONNECTED;
      uip_connr->len = 0;
      if(uip_len > 0) {
        uip_flags |= UIP_NEWDATA;
        uip_add_rcv_nxt(uip_len);
      }
      uip_slen = 0;
      UIP_APPCALL();
      goto appsend;
    }
    goto drop;
#if UIP_ACTIVE_OPEN
  case SYN_SENT:
    /* In SYN_SENT, we wait for a SYNACK that is sent in response to
       our SYN. The rcv_nxt is set to sequence number in the SYNACK
       plus one, and we send an ACK. We move into the ESTABLISHED
       state. */
    if((uip_flags & UIP_ACKDATA) &&
       BUF->flags == (TCP_SYN | TCP_ACK)) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀久久久久久久| 狠狠色丁香婷综合久久| 国产在线播放一区二区三区 | 国产精品美女久久久久久2018| 亚洲美女免费视频| 国产乱码精品1区2区3区| 欧美日韩电影在线播放| **欧美大码日韩| 国模一区二区三区白浆| 欧美性色欧美a在线播放| 国产精品毛片a∨一区二区三区| 日产欧产美韩系列久久99| 色婷婷香蕉在线一区二区| 日本一区二区三区高清不卡| 久久国产精品99久久久久久老狼 | 精品国产一区二区精华| 天堂成人免费av电影一区| 欧美亚洲日本国产| 亚洲精品国产一区二区精华液 | 日韩一区二区三| 香蕉成人伊视频在线观看| 91美女片黄在线| 亚洲青青青在线视频| 成人av片在线观看| 欧美大尺度电影在线| 免费在线看一区| 日韩一区二区精品| 亚洲国产视频一区| 欧美日韩1区2区| 亚洲成人综合在线| 7777精品伊人久久久大香线蕉超级流畅| 国产精品不卡一区| 在线中文字幕一区二区| **欧美大码日韩| 欧美在线观看视频一区二区 | 亚洲综合精品久久| 一本色道久久综合亚洲91| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 91久久免费观看| 亚洲日穴在线视频| 91亚洲国产成人精品一区二区三| 国产女同性恋一区二区| 成a人片国产精品| 亚洲欧洲精品一区二区三区| youjizz国产精品| 亚洲精品ww久久久久久p站| 欧洲精品一区二区三区在线观看| 亚洲成a人v欧美综合天堂下载| 精品视频在线看| 日韩av在线免费观看不卡| 欧美成人三级在线| 成人少妇影院yyyy| 亚洲综合小说图片| 欧美不卡一区二区三区四区| 大胆欧美人体老妇| 亚洲精品第1页| 欧美一级理论片| 粉嫩av一区二区三区在线播放| 亚洲欧洲99久久| 欧美精品一卡二卡| 懂色av中文字幕一区二区三区 | 日韩中文字幕91| 精品国产91亚洲一区二区三区婷婷 | 国产精品一区二区免费不卡| 国产精品伦一区二区三级视频| 在线观看91视频| 精品一区二区三区在线播放| 亚洲欧洲综合另类| 精品国产乱码久久久久久免费| 波多野结衣亚洲一区| 丝袜美腿亚洲综合| 中文字幕视频一区| 日韩无一区二区| 色天天综合色天天久久| 激情综合网最新| 亚洲国产色一区| 中文字幕中文在线不卡住| 4438亚洲最大| 色综合久久天天| 国产成人精品aa毛片| 丝袜亚洲另类丝袜在线| 亚洲欧美日韩在线播放| 久久先锋资源网| 欧美做爰猛烈大尺度电影无法无天| 久久99深爱久久99精品| 亚洲图片有声小说| 国产精品福利一区| 久久―日本道色综合久久| 欧美乱妇23p| 欧美日免费三级在线| av一区二区三区| 全部av―极品视觉盛宴亚洲| 亚洲天堂免费看| 日本一区二区免费在线观看视频 | 欧美精品丝袜中出| 91极品视觉盛宴| av电影在线观看一区| 国产乱码精品一区二区三区av| 日韩影院免费视频| 亚洲成人一区在线| 亚洲大型综合色站| 亚洲一区二区三区不卡国产欧美 | 午夜影院在线观看欧美| 亚洲色图欧洲色图婷婷| √…a在线天堂一区| 亚洲国产激情av| 中文字幕不卡在线播放| 久久伊人蜜桃av一区二区| 久久这里只有精品6| 精品国产亚洲在线| 欧美一区二区三区在线看| 欧美精三区欧美精三区| 欧美午夜不卡在线观看免费| 在线影视一区二区三区| 色婷婷亚洲精品| 色综合久久综合网| 欧美午夜精品免费| 蜜臀av性久久久久蜜臀aⅴ | 一卡二卡欧美日韩| 久久精品一区二区三区不卡牛牛 | 制服丝袜亚洲色图| 91精品国产免费| 日韩一区二区三区视频在线| 欧美大尺度电影在线| 久久精品亚洲一区二区三区浴池| 久久综合色鬼综合色| 国产日本亚洲高清| 亚洲欧美成人一区二区三区| 夜夜揉揉日日人人青青一国产精品| 一区二区三区四区视频精品免费 | caoporen国产精品视频| av色综合久久天堂av综合| 欧美性videosxxxxx| 亚洲一区视频在线| 日韩成人一区二区三区在线观看| 亚洲一区二区黄色| 热久久国产精品| 高清国产一区二区三区| 欧美在线一二三| 精品国产91乱码一区二区三区| 国产精品久久久久久久久免费樱桃 | 首页综合国产亚洲丝袜| 日本成人在线看| 欧美色手机在线观看| 国产亚洲欧美一区在线观看| 亚洲午夜影视影院在线观看| 美国精品在线观看| 欧美在线观看一区| 精品一区二区三区香蕉蜜桃| 欧美日韩精品一区二区天天拍小说 | 成人开心网精品视频| 亚洲美女一区二区三区| 中文字幕综合网| 亚洲成人午夜电影| 韩国中文字幕2020精品| 成人做爰69片免费看网站| 日本高清无吗v一区| 2022国产精品视频| 麻豆国产精品官网| 国产欧美综合在线观看第十页| 五月婷婷综合在线| 成人免费视频国产在线观看| 99精品1区2区| 国产三级欧美三级日产三级99 | 成人深夜视频在线观看| 色视频欧美一区二区三区| 欧美一区二区三区视频在线观看| 日韩美女视频在线| 午夜精品久久久久久久99水蜜桃| 欧美美女喷水视频| 久久狠狠亚洲综合| 国产偷国产偷精品高清尤物| 成人福利在线看| 亚洲精品成人悠悠色影视| 欧美日韩黄视频| 精品综合免费视频观看| 国产情人综合久久777777| 91丨porny丨中文| 视频一区在线播放| 欧美激情综合五月色丁香| 日本韩国欧美国产| 国产一区二区三区综合| 1024精品合集| 欧美电影免费观看高清完整版在线 | 亚洲欧美视频在线观看| 欧美一级免费观看| 91成人免费网站| 成人18视频日本| 韩国欧美国产一区| 亚洲成a人v欧美综合天堂下载| 国产亚洲精品7777| 精品国产成人系列| 7777精品伊人久久久大香线蕉超级流畅| 精品一二线国产| 麻豆成人久久精品二区三区小说| **欧美大码日韩| 一区二区三区不卡视频| 中文字幕二三区不卡| 久久综合久久久久88| 日韩三级免费观看|