summaryrefslogtreecommitdiff
path: root/pattest.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 /pattest.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 'pattest.c')
-rw-r--r--pattest.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/pattest.c b/pattest.c
index 69c3b6e..4e26ea0 100644
--- a/pattest.c
+++ b/pattest.c
@@ -10,11 +10,7 @@
#include <stdlib.h>
#include "bittest.h"
-#ifdef STANDALONE_ZAPATA
-#include "kernel/zaptel.h"
-#else
-#include <zaptel/zaptel.h>
-#endif
+#include <dahdi/user.h>
#define BLOCK_SIZE 2039
@@ -31,7 +27,7 @@ int main(int argc, char *argv[])
{
int fd;
int res, x;
- ZT_PARAMS tp;
+ DAHDI_PARAMS tp;
int bs = BLOCK_SIZE;
unsigned char c=0;
unsigned char outbuf[BLOCK_SIZE];
@@ -47,36 +43,36 @@ 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);
}
- ioctl(fd, ZT_GETEVENT);
+ ioctl(fd, DAHDI_GETEVENT);
for(;;) {
res = bs;
res = read(fd, outbuf, res);
if (res < bs) {
int e;
- ZT_SPANINFO zi;
- res = ioctl(fd,ZT_GETEVENT,&e);
+ DAHDI_SPANINFO zi;
+ res = ioctl(fd,DAHDI_GETEVENT,&e);
if (res == -1)
{
- perror("ZT_GETEVENT");
+ perror("DAHDI_GETEVENT");
exit(1);
}
- if (e == ZT_EVENT_NOALARM)
+ if (e == DAHDI_EVENT_NOALARM)
printf("ALARMS CLEARED\n");
- if (e == ZT_EVENT_ALARM)
+ if (e == DAHDI_EVENT_ALARM)
{
zi.spanno = 0;
- res = ioctl(fd,ZT_SPANSTAT,&zi);
+ res = ioctl(fd,DAHDI_SPANSTAT,&zi);
if (res == -1)
{
- perror("ZT_SPANSTAT");
+ perror("DAHDI_SPANSTAT");
exit(1);
}
printf("Alarm mask %x hex\n",zi.alarms);