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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tcp.lst

?? 基于51單片機(jī)和RTL8019以太網(wǎng)控制器的嵌入式以太網(wǎng)控制程序。
?? LST
?? 第 1 頁 / 共 5 頁
字號:
 363   5                                              {
 364   6                                                 index=j;
C51 COMPILER V8.02   TCP                                                                   09/21/2006 20:16:32 PAGE 7   

 365   6                                                 // Initialize new connection
 366   6                                                 conxn[index].state=STATE_LISTEN;
 367   6                                                 conxn[index].socket_type=SERVER;
 368   6                                                 break;
 369   6                                              }
 370   5                                       }
 371   4                                       //所有的連接都被占有,則丟棄該包
 372   4                                       if (NO_CONNECTION==j) return;
 373   4                              }
 374   3                              else
 375   3                                      return;
 376   3                        }
 377   2                      //保證程序不出錯
 378   2                      if (index > NO_CONNECTION-1)
 379   2                      {
 380   3      //                      if (debug) PrintStr("TCP: Error in assigning conxn number\r");
 381   3                              return;
 382   3                      }
 383   2                      //檢查收到的包的序列號是否出錯
 384   2                      if (pRxdnet->tcpframe.seqnumber > 0xFFFFFF00L)
 385   2                      {
 386   3      //                      if (debug) PrintStr("TCP: Rcvd a high sequence number\r");      
 387   3                              InerClose(index);
 388   3                              tcp_send(&TCPSend,FLG_RST, 20, NO_CONNECTION);
 389   3                              return;
 390   3                      }
 391   2                      if (pRxdnet->tcpframe.control & FLG_RST)
 392   2                      {
 393   3                              // An RST does not depend on state at all.  And it does
 394   3                              // not count as data so do not send an ACK here.  Close
 395   3                              // connection
 396   3      //                      if (debug) PrintStr("TCP: Rcvd a reset\r");
 397   3                              InerClose(index);
 398   3                              return;
 399   3                      }
 400   2                      else if (pRxdnet->tcpframe.control & FLG_SYN)
 401   2                      {
 402   3                              //收到一個SYN+ACK包,則該包只有在STATE_SYN_SEND時才有效
 403   3                              //由Mingtree添加,以適應(yīng)當(dāng)單片機(jī)為客戶端時的情況
 404   3                              if(pRxdnet->tcpframe.control & FLG_ACK)
 405   3                              {
 406   4                                      if (conxn[index].state != STATE_SYN_SENT)
 407   4                                      {
 408   5      //                                      if (debug) PrintStr("TCP: Error, rcvd bogus SYN AND ACK\r");
 409   5                                              tcp_send(&TCPSend,FLG_RST, 20, NO_CONNECTION);
 410   5                                              return;
 411   5                                      }
 412   4                              }
 413   3      
 414   3                              // A SYN segment only makes sense if connection is in LISTEN
 415   3                              else if ((conxn[index].state != STATE_LISTEN) &&
 416   3                                      (conxn[index].state != STATE_CLOSED))
 417   3                              {
 418   4      //                              if (debug) PrintStr("TCP: Error, rcvd bogus SYN\r");
 419   4                                      InerClose(index);
 420   4                                      tcp_send(&TCPSend,FLG_RST, 20, NO_CONNECTION);
 421   4                                      return;
 422   4                              }
 423   3                      }
 424   2                      else if ((pRxdnet->tcpframe.control & FLG_ACK) == 0)
 425   2                      {
 426   3                              // Incoming segments except SYN or RST must have ACK bit set
C51 COMPILER V8.02   TCP                                                                   09/21/2006 20:16:32 PAGE 8   

 427   3                              // See TCP/IP Illustrated, Vol 2, Page 965
 428   3                              // Drop segment but do not send a reset
 429   3      //                      if (debug) PrintStr("TCP: Error, rcvd segment has no ACK\r");
 430   3                              return;
 431   3                      }
 432   2                      // Compute length of header including options, and from that
 433   2                      // compute length of actual data
 434   2                      //計算頭部長度,并計算實(shí)際長度
 435   2                      header_len=(pRxdnet->tcpframe.offset&0xF0)>>2;
 436   2                      data_len=pRxdnet->ipframe.totallength-((pRxdnet->ipframe.verandihl& 0x0F)*4)-header_len;
 437   2                      packACK = pRxdnet->tcpframe.acknumber;
 438   2                      packSeq = pRxdnet->tcpframe.seqnumber;
 439   2                      // Handle TCP state machine for this connection
 440   2                      switch (conxn[index].state)
 441   2                      {
 442   3                              case STATE_CLOSED:
 443   3                              case STATE_LISTEN:
 444   3                                      // If incoming segment contains SYN and no ACK, then handle
 445   3                                      if ((pRxdnet->tcpframe.control & FLG_SYN) && ((pRxdnet->tcpframe.control & FLG_ACK) == 0))
 446   3                                      {
 447   4                                              // Capture his starting sequence number and generate
 448   4                                              // my starting sequence number
 449   4                                              // Fill in connection information
 450   4                                              conxn[index].ip.words[0]= pRxdnet->ipframe.sourceip[0];
 451   4                                              conxn[index].ip.words[1]= pRxdnet->ipframe.sourceip[1];
 452   4                                              conxn[index].port = pRxdnet->tcpframe.sourceport;
 453   4                                              conxn[index].state = STATE_LISTEN;
 454   4                                              conxn[index].his_sequence = 1 + packACK;
 455   4                                              conxn[index].his_ack = packSeq;
 456   4      
 457   4                                              // Use system clock for initial sequence number
 458   4                                              EA = 0;
 459   4                                              conxn[index].my_sequence = initial_sequence_nr;
 460   4                                              initial_sequence_nr += 64000L;
 461   4                                              EA = 1;
 462   4      
 463   4                                              // Send header options with the next message
 464   4                                              // Since timestamps are optional and we do not use
 465   4                                              // them, do not have to send them
 466   4                                              // After sending the SYN ACK the client browser will
 467   4                                              // blast me with 2 messages, an ACK, and a HTTP GET
 468   4                                              tcp_send(&TCPSend,FLG_SYN | FLG_ACK, 28, index);
 469   4      
 470   4                                              // My SYN flag increments my sequence number
 471   4                                              // My sequence number is always updated to point to
 472   4                                              // the next byte to be sent.  So the incoming ack
 473   4                                              // number should equal my sequence number
 474   4                                              conxn[index].my_sequence++;
 475   4      
 476   4                                              conxn[index].state = STATE_SYN_RCVD;
 477   4      //                                      if (debug) PrintStr("TCP: Entered SYN RCVD state\r");
 478   4                                      }
 479   3                                      else
 480   3                                      {
 481   4                                              // Sender is out of sync so send reset
 482   4                                              InerClose(index);
 483   4                                              tcp_send(&TCPSend,FLG_RST, 20, NO_CONNECTION);
 484   4                                      }
 485   3                                      break;
 486   3      
 487   3                              case STATE_SYN_RCVD:
 488   3                                      // He may already be sending me data - should process it
C51 COMPILER V8.02   TCP                                                                   09/21/2006 20:16:32 PAGE 9   

 489   3                                      conxn[index].his_sequence += data_len;
 490   3                                      conxn[index].his_ack = packACK;
 491   3      
 492   3                                      if (pRxdnet->tcpframe.control & FLG_FIN)
 493   3                                      {
 494   4                                              // His FIN counts as a byte of data
 495   4                                              conxn[index].his_sequence++;
 496   4                                              tcp_send(&TCPSend,FLG_ACK, 20, index);
 497   4                                              conxn[index].state = STATE_CLOSE_WAIT;
 498   4      //                                      if (debug) PrintStr("TCP: Entered CLOSE_WAIT state\r");
 499   4      
 500   4                                      // At this point we would normally wait for the application
 501   4                                              // to close.  For now, send FIN right away.
 502   4                                              tcp_send(&TCPSend,FLG_FIN | FLG_ACK, 20, index);
 503   4                                              conxn[index].my_sequence++;   // For my FIN
 504   4                                              conxn[index].state = STATE_LAST_ACK;
 505   4      //                                      if (debug) PrintStr("TCP: Entered LAST ACK state\r");
 506   4                                      }
 507   3      
 508   3                                      // Make sure he is ACKing my SYN
 509   3                                      else if (packACK == conxn[index].my_sequence)
 510   3                                      {
 511   4                                              conxn[index].state = STATE_ESTABLISHED;
 512   4      //                                      if (debug) PrintStr("TCP: Entered ESTABLISHED state\r");
 513   4                                              // If sender sent data ignore it and he will resend
 514   4                                              // Do not send response because we received no
 515   4      
 516   4                                              //--------------------------------------------------------
 517   4                                              //
 518   4                                              //                                      進(jìn)入連接狀態(tài),可以發(fā)送數(shù)據(jù)
 519   4                                              //
 520   4                                              //--------------------------------------------------------
 521   4                                              //調(diào)用服務(wù)器OnConnect()回調(diào)函數(shù),該函數(shù)在TCPListen時被實(shí)體化
 522   4                                              (* conxn[index].connect)();
 523   4                                      }
 524   3                                      break;
 525   3                              case STATE_ESTABLISHED:
 526   3                                      conxn[index].his_ack = packACK;
 527   3      
 528   3                                      if (pRxdnet->tcpframe.control & FLG_FIN)
 529   3                                      {
 530   4                                              // His FIN counts as a byte of data
 531   4                                              conxn[index].his_sequence++;
 532   4                                              tcp_send(&TCPSend,FLG_ACK, 20, index);
 533   4                                              conxn[index].state = STATE_CLOSE_WAIT;
 534   4      //                                      if (debug) PrintStr("TCP: Entered CLOSE_WAIT state\r");
 535   4      
 536   4                                      // At this point we would normally wait for the application
 537   4                                              // to close.  For now, send FIN immediately.
 538   4                                              tcp_send(&TCPSend,FLG_FIN | FLG_ACK, 20, index);
 539   4                                              conxn[index].my_sequence++;   // For my FIN
 540   4                                              conxn[index].state = STATE_LAST_ACK;
 541   4      //                                      if (debug) PrintStr("TCP: Entered LAST ACK state\r");
 542   4                                      }
 543   3                                      else if (data_len != 0)
 544   3                                      {
 545   4                                              //先判斷對方的序列號是否小于conxn[index].his_sequence
 546   4                                              if(packSeq < conxn[index].his_sequence)
 547   4                                              {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av毛片久久久久**hd| 亚洲aⅴ怡春院| 亚洲综合一二区| 日韩中文字幕亚洲一区二区va在线| 蜜桃精品视频在线| 国产精品1区2区3区| 日本丶国产丶欧美色综合| 欧美一区二区网站| 国产欧美日韩在线视频| 一区二区三区高清| 麻豆一区二区三区| 成av人片一区二区| 在线观看91av| 欧美激情一区在线观看| 婷婷成人激情在线网| 国产一区91精品张津瑜| 欧日韩精品视频| 久久亚洲欧美国产精品乐播| 亚洲精品自拍动漫在线| 麻豆国产精品一区二区三区 | 51午夜精品国产| 久久久午夜精品理论片中文字幕| 最新国产成人在线观看| 精品中文字幕一区二区| 在线中文字幕一区| 久久综合狠狠综合久久激情| 一区二区在线观看免费| 91网站最新地址| 欧美精品在线一区二区三区| 久久精品亚洲精品国产欧美| 一区二区三区在线播放| 国产在线播放一区| 国产一区二区不卡| 欧美日韩国产免费一区二区| 国产欧美一区二区在线| 一区二区在线观看不卡| 久久99精品久久久久婷婷| 色诱视频网站一区| 国产丝袜美腿一区二区三区| 免费在线一区观看| 日本伦理一区二区| 精品成人一区二区| 亚洲一区二区三区视频在线 | 久久www免费人成看片高清| www.日韩大片| 精品久久国产老人久久综合| 亚洲欧美日韩久久| 玖玖九九国产精品| 在线观看国产精品网站| 国产日韩欧美精品在线| 奇米色777欧美一区二区| 99久久亚洲一区二区三区青草| 日韩欧美在线影院| 一区二区三区四区中文字幕| 国产乱子伦一区二区三区国色天香| 91福利国产成人精品照片| 国产午夜亚洲精品羞羞网站| 日韩制服丝袜先锋影音| 91首页免费视频| 日韩三级视频中文字幕| 无码av免费一区二区三区试看| 99久久精品免费精品国产| 久久日韩粉嫩一区二区三区| 日本一不卡视频| 欧美人体做爰大胆视频| 亚洲日本在线a| 成人在线综合网站| 精品国产髙清在线看国产毛片 | 国产日韩欧美亚洲| 免费观看在线综合色| 欧美色视频一区| 国产精品日日摸夜夜摸av| 国产伦精品一区二区三区免费迷 | 久久午夜色播影院免费高清| 日韩精品福利网| 在线观看日产精品| 亚洲激情在线播放| 91片在线免费观看| 久久综合九色综合97_久久久| 亚洲午夜电影在线| 欧美色手机在线观看| 亚洲精品国久久99热| 97久久精品人人爽人人爽蜜臀| 国产精品久久一级| 国产91对白在线观看九色| 精品国产乱码久久久久久久 | 成人激情午夜影院| 国产精品视频免费| 不卡的电视剧免费网站有什么| 国产日韩视频一区二区三区| 国产精品系列在线观看| 久久综合国产精品| 亚洲风情在线资源站| 色噜噜久久综合| 亚洲欧美韩国综合色| 99热精品国产| 亚洲综合一区二区精品导航| 欧美视频在线观看一区二区| 中文字幕亚洲精品在线观看| av动漫一区二区| 亚洲精选免费视频| 色嗨嗨av一区二区三区| 亚洲第一成年网| 欧美美女激情18p| 日日摸夜夜添夜夜添精品视频 | 亚洲人成网站影音先锋播放| 91欧美激情一区二区三区成人| 亚洲人吸女人奶水| 色婷婷精品大视频在线蜜桃视频| 亚洲精品久久久久久国产精华液| 欧美性大战久久久| 日本sm残虐另类| 精品国产a毛片| 成人手机在线视频| 亚洲精品成人少妇| 欧美一区二区三区精品| 九九热在线视频观看这里只有精品| 久久亚洲综合色一区二区三区| 国产一区在线视频| 国产精品欧美精品| 91免费观看视频在线| 亚洲第一综合色| 日韩欧美第一区| 粉嫩久久99精品久久久久久夜| 亚洲精品亚洲人成人网在线播放| 欧美日韩亚洲高清一区二区| 麻豆精品在线视频| **性色生活片久久毛片| 91精品国产色综合久久ai换脸| 国产一区二区三区av电影| 国产精品福利一区二区三区| 精品视频1区2区3区| 韩国三级中文字幕hd久久精品| 国产精品久久久一区麻豆最新章节| 色婷婷av一区| 久久99国产精品尤物| 日韩理论电影院| 欧美一卡二卡三卡四卡| 成人性生交大片免费看视频在线| 亚洲午夜一二三区视频| 精品国产百合女同互慰| 成人精品在线视频观看| 国产精品视频在线看| 欧美电影影音先锋| 丁香激情综合国产| 视频一区二区欧美| 亚洲三级在线免费| 精品嫩草影院久久| 欧美三级中文字幕在线观看| 国产伦精品一区二区三区免费迷| 亚洲午夜精品在线| 国产精品热久久久久夜色精品三区| 欧美狂野另类xxxxoooo| 成人黄色综合网站| 日韩美女视频在线| 成人午夜视频在线观看| 中文字幕在线不卡视频| 在线免费观看一区| 国产精品综合视频| 午夜私人影院久久久久| 国产精品萝li| www国产精品av| 国产九色sp调教91| 亚洲成人在线观看视频| 久久久亚洲国产美女国产盗摄| 欧美日本视频在线| 色哟哟国产精品免费观看| 国产成人自拍网| 日韩理论片中文av| 国产精品久久久久aaaa| 精品久久人人做人人爰| 91麻豆精品91久久久久同性| 一本色道**综合亚洲精品蜜桃冫| 国产一区二区视频在线播放| 奇米四色…亚洲| 日韩精品视频网站| 一区二区三区中文在线观看| 欧美激情一区二区| 久久久久久久久久久久电影| 欧美日韩中文字幕一区二区| av动漫一区二区| 色综合亚洲欧洲| 成人av免费在线播放| 国产一区不卡视频| 国产综合久久久久影院| 蜜臀99久久精品久久久久久软件| 亚洲国产成人av| 亚洲第一成人在线| 亚洲国产毛片aaaaa无费看| 亚洲欧美日韩久久精品| 亚洲色图.com| 中文字幕亚洲精品在线观看| 国产精品入口麻豆原神| 国产精品天干天干在线综合| 国产欧美精品一区二区三区四区 | 欧美极品另类videosde| 亚洲精品一区二区三区香蕉| 久久这里只有精品6| 久久色在线观看| 国产亚洲自拍一区|