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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? tcp.lst

?? tcpip.rar 是一個(gè)51控制8019的程序,我已用于商用.還很穩(wěn)定,有興趣的可以看一下,對(duì)TCP IP UDP ICMP ARP RARP HTTP均可以實(shí)現(xiàn).
?? LST
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
C51 COMPILER V7.06   TCP                                                                   05/19/2004 15:18:11 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE TCP
OBJECT MODULE PLACED IN TCP.OBJ
COMPILER INVOKED BY: d:\Keil\C51\BIN\C51.EXE TCP.C LARGE BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          //-----------------------------------------------------------------------------
   2          // Net TCP.C
   3          //
   4          // This module handles TCP segments
   5          // Refer to RFC 793, 896, 1122, 1323, 2018, 2581
   6          //
   7          // A "connection" is a unique combination of 4 items:  His IP address,
   8          // his port number, my IP address, and my port number.
   9          //
  10          // Note that a SYN and a FIN count as a byte of data, but a RST does
  11          // not count. Neither do any of the other flags.
  12          // See "TCP/IP Illustrated, Volume 1" Sect 17.3 for info on flags
  13          //-----------------------------------------------------------------------------
  14          #include <string.h>
  15          #include <stdlib.h>
  16          #include <ctype.h>              // toupper
  17          #include <reg52.h>
  18          #include <stdio.h>
  19          #include "net.h"
  20          #include "cksum.h"
  21          #include "serial.h"
  22          #include "ip.h"
  23          #include "http.h"
  24          #include "tcp.h"
  25          
  26          
  27          // These structures keep track of connection information
  28          CONNECTION xdata conxn[5];
  29          
  30          ULONG idata initial_sequence_nr;
  31          UINT xdata sender_tcpport;
  32          static ULONG xdata sender_ipaddr;
  33          UCHAR idata just_closed; // Keeps track of when a conxn closed
  34          
  35          extern ULONG code my_ipaddr;
  36          extern UCHAR idata debug;
  37          extern char xdata text[];
  38          
  39          // Options: MSS (4 bytes), NOPS (2 bytes), Selective ACK (2 bytes) 
  40          UCHAR code opt[10] = {
  41          0x02, 0x04, 0x05, 0xB4,
  42          0x01, 0x01,
  43          0x04, 0x02};
  44          
  45          
  46          
  47          //------------------------------------------------------------------------
  48          //  Initialize variables declared in this module
  49          //
  50          //------------------------------------------------------------------------
  51          void init_tcp(void)
  52          {
  53   1         memset(conxn, 0, sizeof(conxn));
  54   1         just_closed = FALSE;
  55   1         initial_sequence_nr = 1;
C51 COMPILER V7.06   TCP                                                                   05/19/2004 15:18:11 PAGE 2   

  56   1      }
  57          
  58          
  59          
  60          //------------------------------------------------------------------------
  61          // This sends a TCP segments that do not include any data.
  62          // http_send() in the HTTP module is used to send data.
  63          // See "TCP/IP Illustrated, Volume 1" Sect 17.3
  64          //------------------------------------------------------------------------
  65          void tcp_send(UINT flags, UINT hdr_len, UCHAR nr)
  66          {
  67   1         ULONG idata sum, dest;
  68   1              UINT idata result;
  69   1         UCHAR xdata * outbuf;
  70   1         TCP_HEADER xdata * tcp;
  71   1         IP_HEADER xdata * ip;
  72   1                
  73   1         
  74   1         // Allocate memory for entire outgoing message including
  75   1         // eth & IP headers 
  76   1         outbuf = (UCHAR xdata *)malloc(34 + hdr_len);
  77   1         if (outbuf == NULL)
  78   1         {
  79   2            if (debug) printf("TCP: Oops, out of memory\n");
  80   2            return;
  81   2         }
  82   1      
  83   1                 
  84   1         tcp = (TCP_HEADER xdata *)(outbuf + 34);
  85   1         ip = (IP_HEADER xdata *)(outbuf + 14);
  86   1      
  87   1         // If no connection, then message is probably a reset
  88   1         // message which goes back to the sender
  89   1         // Otherwise, use information from the connection.
  90   1         if (nr == NO_CONNECTION)
  91   1         {
  92   2            tcp->source_port = HTTP_PORT;
  93   2            tcp->dest_port = sender_tcpport;
  94   2            tcp->sequence = 0;
  95   2            tcp->ack_number = 0;
  96   2            dest = sender_ipaddr;
  97   2         }
  98   1         else if (nr < 5)
  99   1         {
 100   2            // This message is to connected port
 101   2            tcp->source_port = HTTP_PORT;
 102   2            tcp->dest_port = conxn[nr].port;
 103   2            tcp->sequence = conxn[nr].my_sequence;
 104   2            tcp->ack_number = conxn[nr].his_sequence;
 105   2            dest = conxn[nr].ipaddr;
 106   2         }
 107   1         else
 108   1         {
 109   2              if (debug) printf("TCP: Oops, sock nr out of range\n");
 110   2                      free(outbuf);
 111   2                      return;
 112   2              }
 113   1      
 114   1         // Total segment length = header length
 115   1            
 116   1         // Insert header len
 117   1         tcp->flags = (hdr_len << 10) | flags;
C51 COMPILER V7.06   TCP                                                                   05/19/2004 15:18:11 PAGE 3   

 118   1         tcp->window = 1024;
 119   1         tcp->checksum = 0;
 120   1         tcp->urgent_ptr = 0;
 121   1         
 122   1         // Sending SYN with header options
 123   1         if (hdr_len == 28)
 124   1         {
 125   2            memcpy(&tcp->options, opt, 8);
 126   2         }   
 127   1         
 128   1         // Compute checksum including 12 bytes of pseudoheader
 129   1              // Must pre-fill 2 items in ip header to do this
 130   1              ip->dest_ipaddr = dest;
 131   1              ip->source_ipaddr = my_ipaddr;
 132   1                      
 133   1              // Sum source_ipaddr, dest_ipaddr, and entire TCP message 
 134   1              sum = (ULONG)cksum(outbuf + 26, 8 + hdr_len);
 135   1                                      
 136   1              // Add in the rest of pseudoheader which is
 137   1              // protocol id and TCP segment length
 138   1              sum += (ULONG)0x0006;
 139   1              sum += (ULONG)hdr_len;
 140   1      
 141   1              // In case there was a carry, add it back around
 142   1              result = (UINT)(sum + (sum >> 16));
 143   1              tcp->checksum = ~result;
 144   1         
 145   1         if (debug) printf("TCP: Sending msg to IP layer\n");
 146   1              ip_send(outbuf, dest, TCP_TYPE, hdr_len);
 147   1      
 148   1         // (Re)start TCP retransmit timer
 149   1         conxn[nr].timer = TCP_TIMEOUT;
 150   1      }
 151          
 152          
 153          
 154          
 155          //------------------------------------------------------------------------
 156          // This runs every 0.5 seconds.  If the other end has not ACK'd
 157          // everyting we have sent, it re-sends it.  To save RAM space, we 
 158          // regenerate a segment rather than keeping a bunch of segments 
 159          // hanging around eating up RAM.  A connection should not be in an
 160          // opening or closing state when this timer expires, so we simply
 161          // send a reset.
 162          //
 163          //      If a connection is in the ESTABLISHED state when the timer expires
 164          // then we have just sent a web page so re-send the page
 165          //------------------------------------------------------------------------
 166          void tcp_retransmit(void)
 167          {
 168   1         static UCHAR idata retries = 0;
 169   1         UCHAR idata nr;
 170   1      
 171   1         // Scan through all active connections 
 172   1         for (nr = 0; nr < 5; nr++)
 173   1         {
 174   2            if ((conxn[nr].ipaddr != 0) && (conxn[nr].timer))
 175   2            {
 176   3               // Decrement the timer and see if it hit 0
 177   3               conxn[nr].timer--;
 178   3               if (conxn[nr].timer == 0)
 179   3               {
C51 COMPILER V7.06   TCP                                                                   05/19/2004 15:18:11 PAGE 4   

 180   4                  // Socket just timed out. If we are not in ESTABLISHED state
 181   4                  // something is amiss so send reset and close connection
 182   4                  if (conxn[nr].state != STATE_ESTABLISHED)
 183   4                  {
 184   5                     // Send reset and close connection
 185   5                     if (debug) printf("TCP: Timeout, sending reset\n");
 186   5                     tcp_send(FLG_RST, 20, nr);
 187   5                     conxn[nr].ipaddr = 0;
 188   5                     return;
 189   5                  }
 190   4                  else
 191   4                  {
 192   5                     // Socket is in ESTABLISHED state. First make sure his
 193   5                     // ack number is not bogus.
 194   5                     if (conxn[nr].his_ack > conxn[nr].my_sequence)
 195   5                     {
 196   6                        // Send reset and close connection
 197   6                        if (debug) printf("TCP: Timeout, sending reset\n");
 198   6                        tcp_send(FLG_RST, 20, nr);
 199   6                        conxn[nr].ipaddr = 0;
 200   6                        return;
 201   6                     }
 202   5                     
 203   5                     // We always increment our sequence number immediately
 204   5                                              // after sending, so the ack number from the other end
 205   5                                              // should be equal to our sequence number.  If it is less,
 206   5                                              // it means he lost some of our data.
 207   5                     if (conxn[nr].his_ack < conxn[nr].my_sequence)
 208   5                                              {
 209   6                        retries++;
 210   6                                                      if (retries <= 2)
 211   6                                                      {
 212   7                              // The only thing we send is a web page, and it looks
 213   7                              // like other end did not get it, so resend
 214   7                              // but do not increase my sequence number
 215   7                              if (debug) printf("TCP: Timeout, resending data\n");
 216   7                              http_server(conxn[nr].query, 0, nr, 1);
 217   7                                          conxn[nr].inactivity = INACTIVITY_TIME;
 218   7                        }
 219   6                                                      else
 220   6                                                      {
 221   7                                                              if (debug) printf("TCP: Giving up, sending reset\n");
 222   7                                                              // Send reset and close connection
 223   7                              tcp_send(FLG_RST, 20, nr);
 224   7                              conxn[nr].ipaddr = 0;
 225   7                      }
 226   6                     }

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产乱子轮精品视频| 精品视频免费看| 亚洲图片欧美视频| 色94色欧美sute亚洲线路二| 午夜婷婷国产麻豆精品| 成人精品一区二区三区中文字幕| 国产精品日韩成人| av网站一区二区三区| 中文字幕精品一区| 欧美精品一二三四| 国产成人欧美日韩在线电影| 亚洲少妇中出一区| 91精品国产91热久久久做人人| 激情综合网激情| 亚洲第一在线综合网站| 久久综合网色—综合色88| 日本美女视频一区二区| 欧美三级一区二区| 亚洲你懂的在线视频| 成人免费不卡视频| 亚洲成人激情综合网| 欧美在线观看视频在线| 婷婷综合在线观看| 精品第一国产综合精品aⅴ| 日本欧美一区二区三区| 精品国一区二区三区| 婷婷综合五月天| 91丝袜国产在线播放| 天天爽夜夜爽夜夜爽精品视频| av激情亚洲男人天堂| 免费精品视频在线| 国产精品一区二区久激情瑜伽 | 不卡的av在线播放| 日韩 欧美一区二区三区| 日韩一区二区三区免费看| 日本va欧美va精品发布| 欧美电影免费观看高清完整版在线观看| 亚洲成人一区在线| 制服视频三区第一页精品| 久久精品国产亚洲aⅴ| 五月激情丁香一区二区三区| 天天做天天摸天天爽国产一区| 一区二区三区日韩| 午夜电影久久久| 激情综合色综合久久| 高清视频一区二区| 色婷婷综合久久久久中文| 欧美三级日韩在线| 91精品国产综合久久久久久久| 日本久久一区二区| 国产福利一区二区| 免费亚洲电影在线| 日日夜夜免费精品视频| 日韩天堂在线观看| 色婷婷综合久久久久中文一区二区 | 精品国内片67194| 国产河南妇女毛片精品久久久| 天天综合色天天综合| 成人欧美一区二区三区1314| 久久久美女艺术照精彩视频福利播放| 色综合天天综合| 色88888久久久久久影院野外| 国产成人三级在线观看| av中文字幕一区| 91小视频在线| 日韩欧美色综合| 美女一区二区三区在线观看| 亚洲免费伊人电影| 亚洲欧美综合网| 国产精品萝li| 亚洲福利视频导航| 美女国产一区二区三区| 无吗不卡中文字幕| 国产乱理伦片在线观看夜一区| 大陆成人av片| 在线视频一区二区三| 国产色综合久久| 天堂av在线一区| 精品视频一区 二区 三区| 亚洲一区二区三区四区不卡| 亚洲自拍欧美精品| 亚洲色图欧美激情| 亚洲精品视频在线观看网站| 久久久久久毛片| 亚洲色图.com| 蜜桃视频在线观看一区二区| 国产成人鲁色资源国产91色综| 色婷婷精品大视频在线蜜桃视频| 欧美日本一区二区三区| 在线精品视频免费播放| 91精品国产色综合久久不卡蜜臀 | 精品国产91九色蝌蚪| 午夜成人在线视频| 久久精品亚洲乱码伦伦中文| 色综合久久66| 国产精品一区在线| 亚洲人成人一区二区在线观看| 欧美一级在线视频| 日本精品视频一区二区| 香港成人在线视频| 老司机精品视频线观看86| 91浏览器打开| 久久久高清一区二区三区| 男人的j进女人的j一区| 欧美视频一区二区三区| 国产精品国产三级国产aⅴ中文| 福利一区福利二区| 精品国产不卡一区二区三区| 国产·精品毛片| 夜夜夜精品看看| 欧美调教femdomvk| 一区二区三区产品免费精品久久75| 成人app在线| 久久久精品综合| 色综合咪咪久久| 亚洲gay无套男同| 欧美网站一区二区| 亚洲r级在线视频| 一区二区欧美国产| 在线电影欧美成精品| 精品粉嫩超白一线天av| 亚洲444eee在线观看| 日韩一区二区三区视频| 91蜜桃网址入口| 日韩福利视频导航| 亚洲免费av观看| 久久免费午夜影院| 欧美四级电影网| 国产精品88888| 日韩电影在线观看一区| 久久综合国产精品| 国产精品系列在线播放| 午夜精品福利一区二区蜜股av| 2欧美一区二区三区在线观看视频| 日本电影亚洲天堂一区| 国产风韵犹存在线视精品| 无吗不卡中文字幕| 久久―日本道色综合久久| 91在线码无精品| 91.麻豆视频| 亚洲欧美激情一区二区| 日本午夜一本久久久综合| 国内外精品视频| 欧美三级在线看| 亚洲欧美日韩电影| 不卡的电影网站| 国产午夜精品一区二区三区视频| 亚洲成人av电影| 一本一道久久a久久精品综合蜜臀| 国产欧美一区二区精品秋霞影院| 日本亚洲欧美天堂免费| 精品视频免费在线| 国产精品卡一卡二卡三| 欧美精品精品一区| 欧美写真视频网站| 日韩一区二区三区在线| 欧美精品一区二区在线播放| 日韩欧美视频一区| 国产精品你懂的在线| 国产精品久久久久影院亚瑟| 亚洲精品国产一区二区三区四区在线| 国产精品嫩草影院av蜜臀| 亚洲免费观看高清在线观看| 亚洲另类春色国产| 丝瓜av网站精品一区二区| 久久99蜜桃精品| 国产精品18久久久久| 日本亚洲三级在线| 99视频有精品| 精品国产免费久久| 午夜国产精品影院在线观看| 成人激情午夜影院| 亚洲一区二区三区四区五区黄| 日韩久久免费av| 国产精品久久久久影院老司| 精品999久久久| 欧美激情一区二区三区在线| 亚洲午夜久久久久中文字幕久| 日本视频一区二区| 成人毛片在线观看| 亚洲精品中文在线| 北条麻妃一区二区三区| 欧美色手机在线观看| 视频在线观看国产精品| 欧美挠脚心视频网站| 亚洲欧美视频在线观看视频| 国产一区美女在线| 日韩一级二级三级| 免费在线观看不卡| 国产欧美日本一区二区三区| 麻豆高清免费国产一区| 久久超碰97人人做人人爱| 香蕉久久夜色精品国产使用方法| 依依成人精品视频| 欧美色老头old∨ideo| 一区二区三区成人在线视频| 亚洲成人综合视频| 国产精品日产欧美久久久久| 国产福利一区在线观看| 亚洲一区二区在线免费观看视频|