summaryrefslogtreecommitdiff
path: root/hdlctest.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2008-05-23 15:16:24 +0000
committerKevin P. Fleming <kpfleming@digium.com>2008-05-23 15:16:24 +0000
commit04128951db339ddfd7905adf92990f00a3a01447 (patch)
treefed6cec907ec871794693772483db9bd04e0422d /hdlctest.c
parente027cd533ab52f09186f1bd4cd33e0f3aac0363c (diff)
yay, all the tools compile now
git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@4339 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'hdlctest.c')
-rw-r--r--hdlctest.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/hdlctest.c b/hdlctest.c
index 4cd4d91..680b33a 100644
--- a/hdlctest.c
+++ b/hdlctest.c
@@ -2,13 +2,13 @@
#include <fcntl.h>
#include <string.h>
#include <errno.h>
-#include "kernel/zaptel.h"
#include <stdio.h>
#include <linux/types.h>
#include <linux/ppp_defs.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <stdlib.h>
+#include <dahdi/user.h>
#include "bittest.h"
#define FAST_HDLC_NEED_TABLES
#include "kernel/fasthdlc.h"
@@ -131,8 +131,8 @@ int main(int argc, char *argv[])
{
int fd;
int res, x;
- ZT_PARAMS tp;
- ZT_BUFFERINFO bi;
+ DAHDI_PARAMS tp;
+ DAHDI_BUFFERINFO bi;
int bs = BLOCK_SIZE;
int pos = 0;
unsigned char inbuf[BLOCK_SIZE];
@@ -156,30 +156,30 @@ int main(int argc, char *argv[])
fprintf(stderr, "Unable to open %s: %s\n", argv[1], strerror(errno));
exit(1);
}
- if (ioctl(fd, ZT_SET_BLOCKSIZE, &bs)) {
+ if (ioctl(fd, DAHDI_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)) {
+ if (ioctl(fd, DAHDI_GET_PARAMS, &tp)) {
fprintf(stderr, "Unable to get channel parameters\n");
exit(1);
}
- if ((tp.sigtype & ZT_SIG_HDLCRAW) == ZT_SIG_HDLCRAW) {
+ if ((tp.sigtype & DAHDI_SIG_HDLCRAW) == DAHDI_SIG_HDLCRAW) {
printf("In HDLC mode\n");
hdlcmode = 1;
- } else if ((tp.sigtype & ZT_SIG_CLEAR) == ZT_SIG_CLEAR) {
+ } else if ((tp.sigtype & DAHDI_SIG_CLEAR) == DAHDI_SIG_CLEAR) {
printf("In CLEAR mode\n");
hdlcmode = 0;
} else {
fprintf(stderr, "Not in a reasonable mode\n");
exit(1);
}
- res = ioctl(fd, ZT_GET_BUFINFO, &bi);
+ res = ioctl(fd, DAHDI_GET_BUFINFO, &bi);
if (!res) {
- bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
- bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
+ bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
+ bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.numbufs = 4;
- res = ioctl(fd, ZT_SET_BUFINFO, &bi);
+ res = ioctl(fd, DAHDI_SET_BUFINFO, &bi);
if (res < 0) {
fprintf(stderr, "Unable to set buf info: %s\n", strerror(errno));
exit(1);
@@ -188,7 +188,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "Unable to get buf info: %s\n", strerror(errno));
exit(1);
}
- ioctl(fd, ZT_GETEVENT);
+ ioctl(fd, DAHDI_GETEVENT);
fasthdlc_precalc();
fasthdlc_init(&fs);
for(;;) {
@@ -196,7 +196,7 @@ int main(int argc, char *argv[])
if (hdlcmode) {
if (res < 0) {
if (errno == ELAST) {
- if (ioctl(fd, ZT_GETEVENT, &x) < 0) {
+ if (ioctl(fd, DAHDI_GETEVENT, &x) < 0) {
fprintf(stderr, "Unaable to get event: %s\n", strerror(errno));
exit(1);
}