Diff for /libelwix/inc/elwix/acrc.h between versions 1.6 and 1.7

version 1.6, 2017/12/08 00:07:48 version 1.7, 2019/12/30 18:11:16
Line 12  terms: Line 12  terms:
 All of the documentation and software included in the ELWIX and AITNET  All of the documentation and software included in the ELWIX and AITNET
 Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>  Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>
   
Copyright 2004 - 2017Copyright 2004 - 2019
         by Michael Pounov <misho@elwix.org>.  All rights reserved.          by Michael Pounov <misho@elwix.org>.  All rights reserved.
   
 Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
Line 64  typedef struct tagCRCPoly crcPoly_t; Line 64  typedef struct tagCRCPoly crcPoly_t;
  *   *
  * @crcNum = Number for reflection   * @crcNum = Number for reflection
  * @crcBits = Number width bits    * @crcBits = Number width bits 
 * return: -1 error, !=-1 reflecting number * return: reflecting number
  */   */
 unsigned int crcReflect(unsigned int crcNum, unsigned char crcBits);  unsigned int crcReflect(unsigned int crcNum, unsigned char crcBits);
 /*  /*
Line 76  unsigned int crcReflect(unsigned int crcNum, unsigned  Line 76  unsigned int crcReflect(unsigned int crcNum, unsigned 
  * @RevOpts = Options for computation (REVOPTS_REVERTBYTE, REVOPTS_REVERTCRC)   * @RevOpts = Options for computation (REVOPTS_REVERTBYTE, REVOPTS_REVERTCRC)
  * @initCRC = Initial CRC value   * @initCRC = Initial CRC value
  * @xorCRC = Last xor CRC value   * @xorCRC = Last xor CRC value
 * return: -1 error, !=-1 CRC checksum * return: CRC checksum
  */   */
 unsigned int crcCalc(unsigned char * __restrict psBuf, unsigned int bufLen,   unsigned int crcCalc(unsigned char * __restrict psBuf, unsigned int bufLen, 
                 unsigned char crcBits, unsigned char RevOpts,                   unsigned char crcBits, unsigned char RevOpts, 
                 unsigned int initCRC, unsigned int xorCRC);                  unsigned int initCRC, unsigned int xorCRC);
   
 /*  /*
    * crc16() - Checksum calculation in X/Y modem communication
    *
    * @buf = Data for calculation
    * @bufLen = Length of data
    * return: Checksum
    */
   unsigned short crc16(unsigned char * __restrict buf, int bufLen);
   /*
    * crc16_ext() - Checksum ver.2 calculation in X/Y modem communication
    *
    * @buf = Data for calculation
    * @bufLen = Length of data
    * return: Checksum
    */
   unsigned short crc16_ext(unsigned char * __restrict buf, int bufLen);
   /*
  * crcIP() - Checksum in IP communication   * crcIP() - Checksum in IP communication
  *   *
  * @buf = Data for calculation   * @buf = Data for calculation
  * @bufLen = Length of data   * @bufLen = Length of data
 * return: -1 error, !=-1 Checksum * return: Checksum
  */   */
 unsigned short crcIP(unsigned char * __restrict buf, int bufLen);  unsigned short crcIP(unsigned char * __restrict buf, int bufLen);
 /*  /*
Line 96  unsigned short crcIP(unsigned char * __restrict buf, i Line 112  unsigned short crcIP(unsigned char * __restrict buf, i
  * @buf = Data for calculation   * @buf = Data for calculation
  * @bufLen = Length of data   * @bufLen = Length of data
  * @th = TCP header   * @th = TCP header
 * return: -1 error, !=-1 Checksum * return: Checksum
  */   */
 unsigned short crcTCP(struct in_addr src, struct in_addr dst,   unsigned short crcTCP(struct in_addr src, struct in_addr dst, 
                 unsigned char * __restrict th);                  unsigned char * __restrict th);
Line 106  unsigned short crcTCP(struct in_addr src, struct in_ad Line 122  unsigned short crcTCP(struct in_addr src, struct in_ad
  * @buf = Data for calculation   * @buf = Data for calculation
  * @bufLen = Length of data   * @bufLen = Length of data
  * @uh = UDP header   * @uh = UDP header
 * return: -1 error, !=-1 Checksum * return: Checksum
  */   */
 unsigned short crcUDP(struct in_addr src, struct in_addr dst,   unsigned short crcUDP(struct in_addr src, struct in_addr dst, 
                 unsigned char * __restrict uh);                  unsigned char * __restrict uh);
Line 116  unsigned short crcUDP(struct in_addr src, struct in_ad Line 132  unsigned short crcUDP(struct in_addr src, struct in_ad
  *   *
  * @nBuf = Data for calculation   * @nBuf = Data for calculation
  * @bufLen = Length of data   * @bufLen = Length of data
 * return: -1 error, !=-1 Checksum * return: Checksum
  */   */
 unsigned short crcFletcher16(unsigned short * __restrict nBuf, int bufLen);  unsigned short crcFletcher16(unsigned short * __restrict nBuf, int bufLen);
 /*  /*
Line 124  unsigned short crcFletcher16(unsigned short * __restri Line 140  unsigned short crcFletcher16(unsigned short * __restri
  *   *
  * @nBuf = Data for calculation   * @nBuf = Data for calculation
  * @bufLen = Length of data   * @bufLen = Length of data
 * return: -1 error, !=-1 Checksum * return: Checksum
  */   */
 unsigned int crcFletcher(unsigned short * __restrict nBuf, int bufLen);  unsigned int crcFletcher(unsigned short * __restrict nBuf, int bufLen);
 /*  /*
Line 132  unsigned int crcFletcher(unsigned short * __restrict n Line 148  unsigned int crcFletcher(unsigned short * __restrict n
  *   *
  * @psBuf = Data for calculation   * @psBuf = Data for calculation
  * @bufLen = Length of data   * @bufLen = Length of data
 * return: -1 error, !=-1 Checksum * return: Checksum
  */   */
 unsigned int crcAdler(unsigned char * __restrict psBuf, int bufLen);  unsigned int crcAdler(unsigned char * __restrict psBuf, int bufLen);
   
Line 141  unsigned int crcAdler(unsigned char * __restrict psBuf Line 157  unsigned int crcAdler(unsigned char * __restrict psBuf
  *   *
  * @psBuf = Data for calculation   * @psBuf = Data for calculation
  * @bufLen = Length of data   * @bufLen = Length of data
 * return: -1 error, !=-1 Checksum * return: Checksum
  */   */
 #define crcEther(psBuf, bufLen) crcCalc((psBuf), (bufLen), 32, 3, 0xFFFFFFFF, 0xFFFFFFFF)  #define crcEther(psBuf, bufLen) crcCalc((psBuf), (bufLen), 32, 3, 0xFFFFFFFF, 0xFFFFFFFF)
   

Removed from v.1.6  
changed lines
  Added in v.1.7


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>