⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 crcgen.c

📁 cipe 编程
💻 C
字号:
/*   CIPE - encrypted IP over UDP tunneling   crcgen.c - run a CRC32 over the input   Copyright 1999 Olaf Titz <olaf@bigred.inka.de>   This program is free software; you can redistribute it and/or   modify it under the terms of the GNU General Public License   as published by the Free Software Foundation; either version   2 of the License, or (at your option) any later version.*//* $Id: crcgen.c,v 1.8 2004/01/18 14:57:51 olaf81825 Exp $ */#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#define BUFS 4096extern u_int32_t crc32(u_int32_t seed, const unsigned char *s, unsigned int len);int main(int argc, char *argv[]){    u_int32_t crc=0UL;    if (argc<2)        exit(1);    if (argv[1][0]=='-') {        char buf[BUFS];        int n;        n=read(0, buf, BUFS-1);        if (n<0)            exit(2);        if (n>=BUFS)            exit(3);        crc=crc32(0, buf, n);	buf[n]=0;	printf("/* Configuration defines:%s*/\n", buf);    } else {        crc=crc32(0, argv[1], strlen(argv[1]));    }    printf("#define VERSION_MAGIC 0x%08X\n", crc);    return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -