-
计算校验和
校验和算法描述:为保证网络上传输的数据的可靠性,在许多协议中都设置了校验和项,例如:IPv4、ICMPv4、IGMPV4、ICMPv6、UDP...
计算校验和
校验和算法描述:为保证网络上传输的数据的可靠性,在许多协议中都设置了校验和项,例如:IPv4、ICMPv4、IGMPV4、ICMPv6、UDP和TCP 等等。计算这些校验和的算法称为网际校验和算法,简单来说就是:把被校验的数据16位进行累加,然后取反码,若数据字节长度为奇数,则数据尾部补一个字节的0以凑成偶数。
由于从输入文件读入的数据不能直接满足计算校验和的条件,所以首先对从文件读入缓冲区的数据进行预处理,即读入缓冲区时忽略空格。由于累加是按16位进行的,所以每次从缓冲区中读出4个字符,并将字符转换成对应的16进制数字,如此依次累加,直至数据全部读完。
还有一种情况,即如果数据长度为奇数个字节,则需要判断,并补0累加。程序中利用的是缓冲区长度计数器i和当前读取到计数器j判断数据长度是否为奇数。即如果数据长度为偶数,则读完数据时当前读取到计数器j的值应与缓冲区长度i相等,而如果数据长度为奇数,则读完数据时,当前读取到计数器j>缓冲区长度i,此时需将缓冲区中剩余的两个字符读出,并补0,转换成相应16进制数以后参与累加。
当累加结束后,将累加和的16位以上数据位移下再进行一次累加,并对最后累加和取反即得所求校验和。
-calculated checksum checksum algorithm Description : To ensure the network transmission of data reliability, in many of the agreements are set up and calibration, for example : IPv4, ICMPv4, IGMPV4, ICMPv6. UDP and TCP so on. Calculating checksum algorithm called the Internet checksum algorithm, the simple answer is : as has been the calibration data for 16 cumulative, and then take the anti-code, if the data byte length of the odd, data will make up the tai
- 2022-01-26 06:39:03下载
- 积分:1
-
本源代码是用SMTP来发送电子邮件的,能一起发送附件
本源代码是用SMTP来发送电子邮件的,能一起发送附件-source code is used to send SMTP e-mail can be sent along with Annex
- 2022-07-02 15:23:32下载
- 积分:1
-
中点圆算法 简单精炼 特别适合初学者 希望对大家有点参考价值...
中点圆算法 简单精炼 特别适合初学者 希望对大家有点参考价值-Midpoint circle algorithm is simple and particularly suitable for beginners refining hope everybody a little bit reference value
- 2023-07-08 14:20:02下载
- 积分:1
-
本程序使用Visual C++6.0编写,使用了MFC,数据库用的是SQL Server,要正常运行本程序,请安装该数据库,并参加压缩文件中的DBConfig....
本程序使用Visual C++6.0编写,使用了MFC,数据库用的是SQL Server,要正常运行本程序,请安装该数据库,并参加压缩文件中的DBConfig.ini文件。可以监控局域网内所有主机(IP)的上网情况,包括上传下载流量、浏览的网页、上网时长等-This procedure using Visual C++ 6.0 preparation, the use of the MFC, the database used is SQL Server, to the normal operation of this program, please install the database, and participated in the compressed file DBConfig.ini file. LAN can monitor all hosts (IP) access to the Internet, including uploading and downloading traffic, browsing web pages, Internet time and long
- 2022-01-26 15:34:07下载
- 积分:1
-
rtp windows platform in the realization, it can be examined.
rtp在windows平台下的实现方式,可以参考一下。-rtp windows platform in the realization, it can be examined.
- 2023-05-17 05:05:03下载
- 积分:1
-
/* This IPv4 example uses the background thread itself to process all packets. Y...
12887的c51。-12,887.
- 2022-02-06 17:09:02下载
- 积分:1
-
该软件是一个类似串口调试助手的网口调试软件。软件实现TCP/IP下的数据发送和接收功能,可以作为单片机,嵌入式网口程序开发的调试工具...
该软件是一个类似串口调试助手的网口调试软件。软件实现TCP/IP下的数据发送和接收功能,可以作为单片机,嵌入式网口程序开发的调试工具-The software is similar to a serial debugging assistant net mouth debugging software. Software TCP/IP of the sending and receiving of data that can be used as a microcontroller, I Embedded Network Programming Debugging Tools
- 2022-03-19 23:19:59下载
- 积分:1
-
Project is based on the bookstoressh package eclipse3.2 deployed, the user only...
项目bookstoressh是基于 eclipse3.2包进行布署的,使用者只用下载后,解压出来,然后,通过eclipse的import导入工程,就可以重新布署应用该程序了,注意把DB目录下的文件复制到你的MYSQL的DATA目录
然后如果要改数据库连接,就在com.asent.bean包下修改hibernate.cfg.xml文件就行了,-Project is based on the bookstoressh package eclipse3.2 deployed, the user only after downloading, unzip them, and then, through the eclipse of the import into the project, you can re-deployment of application of the procedure, paying attention to the DB directory copy files to your MYSQL the DATA directory and then if we have to change database connection on the package com.asent.bean modify hibernate.cfg.xml file on the list,
- 2023-07-14 18:40:09下载
- 积分:1
-
一品脱
一个小巧玲珑的在线调查程序,它容量很小,可读性很高,多多关照-a pint-sized online survey procedures, capacity small, highly readable, to take care of
- 2022-01-25 21:00:04下载
- 积分:1
-
P2P代码。。 。。很详细
P2P代码。。 。。很详细-P2P code. . . . . . Detail
- 2022-02-13 19:48:14下载
- 积分:1