资源简介
zmodem协议Linux下的实现代码,非常完整。
代码片段和文件信息
/*% cc -O -K -dos % -o crc.exe
*/
/*
* Crc - 32 BIT ANSI X3.66 CRC checksum files
*/
#include
#define OK 0
#define ERROR (-1)
#define LINT_ARGS
/**********************************************************************\
|* *|
|* Demonstration program to compute the 32-bit CRC used as the frame *|
|* check sequence in ADCCP (ANSI X3.66 also known as FIPS PUB 71 *|
|* and FED-STD-1003 the U.S. versions of CCITT‘s X.25 link-level *|
|* protocol). The 32-bit FCS was added via the Federal Register *|
|* 1 June 1982 p.23798. I presume but don‘t know for certain that *|
|* this polynomial is or will be included in CCITT V.41 which *|
|* defines the 16-bit CRC (often called CRC-CCITT) polynomial. FIPS *|
|* PUB 78 says that the 32-bit FCS reduces otherwise undetected *|
|* errors by a factor of 10^-5 over 16-bit FCS. *|
|* *|
\**********************************************************************/
/* Need an unsigned type capable of holding 32 bits; */
typedef unsigned long int UNS_32_BITS;
/*
* Copyright (C) 1986 Gary S. Brown. You may use this program or
* code or tables extracted from it as desired without restriction.
*/
/* First the polynomial itself and its table of feedback terms. The */
/* polynomial is */
/* X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 */
/* Note that we take it “backwards“ and put the highest-order term in */
/* the lowest-order bit. The X^32 term is “implied“; the LSB is the */
/* X^31 term etc. The X^0 term (usually shown as “+1“) results in */
/* the MSB being 1. */
/* Note that the usual hardware shift register implementation which */
/* is what we‘re using (we‘re merely optimizing it by doing eight-bit */
/* chunks at a time) shifts bits into the lowest-order term. In our */
/* implementation that means shifting towards the right. Why do we */
/* do it this way? Because the calculated CRC must be transmitted in */
/* order from highest-order term to lowest-order term. UARTs transmit */
/* characters in order from LSB to MSB. By storing the CRC this way */
/* we hand it to the UART in the order low-byte to high-byte; the UART */
/* sends each low-bit to hight-bit; and the result is transmission bit */
/* by bit from highest- to lowest-order term without requiring any bit */
/* shuffling on our part. Reception works similarly. */
/* The feedback terms table consists of 256 32-bit entries. Notes: */
/* */
/* 1. The table can be generated at runtime if desired; code to do so */
/* is shown later. It might not be obvious but the feedback */
/* terms simply re
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 8824 2002-11-30 03:19 Zmodem协议Linux下的源代码(比较完整)\crc.c
文件 1492 1994-01-20 10:51 Zmodem协议Linux下的源代码(比较完整)\crc.doc
文件 8764 1994-10-18 14:55 Zmodem协议Linux下的源代码(比较完整)\crctab.c
文件 22 1991-09-14 16:16 Zmodem协议Linux下的源代码(比较完整)\gz
文件 3657 2002-10-15 14:28 Zmodem协议Linux下的源代码(比较完整)\mailer.rz
文件 8650 2002-07-19 08:54 Zmodem协议Linux下的源代码(比较完整)\makefile
文件 2868 1995-01-14 09:58 Zmodem协议Linux下的源代码(比较完整)\minirb.c
文件 2727 1995-04-21 14:48 Zmodem协议Linux下的源代码(比较完整)\minirb.doc
文件 10014 2003-01-30 15:51 Zmodem协议Linux下的源代码(比较完整)\rbsb.c
文件 4769 2000-11-27 12:02 Zmodem协议Linux下的源代码(比较完整)\readme
文件 30340 2003-01-30 15:52 Zmodem协议Linux下的源代码(比较完整)\rz.c
文件 19632 1999-10-04 09:51 Zmodem协议Linux下的源代码(比较完整)\rz.doc
文件 38424 2003-01-30 15:53 Zmodem协议Linux下的源代码(比较完整)\sz.c
文件 26418 2000-06-13 01:52 Zmodem协议Linux下的源代码(比较完整)\sz.doc
文件 7626 2002-08-31 07:44 Zmodem协议Linux下的源代码(比较完整)\undos.c
文件 4282 1997-07-04 23:04 Zmodem协议Linux下的源代码(比较完整)\undos.doc
文件 17715 2002-12-08 16:17 Zmodem协议Linux下的源代码(比较完整)\zm.c
文件 6513 2002-12-08 16:15 Zmodem协议Linux下的源代码(比较完整)\zmodem.h
文件 4351 2002-07-02 08:14 Zmodem协议Linux下的源代码(比较完整)\zmr.c
文件 738 1991-09-15 18:19 Zmodem协议Linux下的源代码(比较完整)\zupl.t
文件 784 2010-04-08 17:56 Zmodem协议Linux下的源代码(比较完整)\使用说明请参看右侧注释====〉〉.txt
目录 0 2011-11-30 20:26 Zmodem协议Linux下的源代码(比较完整)
----------- --------- ---------- ----- ----
208610 22
评论
共有 条评论