[asterisk-commits] kpfleming: branch group/new_loader_completion r40358 - in /team/group/new_loa...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Aug 17 16:14:44 MST 2006


Author: kpfleming
Date: Thu Aug 17 18:14:44 2006
New Revision: 40358

URL: http://svn.digium.com/view/asterisk?rev=40358&view=rev
Log:
small (but important) build rule change
remove compiler warnings found when compiling the misdn stuff using the 'normal' CFLAGS

Modified:
    team/group/new_loader_completion/Makefile.moddir_rules
    team/group/new_loader_completion/channels/misdn/isdn_lib.c
    team/group/new_loader_completion/channels/misdn/isdn_msg_parser.c

Modified: team/group/new_loader_completion/Makefile.moddir_rules
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/Makefile.moddir_rules?rev=40358&r1=40357&r2=40358&view=diff
==============================================================================
--- team/group/new_loader_completion/Makefile.moddir_rules (original)
+++ team/group/new_loader_completion/Makefile.moddir_rules Thu Aug 17 18:14:44 2006
@@ -1,7 +1,7 @@
 #
 # Asterisk -- A telephony toolkit for Linux.
 # 
-# Makefile rules
+# Makefile rules for subdirectories containing modules
 #
 # Copyright (C) 2006, Digium, Inc.
 #
@@ -22,10 +22,10 @@
 
 define module_so_template
 $(1)=$(1).so
-$(1).so: $(2)
+$(1).so: CFLAGS+=-fPIC
 $(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
 $(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
-$(2): CFLAGS+=-fPIC
+$(1).so: $(2)
 endef
 
 define module_a_template

Modified: team/group/new_loader_completion/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/misdn/isdn_lib.c?rev=40358&r1=40357&r2=40358&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/misdn/isdn_lib.c (original)
+++ team/group/new_loader_completion/channels/misdn/isdn_lib.c Thu Aug 17 18:14:44 2006
@@ -13,8 +13,10 @@
 
 
 #include <syslog.h>
+#include <mISDNuser/isdn_debug.h>
+
+#include "isdn_lib.h"
 #include "isdn_lib_intern.h"
-#include <mISDNuser/isdn_debug.h>
 
 void misdn_join_conf(struct misdn_bchannel *bc, int conf_id);
 void misdn_split_conf(struct misdn_bchannel *bc, int conf_id);
@@ -275,7 +277,7 @@
 
 static char flip_table[256];
 
-void init_flip_bits(void)
+static void init_flip_bits(void)
 {
 	int i,k;
 	
@@ -288,7 +290,7 @@
 	}
 }
 
-char * flip_buf_bits ( char * buf , int len)
+static char * flip_buf_bits ( char * buf , int len)
 {
 	int i;
 	char * start = buf;
@@ -303,7 +305,7 @@
 
 
 
-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 +366,7 @@
 }
 
 
-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 +419,7 @@
 }
 
 
-void dump_chan_list(struct misdn_stack *stack)
+static void dump_chan_list(struct misdn_stack *stack)
 {
 	int i;
 
@@ -460,7 +462,7 @@
 	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 +523,7 @@
 	}
 }
 
-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 +533,7 @@
 }
 
 
-void empty_bc(struct misdn_bchannel *bc)
+static void empty_bc(struct misdn_bchannel *bc)
 {
 	bc->bframe_len=0;
 	
@@ -624,7 +626,7 @@
 }
 
 
-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 +669,7 @@
 
 
 
-void clear_l3(struct misdn_stack *stack)
+static void clear_l3(struct misdn_stack *stack)
 {
 	int i;
 
@@ -682,7 +684,7 @@
 	} 
 }
 
-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 +697,22 @@
 	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 +729,7 @@
 }
 
 
-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 +755,7 @@
 }
 
 
-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 +795,8 @@
 	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 +808,9 @@
 	return mISDN_write(stack->midev, &act, mISDN_HEADER_LEN+act.len, TIMEOUT_1SEC);
 	return 0;
 }
