add core wanpipe headers etc and tweak build flags
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@10 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
fcbd79567c
commit
7e3412baf1
|
@ -35,13 +35,20 @@ MYLIB=libopenzap.a
|
||||||
|
|
||||||
include general.makefile $(ZAP_MODS)
|
include general.makefile $(ZAP_MODS)
|
||||||
|
|
||||||
|
all: $(MYLIB)
|
||||||
|
|
||||||
$(MYLIB): $(OBJS)
|
$(MYLIB): $(OBJS)
|
||||||
ar rcs $(MYLIB) $(OBJS)
|
ar rcs $(MYLIB) $(OBJS)
|
||||||
ranlib $(MYLIB)
|
ranlib $(MYLIB)
|
||||||
%.o: %.c
|
|
||||||
$(CC) $(CFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
all: $(MYLIB)
|
zap_wanpipe.o: zap_wanpipe.c
|
||||||
|
$(CC) $(CFLAGS) $(ZAP_CFLAGS) $(WP_CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
zap_zt.o: zap_zt.c
|
||||||
|
$(CC) $(CFLAGS) $(ZAP_CFLAGS) $(ZT_CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
%.o: %.c
|
||||||
|
$(CC) $(CC_CFLAGS) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o $(MYLIB) *~ \#*
|
rm -f *.o $(MYLIB) *~ \#*
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
CC=gcc
|
CC=gcc
|
||||||
CFLAGS += -Wall -Werror -Wextra -std=c99 -pedantic -ansi
|
CC_CFLAGS += -Wall -Werror -Wextra -std=c99 -pedantic -ansi
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,6 @@ struct zap_software_interface;
|
||||||
*/
|
*/
|
||||||
#define zap_copy_flags(dest, src, flags) (dest)->flags &= ~(flags); (dest)->flags |= ((src)->flags & (flags))
|
#define zap_copy_flags(dest, src, flags) (dest)->flags &= ~(flags); (dest)->flags |= ((src)->flags & (flags))
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Free a pointer and set it to NULL unless it already is NULL
|
\brief Free a pointer and set it to NULL unless it already is NULL
|
||||||
\param it the pointer
|
\param it the pointer
|
||||||
|
@ -201,7 +200,6 @@ typedef zap_status_t (*zint_write_t) ZINT_WRITE_ARGS ;
|
||||||
#define ZINT_READ_MUZZLE assert(zchan != NULL); assert(data != NULL); assert(datalen != NULL)
|
#define ZINT_READ_MUZZLE assert(zchan != NULL); assert(data != NULL); assert(datalen != NULL)
|
||||||
#define ZINT_WRITE_MUZZLE assert(zchan != NULL); assert(data != NULL); assert(datalen != NULL)
|
#define ZINT_WRITE_MUZZLE assert(zchan != NULL); assert(data != NULL); assert(datalen != NULL)
|
||||||
|
|
||||||
|
|
||||||
struct zap_software_interface {
|
struct zap_software_interface {
|
||||||
const char *name;
|
const char *name;
|
||||||
zint_configure_t configure;
|
zint_configure_t configure;
|
||||||
|
|
|
@ -229,7 +229,7 @@ zap_status_t zap_global_init(void)
|
||||||
char *var, *val;
|
char *var, *val;
|
||||||
unsigned configured = 0;
|
unsigned configured = 0;
|
||||||
zap_software_interface_t *zint;
|
zap_software_interface_t *zint;
|
||||||
|
|
||||||
globals.interface_hash = create_hashtable(16, hashfromstring, equalkeys);
|
globals.interface_hash = create_hashtable(16, hashfromstring, equalkeys);
|
||||||
zint = NULL;
|
zint = NULL;
|
||||||
|
|
||||||
|
@ -265,6 +265,8 @@ zap_status_t zap_global_init(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
zap_config_close_file(&cfg);
|
||||||
|
|
||||||
return configured ? ZAP_SUCCESS : ZAP_FAIL;
|
return configured ? ZAP_SUCCESS : ZAP_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,11 @@
|
||||||
CFLAGS +=-DZAP_WANPIPE_SUPPORT
|
CFLAGS +=-DZAP_WANPIPE_SUPPORT
|
||||||
OBJS += zap_wanpipe.o
|
OBJS += zap_wanpipe.o
|
||||||
|
WANPIPE_INCLUDE=/usr/include/wanpipe
|
||||||
|
#WANPIPE_INCLUDE=../../wanpipe-3.1.0.p18/patches/kdrivers/include
|
||||||
|
|
||||||
|
WP_CFLAGS =-I$(WANPIPE_INCLUDE) -I/usr/local/include -I/usr/src/linux/include -I. -I/usr/include
|
||||||
|
WP_CFLAGS +=-D__LINUX__ -D_REENTRANT -D_GNU_SOURCE -DAFT_A104 -DWANPIPE_TDM_API -D_GNUC_ -DWANPIPE_TDM_API
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,13 +31,45 @@
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "openzap.h"
|
#include "openzap.h"
|
||||||
#include "zap_wanpipe.h"
|
#include "zap_wanpipe.h"
|
||||||
|
#include <wanpipe_defines.h>
|
||||||
|
#include <wanpipe_cfg.h>
|
||||||
|
#include <wanpipe_tdm_api.h>
|
||||||
|
#include <sdla_te1_pmc.h>
|
||||||
|
#include <sdla_te1.h>
|
||||||
|
#include <sdla_56k.h>
|
||||||
|
#include <sdla_remora.h>
|
||||||
|
#include <sdla_te3.h>
|
||||||
|
#include <sdla_front_end.h>
|
||||||
|
#include <sdla_aft_te1.h>
|
||||||
|
|
||||||
|
struct wanpipe_channel {
|
||||||
|
struct zap_channel zchan;
|
||||||
|
int x;
|
||||||
|
};
|
||||||
|
|
||||||
static ZINT_CONFIGURE_FUNCTION(wanpipe_configure)
|
static ZINT_CONFIGURE_FUNCTION(wanpipe_configure)
|
||||||
{
|
{
|
||||||
|
zap_config_t cfg;
|
||||||
|
char *var, *val;
|
||||||
|
int catno = -1;
|
||||||
|
|
||||||
ZINT_CONFIGURE_MUZZLE;
|
ZINT_CONFIGURE_MUZZLE;
|
||||||
|
|
||||||
|
if (!zap_config_open_file(&cfg, "wanpipe.conf")) {
|
||||||
|
return ZAP_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (zap_config_next_pair(&cfg, &var, &val)) {
|
||||||
|
if (!strcasecmp(cfg.category, "span")) {
|
||||||
|
if (cfg.catno != catno) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
zap_config_close_file(&cfg);
|
||||||
|
|
||||||
return ZAP_FAIL;
|
return ZAP_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue