[libpri-commits] rmudgett: branch 1.4 r2292 - in /branches/1.4: pridump.c testprilib.c
SVN commits to the libpri project
libpri-commits at lists.digium.com
Fri Aug 10 19:42:08 CDT 2012
Author: rmudgett
Date: Fri Aug 10 19:42:04 2012
New Revision: 2292
URL: http://svnview.digium.com/svn/libpri?view=rev&rev=2292
Log:
Make pridump and testprilib compile again.
Modified:
branches/1.4/pridump.c
branches/1.4/testprilib.c
Modified: branches/1.4/pridump.c
URL: http://svnview.digium.com/svn/libpri/branches/1.4/pridump.c?view=diff&rev=2292&r1=2291&r2=2292
==============================================================================
--- branches/1.4/pridump.c (original)
+++ branches/1.4/pridump.c Fri Aug 10 19:42:04 2012
@@ -42,7 +42,7 @@
#include <sys/ioctl.h>
#include <sys/select.h>
#include <sys/types.h>
-#include <zaptel/zaptel.h>
+#include <dahdi/user.h>
#include "libpri.h"
#include "pri_q921.h"
#include "pri_q931.h"
@@ -50,18 +50,18 @@
static int pri_open(char *dev)
{
int dfd;
- struct zt_params p;
+ struct dahdi_params p;
dfd = open(dev, O_RDWR);
if (dfd < 0) {
fprintf(stderr, "Failed to open dchannel '%s': %s\n", dev, strerror(errno));
return -1;
}
- if (ioctl(dfd, ZT_GET_PARAMS, &p)) {
+ if (ioctl(dfd, DAHDI_GET_PARAMS, &p)) {
fprintf(stderr, "Unable to get parameters on '%s': %s\n", dev, strerror(errno));
return -1;
}
- if ((p.sigtype != ZT_SIG_HDLCRAW) && (p.sigtype != ZT_SIG_HDLCFCS)) {
+ if ((p.sigtype != DAHDI_SIG_HDLCRAW) && (p.sigtype != DAHDI_SIG_HDLCFCS)) {
fprintf(stderr, "%s is in %d signalling, not FCS HDLC or RAW HDLC mode\n", dev, p.sigtype);
return -1;
}
@@ -94,8 +94,8 @@
max = d1;
if (max < d2)
max = d2;
- ioctl(d1, ZT_GETEVENT, &e);
- ioctl(d2, ZT_GETEVENT, &e);
+ ioctl(d1, DAHDI_GETEVENT, &e);
+ ioctl(d2, DAHDI_GETEVENT, &e);
res = select(max + 1, &fds, NULL, NULL, NULL);
if (res < 0) {
fprintf(stderr, "Select returned %d: %s\n", res, strerror(errno));
Modified: branches/1.4/testprilib.c
URL: http://svnview.digium.com/svn/libpri/branches/1.4/testprilib.c?view=diff&rev=2292&r1=2291&r2=2292
==============================================================================
--- branches/1.4/testprilib.c (original)
+++ branches/1.4/testprilib.c Fri Aug 10 19:42:04 2012
@@ -48,13 +48,10 @@
#include <sys/time.h>
#include <netinet/in.h>
#include <sys/socket.h>
-#include <zaptel/zaptel.h>
-#ifndef SOLARIS
-#include <zap.h>
-#endif
#include <pthread.h>
#include <sys/select.h>
#include "libpri.h"
+#include "pri_q921.h"
#include "pri_q931.h"
#ifndef AF_LOCAL
@@ -66,7 +63,7 @@
#define PRI_DEF_NODETYPE PRI_CPE
#define PRI_DEF_SWITCHTYPE PRI_SWITCH_NI2
-static struct pri *first, *cur;
+static struct pri *first;
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
@@ -159,9 +156,9 @@
*c = '\0';
c++;
}
- if (keeplast)
+ if (keeplast || !pri)
printf("%s", s);
- else if (cur == first)
+ else if (pri == first)
printf("-1 %s", s);
else
printf("-2 %s", s);
@@ -185,9 +182,9 @@
*c = '\0';
c++;
}
- if (keeplast)
+ if (keeplast || !pri)
printf("%s", s);
- else if (cur == first)
+ else if (pri == first)
printf("=1 %s", s);
else
printf("=2 %s", s);
@@ -207,7 +204,7 @@
/* Joint D-channel */
struct pri *pri = data;
struct timeval *next, tv;
- pri_event *e;
+ pri_event *e = NULL;
fd_set fds;
int res;
for(;;) {
@@ -228,7 +225,6 @@
FD_SET(pri_fd(pri), &fds);
res = select(pri_fd(pri) + 1, &fds, NULL, NULL, next ? &tv : NULL);
pthread_mutex_lock(&lock);
- cur = pri;
if (res < 0) {
perror("select");
} else if (!res) {
@@ -238,9 +234,9 @@
}
if (e) {
if (first == pri) {
- event1(e->gen.pri, e);
+ event1(pri, e);
} else {
- event2(e->gen.pri, e);
+ event2(pri, e);
}
}
pthread_mutex_unlock(&lock);
More information about the libpri-commits
mailing list