-
-
-int misdn_lib_get_short_status(struct misdn_stack *stack)
+#endif
+
+static int misdn_lib_get_short_status(struct misdn_stack *stack)
 {
 	iframe_t act;
 	
@@ -1342,7 +1346,7 @@
 }
 
 
-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 +1361,7 @@
 }
 
 
-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 +1373,7 @@
 	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 +1385,7 @@
 	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 +1404,7 @@
 	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 +1414,7 @@
 }
 
 
-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 +1438,7 @@
 }
 
 
-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 +1458,7 @@
 
 
 
-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 +1532,7 @@
 	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 +1548,7 @@
 	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 +2098,7 @@
 }
 
 
-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 +2239,7 @@
 	}
 }
 
-int handle_bchan(msg_t *msg)
+static int handle_bchan(msg_t *msg)
 {
 	iframe_t *frm= (iframe_t*)msg->data;
 
@@ -2497,7 +2501,7 @@
 
 
 
-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 +2536,7 @@
 }
 
 
-int handle_frm(msg_t *msg)
+static int handle_frm(msg_t *msg)
 {
 	iframe_t *frm = (iframe_t*) msg->data;
 	
@@ -2630,7 +2634,7 @@
 }
 
 
-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 +2704,7 @@
 	return 0;
 }
 
-int handle_l2(msg_t *msg)
+static int handle_l2(msg_t *msg)
 {
 	iframe_t *frm = (iframe_t*) msg->data;
 
@@ -2747,7 +2751,7 @@
 	return 0;
 }
 
-int handle_mgmt(msg_t *msg)
+static int handle_mgmt(msg_t *msg)
 {
 	iframe_t *frm = (iframe_t*) msg->data;
 
@@ -2824,7 +2828,7 @@
 }
 
 
-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 +3016,7 @@
 
 
 
-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 +3084,8 @@
 }
 
 
-char *fac2str (enum FacFunction func) {
+static char *fac2str (enum FacFunction func)
+{
 	struct arr_el { 
 		enum FacFunction p; 
 		char *s ; 
@@ -3329,7 +3334,7 @@
 }
 
 
-int handle_err(msg_t *msg)
+static int handle_err(msg_t *msg)
 {
 	iframe_t *frm = (iframe_t*) msg->data;
 
@@ -3412,8 +3417,9 @@
 	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 +3433,7 @@
 	sem_post(&glob_mgr->new_msg);
 	return 1;
 }
+#endif
 
 int manager_isdn_handler(iframe_t *frm ,msg_t *msg)
 {  
@@ -3578,7 +3585,7 @@
 
 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 +4268,7 @@
 	};
 	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 +4291,7 @@
 	};
 	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 {

Modified: team/group/new_loader_completion/channels/misdn/isdn_msg_parser.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/misdn/isdn_msg_parser.c?rev=40358&r1=40357&r2=40358&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/misdn/isdn_msg_parser.c (original)
+++ team/group/new_loader_completion/channels/misdn/isdn_msg_parser.c Thu Aug 17 18:14:44 2006
@@ -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 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 @@
 	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 @@
 	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 @@
 
  
 }
-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 @@
 }
 
 
-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 @@
 #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 @@
 	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 @@
 }
 
 #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 @@
 	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 @@
 	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 @@
 	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 @@
 
  
 }
-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 @@
 	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 @@
 
  
 }
-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 @@
 	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 @@
 
  
 }
-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 @@
 	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 @@
 
  
 }
-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 @@
 	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 @@
 
  
 }
-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 @@
 	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 @@
 
  
 }
-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 @@
 	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 @@
 
  
 }
-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 @@
 	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 @@
 
  
 }
-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 @@
 	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 @@
 
  
 }
-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 @@
 	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 @@
 
  
 }
-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 @@
 	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 @@
 
  
 }
-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 @@
 	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 @@
 
  
 }
