/* * See http://www.asterisk.org for more information about * the Asterisk project. Please do not directly contact * any of the maintainers of this project for assistance; * the project provides a web site, mailing lists and IRC * channels for your use. * * This program is free software, distributed under the terms of * the GNU General Public License Version 2 as published by the * Free Software Foundation. See the LICENSE file included with * this program for more details. */ #include #include #include #include #include #include #include #include #include #include #include "bittest.h" #ifdef STANDALONE_ZAPATA #include "kernel/zaptel.h" #else #include #endif /* #define BLOCK_SIZE 2048 */ #define BLOCK_SIZE 2041 void print_packet(unsigned char *buf, int len) { int x; printf("{ "); for (x=0;x\n", argv[0]); exit(1); } fd = open(argv[1], O_RDWR, 0600); if (fd < 0) { fprintf(stderr, "Unable to open %s: %s\n", argv[1], strerror(errno)); exit(1); } if (ioctl(fd, ZT_SET_BLOCKSIZE, &bs)) { fprintf(stderr, "Unable to set block size to %d: %s\n", bs, strerror(errno)); exit(1); } if (ioctl(fd, ZT_GET_PARAMS, &tp)) { fprintf(stderr, "Unable to get channel parameters\n"); exit(1); } ioctl(fd, ZT_GETEVENT); #if 0 print_packet(outbuf, res); printf("FCS is %x, PPP_GOODFCS is %x\n", fcs,PPP_GOODFCS); #endif for(;;) { res = bs; for (x=0;x