summaryrefslogtreecommitdiffstats
path: root/sys/i4b/layer3
diff options
context:
space:
mode:
authorhm <hm@FreeBSD.org>1999-05-20 10:14:57 +0000
committerhm <hm@FreeBSD.org>1999-05-20 10:14:57 +0000
commit2077acfca034178f39e3fa4e86cb8d371f44737c (patch)
tree730187a2063473cb0d2e7cac998a9a4307285426 /sys/i4b/layer3
parent5ea75aea8a2633cc0acf9dd870c1e1db1abd6a21 (diff)
downloadFreeBSD-src-2077acfca034178f39e3fa4e86cb8d371f44737c.zip
FreeBSD-src-2077acfca034178f39e3fa4e86cb8d371f44737c.tar.gz
upgrade isdn4bsd from version 0.71 to the just released version 0.81
Diffstat (limited to 'sys/i4b/layer3')
-rw-r--r--sys/i4b/layer3/i4b_l3fsm.c11
-rw-r--r--sys/i4b/layer3/i4b_l3timer.c57
-rw-r--r--sys/i4b/layer3/i4b_l4if.c6
-rw-r--r--sys/i4b/layer3/i4b_q931.c58
4 files changed, 100 insertions, 32 deletions
diff --git a/sys/i4b/layer3/i4b_l3fsm.c b/sys/i4b/layer3/i4b_l3fsm.c
index 39c024c..a022bf8 100644
--- a/sys/i4b/layer3/i4b_l3fsm.c
+++ b/sys/i4b/layer3/i4b_l3fsm.c
@@ -27,9 +27,9 @@
* i4b_l3fsm.c - layer 3 FSM
* -------------------------
*
- * $Id: i4b_l3fsm.c,v 1.14 1999/02/14 09:45:01 hm Exp $
+ * $Id: i4b_l3fsm.c,v 1.16 1999/04/21 07:50:31 hm Exp $
*
- * last edit-date: [Sun Feb 14 10:33:25 1999]
+ * last edit-date: [Wed Apr 21 09:42:26 1999]
*
*---------------------------------------------------------------------------*/
@@ -889,6 +889,13 @@ 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"));
+
+ /* stop T310 in case this is the result of an incoming call for a */
+ /* calledback connection */
+
+ if(cd->T310 == TIMER_ACTIVE)
+ T310_stop(cd);
+
/* cause from L4 */
i4b_l3_tx_disconnect(cd);
T305_start(cd);
diff --git a/sys/i4b/layer3/i4b_l3timer.c b/sys/i4b/layer3/i4b_l3timer.c
index dc20d4e..a4a01be 100644
--- a/sys/i4b/layer3/i4b_l3timer.c
+++ b/sys/i4b/layer3/i4b_l3timer.c
@@ -27,9 +27,9 @@
* i4b_l3timer.c - timer and timeout handling for layer 3
* ------------------------------------------------------
*
- * $Id: i4b_l3timer.c,v 1.10 1999/02/14 09:45:01 hm Exp $
+ * $Id: i4b_l3timer.c,v 1.12 1999/04/21 07:50:31 hm Exp $
*
- * last edit-date: [Sun Feb 14 10:33:38 1999]
+ * last edit-date: [Wed Apr 21 09:46:59 1999]
*
*---------------------------------------------------------------------------*/
@@ -101,8 +101,12 @@ T303_timeout(call_desc_t *cd)
void
T303_start(call_desc_t *cd)
{
+ if (cd->T303 == TIMER_ACTIVE)
+ return;
+
DBGL3(L3_T_MSG, "T303_start", ("cr = %d\n", cd->cr));
cd->T303 = TIMER_ACTIVE;
+
#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
cd->T303_callout = timeout((TIMEOUT_FUNC_T)T303_timeout, (void *)cd, T303VAL);
#else
@@ -116,6 +120,9 @@ T303_start(call_desc_t *cd)
void
T303_stop(call_desc_t *cd)
{
+ CRIT_VAR;
+ CRIT_BEG;
+
if(cd->T303 != TIMER_IDLE)
{
#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
@@ -125,6 +132,7 @@ T303_stop(call_desc_t *cd)
#endif
cd->T303 = TIMER_IDLE;
}
+ CRIT_END;
DBGL3(L3_T_MSG, "T303_stop", ("cr = %d\n", cd->cr));
}
@@ -144,8 +152,12 @@ T305_timeout(call_desc_t *cd)
void
T305_start(call_desc_t *cd)
{
+ if (cd->T305 == TIMER_ACTIVE)
+ return;
+
DBGL3(L3_T_MSG, "T305_start", ("cr = %d\n", cd->cr));
cd->T305 = TIMER_ACTIVE;
+
#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
cd->T305_callout = timeout((TIMEOUT_FUNC_T)T305_timeout, (void *)cd, T305VAL);
#else
@@ -159,6 +171,9 @@ T305_start(call_desc_t *cd)
void
T305_stop(call_desc_t *cd)
{
+ CRIT_VAR;
+ CRIT_BEG;
+
if(cd->T305 != TIMER_IDLE)
{
#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
@@ -168,6 +183,8 @@ T305_stop(call_desc_t *cd)
#endif
cd->T305 = TIMER_IDLE;
}
+ CRIT_END;
+
DBGL3(L3_T_MSG, "T305_stop", ("cr = %d\n", cd->cr));
}
@@ -187,8 +204,12 @@ T308_timeout(call_desc_t *cd)
void
T308_start(call_desc_t *cd)
{
+ if(cd->T308 == TIMER_ACTIVE)
+ return;
+
DBGL3(L3_T_MSG, "T308_start", ("cr = %d\n", cd->cr));
cd->T308 = TIMER_ACTIVE;
+
#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
cd->T308_callout = timeout((TIMEOUT_FUNC_T)T308_timeout, (void *)cd, T308VAL);
#else
@@ -202,6 +223,9 @@ T308_start(call_desc_t *cd)
void
T308_stop(call_desc_t *cd)
{
+ CRIT_VAR;
+ CRIT_BEG;
+
if(cd->T308 != TIMER_IDLE)
{
#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
@@ -211,6 +235,8 @@ T308_stop(call_desc_t *cd)
#endif
cd->T308 = TIMER_IDLE;
}
+ CRIT_END;
+
DBGL3(L3_T_MSG, "T308_stop", ("cr = %d\n", cd->cr));
}
@@ -230,8 +256,12 @@ T309_timeout(call_desc_t *cd)
void
T309_start(call_desc_t *cd)
{
+ if (cd->T309 == TIMER_ACTIVE)
+ return;
+
DBGL3(L3_T_MSG, "T309_start", ("cr = %d\n", cd->cr));
cd->T309 = TIMER_ACTIVE;
+
#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
cd->T309_callout = timeout((TIMEOUT_FUNC_T)T309_timeout, (void *)cd, T309VAL);
#else
@@ -245,6 +275,9 @@ T309_start(call_desc_t *cd)
void
T309_stop(call_desc_t *cd)
{
+ CRIT_VAR;
+ CRIT_BEG;
+
if(cd->T309 != TIMER_IDLE)
{
#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
@@ -254,6 +287,8 @@ T309_stop(call_desc_t *cd)
#endif
cd->T309 = TIMER_IDLE;
}
+ CRIT_END;
+
DBGL3(L3_T_MSG, "T309_stop", ("cr = %d\n", cd->cr));
}
@@ -273,8 +308,12 @@ T310_timeout(call_desc_t *cd)
void
T310_start(call_desc_t *cd)
{
+ if (cd->T310 == TIMER_ACTIVE)
+ return;
+
DBGL3(L3_T_MSG, "T310_start", ("cr = %d\n", cd->cr));
cd->T310 = TIMER_ACTIVE;
+
#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
cd->T310_callout = timeout((TIMEOUT_FUNC_T)T310_timeout, (void *)cd, T310VAL);
#else
@@ -288,6 +327,9 @@ T310_start(call_desc_t *cd)
void
T310_stop(call_desc_t *cd)
{
+ CRIT_VAR;
+ CRIT_BEG;
+
if(cd->T310 != TIMER_IDLE)
{
#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
@@ -297,6 +339,8 @@ T310_stop(call_desc_t *cd)
#endif
cd->T310 = TIMER_IDLE;
}
+ CRIT_END;
+
DBGL3(L3_T_MSG, "T310_stop", ("cr = %d\n", cd->cr));
}
@@ -316,8 +360,12 @@ T313_timeout(call_desc_t *cd)
void
T313_start(call_desc_t *cd)
{
+ if (cd->T313 == TIMER_ACTIVE)
+ return;
+
DBGL3(L3_T_MSG, "T313_start", ("cr = %d\n", cd->cr));
cd->T313 = TIMER_ACTIVE;
+
#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
cd->T313_callout = timeout((TIMEOUT_FUNC_T)T313_timeout, (void *)cd, T313VAL);
#else
@@ -331,6 +379,9 @@ T313_start(call_desc_t *cd)
void
T313_stop(call_desc_t *cd)
{
+ CRIT_VAR;
+ CRIT_BEG;
+
if(cd->T313 != TIMER_IDLE)
{
cd->T313 = TIMER_IDLE;
@@ -340,6 +391,8 @@ T313_stop(call_desc_t *cd)
untimeout((TIMEOUT_FUNC_T)T313_timeout, (void *)cd);
#endif
}
+ CRIT_END;
+
DBGL3(L3_T_MSG, "T313_stop", ("cr = %d\n", cd->cr));
}
diff --git a/sys/i4b/layer3/i4b_l4if.c b/sys/i4b/layer3/i4b_l4if.c
index 3f0c0cb..46210d6 100644
--- a/sys/i4b/layer3/i4b_l4if.c
+++ b/sys/i4b/layer3/i4b_l4if.c
@@ -27,9 +27,9 @@
* i4b_l4if.c - Layer 3 interface to Layer 4
* -------------------------------------------
*
- * $Id: i4b_l4if.c,v 1.18 1999/02/14 09:45:01 hm Exp $
+ * $Id: i4b_l4if.c,v 1.19 1999/04/27 14:47:58 hm Exp $
*
- * last edit-date: [Sun Feb 14 10:33:44 1999]
+ * last edit-date: [Tue Apr 27 16:46:51 1999]
*
*---------------------------------------------------------------------------*/
@@ -304,7 +304,7 @@ n_connect_response(u_int cdid, int response, int cause)
}
else
{
- DBGL3(L3_ERR, "n_connect_response", ("ERROR, invalid channel %d\n", cd->channelid));
+ DBGL3(L3_MSG, "n_connect_response", ("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 64ce766..6e02565 100644
--- a/sys/i4b/layer3/i4b_q931.c
+++ b/sys/i4b/layer3/i4b_q931.c
@@ -27,9 +27,9 @@
* i4b_q931.c - Q931 received messages handling
* --------------------------------------------
*
- * $Id: i4b_q931.c,v 1.19 1999/02/14 09:45:02 hm Exp $
+ * $Id: i4b_q931.c,v 1.21 1999/04/27 10:08:13 hm Exp $
*
- * last edit-date: [Sun Feb 14 10:33:50 1999]
+ * last edit-date: [Tue Apr 27 12:04:35 1999]
*
*---------------------------------------------------------------------------*/
@@ -270,7 +270,7 @@ i4b_decode_q931_cs0_ie(int unit, call_desc_t *cd, int msg_len, u_char *msg_ptr)
/* single byte IE's */
case IEI_SENDCOMPL:
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_SENDCOMPL\n"));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_SENDCOMPL\n"));
return(1);
break;
@@ -283,17 +283,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_codeset0", ("IEI_BEARERCAP - Telephony\n"));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_BEARERCAP - Telephony\n"));
break;
case 0x88: /* unrestricted digital info */
/* XXX */ cd->bprot = BPROT_RHDLC;
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_BEARERCAP - Raw HDLC\n"));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_BEARERCAP - Raw HDLC\n"));
break;
default:
/* XXX */ cd->bprot = BPROT_NONE;
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_BEARERCAP - No Protocol\n"));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_BEARERCAP - No Protocol\n"));
break;
}
break;
@@ -302,12 +302,12 @@ 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_codeset0", ("IEI_CAUSE = %d\n", msg_ptr[3] & 0x7f));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CAUSE = %d\n", msg_ptr[3] & 0x7f));
}
else
{
cd->cause_in = msg_ptr[4] & 0x7f;
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CAUSE = %d\n", msg_ptr[4] & 0x7f));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CAUSE = %d\n", msg_ptr[4] & 0x7f));
}
break;
@@ -315,7 +315,7 @@ i4b_decode_q931_cs0_ie(int unit, call_desc_t *cd, int msg_len, u_char *msg_ptr)
if((msg_ptr[2] & 0xf4) != 0x80)
{
cd->channelid = CHAN_NO;
- DBGL3(L3_P_ERR, "i4b_decode_q931_codeset0", ("IEI_CHANNELID, unsupported value 0x%x\n", msg_ptr[2]));
+ DBGL3(L3_P_ERR, "i4b_decode_q931_cs0_ie", ("IEI_CHANNELID, unsupported value 0x%x\n", msg_ptr[2]));
}
else
{
@@ -336,7 +336,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_codeset0", ("IEI_CHANNELID - channel %d, exclusive = %d\n", cd->channelid, cd->channelexcl));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CHANNELID - channel %d, exclusive = %d\n", cd->channelid, cd->channelexcl));
/* if this is a setup message, reserve channel */
@@ -347,15 +347,15 @@ 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_codeset0", ("IE ChannelID, Channel NOT free!!\n"));
+ DBGL3(L3_P_ERR, "i4b_decode_q931_cs0_ie", ("IE ChannelID, Channel NOT free!!\n"));
}
else if(cd->channelid == CHAN_NO)
{
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IE ChannelID, SETUP with channel = No channel (CW)\n"));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IE ChannelID, SETUP with channel = No channel (CW)\n"));
}
else /* cd->channelid == CHAN_ANY */
{
- DBGL3(L3_P_ERR, "i4b_decode_q931_codeset0", ("ERROR: IE ChannelID, SETUP with channel = Any channel!\n"));
+ DBGL3(L3_P_ERR, "i4b_decode_q931_cs0_ie", ("ERROR: IE ChannelID, SETUP with channel = Any channel!\n"));
}
}
}
@@ -374,29 +374,29 @@ i4b_decode_q931_cs0_ie(int unit, call_desc_t *cd, int msg_len, u_char *msg_ptr)
cd->src_telno[min(TELNO_MAX, msg_ptr[1] - 2)] = '\0';
cd->scr_ind = (msg_ptr[3] & 0x03) + SCR_USR_NOSC;
}
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CALLINGPN = %s\n", cd->src_telno));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CALLINGPN = %s\n", cd->src_telno));
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_codeset0", ("IEI_CALLED = %s\n", cd->dst_telno));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CALLED = %s\n", cd->dst_telno));
break;
case IEI_CALLSTATE: /* call state */
cd->call_state = msg_ptr[2] & 0x3f;
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CALLSTATE = %d\n", cd->call_state));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CALLSTATE = %d\n", cd->call_state));
break;
case IEI_PROGRESSI: /* progress indicator */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_PROGRESSINDICATOR\n"));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_PROGRESSINDICATOR\n"));
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_codeset0", ("IEI_DISPLAY = %s\n", cd->display));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_DISPLAY = %s\n", cd->display));
break;
case IEI_DATETIME: /* date/time */
@@ -408,33 +408,41 @@ i4b_decode_q931_cs0_ie(int unit, call_desc_t *cd, int msg_len, u_char *msg_ptr)
for(j = msg_ptr[1]; j > 0; j--, i++)
sprintf(p+strlen(p), "%02d", msg_ptr[i]);
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_DATETIME = %s\n", cd->datetime));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_DATETIME = %s\n", cd->datetime));
break;
case IEI_FACILITY: /* facility */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_FACILITY\n"));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_FACILITY\n"));
if(i4b_aoc(msg_ptr, cd) > -1)
i4b_l4_charging_ind(cd);
break;
case IEI_CONCTDNO: /* connected number */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CONCTDNO\n"));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CONCTDNO\n"));
break;
case IEI_NETSPCFAC: /* network specific fac */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_NETSPCFAC\n"));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_NETSPCFAC\n"));
break;
case IEI_LLCOMPAT: /* low layer compat */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_LLCOMPAT\n"));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_LLCOMPAT\n"));
break;
case IEI_HLCOMPAT: /* high layer compat */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_HLCOMPAT\n"));
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_HLCOMPAT\n"));
+ break;
+
+ case IEI_CALLINGPS: /* calling party subaddress */
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CALLINGPS\n"));
+ break;
+
+ case IEI_CALLEDPS: /* called party subaddress */
+ DBGL3(L3_P_MSG, "i4b_decode_q931_cs0_ie", ("IEI_CALLEDPS\n"));
break;
default:
- DBGL3(L3_P_ERR, "i4b_decode_q931_codeset0", ("Unknown IE %d - ", *msg_ptr));
+ DBGL3(L3_P_ERR, "i4b_decode_q931_cs0_ie", ("Unknown IE %d - ", *msg_ptr));
i4b_print_frame(msg_ptr[1]+2, msg_ptr);
break;
}
OpenPOWER on IntegriCloud