-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 @@
 	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 @@
 
  
 }
-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 @@
 	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 @@
 
  
 }
-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 @@
 	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 @@
 
  
 }
-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 @@
 	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 @@
 
  
 }
-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 @@
 	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 @@
 #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 @@
   
  
 }
-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 @@
 	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 @@
 
  
 }
-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 @@
 	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 @@
 #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 @@
 	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 @@
 	}
 }
 
-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 @@
 	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 @@
 	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 @@
 	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 @@
 #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 @@
 	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 @@
 #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 @@
 	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;
@@ -1177,7 +1199,8 @@
 #define msgs_max (sizeof(msgs_g)/sizeof(struct isdn_msg))
 
 /** INTERFACE FCTS ***/
-int isdn_msg_get_index(struct isdn_msg msgs[], msg_t *msg, int nt)
+#if 0
+static int isdn_msg_get_index(struct isdn_msg msgs[], msg_t *msg, int nt)
 {
 	int i;
 
@@ -1197,8 +1220,10 @@
 
 	return -1;
 }
-
-int isdn_msg_get_index_by_event(struct isdn_msg msgs[], enum event_e event, int nt)
+#endif
+
+#if 0
+static int isdn_msg_get_index_by_event(struct isdn_msg msgs[], enum event_e event, int nt)
 {
 	int i;
 	for (i=0; i< msgs_max; i++) 
@@ -1208,20 +1233,25 @@
 	
 	return -1;
 }
-
-enum event_e isdn_msg_get_event(struct isdn_msg msgs[], msg_t *msg, int nt)
+#endif
+
+#if 0
+static enum event_e isdn_msg_get_event(struct isdn_msg msgs[], msg_t *msg, int nt)
 {
 	int i=isdn_msg_get_index(msgs, msg, nt);
 	if(i>=0) return msgs[i].event;
 	return EVENT_UNKNOWN;
 }
-
-char * isdn_msg_get_info(struct isdn_msg msgs[], msg_t *msg, int nt)
+#endif
+
+#if 0
+static char * isdn_msg_get_info(struct isdn_msg msgs[], msg_t *msg, int nt)
 {
 	int i=isdn_msg_get_index(msgs, msg, nt);
 	if(i>=0) return msgs[i].info;
 	return NULL;
 }
+#endif
 
 
 char EVENT_CLEAN_INFO[] = "CLEAN_UP";
@@ -1234,7 +1264,8 @@
 char EVENT_BCHAN_ACTIVATED_INFO[] = "BCHAN_ACTIVATED";
 char EVENT_TONE_GENERATE_INFO[] = "TONE_GENERATE";
 
-char * isdn_get_info(struct isdn_msg msgs[], enum event_e event, int nt)
+#if 0
+static char * isdn_get_info(struct isdn_msg msgs[], enum event_e event, int nt)
 {
 	int i=isdn_msg_get_index_by_event(msgs, event, nt);
 	
@@ -1252,8 +1283,10 @@
 	
 	return NULL;
 }
-
-int isdn_msg_parse_event(struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+#endif
+
+#if 0
+static int isdn_msg_parse_event(struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
 {
 	int i=isdn_msg_get_index(msgs, msg, nt);
 	if(i<0) return -1;
@@ -1261,12 +1294,14 @@
 	msgs[i].msg_parser(msgs, msg, bc, nt);
 	return 0;
 }
-
-msg_t * isdn_msg_build_event(struct isdn_msg msgs[], struct misdn_bchannel *bc, enum event_e event, int nt)
+#endif
+
+#if 0
+static msg_t * isdn_msg_build_event(struct isdn_msg msgs[], struct misdn_bchannel *bc, enum event_e event, int nt)
 {
 	int i=isdn_msg_get_index_by_event(msgs, event, nt);
 	if(i<0) return NULL;
   
 	return  msgs[i].msg_builder(msgs, bc, nt);
 }
-
+#endif



More information about the asterisk-commits mailing list