diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-21 02:11:39 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-21 02:11:39 +0000 |
commit | 8b0c007ad990aa27d9868da49215fd1076ac77cc (patch) | |
tree | 270b9c46c1e644483d6d2a35b509f43218ba3252 /channels/misdn | |
parent | a42edc84034f91932a3e12d503e07f76a6eb498a (diff) |
merge new_loader_completion branch, including (at least):
- restructured build tree and makefiles to eliminate recursion problems
- support for embedded modules
- support for static builds
- simpler cross-compilation support
- simpler module/loader interface (no exported symbols)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/misdn')
-rw-r--r-- | channels/misdn/Makefile | 25 | ||||
-rw-r--r-- | channels/misdn/ie.c | 96 | ||||
-rw-r--r-- | channels/misdn/isdn_lib.c | 104 | ||||
-rw-r--r-- | channels/misdn/isdn_lib.h | 1 | ||||
-rw-r--r-- | channels/misdn/isdn_lib_intern.h | 8 | ||||
-rw-r--r-- | channels/misdn/isdn_msg_parser.c | 147 |
6 files changed, 205 insertions, 176 deletions
diff --git a/channels/misdn/Makefile b/channels/misdn/Makefile index f1838d13e..895dc9dee 100644 --- a/channels/misdn/Makefile +++ b/channels/misdn/Makefile @@ -1,30 +1,13 @@ # -# Makefile +# Makefile for chan_misdn support # -# Make file for chan_misdn support -# - -# Verify those options with main Makefile -CFLAGS = -pipe -c -Wall -ggdb -ifeq ($(shell uname -m),x86_64) -CFLAGS += -fPIC -endif -SOURCES = isdn_lib.c isdn_msg_parser.c -OBJDIR = . -OBJS = isdn_lib.o isdn_msg_parser.o - -all: chan_misdn_lib.a +all: %.o: %.c - $(CC) $(CFLAGS) -o $@ $< - -chan_misdn_lib.a: $(OBJS) - ar crv $@ $(OBJS) - + $(CC) $(CFLAGS) -c -o $@ $< portinfo: portinfo.o - $(CC) -L/usr/lib -o $@ $^ -lisdnnet -lmISDN -lpthread - + $(CC) -o $@ $^ -lisdnnet -lmISDN -lpthread clean: rm -rf *.a *.o *.so portinfo diff --git a/channels/misdn/ie.c b/channels/misdn/ie.c index 712f8132b..892daa7c5 100644 --- a/channels/misdn/ie.c +++ b/channels/misdn/ie.c @@ -43,7 +43,8 @@ static void strnncpy(char *dest, char *src, int len, int dst_len) /* IE_COMPLETE */ -void enc_ie_complete(unsigned char **ntmode, msg_t *msg, int complete, int nt, struct misdn_bchannel *bc) +#if 0 +static void enc_ie_complete(unsigned char **ntmode, msg_t *msg, int complete, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -69,8 +70,9 @@ void enc_ie_complete(unsigned char **ntmode, msg_t *msg, int complete, int nt, s p[0] = IE_COMPLETE; } } +#endif -void dec_ie_complete(unsigned char *p, Q931_info_t *qi, int *complete, int nt, struct misdn_bchannel *bc) +static void dec_ie_complete(unsigned char *p, Q931_info_t *qi, int *complete, int nt, struct misdn_bchannel *bc) { *complete = 0; if (!nt) @@ -87,7 +89,7 @@ void dec_ie_complete(unsigned char *p, Q931_info_t *qi, int *complete, int nt, s /* IE_BEARER */ -void enc_ie_bearer(unsigned char **ntmode, msg_t *msg, int coding, int capability, int mode, int rate, int multi, int user, int nt, struct misdn_bchannel *bc) +static void enc_ie_bearer(unsigned char **ntmode, msg_t *msg, int coding, int capability, int mode, int rate, int multi, int user, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -147,7 +149,7 @@ void enc_ie_bearer(unsigned char **ntmode, msg_t *msg, int coding, int capabilit p[4+(multi>=0)] = 0xa0 + user; } -void dec_ie_bearer(unsigned char *p, Q931_info_t *qi, int *coding, int *capability, int *mode, int *rate, int *multi, int *user, +static void dec_ie_bearer(unsigned char *p, Q931_info_t *qi, int *coding, int *capability, int *mode, int *rate, int *multi, int *user, int *async, int *urate, int *stopbits, int *dbits, int *parity, int nt, struct misdn_bchannel *bc) { int octet; @@ -260,7 +262,8 @@ void dec_ie_bearer(unsigned char *p, Q931_info_t *qi, int *coding, int *capabili /* IE_CALL_ID */ -void enc_ie_call_id(unsigned char **ntmode, msg_t *msg, char *callid, int callid_len, int nt, struct misdn_bchannel *bc) +#if 0 +static void enc_ie_call_id(unsigned char **ntmode, msg_t *msg, char *callid, int callid_len, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -298,8 +301,10 @@ void enc_ie_call_id(unsigned char **ntmode, msg_t *msg, char *callid, int callid p[1] = l; memcpy(p+2, callid, callid_len); } +#endif -void dec_ie_call_id(unsigned char *p, Q931_info_t *qi, char *callid, int *callid_len, int nt, struct misdn_bchannel *bc) +#if 0 +static void dec_ie_call_id(unsigned char *p, Q931_info_t *qi, char *callid, int *callid_len, int nt, struct misdn_bchannel *bc) { char debug[25]; int i; @@ -332,10 +337,10 @@ void dec_ie_call_id(unsigned char *p, Q931_info_t *qi, char *callid, int *callid if (MISDN_IE_DEBG) printf(" callid%s\n", debug); } - +#endif /* IE_CALLED_PN */ -void enc_ie_called_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, char *number, int nt, struct misdn_bchannel *bc) +static void enc_ie_called_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, char *number, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -371,7 +376,7 @@ void enc_ie_called_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, ch strncpy((char *)p+3, (char *)number, strlen((char *)number)); } -void dec_ie_called_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, char *number, int number_len, int nt, struct misdn_bchannel *bc) +static void dec_ie_called_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, char *number, int number_len, int nt, struct misdn_bchannel *bc) { *type = -1; *plan = -1; @@ -400,7 +405,7 @@ void dec_ie_called_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, c /* IE_CALLING_PN */ -void enc_ie_calling_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc) +static void enc_ie_calling_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -455,7 +460,7 @@ void enc_ie_calling_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, i } } -void dec_ie_calling_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc) +static void dec_ie_calling_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc) { *type = -1; *plan = -1; @@ -502,7 +507,7 @@ void dec_ie_calling_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, /* IE_CONNECTED_PN */ -void enc_ie_connected_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc) +static void enc_ie_connected_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -557,7 +562,7 @@ void enc_ie_connected_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, } } -void dec_ie_connected_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc) +static void dec_ie_connected_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc) { *type = -1; *plan = -1; @@ -601,7 +606,7 @@ void dec_ie_connected_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan /* IE_CAUSE */ -void enc_ie_cause(unsigned char **ntmode, msg_t *msg, int location, int cause, int nt, struct misdn_bchannel *bc) +static void enc_ie_cause(unsigned char **ntmode, msg_t *msg, int location, int cause, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -631,7 +636,9 @@ void enc_ie_cause(unsigned char **ntmode, msg_t *msg, int location, int cause, i p[2] = 0x80 + location; p[3] = 0x80 + cause; } -void enc_ie_cause_standalone(unsigned char **ntmode, msg_t *msg, int location, int cause, int nt, struct misdn_bchannel *bc) + +#if 0 +static void enc_ie_cause_standalone(unsigned char **ntmode, msg_t *msg, int location, int cause, int nt, struct misdn_bchannel *bc) { unsigned char *p = msg_put(msg, 4); Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -644,9 +651,9 @@ void enc_ie_cause_standalone(unsigned char **ntmode, msg_t *msg, int location, i p[2] = 0x80 + location; p[3] = 0x80 + cause; } +#endif - -void dec_ie_cause(unsigned char *p, Q931_info_t *qi, int *location, int *cause, int nt, struct misdn_bchannel *bc) +static void dec_ie_cause(unsigned char *p, Q931_info_t *qi, int *location, int *cause, int nt, struct misdn_bchannel *bc) { *location = -1; *cause = -1; @@ -673,7 +680,7 @@ void dec_ie_cause(unsigned char *p, Q931_info_t *qi, int *location, int *cause, /* IE_CHANNEL_ID */ -void enc_ie_channel_id(unsigned char **ntmode, msg_t *msg, int exclusive, int channel, int nt, struct misdn_bchannel *bc) +static void enc_ie_channel_id(unsigned char **ntmode, msg_t *msg, int exclusive, int channel, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -748,7 +755,7 @@ void enc_ie_channel_id(unsigned char **ntmode, msg_t *msg, int exclusive, int ch } } -void dec_ie_channel_id(unsigned char *p, Q931_info_t *qi, int *exclusive, int *channel, int nt, struct misdn_bchannel *bc) +static void dec_ie_channel_id(unsigned char *p, Q931_info_t *qi, int *exclusive, int *channel, int nt, struct misdn_bchannel *bc) { struct misdn_stack *stack=get_stack_by_bc(bc); int pri =stack->pri; @@ -842,7 +849,7 @@ void dec_ie_channel_id(unsigned char *p, Q931_info_t *qi, int *exclusive, int *c /* IE_DATE */ -void enc_ie_date(unsigned char **ntmode, msg_t *msg, time_t ti, int nt, struct misdn_bchannel *bc) +static void enc_ie_date(unsigned char **ntmode, msg_t *msg, time_t ti, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -876,7 +883,7 @@ void enc_ie_date(unsigned char **ntmode, msg_t *msg, time_t ti, int nt, struct m /* IE_DISPLAY */ -void enc_ie_display(unsigned char **ntmode, msg_t *msg, char *display, int nt, struct misdn_bchannel *bc) +static void enc_ie_display(unsigned char **ntmode, msg_t *msg, char *display, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -907,7 +914,8 @@ void enc_ie_display(unsigned char **ntmode, msg_t *msg, char *display, int nt, s strncpy((char *)p+2, (char *)display, strlen((char *)display)); } -void dec_ie_display(unsigned char *p, Q931_info_t *qi, char *display, int display_len, int nt, struct misdn_bchannel *bc) +#if 0 +static void dec_ie_display(unsigned char *p, Q931_info_t *qi, char *display, int display_len, int nt, struct misdn_bchannel *bc) { *display = '\0'; @@ -929,10 +937,11 @@ void dec_ie_display(unsigned char *p, Q931_info_t *qi, char *display, int displa if (MISDN_IE_DEBG) printf(" display='%s'\n", display); } - +#endif /* IE_KEYPAD */ -void enc_ie_keypad(unsigned char **ntmode, msg_t *msg, char *keypad, int nt, struct misdn_bchannel *bc) +#if 0 +static void enc_ie_keypad(unsigned char **ntmode, msg_t *msg, char *keypad, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -956,8 +965,9 @@ void enc_ie_keypad(unsigned char **ntmode, msg_t *msg, char *keypad, int nt, str p[1] = l; strncpy((char *)p+2, (char *)keypad, strlen((char *)keypad)); } +#endif -void dec_ie_keypad(unsigned char *p, Q931_info_t *qi, char *keypad, int keypad_len, int nt, struct misdn_bchannel *bc) +static void dec_ie_keypad(unsigned char *p, Q931_info_t *qi, char *keypad, int keypad_len, int nt, struct misdn_bchannel *bc) { *keypad = '\0'; @@ -982,7 +992,8 @@ void dec_ie_keypad(unsigned char *p, Q931_info_t *qi, char *keypad, int keypad_l /* IE_NOTIFY */ -void enc_ie_notify(unsigned char **ntmode, msg_t *msg, int notify, int nt, struct misdn_bchannel *bc) +#if 0 +static void enc_ie_notify(unsigned char **ntmode, msg_t *msg, int notify, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -1006,8 +1017,10 @@ void enc_ie_notify(unsigned char **ntmode, msg_t *msg, int notify, int nt, struc p[1] = l; p[2] = 0x80 + notify; } +#endif -void dec_ie_notify(unsigned char *p, Q931_info_t *qi, int *notify, int nt, struct misdn_bchannel *bc) +#if 0 +static void dec_ie_notify(unsigned char *p, Q931_info_t *qi, int *notify, int nt, struct misdn_bchannel *bc) { *notify = -1; @@ -1029,10 +1042,11 @@ void dec_ie_notify(unsigned char *p, Q931_info_t *qi, int *notify, int nt, struc if (MISDN_IE_DEBG) printf(" notify=%d\n", *notify); } +#endif /* IE_PROGRESS */ -void enc_ie_progress(unsigned char **ntmode, msg_t *msg, int coding, int location, int progress, int nt, struct misdn_bchannel *bc) +static void enc_ie_progress(unsigned char **ntmode, msg_t *msg, int coding, int location, int progress, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -1068,7 +1082,7 @@ void enc_ie_progress(unsigned char **ntmode, msg_t *msg, int coding, int locatio p[3] = 0x80 + progress; } -void dec_ie_progress(unsigned char *p, Q931_info_t *qi, int *coding, int *location, int *progress, int nt, struct misdn_bchannel *bc) +static void dec_ie_progress(unsigned char *p, Q931_info_t *qi, int *coding, int *location, int *progress, int nt, struct misdn_bchannel *bc) { *coding = -1; *location = -1; @@ -1098,7 +1112,7 @@ void dec_ie_progress(unsigned char *p, Q931_info_t *qi, int *coding, int *locati /* IE_REDIR_NR (redirecting = during MT_SETUP) */ -void enc_ie_redir_nr(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, int reason, char *number, int nt, struct misdn_bchannel *bc) +static void enc_ie_redir_nr(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, int reason, char *number, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -1172,7 +1186,7 @@ void enc_ie_redir_nr(unsigned char **ntmode, msg_t *msg, int type, int plan, int } } -void dec_ie_redir_nr(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, int *reason, char *number, int number_len, int nt, struct misdn_bchannel *bc) +static void dec_ie_redir_nr(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, int *reason, char *number, int number_len, int nt, struct misdn_bchannel *bc) { *type = -1; *plan = -1; @@ -1219,7 +1233,8 @@ void dec_ie_redir_nr(unsigned char *p, Q931_info_t *qi, int *type, int *plan, in /* IE_REDIR_DN (redirection = during MT_NOTIFY) */ -void enc_ie_redir_dn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, char *number, int nt, struct misdn_bchannel *bc) +#if 0 +static void enc_ie_redir_dn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, char *number, int nt, struct misdn_bchannel *bc) { unsigned char *p; /* Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); */ @@ -1269,8 +1284,10 @@ void enc_ie_redir_dn(unsigned char **ntmode, msg_t *msg, int type, int plan, int strncpy((char *)p+3, (char *)number, strlen((char *)number)); } } +#endif -void dec_ie_redir_dn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, char *number, int number_len, int nt, struct misdn_bchannel *bc) +#if 0 +static void dec_ie_redir_dn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, char *number, int number_len, int nt, struct misdn_bchannel *bc) { *type = -1; *plan = -1; @@ -1305,11 +1322,12 @@ void dec_ie_redir_dn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, in if (MISDN_IE_DEBG) printf(" type=%d plan=%d present=%d number='%s'\n", *type, *plan, *present, number); } - +#endif /* IE_USERUSER */ -void enc_ie_useruser(unsigned char **ntmode, msg_t *msg, int protocol, char *user, int user_len, int nt, struct misdn_bchannel *bc) +#if 0 +static void enc_ie_useruser(unsigned char **ntmode, msg_t *msg, int protocol, char *user, int user_len, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -1348,8 +1366,10 @@ void enc_ie_useruser(unsigned char **ntmode, msg_t *msg, int protocol, char *use p[2] = 0x80 + protocol; memcpy(p+3, user, user_len); } +#endif -void dec_ie_useruser(unsigned char *p, Q931_info_t *qi, int *protocol, char *user, int *user_len, int nt, struct misdn_bchannel *bc) +#if 0 +static void dec_ie_useruser(unsigned char *p, Q931_info_t *qi, int *protocol, char *user, int *user_len, int nt, struct misdn_bchannel *bc) { char debug[768]; int i; @@ -1382,7 +1402,5 @@ void dec_ie_useruser(unsigned char *p, Q931_info_t *qi, int *protocol, char *use if (MISDN_IE_DEBG) printf(" protocol=%d user-user%s\n", *protocol, debug); } - - - +#endif diff --git a/channels/misdn/isdn_lib.c b/channels/misdn/isdn_lib.c index ea38592bd..b0d2fbe9d 100644 --- a/channels/misdn/isdn_lib.c +++ b/channels/misdn/isdn_lib.c @@ -13,9 +13,11 @@ #include <syslog.h> -#include "isdn_lib_intern.h" #include <mISDNuser/isdn_debug.h> +#include "isdn_lib_intern.h" +#include "isdn_lib.h" + void misdn_join_conf(struct misdn_bchannel *bc, int conf_id); void misdn_split_conf(struct misdn_bchannel *bc, int conf_id); @@ -232,11 +234,6 @@ void manager_clean_bc(struct misdn_bchannel *bc ); void manager_bchannel_setup (struct misdn_bchannel *bc); void manager_bchannel_cleanup (struct misdn_bchannel *bc); -int isdn_msg_get_index(struct isdn_msg msgs[], msg_t *frm, int nt); -enum event_e isdn_msg_get_event(struct isdn_msg msgs[], msg_t *frm, int nt); -int isdn_msg_parse_event(struct isdn_msg msgs[], msg_t *frm, struct misdn_bchannel *bc, int nt); -char * isdn_get_info(struct isdn_msg msgs[], enum event_e event, int nt); -msg_t * isdn_msg_build_event(struct isdn_msg msgs[], struct misdn_bchannel *bc, enum event_e event, int nt); void ec_chunk( struct misdn_bchannel *bc, unsigned char *rxchunk, unsigned char *txchunk, int chunk_size); /* end */ int bchdev_echocancel_activate(struct misdn_bchannel* dev); @@ -275,7 +272,7 @@ static char *bearer2str(int cap) { static char flip_table[256]; -void init_flip_bits(void) +static void init_flip_bits(void) { int i,k; @@ -288,7 +285,7 @@ void init_flip_bits(void) } } -char * flip_buf_bits ( char * buf , int len) +static char * flip_buf_bits ( char * buf , int len) { int i; char * start = buf; @@ -303,7 +300,7 @@ char * flip_buf_bits ( char * buf , int len) -msg_t *create_l2msg(int prim, int dinfo, int size) /* NT only */ +static msg_t *create_l2msg(int prim, int dinfo, int size) /* NT only */ { int i = 0; msg_t *dmsg; @@ -364,7 +361,7 @@ msg_t *create_l3msg(int prim, int mt, int dinfo, int size, int ntmode) } -int send_msg (int midev, struct misdn_bchannel *bc, msg_t *dmsg) +static int send_msg (int midev, struct misdn_bchannel *bc, msg_t *dmsg) { iframe_t *frm; frm = (iframe_t *)dmsg->data; @@ -417,7 +414,7 @@ int misdn_inband_avail(struct misdn_bchannel *bc) } -void dump_chan_list(struct misdn_stack *stack) +static void dump_chan_list(struct misdn_stack *stack) { int i; @@ -460,7 +457,7 @@ static int find_free_chan_in_stack(struct misdn_stack *stack, struct misdn_bchan return 0; } -int empty_chan_in_stack(struct misdn_stack *stack, int channel) +static int empty_chan_in_stack(struct misdn_stack *stack, int channel) { if (channel<=0) { cb_log(0,stack?stack->port:0, "empty_chan_inst_stack: cannot empty channel %d\n",channel); @@ -521,7 +518,7 @@ void bc_state_change(struct misdn_bchannel *bc, enum bchannel_state state) } } -void bc_next_state_change(struct misdn_bchannel *bc, enum bchannel_state state) +static void bc_next_state_change(struct misdn_bchannel *bc, enum bchannel_state state) { cb_log(5,bc->port,"BC_NEXT_STATE_CHANGE: from:%s to:%s\n", bc_state2str(bc->next_bc_state), @@ -531,7 +528,7 @@ void bc_next_state_change(struct misdn_bchannel *bc, enum bchannel_state state) } -void empty_bc(struct misdn_bchannel *bc) +static void empty_bc(struct misdn_bchannel *bc) { bc->bframe_len=0; @@ -624,7 +621,7 @@ void empty_bc(struct misdn_bchannel *bc) } -int clean_up_bc(struct misdn_bchannel *bc) +static int clean_up_bc(struct misdn_bchannel *bc) { int ret=0; unsigned char buff[32]; @@ -667,7 +664,7 @@ int clean_up_bc(struct misdn_bchannel *bc) -void clear_l3(struct misdn_stack *stack) +static void clear_l3(struct misdn_stack *stack) { int i; @@ -682,7 +679,7 @@ void clear_l3(struct misdn_stack *stack) } } -int set_chan_in_stack(struct misdn_stack *stack, int channel) +static int set_chan_in_stack(struct misdn_stack *stack, int channel) { cb_log(4,stack->port,"set_chan_in_stack: %d\n",channel); @@ -695,21 +692,22 @@ int set_chan_in_stack(struct misdn_stack *stack, int channel) return 0; } -int chan_in_stack_free(struct misdn_stack *stack, int channel) +#if 0 +static int chan_in_stack_free(struct misdn_stack *stack, int channel) { if (stack->channels[channel-1]) return 0; return 1; } - +#endif static int newteid=0; #define MAXPROCS 0x100 -int misdn_lib_get_l1_down(struct misdn_stack *stack) +static int misdn_lib_get_l1_down(struct misdn_stack *stack) { /* Pull Up L1 */ iframe_t act; @@ -726,7 +724,7 @@ int misdn_lib_get_l1_down(struct misdn_stack *stack) } -int misdn_lib_get_l2_down(struct misdn_stack *stack) +static int misdn_lib_get_l2_down(struct misdn_stack *stack) { if (stack->ptp && (stack->nt) ) { @@ -752,7 +750,7 @@ int misdn_lib_get_l2_down(struct misdn_stack *stack) } -int misdn_lib_get_l1_up(struct misdn_stack *stack) +static int misdn_lib_get_l1_up(struct misdn_stack *stack) { /* Pull Up L1 */ iframe_t act; @@ -792,7 +790,8 @@ int misdn_lib_get_l2_up(struct misdn_stack *stack) return 0; } -int misdn_lib_get_l2_te_ptp_up(struct misdn_stack *stack) +#if 0 +static int misdn_lib_get_l2_te_ptp_up(struct misdn_stack *stack) { iframe_t act; @@ -804,9 +803,9 @@ int misdn_lib_get_l2_te_ptp_up(struct misdn_stack *stack) return mISDN_write(stack->midev, &act, mISDN_HEADER_LEN+act.len, TIMEOUT_1SEC); return 0; } +#endif - -int misdn_lib_get_short_status(struct misdn_stack *stack) +static int misdn_lib_get_short_status(struct misdn_stack *stack) { iframe_t act; @@ -1342,7 +1341,7 @@ void stack_destroy(struct misdn_stack* stack) } -struct misdn_stack * find_stack_by_addr(int addr) +static struct misdn_stack * find_stack_by_addr(int addr) { struct misdn_stack *stack; @@ -1357,7 +1356,7 @@ struct misdn_stack * find_stack_by_addr(int addr) } -struct misdn_stack * find_stack_by_port(int port) +static struct misdn_stack * find_stack_by_port(int port) { struct misdn_stack *stack; @@ -1369,7 +1368,7 @@ struct misdn_stack * find_stack_by_port(int port) return NULL; } -struct misdn_stack * find_stack_by_mgr(manager_t* mgr_nt) +static struct misdn_stack * find_stack_by_mgr(manager_t* mgr_nt) { struct misdn_stack *stack; @@ -1381,7 +1380,7 @@ struct misdn_stack * find_stack_by_mgr(manager_t* mgr_nt) return NULL; } -struct misdn_bchannel *find_bc_by_masked_l3id(struct misdn_stack *stack, unsigned long l3id, unsigned long mask) +static struct misdn_bchannel *find_bc_by_masked_l3id(struct misdn_stack *stack, unsigned long l3id, unsigned long mask) { int i; for (i=0; i<stack->b_num; i++) { @@ -1400,7 +1399,7 @@ struct misdn_bchannel *find_bc_by_l3id(struct misdn_stack *stack, unsigned long return stack_holder_find(stack,l3id); } -struct misdn_bchannel *find_bc_holded(struct misdn_stack *stack) +static struct misdn_bchannel *find_bc_holded(struct misdn_stack *stack) { int i; for (i=0; i<stack->b_num; i++) { @@ -1410,7 +1409,7 @@ struct misdn_bchannel *find_bc_holded(struct misdn_stack *stack) } -struct misdn_bchannel *find_bc_by_addr(unsigned long addr) +static struct misdn_bchannel *find_bc_by_addr(unsigned long addr) { struct misdn_stack* stack; int i; @@ -1434,7 +1433,7 @@ struct misdn_bchannel *find_bc_by_addr(unsigned long addr) } -struct misdn_bchannel *find_bc_by_channel(int port, int channel) +static struct misdn_bchannel *find_bc_by_channel(int port, int channel) { struct misdn_stack* stack=find_stack_by_port(port); int i; @@ -1454,7 +1453,7 @@ struct misdn_bchannel *find_bc_by_channel(int port, int channel) -int handle_event ( struct misdn_bchannel *bc, enum event_e event, iframe_t *frm) +static int handle_event ( struct misdn_bchannel *bc, enum event_e event, iframe_t *frm) { struct misdn_stack *stack=get_stack_by_bc(bc); @@ -1528,7 +1527,7 @@ int handle_event ( struct misdn_bchannel *bc, enum event_e event, iframe_t *frm) return 0; } -int handle_new_process(struct misdn_stack *stack, iframe_t *frm) +static int handle_new_process(struct misdn_stack *stack, iframe_t *frm) { struct misdn_bchannel* bc=misdn_lib_get_free_bc(stack->port, 0); @@ -1544,7 +1543,7 @@ int handle_new_process(struct misdn_stack *stack, iframe_t *frm) return 0; } -int handle_cr ( struct misdn_stack *stack, iframe_t *frm) +static int handle_cr ( struct misdn_stack *stack, iframe_t *frm) { if (!stack) return -1; @@ -2094,7 +2093,7 @@ handle_event_nt(void *dat, void *arg) } -int handle_timers(msg_t* msg) +static int handle_timers(msg_t* msg) { iframe_t *frm= (iframe_t*)msg->data; struct misdn_stack *stack; @@ -2235,7 +2234,7 @@ void misdn_tx_jitter(struct misdn_bchannel *bc, int len) } } -int handle_bchan(msg_t *msg) +static int handle_bchan(msg_t *msg) { iframe_t *frm= (iframe_t*)msg->data; @@ -2497,7 +2496,7 @@ int handle_bchan(msg_t *msg) -int handle_frm_nt(msg_t *msg) +static int handle_frm_nt(msg_t *msg) { iframe_t *frm= (iframe_t*)msg->data; struct misdn_stack *stack; @@ -2532,7 +2531,7 @@ int handle_frm_nt(msg_t *msg) } -int handle_frm(msg_t *msg) +static int handle_frm(msg_t *msg) { iframe_t *frm = (iframe_t*) msg->data; @@ -2630,7 +2629,7 @@ handle_frm_bc: } -int handle_l1(msg_t *msg) +static int handle_l1(msg_t *msg) { iframe_t *frm = (iframe_t*) msg->data; struct misdn_stack *stack = find_stack_by_addr(frm->addr); @@ -2700,7 +2699,7 @@ int handle_l1(msg_t *msg) return 0; } -int handle_l2(msg_t *msg) +static int handle_l2(msg_t *msg) { iframe_t *frm = (iframe_t*) msg->data; @@ -2747,7 +2746,7 @@ int handle_l2(msg_t *msg) return 0; } -int handle_mgmt(msg_t *msg) +static int handle_mgmt(msg_t *msg) { iframe_t *frm = (iframe_t*) msg->data; @@ -2824,7 +2823,7 @@ int handle_mgmt(msg_t *msg) } -msg_t *fetch_msg(int midev) +static msg_t *fetch_msg(int midev) { msg_t *msg=alloc_msg(MAX_MSG_SIZE); int r; @@ -3012,7 +3011,7 @@ struct misdn_bchannel *manager_find_bc_holded(struct misdn_bchannel* bc) -void prepare_bc(struct misdn_bchannel*bc, int channel) +static void prepare_bc(struct misdn_bchannel*bc, int channel) { bc->channel = channel; bc->channel_preselected = channel?1:0; @@ -3080,7 +3079,8 @@ struct misdn_bchannel* misdn_lib_get_free_bc(int port, int channel) } -char *fac2str (enum FacFunction func) { +static char *fac2str (enum FacFunction func) +{ struct arr_el { enum FacFunction p; char *s ; @@ -3329,7 +3329,7 @@ int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event ) } -int handle_err(msg_t *msg) +static int handle_err(msg_t *msg) { iframe_t *frm = (iframe_t*) msg->data; @@ -3412,8 +3412,9 @@ int handle_err(msg_t *msg) return 0; } - -int queue_l2l3(msg_t *msg) { +#if 0 +static int queue_l2l3(msg_t *msg) +{ iframe_t *frm= (iframe_t*)msg->data; struct misdn_stack *stack; stack=find_stack_by_addr( frm->addr ); @@ -3427,6 +3428,7 @@ int queue_l2l3(msg_t *msg) { sem_post(&glob_mgr->new_msg); return 1; } +#endif int manager_isdn_handler(iframe_t *frm ,msg_t *msg) { @@ -3578,7 +3580,7 @@ int misdn_lib_port_restart(int port) sem_t handler_started; -void manager_event_handler(void *arg) +static void manager_event_handler(void *arg) { sem_post(&handler_started); while (1) { @@ -4261,7 +4263,7 @@ void misdn_lib_bridge( struct misdn_bchannel * bc1, struct misdn_bchannel *bc2) }; struct misdn_bchannel **bc; - for (bc=bc_list; *bc; *bc++) { + for (bc=bc_list; *bc; bc++) { (*bc)->conf_id=conf_id; cb_log(1, (*bc)->port, " --> bc_addr:%x\n",(*bc)->addr); @@ -4284,7 +4286,7 @@ void misdn_lib_split_bridge( struct misdn_bchannel * bc1, struct misdn_bchannel }; struct misdn_bchannel **bc; - for (bc=bc_list; *bc; *bc++) { + for (bc=bc_list; *bc; bc++) { if ( (*bc)->bc_state == BCHAN_BRIDGED){ misdn_split_conf( *bc, (*bc)->conf_id); } else { diff --git a/channels/misdn/isdn_lib.h b/channels/misdn/isdn_lib.h index 1d38bb4fa..d849a7ce8 100644 --- a/channels/misdn/isdn_lib.h +++ b/channels/misdn/isdn_lib.h @@ -458,5 +458,4 @@ char *bc_state2str(enum bchannel_state state); void bc_state_change(struct misdn_bchannel *bc, enum bchannel_state state); - #endif diff --git a/channels/misdn/isdn_lib_intern.h b/channels/misdn/isdn_lib_intern.h index 6dbc3afb7..86d95a9fe 100644 --- a/channels/misdn/isdn_lib_intern.h +++ b/channels/misdn/isdn_lib_intern.h @@ -11,7 +11,6 @@ #include "isdn_lib.h" - #if !defined MISDNUSER_VERSION_CODE || (MISDNUSER_VERSION_CODE < MISDNUSER_VERSION(1, 0, 3)) #error "You need a newer version of mISDNuser ..." #endif @@ -104,6 +103,13 @@ struct misdn_stack { struct misdn_stack* get_stack_by_bc(struct misdn_bchannel *bc); +int isdn_msg_get_index(struct isdn_msg msgs[], msg_t *frm, int nt); +enum event_e isdn_msg_get_event(struct isdn_msg msgs[], msg_t *frm, int nt); +int isdn_msg_parse_event(struct isdn_msg msgs[], msg_t *frm, struct misdn_bchannel *bc, int nt); +char * isdn_get_info(struct isdn_msg msgs[], enum event_e event, int nt); +msg_t * isdn_msg_build_event(struct isdn_msg msgs[], struct misdn_bchannel *bc, enum event_e event, int nt); +int isdn_msg_get_index_by_event(struct isdn_msg msgs[], enum event_e event, int nt); +char * isdn_msg_get_info(struct isdn_msg msgs[], msg_t *msg, int nt); #endif diff --git a/channels/misdn/isdn_msg_parser.c b/channels/misdn/isdn_msg_parser.c index a7fbf4e79..4179d8e60 100644 --- a/channels/misdn/isdn_msg_parser.c +++ b/channels/misdn/isdn_msg_parser.c @@ -20,7 +20,8 @@ #include "ie.c" -void set_channel(struct misdn_bchannel *bc, int channel) { +static void set_channel(struct misdn_bchannel *bc, int channel) +{ cb_log(3,bc->port,"set_channel: bc->channel:%d channel:%d\n", bc->channel, channel); @@ -47,7 +48,7 @@ void set_channel(struct misdn_bchannel *bc, int channel) { } } -void parse_proceeding (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_proceeding (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; CALL_PROCEEDING_t *proceeding=(CALL_PROCEEDING_t*)((unsigned long)msg->data+ HEADER_LEN); @@ -68,7 +69,7 @@ void parse_proceeding (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel printf("Parsing PROCEEDING Msg\n"); #endif } -msg_t *build_proceeding (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_proceeding (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; CALL_PROCEEDING_t *proceeding; @@ -88,7 +89,7 @@ msg_t *build_proceeding (struct isdn_msg msgs[], struct misdn_bchannel *bc, int return msg; } -void parse_alerting (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_alerting (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; ALERTING_t *alerting=(ALERTING_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -102,7 +103,8 @@ void parse_alerting (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel * } -msg_t *build_alerting (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_alerting (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; ALERTING_t *alerting; @@ -121,7 +123,7 @@ msg_t *build_alerting (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt } -void parse_progress (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_progress (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; PROGRESS_t *progress=(PROGRESS_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -134,7 +136,7 @@ void parse_progress (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel * #endif } -msg_t *build_progress (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_progress (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; PROGRESS_t *progress; @@ -148,7 +150,7 @@ msg_t *build_progress (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt return msg; } -void parse_setup (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_setup (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; SETUP_t *setup= (SETUP_t*)((unsigned long)msg->data+HEADER_LEN); @@ -256,7 +258,7 @@ void parse_setup (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, } #define ANY_CHANNEL 0xff /* IE attribut for 'any channel' */ -msg_t *build_setup (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_setup (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; SETUP_t *setup; @@ -331,7 +333,7 @@ msg_t *build_setup (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_connect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_connect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; CONNECT_t *connect=(CONNECT_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -353,7 +355,8 @@ void parse_connect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *b printf("Parsing CONNECT Msg\n"); #endif } -msg_t *build_connect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_connect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; CONNECT_t *connect; @@ -380,7 +383,7 @@ msg_t *build_connect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_setup_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_setup_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; SETUP_ACKNOWLEDGE_t *setup_acknowledge=(SETUP_ACKNOWLEDGE_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -400,7 +403,8 @@ void parse_setup_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_b } -msg_t *build_setup_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_setup_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; SETUP_ACKNOWLEDGE_t *setup_acknowledge; @@ -419,7 +423,7 @@ msg_t *build_setup_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *b return msg; } -void parse_connect_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_connect_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing CONNECT_ACKNOWLEDGE Msg\n"); @@ -427,7 +431,8 @@ void parse_connect_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn } -msg_t *build_connect_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_connect_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; CONNECT_ACKNOWLEDGE_t *connect_acknowledge; @@ -443,7 +448,7 @@ msg_t *build_connect_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel return msg; } -void parse_user_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_user_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing USER_INFORMATION Msg\n"); @@ -451,7 +456,8 @@ void parse_user_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bc } -msg_t *build_user_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_user_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; USER_INFORMATION_t *user_information; @@ -465,7 +471,7 @@ msg_t *build_user_information (struct isdn_msg msgs[], struct misdn_bchannel *bc return msg; } -void parse_suspend_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_suspend_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing SUSPEND_REJECT Msg\n"); @@ -473,7 +479,8 @@ void parse_suspend_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bcha } -msg_t *build_suspend_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_suspend_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; SUSPEND_REJECT_t *suspend_reject; @@ -487,7 +494,7 @@ msg_t *build_suspend_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, return msg; } -void parse_resume_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_resume_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing RESUME_REJECT Msg\n"); @@ -495,7 +502,8 @@ void parse_resume_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchan } -msg_t *build_resume_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_resume_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RESUME_REJECT_t *resume_reject; @@ -509,7 +517,7 @@ msg_t *build_resume_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, i return msg; } -void parse_hold (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_hold (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing HOLD Msg\n"); @@ -517,7 +525,8 @@ void parse_hold (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, } -msg_t *build_hold (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_hold (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; HOLD_t *hold; @@ -531,7 +540,7 @@ msg_t *build_hold (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_suspend (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_suspend (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing SUSPEND Msg\n"); @@ -539,7 +548,8 @@ void parse_suspend (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *b } -msg_t *build_suspend (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_suspend (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; SUSPEND_t *suspend; @@ -553,7 +563,7 @@ msg_t *build_suspend (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_resume (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_resume (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing RESUME Msg\n"); @@ -561,7 +571,8 @@ void parse_resume (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc } -msg_t *build_resume (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_resume (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RESUME_t *resume; @@ -575,7 +586,7 @@ msg_t *build_resume (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_hold_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_hold_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing HOLD_ACKNOWLEDGE Msg\n"); @@ -583,7 +594,8 @@ void parse_hold_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bc } -msg_t *build_hold_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_hold_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; HOLD_ACKNOWLEDGE_t *hold_acknowledge; @@ -597,7 +609,7 @@ msg_t *build_hold_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc return msg; } -void parse_suspend_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_suspend_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing SUSPEND_ACKNOWLEDGE Msg\n"); @@ -605,7 +617,8 @@ void parse_suspend_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn } -msg_t *build_suspend_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_suspend_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; SUSPEND_ACKNOWLEDGE_t *suspend_acknowledge; @@ -619,7 +632,7 @@ msg_t *build_suspend_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel return msg; } -void parse_resume_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_resume_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing RESUME_ACKNOWLEDGE Msg\n"); @@ -627,7 +640,8 @@ void parse_resume_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_ } -msg_t *build_resume_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_resume_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RESUME_ACKNOWLEDGE_t *resume_acknowledge; @@ -641,7 +655,7 @@ msg_t *build_resume_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel * return msg; } -void parse_hold_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_hold_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing HOLD_REJECT Msg\n"); @@ -649,7 +663,8 @@ void parse_hold_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchanne } -msg_t *build_hold_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_hold_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; HOLD_REJECT_t *hold_reject; @@ -663,7 +678,7 @@ msg_t *build_hold_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int return msg; } -void parse_retrieve (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_retrieve (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing RETRIEVE Msg\n"); @@ -671,7 +686,8 @@ void parse_retrieve (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel * } -msg_t *build_retrieve (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_retrieve (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RETRIEVE_t *retrieve; @@ -685,7 +701,7 @@ msg_t *build_retrieve (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt return msg; } -void parse_retrieve_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_retrieve_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing RETRIEVE_ACKNOWLEDGE Msg\n"); @@ -693,7 +709,8 @@ void parse_retrieve_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misd } -msg_t *build_retrieve_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_retrieve_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RETRIEVE_ACKNOWLEDGE_t *retrieve_acknowledge; @@ -708,7 +725,7 @@ msg_t *build_retrieve_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel return msg; } -void parse_retrieve_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_retrieve_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing RETRIEVE_REJECT Msg\n"); @@ -716,7 +733,8 @@ void parse_retrieve_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bch } -msg_t *build_retrieve_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_retrieve_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RETRIEVE_REJECT_t *retrieve_reject; @@ -730,7 +748,7 @@ msg_t *build_retrieve_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, return msg; } -void parse_disconnect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_disconnect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; DISCONNECT_t *disconnect=(DISCONNECT_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -745,7 +763,8 @@ void parse_disconnect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel } -msg_t *build_disconnect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_disconnect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; DISCONNECT_t *disconnect; @@ -762,7 +781,7 @@ msg_t *build_disconnect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int return msg; } -void parse_restart (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_restart (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RESTART_t *restart=(RESTART_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -774,8 +793,9 @@ void parse_restart (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *b #endif { - int exclusive, channel; + int exclusive, channel = 0; dec_ie_channel_id(restart->CHANNEL_ID, (Q931_info_t *)restart, &exclusive, &bc->restart_channel, nt,bc); + /* XXX: this is broken... channel is not used */ if (channel==0xff) /* any channel */ channel=-1; cb_log(3, stack->port, "CC_RESTART Request on channel:%d on this port.\n"); @@ -783,7 +803,8 @@ void parse_restart (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *b } -msg_t *build_restart (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_restart (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RESTART_t *restart; @@ -797,7 +818,7 @@ msg_t *build_restart (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_release (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_release (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RELEASE_t *release=(RELEASE_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -810,7 +831,8 @@ void parse_release (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *b } -msg_t *build_release (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_release (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RELEASE_t *release; @@ -827,7 +849,7 @@ msg_t *build_release (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_release_complete (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_release_complete (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RELEASE_COMPLETE_t *release_complete=(RELEASE_COMPLETE_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -859,7 +881,7 @@ void parse_release_complete (struct isdn_msg msgs[], msg_t *msg, struct misdn_bc #endif } -msg_t *build_release_complete (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_release_complete (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RELEASE_COMPLETE_t *release_complete; @@ -875,7 +897,7 @@ msg_t *build_release_complete (struct isdn_msg msgs[], struct misdn_bchannel *bc return msg; } -void parse_facility (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_facility (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt ? mISDNUSER_HEAD_SIZE : mISDN_HEADER_LEN; FACILITY_t *facility = (FACILITY_t*)(msg->data+HEADER_LEN); @@ -902,7 +924,7 @@ void parse_facility (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel * } } -msg_t *build_facility (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_facility (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int len, HEADER_LEN = nt ? mISDNUSER_HEAD_SIZE : mISDN_HEADER_LEN; @@ -938,14 +960,14 @@ msg_t *build_facility (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt return msg; } -void parse_notify (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_notify (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing NOTIFY Msg\n"); #endif } -msg_t *build_notify (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_notify (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; NOTIFY_t *notify; @@ -959,14 +981,14 @@ msg_t *build_notify (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_status_enquiry (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_status_enquiry (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing STATUS_ENQUIRY Msg\n"); #endif } -msg_t *build_status_enquiry (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_status_enquiry (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; STATUS_ENQUIRY_t *status_enquiry; @@ -980,7 +1002,7 @@ msg_t *build_status_enquiry (struct isdn_msg msgs[], struct misdn_bchannel *bc, return msg; } -void parse_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; INFORMATION_t *information=(INFORMATION_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -998,7 +1020,7 @@ void parse_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchanne #endif } -msg_t *build_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; INFORMATION_t *information; @@ -1023,7 +1045,7 @@ msg_t *build_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int return msg; } -void parse_status (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_status (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; STATUS_t *status=(STATUS_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -1037,7 +1059,7 @@ void parse_status (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc #endif } -msg_t *build_status (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_status (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; STATUS_t *status; @@ -1051,14 +1073,14 @@ msg_t *build_status (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_timeout (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_timeout (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing STATUS Msg\n"); #endif } -msg_t *build_timeout (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_timeout (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; STATUS_t *status; @@ -1269,4 +1291,3 @@ msg_t * isdn_msg_build_event(struct isdn_msg msgs[], struct misdn_bchannel *bc, return msgs[i].msg_builder(msgs, bc, nt); } - |