summaryrefslogtreecommitdiffstats
path: root/sys/i4b/layer3
diff options
context:
space:
mode:
authorhm <hm@FreeBSD.org>2000-10-09 13:18:17 +0000
committerhm <hm@FreeBSD.org>2000-10-09 13:18:17 +0000
commit9fc2bc8a46f4f09ca71eaf59e5c203b5d61533fb (patch)
treeca1e99e8eac9fd3f8c8cecbcbfc102b0bfa6f03f /sys/i4b/layer3
parent7fc1fa165474e47dca5d7dfb2584d97d169d686d (diff)
downloadFreeBSD-src-9fc2bc8a46f4f09ca71eaf59e5c203b5d61533fb.zip
FreeBSD-src-9fc2bc8a46f4f09ca71eaf59e5c203b5d61533fb.tar.gz
update to i4b version 0.95.04
Diffstat (limited to 'sys/i4b/layer3')
-rw-r--r--sys/i4b/layer3/i4b_l2if.c86
-rw-r--r--sys/i4b/layer3/i4b_l3.h6
-rw-r--r--sys/i4b/layer3/i4b_l3fsm.c153
-rw-r--r--sys/i4b/layer3/i4b_l3fsm.h6
-rw-r--r--sys/i4b/layer3/i4b_l3timer.c124
-rw-r--r--sys/i4b/layer3/i4b_l4if.c53
-rw-r--r--sys/i4b/layer3/i4b_q931.c288
-rw-r--r--sys/i4b/layer3/i4b_q931.h6
-rw-r--r--sys/i4b/layer3/i4b_q932fac.c41
-rw-r--r--sys/i4b/layer3/i4b_q932fac.h6
10 files changed, 403 insertions, 366 deletions
diff --git a/sys/i4b/layer3/i4b_l2if.c b/sys/i4b/layer3/i4b_l2if.c
index c68b622..fda8622 100644
--- a/sys/i4b/layer3/i4b_l2if.c
+++ b/sys/i4b/layer3/i4b_l2if.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_l2if.c - Layer 3 interface to Layer 2
* -------------------------------------------
*
- * $Id: i4b_l2if.c,v 1.18 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_l2if.c,v 1.23 2000/08/24 11:48:58 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:04:48 1999]
+ * last edit-date: [Mon May 29 16:56:22 2000]
*
*---------------------------------------------------------------------------*/
@@ -43,17 +43,16 @@
#if NI4BQ931 > 0
#include <sys/param.h>
-
-#if defined(__FreeBSD__)
-#else
-#include <sys/ioctl.h>
-#endif
-
+#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
+#include <sys/callout.h>
+#endif
+
#ifdef __FreeBSD__
#include <machine/i4b_debug.h>
#include <machine/i4b_ioctl.h>
@@ -142,7 +141,7 @@ i4b_dl_establish_ind(int unit)
int i;
int found = 0;
- DBGL2(L2_PRIM, "DL-ESTABLISH-IND", ("unit %d\n",unit));
+ NDBGL2(L2_PRIM, "DL-ESTABLISH-IND unit %d",unit);
/* first set DL up in controller descriptor */
@@ -151,7 +150,7 @@ i4b_dl_establish_ind(int unit)
if((ctrl_desc[i].ctrl_type == CTRL_PASSIVE) &&
(ctrl_desc[i].unit == unit))
{
- DBGL3(L3_MSG, "i4b_dl_establish_ind", ("unit=%d DL established!\n",unit));
+ NDBGL3(L3_MSG, "unit=%d DL established!",unit);
ctrl_desc[i].dl_est = DL_UP;
found = 1;
}
@@ -159,7 +158,7 @@ i4b_dl_establish_ind(int unit)
if(found == 0)
{
- DBGL3(L3_ERR, "i4b_dl_establish_ind", ("ERROR, controller not found for unit=%d!\n",unit));
+ NDBGL3(L3_ERR, "ERROR, controller not found for unit=%d!",unit);
return(-1);
}
@@ -173,8 +172,8 @@ i4b_dl_establish_ind(int unit)
(ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
(ctrl_desc[call_desc[i].controller].unit == unit))
{
- DBGL3(L3_MSG, "i4b_dl_establish_ind", ("unit=%d, index=%d cdid=%u cr=%d\n",
- unit, i, call_desc[i].cdid, call_desc[i].cr));
+ NDBGL3(L3_MSG, "unit=%d, index=%d cdid=%u cr=%d",
+ unit, i, call_desc[i].cdid, call_desc[i].cr);
next_l3state(&call_desc[i], EV_DLESTIN);
found++;
}
@@ -182,7 +181,7 @@ i4b_dl_establish_ind(int unit)
if(found == 0)
{
- DBGL3(L3_ERR, "i4b_dl_establish_ind", ("ERROR, no cdid for unit %d found!\n", unit));
+ NDBGL3(L3_ERR, "ERROR, no cdid for unit %d found!", unit);
return(-1);
}
else
@@ -200,7 +199,7 @@ i4b_dl_establish_cnf(int unit)
int i;
int found = 0;
- DBGL2(L2_PRIM, "DL-ESTABLISH-CONF", ("unit %d\n",unit));
+ NDBGL2(L2_PRIM, "DL-ESTABLISH-CONF unit %d",unit);
for(i=0; i < N_CALL_DESC; i++)
{
@@ -210,8 +209,8 @@ i4b_dl_establish_cnf(int unit)
{
ctrl_desc[call_desc[i].controller].dl_est = DL_UP;
- DBGL3(L3_MSG, "i4b_dl_establish_cnf", ("unit=%d, index=%d cdid=%u cr=%d\n",
- unit, i, call_desc[i].cdid, call_desc[i].cr));
+ NDBGL3(L3_MSG, "unit=%d, index=%d cdid=%u cr=%d",
+ unit, i, call_desc[i].cdid, call_desc[i].cr);
next_l3state(&call_desc[i], EV_DLESTCF);
found++;
@@ -220,7 +219,7 @@ i4b_dl_establish_cnf(int unit)
if(found == 0)
{
- DBGL3(L3_ERR, "i4b_dl_establish_cnf", ("ERROR, no cdid for unit %d found!\n", unit));
+ NDBGL3(L3_ERR, "ERROR, no cdid for unit %d found!", unit);
return(-1);
}
else
@@ -238,7 +237,7 @@ i4b_dl_release_ind(int unit)
int i;
int found = 0;
- DBGL2(L2_PRIM, "DL-RELEASE-IND", ("unit %d\n",unit));
+ NDBGL2(L2_PRIM, "DL-RELEASE-IND unit %d",unit);
/* first set controller to down */
@@ -247,7 +246,7 @@ i4b_dl_release_ind(int unit)
if((ctrl_desc[i].ctrl_type == CTRL_PASSIVE) &&
(ctrl_desc[i].unit == unit))
{
- DBGL3(L3_MSG, "i4b_dl_release_ind", ("unit=%d DL released!\n",unit));
+ NDBGL3(L3_MSG, "unit=%d DL released!",unit);
ctrl_desc[i].dl_est = DL_DOWN;
found = 1;
}
@@ -255,7 +254,7 @@ i4b_dl_release_ind(int unit)
if(found == 0)
{
- DBGL3(L3_ERR, "i4b_dl_release_ind", ("ERROR, controller not found for unit=%d!\n",unit));
+ NDBGL3(L3_ERR, "ERROR, controller not found for unit=%d!",unit);
return(-1);
}
@@ -269,8 +268,8 @@ i4b_dl_release_ind(int unit)
(ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
(ctrl_desc[call_desc[i].controller].unit == unit))
{
- DBGL3(L3_MSG, "i4b_dl_release_ind", ("unit=%d, index=%d cdid=%u cr=%d\n",
- unit, i, call_desc[i].cdid, call_desc[i].cr));
+ NDBGL3(L3_MSG, "unit=%d, index=%d cdid=%u cr=%d",
+ unit, i, call_desc[i].cdid, call_desc[i].cr);
next_l3state(&call_desc[i], EV_DLRELIN);
found++;
}
@@ -279,7 +278,7 @@ i4b_dl_release_ind(int unit)
if(found == 0)
{
/* this is not an error since it might be a normal call end */
- DBGL3(L3_MSG, "i4b_dl_release_ind", ("no cdid for unit %d found\n", unit));
+ NDBGL3(L3_MSG, "no cdid for unit %d found", unit);
}
return(0);
}
@@ -292,19 +291,19 @@ i4b_dl_release_cnf(int unit)
{
int i;
- DBGL2(L2_PRIM, "DL-RELEASE-CONF", ("unit %d\n",unit));
+ NDBGL2(L2_PRIM, "DL-RELEASE-CONF unit %d",unit);
for(i=0; i < nctrl; i++)
{
if((ctrl_desc[i].ctrl_type == CTRL_PASSIVE) &&
(ctrl_desc[i].unit == unit))
{
- DBGL3(L3_MSG, "i4b_dl_release_cnf", ("unit=%d DL released!\n",unit));
+ NDBGL3(L3_MSG, "unit=%d DL released!",unit);
ctrl_desc[i].dl_est = DL_DOWN;
return(0);
}
}
- DBGL3(L3_ERR, "i4b_dl_release_cnf", ("ERROR, controller not found for unit=%d!\n",unit));
+ NDBGL3(L3_ERR, "ERROR, controller not found for unit=%d!",unit);
return(-1);
}
@@ -315,7 +314,7 @@ int
i4b_dl_data_ind(int unit, struct mbuf *m)
{
#ifdef NOTDEF
- DBGL2(L2_PRIM, "DL-DATA-IND", ("unit %d\n",unit));
+ NDBGL2(L2_PRIM, "DL-DATA-IND unit %d",unit);
#endif
i4b_decode_q931(unit, m->m_len, m->m_data);
i4b_Dfreembuf(m);
@@ -329,7 +328,7 @@ int
i4b_dl_unit_data_ind(int unit, struct mbuf *m)
{
#ifdef NOTDEF
- DBGL2(L2_PRIM, "DL-UNIT-DATA-IND", ("unit %d\n",unit));
+ NDBGL2(L2_PRIM, "DL-UNIT-DATA-IND unit %d",unit);
#endif
i4b_decode_q931(unit, m->m_len, m->m_data);
i4b_Dfreembuf(m);
@@ -345,7 +344,7 @@ i4b_l3_tx_connect(call_desc_t *cd)
struct mbuf *m;
u_char *ptr;
- DBGL3(L3_PRIM, "tx CONNECT", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
+ NDBGL3(L3_PRIM, "unit %d, cr = 0x%02x", ctrl_desc[cd->controller].unit, cd->cr);
if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_CONNECT_LEN)) == NULL)
panic("i4b_l3_tx_connect: can't allocate mbuf\n");
@@ -369,12 +368,19 @@ i4b_l3_tx_release_complete(call_desc_t *cd, int send_cause_flag)
struct mbuf *m;
u_char *ptr;
int len = I_FRAME_HDRLEN + MSG_RELEASE_COMPLETE_LEN;
-
- DBGL3(L3_PRIM, "tx RELEASE-COMPLETE", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
if(send_cause_flag == 0)
+ {
len -= 4;
-
+ NDBGL3(L3_PRIM, "unit %d, cr = 0x%02x",
+ ctrl_desc[cd->controller].unit, cd->cr);
+ }
+ else
+ {
+ NDBGL3(L3_PRIM, "unit=%d, cr=0x%02x, cause=0x%x",
+ ctrl_desc[cd->controller].unit, cd->cr, cd->cause_out);
+ }
+
if((m = i4b_Dgetmbuf(len)) == NULL)
panic("i4b_l3_tx_release_complete: can't allocate mbuf\n");
@@ -405,7 +411,7 @@ i4b_l3_tx_disconnect(call_desc_t *cd)
struct mbuf *m;
u_char *ptr;
- DBGL3(L3_PRIM, "tx DISCONNECT", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
+ NDBGL3(L3_PRIM, "unit %d, cr = 0x%02x", ctrl_desc[cd->controller].unit, cd->cr);
if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_DISCONNECT_LEN)) == NULL)
panic("i4b_l3_tx_disconnect: can't allocate mbuf\n");
@@ -443,7 +449,7 @@ i4b_l3_tx_setup(call_desc_t *cd)
* mechanism should be used in future. (-hm)
*/
- DBGL3(L3_PRIM, "tx SETUP", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
+ NDBGL3(L3_PRIM, "unit %d, cr = 0x%02x", ctrl_desc[cd->controller].unit, cd->cr);
if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_SETUP_LEN + slen + dlen +
(cd->bprot == BPROT_NONE ? 1 : 0))) == NULL)
@@ -533,7 +539,7 @@ i4b_l3_tx_connect_ack(call_desc_t *cd)
struct mbuf *m;
u_char *ptr;
- DBGL3(L3_PRIM, "tx CONNECT-ACK", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
+ NDBGL3(L3_PRIM, "unit %d, cr = 0x%02x", ctrl_desc[cd->controller].unit, cd->cr);
if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_CONNECT_ACK_LEN)) == NULL)
panic("i4b_l3_tx_connect_ack: can't allocate mbuf\n");
@@ -557,7 +563,7 @@ i4b_l3_tx_status(call_desc_t *cd, u_char q850cause)
struct mbuf *m;
u_char *ptr;
- DBGL3(L3_PRIM, "tx STATUS", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
+ NDBGL3(L3_PRIM, "unit %d, cr = 0x%02x", ctrl_desc[cd->controller].unit, cd->cr);
if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_STATUS_LEN)) == NULL)
panic("i4b_l3_tx_status: can't allocate mbuf\n");
@@ -591,7 +597,7 @@ i4b_l3_tx_release(call_desc_t *cd, int send_cause_flag)
u_char *ptr;
int len = I_FRAME_HDRLEN + MSG_RELEASE_LEN;
- DBGL3(L3_PRIM, "tx RELEASE", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
+ NDBGL3(L3_PRIM, "unit %d, cr = 0x%02x", ctrl_desc[cd->controller].unit, cd->cr);
if(send_cause_flag == 0)
len -= 4;
@@ -629,7 +635,7 @@ i4b_l3_tx_alert(call_desc_t *cd)
if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_ALERT_LEN)) == NULL)
panic("i4b_l3_tx_alert: can't allocate mbuf\n");
- DBGL3(L3_PRIM, "tx ALERT", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
+ NDBGL3(L3_PRIM, "unit %d, cr = 0x%02x", ctrl_desc[cd->controller].unit, cd->cr);
ptr = m->m_data + I_FRAME_HDRLEN;
diff --git a/sys/i4b/layer3/i4b_l3.h b/sys/i4b/layer3/i4b_l3.h
index 3badbd8..56caf0e 100644
--- a/sys/i4b/layer3/i4b_l3.h
+++ b/sys/i4b/layer3/i4b_l3.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_l3.h - layer 3 header file
* ------------------------------
*
- * $Id: i4b_l3.h,v 1.10 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_l3.h,v 1.11 2000/04/27 09:25:21 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:04:55 1999]
+ * last edit-date: [Thu Apr 27 11:07:01 2000]
*
*---------------------------------------------------------------------------*/
diff --git a/sys/i4b/layer3/i4b_l3fsm.c b/sys/i4b/layer3/i4b_l3fsm.c
index a74c49c..c8462c7 100644
--- a/sys/i4b/layer3/i4b_l3fsm.c
+++ b/sys/i4b/layer3/i4b_l3fsm.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_l3fsm.c - layer 3 FSM
* -------------------------
*
- * $Id: i4b_l3fsm.c,v 1.18 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_l3fsm.c,v 1.22 2000/08/24 11:48:58 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:05:02 1999]
+ * last edit-date: [Mon May 29 16:56:30 2000]
*
*---------------------------------------------------------------------------*/
@@ -43,17 +43,16 @@
#if NI4BQ931 > 0
#include <sys/param.h>
-
-#if defined(__FreeBSD__)
-#else
-#include <sys/ioctl.h>
-#endif
-
+#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
+#include <sys/callout.h>
+#endif
+
#ifdef __FreeBSD__
#include <machine/i4b_debug.h>
#include <machine/i4b_ioctl.h>
@@ -114,6 +113,7 @@ static void F_309TO(call_desc_t *cd), F_DECF(call_desc_t *cd), F_FCTY(call_desc_
static void F_DECF1(call_desc_t *cd), F_DECF2(call_desc_t *cd), F_DECF3(call_desc_t *cd);
static void F_DLRI(call_desc_t *cd), F_DLRIA(call_desc_t *cd), F_DECF4(call_desc_t *cd);
+#if DO_I4B_DEBUG
static char *l3state_text[N_STATES] = {
"ST_U0 - Null",
"ST_U1 - Out Init",
@@ -176,6 +176,7 @@ static char *l3event_text[N_EVENTS] = {
"EV_ILL - Illegal event!!" /* Illegal */
};
+#endif
/*---------------------------------------------------------------------------*
* layer 3 state transition table
@@ -247,10 +248,10 @@ void next_l3state(call_desc_t *cd, int event)
if(newstate > N_STATES)
panic("i4b_l3fsm.c: newstate > N_STATES\n");
- DBGL3(L3_F_MSG, "next_l3state", ("L3 FSM event [%s]: [%s => %s]\n",
+ NDBGL3(L3_F_MSG, "L3 FSM event [%s]: [%s => %s]",
l3event_text[event],
l3state_text[currstate],
- l3state_text[newstate]));
+ l3state_text[newstate]);
/* execute function */
@@ -259,29 +260,31 @@ void next_l3state(call_desc_t *cd, int event)
if(newstate == ST_ILL)
{
newstate = currstate;
- DBGL3(L3_F_ERR, "next_l3state", ("FSM illegal state, state = %s, event = %s!\n",
+ NDBGL3(L3_F_ERR, "FSM illegal state, state = %s, event = %s!",
l3state_text[newstate],
- l3event_text[event]));
+ l3event_text[event]);
}
if(newstate != ST_SUSE)
cd->Q931state = newstate;
}
+#if DO_I4B_DEBUG
/*---------------------------------------------------------------------------*
- * resturn pointer to current state description
+ * return pointer to current state description
*---------------------------------------------------------------------------*/
char *print_l3state(call_desc_t *cd)
{
return((char *) l3state_text[cd->Q931state]);
}
+#endif
/*---------------------------------------------------------------------------*
* L3 FSM state U0 event L4 setup req
*---------------------------------------------------------------------------*/
static void F_00A(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_00A", ("FSM function F_00A executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_00A executing");
if(i4b_get_dl_stat(cd) == DL_DOWN)
{
@@ -303,7 +306,7 @@ static void F_00A(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_00H(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_00H", ("FSM function F_00H executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_00H executing");
i4b_l4_connect_ind(cd); /* tell l4 we have an incoming setup */
}
@@ -312,7 +315,7 @@ static void F_00H(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_00I(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_00I", ("FSM function F_00I executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_00I executing");
if(cd->call_state != 0)
{
@@ -327,7 +330,7 @@ static void F_00I(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_00J(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_00J", ("FSM function F_00J executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_00J executing");
i4b_l3_tx_release_complete(cd, 0); /* 0 = don't send cause */
}
@@ -336,7 +339,7 @@ static void F_00J(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_01B(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_01B", ("FSM function F_01B executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_01B executing");
/* cause from L4 */
i4b_l3_tx_disconnect(cd);
T303_stop(cd);
@@ -348,7 +351,7 @@ static void F_01B(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_01K(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_01K", ("FSM function F_01K executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_01K executing");
T303_stop(cd);
i4b_l4_disconnect_ind(cd); /* tell l4 we were rejected */
freecd_by_cd(cd);
@@ -359,7 +362,7 @@ static void F_01K(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_01L(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_01L", ("FSM function F_01L executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_01L executing");
T303_stop(cd);
/*
@@ -379,7 +382,7 @@ static void F_01L(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_01M(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_01M", ("FSM function F_01M executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_01M executing");
T303_stop(cd);
T310_start(cd);
i4b_l4_proceeding_ind(cd);
@@ -390,7 +393,7 @@ static void F_01M(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_01N(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_01N", ("FSM function F_01N executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_01N executing");
T303_stop(cd);
i4b_l4_alert_ind(cd);
}
@@ -400,7 +403,7 @@ static void F_01N(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_01O(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_01O", ("FSM function F_01O executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_01O executing");
T303_stop(cd);
i4b_l3_tx_connect_ack(cd);
i4b_l4_connect_active_ind(cd);
@@ -411,7 +414,7 @@ static void F_01O(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_01U(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_01U", ("FSM function F_01U executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_01U executing");
if(cd->T303_first_to == 1)
{
cd->T303_first_to = 0;
@@ -432,7 +435,7 @@ static void F_01U(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_03C(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_03C", ("FSM function F_03C executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_03C executing");
T310_stop(cd);
cd->cause_out = 6;
i4b_l3_tx_release(cd, 1); /* 0 = don't send cause */
@@ -445,7 +448,7 @@ static void F_03C(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_03N(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_03N", ("FSM function F_03N executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_03N executing");
T310_stop(cd);
i4b_l4_alert_ind(cd);
}
@@ -455,7 +458,7 @@ static void F_03N(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_03O(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_03O", ("FSM function F_03O executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_03O executing");
T310_stop(cd);
i4b_l3_tx_connect_ack(cd); /* CONNECT ACK to network */
i4b_l4_connect_active_ind(cd);
@@ -466,7 +469,7 @@ static void F_03O(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_03P(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_03P", ("FSM function F_03P executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_03P executing");
T310_stop(cd);
#ifdef NOTDEF
i4b_l4_progress_ind(cd);
@@ -478,7 +481,7 @@ static void F_03P(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_03Y(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_03Y", ("FSM function F_03Y executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_03Y executing");
cd->cause_out = 102; /* recovery on timer expiry */
i4b_l3_tx_disconnect(cd);
T305_start(cd);
@@ -490,7 +493,7 @@ static void F_03Y(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_04O(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_04O", ("FSM function F_04O executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_04O executing");
i4b_l3_tx_connect_ack(cd); /* CONNECT ACK to network */
i4b_l4_connect_active_ind(cd);
}
@@ -500,7 +503,7 @@ static void F_04O(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_06D(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_06D", ("FSM function F_06D executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_06D executing");
if(i4b_get_dl_stat(cd) == DL_DOWN)
{
@@ -519,7 +522,7 @@ static void F_06D(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_06E(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_06E", ("FSM function F_06E executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_06E executing");
if(i4b_get_dl_stat(cd) == DL_DOWN)
{
@@ -539,7 +542,7 @@ static void F_06E(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_06F(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_06F", ("FSM function F_06F executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_06F executing");
if(i4b_get_dl_stat(cd) == DL_DOWN)
{
@@ -561,7 +564,7 @@ static void F_06F(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_06G(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_06G", ("FSM function F_06G executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_06G executing");
freecd_by_cd(cd);
}
@@ -570,7 +573,7 @@ static void F_06G(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_06J(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_06J", ("FSM function F_06J executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_06J executing");
i4b_l3_tx_release_complete(cd, 0);
i4b_l4_disconnect_ind(cd);
freecd_by_cd(cd);
@@ -581,7 +584,7 @@ static void F_06J(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_06Q(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_06Q", ("FSM function F_06Q executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_06Q executing");
i4b_l4_disconnect_ind(cd);
}
@@ -590,7 +593,7 @@ static void F_06Q(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_07E(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_07E", ("FSM function F_07E executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_07E executing");
i4b_l3_tx_connect(cd);
T313_start(cd);
}
@@ -600,7 +603,7 @@ static void F_07E(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_07F(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_07F", ("FSM function F_07F executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_07F executing");
i4b_l3_tx_release_complete(cd, 1);
freecd_by_cd(cd);
}
@@ -610,7 +613,7 @@ static void F_07F(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_07G(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_07G", ("FSM function F_07G executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_07G executing");
freecd_by_cd(cd);
}
@@ -619,7 +622,7 @@ static void F_07G(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_08R(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_08R", ("FSM function F_08R executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_08R executing");
T313_stop(cd);
i4b_l4_connect_active_ind(cd);
}
@@ -629,7 +632,7 @@ static void F_08R(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_08Z(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_08Z", ("FSM function F_08Z executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_08Z executing");
cd->cause_out = 102; /* recovery on timer expiry */
i4b_l3_tx_disconnect(cd);
T305_start(cd);
@@ -641,7 +644,7 @@ static void F_08Z(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_09D(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_09D", ("FSM function F_09D executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_09D executing");
i4b_l3_tx_alert(cd);
}
@@ -650,7 +653,7 @@ static void F_09D(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_09E(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_09E", ("FSM function F_09E executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_09E executing");
i4b_l3_tx_connect(cd);
T313_start(cd);
}
@@ -660,7 +663,7 @@ static void F_09E(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_09F(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_09F", ("FSM function F_09F executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_09F executing");
i4b_l3_tx_release_complete(cd, 1);
freecd_by_cd(cd);
}
@@ -669,7 +672,7 @@ static void F_09F(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_09G(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_09G", ("FSM function F_09G executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_09G executing");
freecd_by_cd(cd);
}
@@ -678,7 +681,7 @@ static void F_09G(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_11J(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_11J", ("FSM function F_11J executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_11J executing");
T305_stop(cd);
i4b_l3_tx_release_complete(cd, 0);
i4b_l4_disconnect_ind(cd);
@@ -690,7 +693,7 @@ static void F_11J(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_11Q(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_11Q", ("FSM function F_11Q executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_11Q executing");
T305_stop(cd);
i4b_l3_tx_release(cd, 0);
cd->T308_first_to = 1;
@@ -702,7 +705,7 @@ static void F_11Q(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_11V(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_11V", ("FSM function F_11V executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_11V executing");
cd->cause_out = 102;
i4b_l3_tx_release(cd, 1);
cd->T308_first_to = 1;
@@ -714,7 +717,7 @@ static void F_11V(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_12C(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_12C", ("FSM function F_12C executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_12C executing");
i4b_l3_tx_release(cd, 1);
cd->T308_first_to = 1;
T308_start(cd);
@@ -725,7 +728,7 @@ static void F_12C(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_12J(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_12J", ("FSM function F_12J executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_12J executing");
i4b_l3_tx_release_complete(cd, 0);
i4b_l4_disconnect_ind(cd);
freecd_by_cd(cd);
@@ -736,7 +739,7 @@ static void F_12J(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_19I(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_19I", ("FSM function F_19I executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_19I executing");
if(cd->call_state == 0)
{
@@ -755,7 +758,7 @@ static void F_19I(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_19J(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_19J", ("FSM function F_19J executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_19J executing");
T308_stop(cd);
i4b_l4_disconnect_ind(cd);
freecd_by_cd(cd);
@@ -766,7 +769,7 @@ static void F_19J(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_19K(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_19K", ("FSM function F_19K executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_19K executing");
T308_stop(cd);
i4b_l4_disconnect_ind(cd);
freecd_by_cd(cd);
@@ -777,7 +780,7 @@ static void F_19K(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_19W(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_19W", ("FSM function F_19W executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_19W executing");
if(cd->T308_first_to == 0)
{
cd->T308_first_to = 1;
@@ -806,7 +809,7 @@ static void F_NCNA(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_STENQ(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_STENQ", ("FSM function F_STENQ executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_STENQ executing");
i4b_l3_tx_status(cd, CAUSE_Q850_STENQRSP); /* 30, resonse to stat enq */
}
@@ -815,7 +818,7 @@ static void F_STENQ(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_STAT(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_STAT", ("FSM function F_STAT executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_STAT executing");
if(cd->call_state == 0)
{
i4b_l4_status_ind(cd);
@@ -839,7 +842,7 @@ static void F_STAT(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_INFO(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_INFO", ("FSM function F_INFO executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_INFO executing");
i4b_l4_info_ind(cd);
/* remain in current state */
}
@@ -849,7 +852,7 @@ static void F_INFO(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_RELCP(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_RELCP", ("FSM function F_RELCP executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_RELCP executing");
i4b_l3_stop_all_timers(cd);
i4b_l4_disconnect_ind(cd);
freecd_by_cd(cd);
@@ -860,7 +863,7 @@ static void F_RELCP(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_REL(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_REL", ("FSM function F_REL executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_REL executing");
i4b_l3_stop_all_timers(cd);
i4b_l3_tx_release_complete(cd, 0);
i4b_l4_disconnect_ind(cd);
@@ -872,7 +875,7 @@ static void F_REL(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_DISC(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_DISC", ("FSM function F_DISC executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_DISC executing");
i4b_l3_stop_all_timers(cd);
/*
@@ -891,7 +894,7 @@ static void F_DISC(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_DCRQ(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_DCRQ", ("FSM function F_DCRQ executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_DCRQ executing");
/* stop T310 in case this is the result of an incoming call for a */
/* calledback connection */
@@ -910,7 +913,7 @@ static void F_DCRQ(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_UEM(call_desc_t *cd)
{
- DBGL3(L3_F_ERR, "F_UEM", ("FSM function F_UEM executing, state = %s\n", print_l3state(cd)));
+ NDBGL3(L3_F_ERR, "FSM function F_UEM executing, state = %s", print_l3state(cd));
i4b_l3_tx_status(cd, CAUSE_Q850_MSGNCWCS); /* 101, message not compatible with call state */
}
@@ -919,7 +922,7 @@ static void F_UEM(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_SIGN(call_desc_t *cd)
{
- DBGL3(L3_F_ERR, "F_SIGN", ("FSM function F_SIGN executing\n"));
+ NDBGL3(L3_F_ERR, "FSM function F_SIGN executing");
/* XXX */ /* freecd_by_cd(cd); ?????????? XXX */
}
@@ -929,7 +932,7 @@ static void F_SIGN(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_DLEI(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_DLEI", ("FSM function F_DLEI executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_DLEI executing");
/* XXX */
@@ -941,7 +944,7 @@ static void F_DLEI(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_ILL(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_ILL", ("FSM function F_ILL executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_ILL executing");
}
/*---------------------------------------------------------------------------*
@@ -949,7 +952,7 @@ static void F_ILL(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_309TO(call_desc_t *cd)
{
- DBGL3(L3_F_ERR, "F_309TO", ("FSM function F_309TO executing\n"));
+ NDBGL3(L3_F_ERR, "FSM function F_309TO executing");
/* XXX */
@@ -965,7 +968,7 @@ static void F_309TO(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_FCTY(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_FCTY", ("FSM function F_FCTY executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_FCTY executing");
/* ST_SUSE, no change in state ! */
}
@@ -974,7 +977,7 @@ static void F_FCTY(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_DECF1(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_DECF1", ("FSM function F_DECF1 executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_DECF1 executing");
i4b_l3_tx_setup(cd);
}
@@ -983,7 +986,7 @@ static void F_DECF1(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_DECF2(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_DECF2", ("FSM function F_DECF2 executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_DECF2 executing");
i4b_l3_tx_connect(cd);
}
@@ -992,7 +995,7 @@ static void F_DECF2(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_DECF3(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_DECF3", ("FSM function F_DECF3 executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_DECF3 executing");
i4b_l3_tx_release_complete(cd, 1);
freecd_by_cd(cd);
}
@@ -1002,7 +1005,7 @@ static void F_DECF3(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_DECF4(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_DECF4", ("FSM function F_DECF4 executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_DECF4 executing");
i4b_l3_tx_alert(cd);
}
@@ -1012,7 +1015,7 @@ static void F_DECF4(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_DECF(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_DECF", ("FSM function F_DECF executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_DECF executing");
T309_stop(cd);
i4b_l3_tx_status(cd, CAUSE_Q850_NORMUNSP); /* 31, normal unspecified */
}
@@ -1022,7 +1025,7 @@ static void F_DECF(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_DLRI(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_DLRI", ("FSM function F_DLRI executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_DLRI executing");
i4b_l3_stop_all_timers(cd);
i4b_l4_disconnect_ind(cd);
freecd_by_cd(cd);
@@ -1033,7 +1036,7 @@ static void F_DLRI(call_desc_t *cd)
*---------------------------------------------------------------------------*/
static void F_DLRIA(call_desc_t *cd)
{
- DBGL3(L3_F_MSG, "F_DLRIA", ("FSM function F_DLRIA executing\n"));
+ NDBGL3(L3_F_MSG, "FSM function F_DLRIA executing");
if(cd->T309 == TIMER_IDLE)
T309_start(cd);
diff --git a/sys/i4b/layer3/i4b_l3fsm.h b/sys/i4b/layer3/i4b_l3fsm.h
index 1980ae0..0b1c76d 100644
--- a/sys/i4b/layer3/i4b_l3fsm.h
+++ b/sys/i4b/layer3/i4b_l3fsm.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_l3fsm.c - layer 3 FSM
* -------------------------
*
- * $Id: i4b_l3fsm.h,v 1.7 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_l3fsm.h,v 1.8 2000/04/27 09:25:22 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:05:09 1999]
+ * last edit-date: [Thu Apr 27 11:07:16 2000]
*
*---------------------------------------------------------------------------*/
diff --git a/sys/i4b/layer3/i4b_l3timer.c b/sys/i4b/layer3/i4b_l3timer.c
index 261f8de..66dffe4 100644
--- a/sys/i4b/layer3/i4b_l3timer.c
+++ b/sys/i4b/layer3/i4b_l3timer.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_l3timer.c - timer and timeout handling for layer 3
* ------------------------------------------------------
*
- * $Id: i4b_l3timer.c,v 1.14 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_l3timer.c,v 1.17 2000/08/24 11:48:58 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:05:18 1999]
+ * last edit-date: [Thu Aug 24 12:49:50 2000]
*
*---------------------------------------------------------------------------*/
@@ -43,18 +43,16 @@
#if NI4BQ931 > 0
#include <sys/param.h>
-
-#if defined(__FreeBSD__)
-#else
-#include <sys/ioctl.h>
-#endif
-
#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
+#include <sys/callout.h>
+#endif
+
#ifdef __FreeBSD__
#include <machine/i4b_debug.h>
#include <machine/i4b_ioctl.h>
@@ -94,7 +92,7 @@ void i4b_l3_stop_all_timers(call_desc_t *cd)
static void
T303_timeout(call_desc_t *cd)
{
- DBGL3(L3_T_ERR, "T303_timeout", ("SETUP not answered, cr = %d\n", cd->cr));
+ NDBGL3(L3_T_ERR, "SETUP not answered, cr = %d", cd->cr);
next_l3state(cd, EV_T303EXP);
}
@@ -107,14 +105,10 @@ T303_start(call_desc_t *cd)
if (cd->T303 == TIMER_ACTIVE)
return;
- DBGL3(L3_T_MSG, "T303_start", ("cr = %d\n", cd->cr));
+ NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
cd->T303 = TIMER_ACTIVE;
-#if defined(__FreeBSD__)
- cd->T303_callout = timeout((TIMEOUT_FUNC_T)T303_timeout, (void *)cd, T303VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T303_timeout, (void *)cd, T303VAL);
-#endif
+ START_TIMER(cd->T303_callout, T303_timeout, cd, T303VAL);
}
/*---------------------------------------------------------------------------*
@@ -128,15 +122,11 @@ T303_stop(call_desc_t *cd)
if(cd->T303 != TIMER_IDLE)
{
-#if defined(__FreeBSD__)
- untimeout((TIMEOUT_FUNC_T)T303_timeout, (void *)cd, cd->T303_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T303_timeout, (void *)cd);
-#endif
+ STOP_TIMER(cd->T303_callout, T303_timeout, cd);
cd->T303 = TIMER_IDLE;
}
CRIT_END;
- DBGL3(L3_T_MSG, "T303_stop", ("cr = %d\n", cd->cr));
+ NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
}
/*---------------------------------------------------------------------------*
@@ -145,7 +135,7 @@ T303_stop(call_desc_t *cd)
static void
T305_timeout(call_desc_t *cd)
{
- DBGL3(L3_T_ERR, "T305_timeout", ("DISC not answered, cr = %d\n", cd->cr));
+ NDBGL3(L3_T_ERR, "DISC not answered, cr = %d", cd->cr);
next_l3state(cd, EV_T305EXP);
}
@@ -158,14 +148,10 @@ T305_start(call_desc_t *cd)
if (cd->T305 == TIMER_ACTIVE)
return;
- DBGL3(L3_T_MSG, "T305_start", ("cr = %d\n", cd->cr));
+ NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
cd->T305 = TIMER_ACTIVE;
-#if defined(__FreeBSD__)
- cd->T305_callout = timeout((TIMEOUT_FUNC_T)T305_timeout, (void *)cd, T305VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T305_timeout, (void *)cd, T305VAL);
-#endif
+ START_TIMER(cd->T305_callout, T305_timeout, cd, T305VAL);
}
/*---------------------------------------------------------------------------*
@@ -179,16 +165,12 @@ T305_stop(call_desc_t *cd)
if(cd->T305 != TIMER_IDLE)
{
-#if defined(__FreeBSD__)
- untimeout((TIMEOUT_FUNC_T)T305_timeout, (void *)cd, cd->T305_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T305_timeout, (void *)cd);
-#endif
+ STOP_TIMER(cd->T305_callout, T305_timeout, cd);
cd->T305 = TIMER_IDLE;
}
CRIT_END;
- DBGL3(L3_T_MSG, "T305_stop", ("cr = %d\n", cd->cr));
+ NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
}
/*---------------------------------------------------------------------------*
@@ -197,7 +179,7 @@ T305_stop(call_desc_t *cd)
static void
T308_timeout(call_desc_t *cd)
{
- DBGL3(L3_T_ERR, "T308_timeout", ("REL not answered, cr = %d\n", cd->cr));
+ NDBGL3(L3_T_ERR, "REL not answered, cr = %d", cd->cr);
next_l3state(cd, EV_T308EXP);
}
@@ -210,14 +192,10 @@ T308_start(call_desc_t *cd)
if(cd->T308 == TIMER_ACTIVE)
return;
- DBGL3(L3_T_MSG, "T308_start", ("cr = %d\n", cd->cr));
+ NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
cd->T308 = TIMER_ACTIVE;
-#if defined(__FreeBSD__)
- cd->T308_callout = timeout((TIMEOUT_FUNC_T)T308_timeout, (void *)cd, T308VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T308_timeout, (void *)cd, T308VAL);
-#endif
+ START_TIMER(cd->T308_callout, T308_timeout, cd, T308VAL);
}
/*---------------------------------------------------------------------------*
@@ -231,16 +209,12 @@ T308_stop(call_desc_t *cd)
if(cd->T308 != TIMER_IDLE)
{
-#if defined(__FreeBSD__)
- untimeout((TIMEOUT_FUNC_T)T308_timeout, (void *)cd, cd->T308_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T308_timeout, (void *)cd);
-#endif
+ STOP_TIMER(cd->T308_callout, T308_timeout, cd);
cd->T308 = TIMER_IDLE;
}
CRIT_END;
- DBGL3(L3_T_MSG, "T308_stop", ("cr = %d\n", cd->cr));
+ NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
}
/*---------------------------------------------------------------------------*
@@ -249,7 +223,7 @@ T308_stop(call_desc_t *cd)
static void
T309_timeout(call_desc_t *cd)
{
- DBGL3(L3_T_ERR, "T309_timeout", ("datalink not reconnected, cr = %d\n", cd->cr));
+ NDBGL3(L3_T_ERR, "datalink not reconnected, cr = %d", cd->cr);
next_l3state(cd, EV_T309EXP);
}
@@ -262,14 +236,10 @@ T309_start(call_desc_t *cd)
if (cd->T309 == TIMER_ACTIVE)
return;
- DBGL3(L3_T_MSG, "T309_start", ("cr = %d\n", cd->cr));
+ NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
cd->T309 = TIMER_ACTIVE;
-#if defined(__FreeBSD__)
- cd->T309_callout = timeout((TIMEOUT_FUNC_T)T309_timeout, (void *)cd, T309VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T309_timeout, (void *)cd, T309VAL);
-#endif
+ START_TIMER(cd->T309_callout, T309_timeout, cd, T309VAL);
}
/*---------------------------------------------------------------------------*
@@ -283,16 +253,12 @@ T309_stop(call_desc_t *cd)
if(cd->T309 != TIMER_IDLE)
{
-#if defined(__FreeBSD__)
- untimeout((TIMEOUT_FUNC_T)T309_timeout, (void *)cd, cd->T309_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T309_timeout, (void *)cd);
-#endif
+ STOP_TIMER(cd->T309_callout, T309_timeout, cd);
cd->T309 = TIMER_IDLE;
}
CRIT_END;
- DBGL3(L3_T_MSG, "T309_stop", ("cr = %d\n", cd->cr));
+ NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
}
/*---------------------------------------------------------------------------*
@@ -301,7 +267,7 @@ T309_stop(call_desc_t *cd)
static void
T310_timeout(call_desc_t *cd)
{
- DBGL3(L3_T_ERR, "T310_timeout", ("CALL PROC timeout, cr = %d\n", cd->cr));
+ NDBGL3(L3_T_ERR, "CALL PROC timeout, cr = %d", cd->cr);
next_l3state(cd, EV_T310EXP);
}
@@ -314,14 +280,10 @@ T310_start(call_desc_t *cd)
if (cd->T310 == TIMER_ACTIVE)
return;
- DBGL3(L3_T_MSG, "T310_start", ("cr = %d\n", cd->cr));
+ NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
cd->T310 = TIMER_ACTIVE;
-#if defined(__FreeBSD__)
- cd->T310_callout = timeout((TIMEOUT_FUNC_T)T310_timeout, (void *)cd, T310VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T310_timeout, (void *)cd, T310VAL);
-#endif
+ START_TIMER(cd->T310_callout, T310_timeout, cd, T310VAL);
}
/*---------------------------------------------------------------------------*
@@ -335,16 +297,12 @@ T310_stop(call_desc_t *cd)
if(cd->T310 != TIMER_IDLE)
{
-#if defined(__FreeBSD__)
- untimeout((TIMEOUT_FUNC_T)T310_timeout, (void *)cd, cd->T310_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T310_timeout, (void *)cd);
-#endif
+ STOP_TIMER(cd->T310_callout, T310_timeout, cd);
cd->T310 = TIMER_IDLE;
}
CRIT_END;
- DBGL3(L3_T_MSG, "T310_stop", ("cr = %d\n", cd->cr));
+ NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
}
/*---------------------------------------------------------------------------*
@@ -353,7 +311,7 @@ T310_stop(call_desc_t *cd)
static void
T313_timeout(call_desc_t *cd)
{
- DBGL3(L3_T_ERR, "T313_timeout", ("CONN ACK not received, cr = %d\n", cd->cr));
+ NDBGL3(L3_T_ERR, "CONN ACK not received, cr = %d", cd->cr);
next_l3state(cd, EV_T313EXP);
}
@@ -366,14 +324,10 @@ T313_start(call_desc_t *cd)
if (cd->T313 == TIMER_ACTIVE)
return;
- DBGL3(L3_T_MSG, "T313_start", ("cr = %d\n", cd->cr));
+ NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
cd->T313 = TIMER_ACTIVE;
-#if defined(__FreeBSD__)
- cd->T313_callout = timeout((TIMEOUT_FUNC_T)T313_timeout, (void *)cd, T313VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T313_timeout, (void *)cd, T313VAL);
-#endif
+ START_TIMER(cd->T313_callout, T313_timeout, cd, T313VAL);
}
/*---------------------------------------------------------------------------*
@@ -388,15 +342,11 @@ T313_stop(call_desc_t *cd)
if(cd->T313 != TIMER_IDLE)
{
cd->T313 = TIMER_IDLE;
-#if defined(__FreeBSD__)
- untimeout((TIMEOUT_FUNC_T)T313_timeout, (void *)cd, cd->T313_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T313_timeout, (void *)cd);
-#endif
+ STOP_TIMER(cd->T313_callout, T313_timeout, cd);
}
CRIT_END;
- DBGL3(L3_T_MSG, "T313_stop", ("cr = %d\n", cd->cr));
+ NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
}
#endif /* NI4BQ931 > 0 */
diff --git a/sys/i4b/layer3/i4b_l4if.c b/sys/i4b/layer3/i4b_l4if.c
index 0062d97..a963288 100644
--- a/sys/i4b/layer3/i4b_l4if.c
+++ b/sys/i4b/layer3/i4b_l4if.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_l4if.c - Layer 3 interface to Layer 4
* -------------------------------------------
*
- * $Id: i4b_l4if.c,v 1.22 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_l4if.c,v 1.27 2000/08/24 11:48:58 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:05:25 1999]
+ * last edit-date: [Fri Jun 2 14:32:19 2000]
*
*---------------------------------------------------------------------------*/
@@ -43,17 +43,16 @@
#if NI4BQ931 > 0
#include <sys/param.h>
-
-#if defined(__FreeBSD__)
-#else
-#include <sys/ioctl.h>
-#endif
-
+#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
+#include <sys/callout.h>
+#endif
+
#ifdef __FreeBSD__
#include <machine/i4b_debug.h>
#include <machine/i4b_ioctl.h>
@@ -83,7 +82,7 @@ static void n_connect_request(u_int cdid);
static void n_connect_response(u_int cdid, int response, int cause);
static void n_disconnect_request(u_int cdid, int cause);
static void n_alert_request(u_int cdid);
-static void n_mgmt_command(int unit, int cmd, int parm);
+static void n_mgmt_command(int unit, int cmd, void *parm);
/*---------------------------------------------------------------------------*
* i4b_mdl_status_ind - status indication from lower layers
@@ -94,12 +93,12 @@ i4b_mdl_status_ind(int unit, int status, int parm)
int sendup;
int i;
- DBGL3(L3_MSG, "i4b_mdl_status_ind", ("unit = %d, status = %d, parm = %d\n", unit, status, parm));
+ NDBGL3(L3_MSG, "unit = %d, status = %d, parm = %d", unit, status, parm);
switch(status)
{
case STI_ATTACH:
- DBGL3(L3_MSG, "i4b_mdl_status_ind", ("STI_ATTACH: attaching unit %d to controller %d\n", unit, nctrl));
+ NDBGL3(L3_MSG, "STI_ATTACH: attaching unit %d to controller %d", unit, nctrl);
/* init function pointers */
@@ -107,8 +106,6 @@ i4b_mdl_status_ind(int unit, int status, int parm)
ctrl_desc[nctrl].N_CONNECT_RESPONSE = n_connect_response;
ctrl_desc[nctrl].N_DISCONNECT_REQUEST = n_disconnect_request;
ctrl_desc[nctrl].N_ALERT_REQUEST = n_alert_request;
- ctrl_desc[nctrl].N_SET_TRACE = isic_settrace;
- ctrl_desc[nctrl].N_GET_TRACE = isic_gettrace;
ctrl_desc[nctrl].N_DOWNLOAD = NULL; /* only used by active cards */
ctrl_desc[nctrl].N_DIAGNOSTICS = NULL; /* only used by active cards */
ctrl_desc[nctrl].N_MGMT_COMMAND = n_mgmt_command;
@@ -138,22 +135,22 @@ i4b_mdl_status_ind(int unit, int status, int parm)
case STI_L1STAT:
i4b_l4_l12stat(unit, 1, parm);
- DBGL3(L3_MSG, "i4b_mdl_status_ind", ("STI_L1STAT: unit %d layer 1 = %s\n", unit, status ? "up" : "down"));
+ NDBGL3(L3_MSG, "STI_L1STAT: unit %d layer 1 = %s", unit, status ? "up" : "down");
break;
case STI_L2STAT:
i4b_l4_l12stat(unit, 2, parm);
- DBGL3(L3_MSG, "i4b_mdl_status_ind", ("STI_L2STAT: unit %d layer 2 = %s\n", unit, status ? "up" : "down"));
+ NDBGL3(L3_MSG, "STI_L2STAT: unit %d layer 2 = %s", unit, status ? "up" : "down");
break;
case STI_TEIASG:
ctrl_desc[unit].tei = parm;
i4b_l4_teiasg(unit, parm);
- DBGL3(L3_MSG, "i4b_mdl_status_ind", ("STI_TEIASG: unit %d TEI = %d = 0x%02x\n", unit, parm, parm));
+ NDBGL3(L3_MSG, "STI_TEIASG: unit %d TEI = %d = 0x%02x", unit, parm, parm);
break;
case STI_PDEACT: /* L1 T4 timeout */
- DBGL3(L3_ERR, "i4b_mdl_status_ind", ("STI_PDEACT: unit %d TEI = %d = 0x%02x\n", unit, parm, parm));
+ NDBGL3(L3_ERR, "STI_PDEACT: unit %d TEI = %d = 0x%02x", unit, parm, parm);
sendup = 0;
@@ -181,7 +178,7 @@ i4b_mdl_status_ind(int unit, int status, int parm)
break;
case STI_NOL1ACC: /* no outgoing access to S0 */
- DBGL3(L3_ERR, "i4b_mdl_status_ind", ("STI_NOL1ACC: unit %d no outgoing access to S0\n", unit));
+ NDBGL3(L3_ERR, "STI_NOL1ACC: unit %d no outgoing access to S0", unit);
for(i=0; i < N_CALL_DESC; i++)
{
@@ -204,7 +201,7 @@ i4b_mdl_status_ind(int unit, int status, int parm)
break;
default:
- DBGL3(L3_ERR, "i4b_mdl_status_ind", ("ERROR, unit %d, unknown status value %d!\n", unit, status));
+ NDBGL3(L3_ERR, "ERROR, unit %d, unknown status value %d!", unit, status);
break;
}
return(0);
@@ -214,14 +211,14 @@ i4b_mdl_status_ind(int unit, int status, int parm)
* send command to the lower layers
*---------------------------------------------------------------------------*/
static void
-n_mgmt_command(int unit, int cmd, int parm)
+n_mgmt_command(int unit, int cmd, void *parm)
{
int i;
switch(cmd)
{
case CMR_DOPEN:
- DBGL3(L3_MSG, "n_mgmt_command", ("CMR_DOPEN for unit %d\n", unit));
+ NDBGL3(L3_MSG, "CMR_DOPEN for unit %d", unit);
for(i=0; i < N_CALL_DESC; i++)
{
@@ -239,12 +236,16 @@ n_mgmt_command(int unit, int cmd, int parm)
break;
case CMR_DCLOSE:
- DBGL3(L3_MSG, "n_mgmt_command", ("CMR_DCLOSE for unit %d\n", unit));
+ NDBGL3(L3_MSG, "CMR_DCLOSE for unit %d", unit);
break;
- default:
+ case CMR_SETTRACE:
+ NDBGL3(L3_MSG, "CMR_SETTRACE for unit %d", unit);
break;
+ default:
+ NDBGL3(L3_MSG, "unknown cmd %d for unit %d", cmd, unit);
+ break;
}
MDL_Command_Req(unit, cmd, parm);
@@ -300,7 +301,7 @@ n_connect_response(u_int cdid, int response, int cause)
default: /* failsafe */
next_l3state(cd, EV_SETDCRS);
chstate = BCH_ST_FREE;
- DBGL3(L3_ERR, "n_connect_response", ("unknown response, doing SETUP_RESP_DNTCRE"));
+ NDBGL3(L3_ERR, "unknown response, doing SETUP_RESP_DNTCRE");
break;
}
@@ -310,7 +311,7 @@ n_connect_response(u_int cdid, int response, int cause)
}
else
{
- DBGL3(L3_MSG, "n_connect_response", ("Warning, invalid channelid %d, response = %d\n", cd->channelid, response));
+ NDBGL3(L3_MSG, "Warning, invalid channelid %d, response = %d\n", cd->channelid, response);
}
}
diff --git a/sys/i4b/layer3/i4b_q931.c b/sys/i4b/layer3/i4b_q931.c
index 06ccbdc..3e8f7ff 100644
--- a/sys/i4b/layer3/i4b_q931.c
+++ b/sys/i4b/layer3/i4b_q931.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_q931.c - Q931 received messages handling
* --------------------------------------------
*
- * $Id: i4b_q931.c,v 1.23 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_q931.c,v 1.32 2000/08/24 11:48:58 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:05:33 1999]
+ * last edit-date: [Mon May 29 16:56:52 2000]
*
*---------------------------------------------------------------------------*/
@@ -44,17 +44,16 @@
#if NI4BQ931 > 0
#include <sys/param.h>
-
-#if defined(__FreeBSD__)
-#else
-#include <sys/ioctl.h>
-#endif
-
+#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
+#include <sys/callout.h>
+#endif
+
#ifdef __FreeBSD__
#include <machine/i4b_debug.h>
#include <machine/i4b_ioctl.h>
@@ -97,6 +96,8 @@ unsigned char cause_tab_q931[CAUSE_I4B_MAX] = {
CAUSE_Q850_CALLREJ, /* CAUSE_I4B_REJECT -> call rejected */
CAUSE_Q850_DSTOOORDR, /* CAUSE_I4B_OOO -> destination out of order */
CAUSE_Q850_TMPFAIL, /* CAUSE_I4B_TMPFAIL -> temporary failure */
+ CAUSE_Q850_USRBSY, /* CAUSE_I4B_L1ERROR -> L1 error / persistent deact XXX */
+ CAUSE_Q850_USRBSY, /* CAUSE_I4B_LLDIAL -> no dialout on leased line XXX */
};
/*---------------------------------------------------------------------------*
@@ -134,9 +135,16 @@ i4b_decode_q931(int unit, int msg_len, u_char *msg_ptr)
if(*msg_ptr != PD_Q931)
{
- DBGL3(L3_P_ERR, "i4b_decode_q931", ("protocol discriminator 0x%x != Q.931\n", *msg_ptr));
+ static int protoflag = -1; /* print only once .. */
+
+ if(*msg_ptr != protoflag)
+ {
+ NDBGL3(L3_P_ERR, "unknown protocol discriminator 0x%x!", *msg_ptr);
+ protoflag = *msg_ptr;
+ }
return;
}
+
msg_ptr++;
msg_len--;
@@ -168,7 +176,7 @@ i4b_decode_q931(int unit, int msg_len, u_char *msg_ptr)
crflag = 0;
}
- DBGL3(L3_P_MSG, "i4b_decode_q931", ("Call Ref, len %d, val %d, flag %d\n", crlen, crval, crflag));
+ NDBGL3(L3_P_MSG, "Call Ref, len %d, val %d, flag %d", crlen, crval, crflag);
/* find or allocate calldescriptor */
@@ -190,7 +198,7 @@ i4b_decode_q931(int unit, int msg_len, u_char *msg_ptr)
{
/*XXX*/ if(crval != 0) /* ignore global call references */
{
- DBGL3(L3_P_ERR, "i4b_decode_q931", ("cannot find calldescriptor for cr = 0x%x, crflag = 0x%x, msg = 0x%x, frame = ", crval, crflag, *msg_ptr));
+ NDBGL3(L3_P_ERR, "cannot find calldescriptor for cr = 0x%x, crflag = 0x%x, msg = 0x%x, frame = ", crval, crflag, *msg_ptr);
i4b_print_frame(msg_len, msg_ptr);
}
splx(s);
@@ -223,7 +231,7 @@ i4b_decode_q931(int unit, int msg_len, u_char *msg_ptr)
if((shift_flag != SHIFTED) &&
(codeset <= old_codeset))
{
- DBGL3(L3_P_ERR, "i4b_decode_q931", ("Q.931 lockingshift proc violation, shift %d -> %d\n", old_codeset, codeset));
+ NDBGL3(L3_P_ERR, "Q.931 lockingshift proc violation, shift %d -> %d", old_codeset, codeset);
codeset = old_codeset;
}
msg_len--;
@@ -241,7 +249,7 @@ i4b_decode_q931(int unit, int msg_len, u_char *msg_ptr)
break;
default:
- DBGL3(L3_P_ERR, "i4b_decode_q931", ("unknown codeset %d, ", codeset));
+ NDBGL3(L3_P_ERR, "unknown codeset %d, ", codeset);
i4b_print_frame(msg_len, msg_ptr);
msg_len = 0;
break;
@@ -269,15 +277,23 @@ i4b_decode_q931_cs0_ie(int unit, call_desc_t *cd, int msg_len, u_char *msg_ptr)
switch(*msg_ptr)
{
+
+/*********/
+/* Q.931 */
+/*********/
/* single byte IE's */
case IEI_SENDCOMPL:
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_SENDCOMPL\n"));
+ NDBGL3(L3_P_MSG, "IEI_SENDCOMPL");
return(1);
break;
/* multi byte IE's */
+ case IEI_SEGMMSG: /* segmented message */
+ NDBGL3(L3_P_MSG, "IEI_SEGMENTED_MESSAGE");
+ break;
+
case IEI_BEARERCAP: /* bearer capability */
switch(msg_ptr[2])
{
@@ -285,17 +301,17 @@ i4b_decode_q931_cs0_ie(int unit, call_desc_t *cd, int msg_len, u_char *msg_ptr)
case 0x89: /* restricted digital info */
case 0x90: /* 3.1KHz audio */
/* XXX */ cd->bprot = BPROT_NONE;
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_BEARERCAP - Telephony\n"));
+ NDBGL3(L3_P_MSG, "IEI_BEARERCAP - Telephony");
break;
case 0x88: /* unrestricted digital info */
/* XXX */ cd->bprot = BPROT_RHDLC;
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_BEARERCAP - Raw HDLC\n"));
+ NDBGL3(L3_P_MSG, "IEI_BEARERCAP - Raw HDLC");
break;
default:
/* XXX */ cd->bprot = BPROT_NONE;
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_BEARERCAP - No Protocol\n"));
+ NDBGL3(L3_P_ERR, "IEI_BEARERCAP - Unsupported B-Protocol 0x%x", msg_ptr[2]);
break;
}
break;
@@ -304,20 +320,29 @@ i4b_decode_q931_cs0_ie(int unit, call_desc_t *cd, int msg_len, u_char *msg_ptr)
if(msg_ptr[2] & 0x80)
{
cd->cause_in = msg_ptr[3] & 0x7f;
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CAUSE = %d\n", msg_ptr[3] & 0x7f));
+ NDBGL3(L3_P_MSG, "IEI_CAUSE = %d", msg_ptr[3] & 0x7f);
}
else
{
cd->cause_in = msg_ptr[4] & 0x7f;
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CAUSE = %d\n", msg_ptr[4] & 0x7f));
+ NDBGL3(L3_P_MSG, "IEI_CAUSE = %d", msg_ptr[4] & 0x7f);
}
break;
+ case IEI_CALLID: /* call identity */
+ NDBGL3(L3_P_MSG, "IEI_CALL_IDENTITY");
+ break;
+
+ case IEI_CALLSTATE: /* call state */
+ cd->call_state = msg_ptr[2] & 0x3f;
+ NDBGL3(L3_P_MSG, "IEI_CALLSTATE = %d", cd->call_state);
+ break;
+
case IEI_CHANNELID: /* channel id */
if((msg_ptr[2] & 0xf4) != 0x80)
{
cd->channelid = CHAN_NO;
- DBGL3(L3_P_ERR, "i4b_decode_q931_cs0_ie", ("IEI_CHANNELID, unsupported value 0x%x\n", msg_ptr[2]));
+ NDBGL3(L3_P_ERR, "IEI_CHANNELID, unsupported value 0x%x", msg_ptr[2]);
}
else
{
@@ -338,7 +363,7 @@ i4b_decode_q931_cs0_ie(int unit, call_desc_t *cd, int msg_len, u_char *msg_ptr)
}
cd->channelexcl = (msg_ptr[2] & 0x08) >> 3;
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CHANNELID - channel %d, exclusive = %d\n", cd->channelid, cd->channelexcl));
+ NDBGL3(L3_P_MSG, "IEI_CHANNELID - channel %d, exclusive = %d", cd->channelid, cd->channelexcl);
/* if this is a setup message, reserve channel */
@@ -349,102 +374,149 @@ i4b_decode_q931_cs0_ie(int unit, call_desc_t *cd, int msg_len, u_char *msg_ptr)
if(ctrl_desc[cd->controller].bch_state[cd->channelid] == BCH_ST_FREE)
ctrl_desc[cd->controller].bch_state[cd->channelid] = BCH_ST_RSVD;
else
- DBGL3(L3_P_ERR, "i4b_decode_q931_cs0_ie", ("IE ChannelID, Channel NOT free!!\n"));
+ NDBGL3(L3_P_ERR, "IE ChannelID, Channel NOT free!!");
}
else if(cd->channelid == CHAN_NO)
{
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IE ChannelID, SETUP with channel = No channel (CW)\n"));
+ NDBGL3(L3_P_MSG, "IE ChannelID, SETUP with channel = No channel (CW)");
}
else /* cd->channelid == CHAN_ANY */
{
- DBGL3(L3_P_ERR, "i4b_decode_q931_cs0_ie", ("ERROR: IE ChannelID, SETUP with channel = Any channel!\n"));
+ NDBGL3(L3_P_ERR, "ERROR: IE ChannelID, SETUP with channel = Any channel!");
}
}
}
break;
+ case IEI_PROGRESSI: /* progress indicator */
+ NDBGL3(L3_P_MSG, "IEI_PROGRESSINDICATOR");
+ break;
+
+ case IEI_NETSPCFAC: /* network specific fac */
+ NDBGL3(L3_P_MSG, "IEI_NETSPCFAC");
+ break;
+
+ case IEI_NOTIFIND: /* notification indicator */
+ NDBGL3(L3_P_MSG, "IEI_NOTIFICATION_INDICATOR");
+ break;
+
+ case IEI_DISPLAY: /* display */
+ memcpy(cd->display, &msg_ptr[2], min(DISPLAY_MAX, msg_ptr[1]));
+ cd->display[min(DISPLAY_MAX, msg_ptr[1])] = '\0';
+ NDBGL3(L3_P_MSG, "IEI_DISPLAY = %s", cd->display);
+ break;
+
+ case IEI_DATETIME: /* date/time */
+ i = 2;
+ j = msg_ptr[1];
+ p = &(cd->datetime[0]);
+ *p = '\0';
+
+ for(j = msg_ptr[1]; j > 0; j--, i++)
+ sprintf(p+strlen(p), "%02d", msg_ptr[i]);
+
+ NDBGL3(L3_P_MSG, "IEI_DATETIME = %s", cd->datetime);
+ break;
+
+ case IEI_KEYPAD: /* keypad facility */
+ NDBGL3(L3_P_MSG, "IEI_KEYPAD_FACILITY");
+ break;
+
+ case IEI_SIGNAL: /* signal type */
+ NDBGL3(L3_P_MSG, "IEI_SIGNAL = %d", msg_ptr[2]);
+ break;
+
+ case IEI_INFRATE: /* information rate */
+ NDBGL3(L3_P_MSG, "IEI_INFORMATION_RATE");
+ break;
+
+ case IEI_ETETDEL: /* end to end transit delay */
+ NDBGL3(L3_P_MSG, "IEI_END_TO_END_TRANSIT_DELAY");
+ break;
+
+ case IEI_CUG: /* closed user group */
+ NDBGL3(L3_P_MSG, "IEI_CLOSED_USER_GROUP");
+ break;
+
case IEI_CALLINGPN: /* calling party no */
if(msg_ptr[2] & 0x80) /* no presentation/screening indicator ? */
{
memcpy(cd->src_telno, &msg_ptr[3], min(TELNO_MAX, msg_ptr[1]-1));
cd->src_telno[min(TELNO_MAX, msg_ptr[1] - 1)] = '\0';
cd->scr_ind = SCR_NONE;
+ cd->prs_ind = PRS_NONE;
}
else
{
memcpy(cd->src_telno, &msg_ptr[4], min(TELNO_MAX, msg_ptr[1]-2));
cd->src_telno[min(TELNO_MAX, msg_ptr[1] - 2)] = '\0';
cd->scr_ind = (msg_ptr[3] & 0x03) + SCR_USR_NOSC;
+ cd->prs_ind = ((msg_ptr[3] >> 5) & 0x03) + PRS_ALLOWED;
}
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CALLINGPN = %s\n", cd->src_telno));
+ NDBGL3(L3_P_MSG, "IEI_CALLINGPN = %s", cd->src_telno);
break;
+ case IEI_CALLINGPS: /* calling party subaddress */
+ NDBGL3(L3_P_MSG, "IEI_CALLINGPS");
+ break;
+
case IEI_CALLEDPN: /* called party number */
memcpy(cd->dst_telno, &msg_ptr[3], min(TELNO_MAX, msg_ptr[1]-1));
cd->dst_telno[min(TELNO_MAX, msg_ptr [1] - 1)] = '\0';
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CALLED = %s\n", cd->dst_telno));
+ NDBGL3(L3_P_MSG, "IEI_CALLED = %s", cd->dst_telno);
break;
- case IEI_CALLSTATE: /* call state */
- cd->call_state = msg_ptr[2] & 0x3f;
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CALLSTATE = %d\n", cd->call_state));
+ case IEI_CALLEDPS: /* called party subaddress */
+ NDBGL3(L3_P_MSG, "IEI_CALLEDPS");
break;
-
- case IEI_PROGRESSI: /* progress indicator */
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_PROGRESSINDICATOR\n"));
+
+ case IEI_REDIRNO: /* redirecting number */
+ NDBGL3(L3_P_MSG, "IEI_REDIRECTING_NUMBER");
break;
-
- case IEI_DISPLAY: /* display */
- /* CHANGED BY <chris@medis.de> */
- memcpy(cd->display, &msg_ptr[2], min(DISPLAY_MAX, msg_ptr[1]));
- cd->display[min(DISPLAY_MAX, msg_ptr[1])] = '\0';
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_DISPLAY = %s\n", cd->display));
- break;
-
- case IEI_DATETIME: /* date/time */
- i = 2;
- j = msg_ptr[1];
- p = &(cd->datetime[0]);
- *p = '\0';
-
- for(j = msg_ptr[1]; j > 0; j--, i++)
- sprintf(p+strlen(p), "%02d", msg_ptr[i]);
-
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_DATETIME = %s\n", cd->datetime));
+
+ case IEI_TRNSEL: /* transit network selection */
+ NDBGL3(L3_P_MSG, "IEI_TRANSIT_NETWORK_SELECTION");
break;
-
- case IEI_FACILITY: /* facility */
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_FACILITY\n"));
- if(i4b_aoc(msg_ptr, cd) > -1)
- i4b_l4_charging_ind(cd);
+
+ case IEI_RESTARTI: /* restart indicator */
+ NDBGL3(L3_P_MSG, "IEI_RESTART_INDICATOR");
break;
-
- case IEI_CONCTDNO: /* connected number */
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CONCTDNO\n"));
+
+ case IEI_LLCOMPAT: /* low layer compat */
+ NDBGL3(L3_P_MSG, "IEI_LLCOMPAT");
break;
- case IEI_NETSPCFAC: /* network specific fac */
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_NETSPCFAC\n"));
+ case IEI_HLCOMPAT: /* high layer compat */
+ NDBGL3(L3_P_MSG, "IEI_HLCOMPAT");
break;
- case IEI_LLCOMPAT: /* low layer compat */
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_LLCOMPAT\n"));
+ case IEI_USERUSER: /* user-user */
+ NDBGL3(L3_P_MSG, "IEI_USER_USER");
break;
- case IEI_HLCOMPAT: /* high layer compat */
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_HLCOMPAT\n"));
+ case IEI_ESCAPE: /* escape for extension */
+ NDBGL3(L3_P_MSG, "IEI_ESCAPE");
break;
- case IEI_CALLINGPS: /* calling party subaddress */
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CALLINGPS\n"));
+/*********/
+/* Q.932 */
+/*********/
+ case IEI_FACILITY: /* facility */
+ NDBGL3(L3_P_MSG, "IEI_FACILITY");
+ if(i4b_aoc(msg_ptr, cd) > -1)
+ i4b_l4_charging_ind(cd);
break;
- case IEI_CALLEDPS: /* called party subaddress */
- DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CALLEDPS\n"));
+/*********/
+/* Q.95x */
+/*********/
+ case IEI_CONCTDNO: /* connected number */
+ NDBGL3(L3_P_MSG, "IEI_CONCTDNO");
break;
+
default:
- DBGL3(L3_P_ERR, "i4b_decode_q931_cs0_ie", ("Unknown IE %d - ", *msg_ptr));
+ NDBGL3(L3_P_ERR, "Unknown IE %d - ", *msg_ptr);
i4b_print_frame(msg_ptr[1]+2, msg_ptr);
break;
}
@@ -457,29 +529,31 @@ i4b_decode_q931_cs0_ie(int unit, call_desc_t *cd, int msg_len, u_char *msg_ptr)
void
i4b_decode_q931_message(int unit, call_desc_t *cd, u_char message_type)
{
- cd->event = EV_ILL;
+ char *m = NULL;
+ cd->event = EV_ILL;
+
switch(message_type)
{
/* call establishment */
case ALERT:
cd->event = EV_ALERT;
- DBGL3(L3_PRIM, "rx ALERT", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "ALERT";
break;
case CALL_PROCEEDING:
cd->event = EV_CALLPRC;
- DBGL3(L3_PRIM, "rx CALL-PROC", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "CALL_PROCEEDING";
break;
case PROGRESS:
cd->event = EV_PROGIND;
- DBGL3(L3_PRIM, "rx PROGRESS", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "PROGRESS";
break;
case SETUP:
- DBGL3(L3_PRIM, "rx SETUP", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "SETUP";
cd->bprot = BPROT_NONE;
cd->cause_in = 0;
cd->cause_out = 0;
@@ -493,142 +567,146 @@ i4b_decode_q931_message(int unit, call_desc_t *cd, u_char message_type)
break;
case CONNECT:
- DBGL3(L3_PRIM, "rx CONNECT", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "CONNECT";
cd->datetime[0] = '\0';
cd->event = EV_CONNECT;
break;
case SETUP_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx SETUP-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "SETUP_ACKNOWLEDGE";
cd->event = EV_SETUPAK;
break;
case CONNECT_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx CONNECT-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "CONNECT_ACKNOWLEDGE";
cd->event = EV_CONACK;
break;
/* call information */
case USER_INFORMATION:
- DBGL3(L3_PRIM, "rx USER-INFO", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "USER_INFORMATION";
break;
case SUSPEND_REJECT:
- DBGL3(L3_PRIM, "rx SUSPEND-REJ", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "SUSPEND_REJECT";
break;
case RESUME_REJECT:
- DBGL3(L3_PRIM, "rx RESUME-REJ", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "RESUME_REJECT";
break;
case HOLD:
- DBGL3(L3_PRIM, "rx HOLD", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "HOLD";
break;
case SUSPEND:
- DBGL3(L3_PRIM, "rx SUSPEND", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "SUSPEND";
break;
case RESUME:
- DBGL3(L3_PRIM, "rx RESUME", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "RESUME";
break;
case HOLD_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx HOLD-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "HOLD_ACKNOWLEDGE";
break;
case SUSPEND_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx SUSPEND-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "SUSPEND_ACKNOWLEDGE";
break;
case RESUME_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx RESUME-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "RESUME_ACKNOWLEDGE";
break;
case HOLD_REJECT:
- DBGL3(L3_PRIM, "rx HOLD-REJ", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "HOLD_REJECT";
break;
case RETRIEVE:
- DBGL3(L3_PRIM, "rx RETRIEVE", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "RETRIEVE";
break;
case RETRIEVE_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx RETRIEVE-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "RETRIEVE_ACKNOWLEDGE";
break;
case RETRIEVE_REJECT:
- DBGL3(L3_PRIM, "rx RETRIEVE-REJ", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "RETRIEVE_REJECT";
break;
/* call clearing */
case DISCONNECT:
- DBGL3(L3_PRIM, "rx DISCONNECT", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "DISCONNECT";
cd->event = EV_DISCONN;
break;
case RESTART:
- DBGL3(L3_PRIM, "rx RESTART", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "RESTART";
break;
case RELEASE:
- DBGL3(L3_PRIM, "rx RELEASE", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "RELEASE";
cd->event = EV_RELEASE;
break;
case RESTART_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx RESTART-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "RESTART_ACKNOWLEDGE";
break;
case RELEASE_COMPLETE:
- DBGL3(L3_PRIM, "rx RELEASE-COMPLETE", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "RELEASE_COMPLETE";
cd->event = EV_RELCOMP;
break;
/* misc messages */
case SEGMENT:
- DBGL3(L3_PRIM, "rx SEGMENT", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "SEGMENT";
break;
case FACILITY:
- DBGL3(L3_PRIM, "rx FACILITY", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "FACILITY";
cd->event = EV_FACILITY;
break;
case REGISTER:
- DBGL3(L3_PRIM, "rx REGISTER", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "REGISTER";
break;
case NOTIFY:
- DBGL3(L3_PRIM, "rx NOTIFY", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "NOTIFY";
break;
case STATUS_ENQUIRY:
- DBGL3(L3_PRIM, "rx STATUS-ENQ", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "STATUS_ENQUIRY";
cd->event = EV_STATENQ;
break;
case CONGESTION_CONTROL:
- DBGL3(L3_PRIM, "rx CONGESTION-CONTROL", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "CONGESTION_CONTROL";
break;
case INFORMATION:
- DBGL3(L3_PRIM, "rx INFORMATION", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "INFORMATION";
cd->event = EV_INFO;
break;
case STATUS:
- DBGL3(L3_PRIM, "rx STATUS", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
+ m = "STATUS";
cd->event = EV_STATUS;
break;
default:
- DBGL3(L3_P_ERR, "rx UNKNOWN msg", ("unit %d, cr = 0x%02x, msg = 0x%02x\n", unit, cd->cr, message_type));
+ NDBGL3(L3_P_ERR, "unit %d, cr = 0x%02x, msg = 0x%02x", unit, cd->cr, message_type);
break;
}
+ if(m)
+ {
+ NDBGL3(L3_PRIM, "%s: unit %d, cr = 0x%02x\n", m, unit, cd->cr);
+ }
}
#endif /* NI4BQ931 > 0 */
diff --git a/sys/i4b/layer3/i4b_q931.h b/sys/i4b/layer3/i4b_q931.h
index bbfc9b6..5568607 100644
--- a/sys/i4b/layer3/i4b_q931.h
+++ b/sys/i4b/layer3/i4b_q931.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_q931.h - Q931 handling header file
* --------------------------------------
*
- * $Id: i4b_q931.h,v 1.8 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_q931.h,v 1.9 2000/04/27 09:25:22 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:05:44 1999]
+ * last edit-date: [Thu Apr 27 11:07:37 2000]
*
*---------------------------------------------------------------------------*/
diff --git a/sys/i4b/layer3/i4b_q932fac.c b/sys/i4b/layer3/i4b_q932fac.c
index a791b08..4ef2644 100644
--- a/sys/i4b/layer3/i4b_q932fac.c
+++ b/sys/i4b/layer3/i4b_q932fac.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_q932fac.c - Q932 facility handling
* --------------------------------------
*
- * $Id: i4b_q932fac.c,v 1.8 1999/12/13 21:25:27 hm Exp $
+ * $Id: i4b_q932fac.c,v 1.11 2000/08/24 11:48:58 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:05:51 1999]
+ * last edit-date: [Mon May 29 16:57:04 2000]
*
*---------------------------------------------------------------------------*/
@@ -43,17 +43,16 @@
#if NI4BQ931 > 0
#include <sys/param.h>
-
-#if defined(__FreeBSD__)
-#else
-#include <sys/ioctl.h>
-#endif
-
+#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
+#include <sys/callout.h>
+#endif
+
#ifdef __FreeBSD__
#include <machine/i4b_debug.h>
#include <machine/i4b_ioctl.h>
@@ -105,24 +104,24 @@ i4b_aoc(unsigned char *buf, call_desc_t *cd)
{
case FAC_PROTO_ROP:
break;
-
+
case FAC_PROTO_CMIP:
- DBGL3(L3_A_MSG, "i4b_facility", ("CMIP Protocol (Q.941), UNSUPPORTED\n"));
+ NDBGL3(L3_A_MSG, "CMIP Protocol (Q.941), UNSUPPORTED");
return(-1);
break;
case FAC_PROTO_ACSE:
- DBGL3(L3_A_MSG, "i4b_facility", ("ACSE Protocol (X.217/X.227), UNSUPPORTED!\n"));
+ NDBGL3(L3_A_MSG, "ACSE Protocol (X.217/X.227), UNSUPPORTED!");
return(-1);
break;
default:
- DBGL3(L3_A_ERR, "i4b_facility", ("Unknown Protocol, UNSUPPORTED!\n"));
+ NDBGL3(L3_A_ERR, "Unknown Protocol, UNSUPPORTED!");
return(-1);
break;
}
- DBGL3(L3_A_MSG, "i4b_facility", ("Remote Operations Protocol\n"));
+ NDBGL3(L3_A_MSG, "Remote Operations Protocol");
/* next byte */
@@ -382,7 +381,7 @@ F_2(int val)
{
if(val != -1)
{
- DBGL3(L3_A_MSG, "i4b_facility", ("Invoke ID = %d\n", val));
+ NDBGL3(L3_A_MSG, "Invoke ID = %d", val);
state = ST_EXP_OP_VAL;
}
}
@@ -395,7 +394,7 @@ F_3(int val)
{
if(val != -1)
{
- DBGL3(L3_A_MSG, "i4b_facility", ("Operation Value = %d\n", val));
+ NDBGL3(L3_A_MSG, "Operation Value = %d", val);
operation_value = val;
@@ -429,7 +428,7 @@ F_4_1(int val)
{
if(val == -1)
{
- DBGL3(L3_A_MSG, "i4b_facility", ("Free of Charge\n"));
+ NDBGL3(L3_A_MSG, "Free of Charge");
/* units = 0; XXXX */
state = ST_EXP_NIX;
}
@@ -443,7 +442,7 @@ F_4_2(int val)
{
if(val == -1)
{
- DBGL3(L3_A_MSG, "i4b_facility", ("Charge not available\n"));
+ NDBGL3(L3_A_MSG, "Charge not available");
/* units = -1; XXXXXX ??? */
state = ST_EXP_NIX;
}
@@ -477,7 +476,7 @@ F_7(int val)
{
if(val != -1)
{
- DBGL3(L3_A_MSG, "i4b_facility", ("Number of Units = %d\n", val));
+ NDBGL3(L3_A_MSG, "Number of Units = %d", val);
units = val;
state = ST_EXP_TOCI;
}
@@ -491,7 +490,7 @@ F_8(int val)
{
if(val != -1)
{
- DBGL3(L3_A_MSG, "i4b_facility", ("Subtotal/Total = %d\n", val));
+ NDBGL3(L3_A_MSG, "Subtotal/Total = %d", val);
/* type_of_charge = val; */
state = ST_EXP_DBID;
}
@@ -505,7 +504,7 @@ F_9(int val)
{
if(val != -1)
{
- DBGL3(L3_A_MSG, "i4b_facility", ("Billing ID = %d\n", val));
+ NDBGL3(L3_A_MSG, "Billing ID = %d", val);
/* billing_id = val; */
state = ST_EXP_NIX;
}
diff --git a/sys/i4b/layer3/i4b_q932fac.h b/sys/i4b/layer3/i4b_q932fac.h
index d878c2e..0c92177 100644
--- a/sys/i4b/layer3/i4b_q932fac.h
+++ b/sys/i4b/layer3/i4b_q932fac.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
* i4b_q932fac.h - Q932 facility handling header file
* --------------------------------------------------
*
- * $Id: i4b_q932fac.h,v 1.7 1999/12/13 21:25:28 hm Exp $
+ * $Id: i4b_q932fac.h,v 1.8 2000/04/27 09:25:22 hm Exp $
*
* $FreeBSD$
*
- * last edit-date: [Mon Dec 13 22:06:00 1999]
+ * last edit-date: [Thu Apr 27 11:07:52 2000]
*
*---------------------------------------------------------------------------
*
OpenPOWER on IntegriCloud