summaryrefslogtreecommitdiffstats
path: root/sys/netatm/uni/unisig_subr.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1998-12-11 21:47:47 +0000
committerphk <phk@FreeBSD.org>1998-12-11 21:47:47 +0000
commit42c5874d2e9141522df7961184e6ec237a91e3c3 (patch)
tree913da2fcc6981c4ed3ea4c07086fc1e98ff63b5a /sys/netatm/uni/unisig_subr.c
parentc55aa9c23d5c6f7f964fa71facbba34dd8c6bfc1 (diff)
downloadFreeBSD-src-42c5874d2e9141522df7961184e6ec237a91e3c3.zip
FreeBSD-src-42c5874d2e9141522df7961184e6ec237a91e3c3.tar.gz
Set and propagate the correct cause code values.
Submitted by: Mike Spengler <mks@circe.networkcs.com>
Diffstat (limited to 'sys/netatm/uni/unisig_subr.c')
-rw-r--r--sys/netatm/uni/unisig_subr.c42
1 files changed, 37 insertions, 5 deletions
diff --git a/sys/netatm/uni/unisig_subr.c b/sys/netatm/uni/unisig_subr.c
index 18e0fa1..888cedc 100644
--- a/sys/netatm/uni/unisig_subr.c
+++ b/sys/netatm/uni/unisig_subr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_subr.c,v 1.3 1998/10/31 20:07:01 phk Exp $
+ * @(#) $Id: unisig_subr.c,v 1.4 1998/10/31 20:08:03 phk Exp $
*
*/
@@ -42,7 +42,7 @@
#include <netatm/uni/unisig_msg.h>
#ifndef lint
-__RCSID("@(#) $Id: unisig_subr.c,v 1.3 1998/10/31 20:07:01 phk Exp $");
+__RCSID("@(#) $Id: unisig_subr.c,v 1.4 1998/10/31 20:08:03 phk Exp $");
#endif
@@ -73,7 +73,7 @@ extern struct ie_epst ie_epst_absent;
/*
- * Set a cause code in an ATM attribute block
+ * Set a User Location cause code in an ATM attribute block
*
* Arguments:
* aap pointer to attribute block
@@ -84,10 +84,13 @@ extern struct ie_epst ie_epst_absent;
*
*/
void
-unisig_set_cause_attr(aap, cause)
+unisig_cause_attr_from_user(aap, cause)
Atm_attributes *aap;
int cause;
{
+ if (cause == T_ATM_ABSENT)
+ return;
+
/*
* Set the fields in the attribute block
*/
@@ -101,6 +104,35 @@ unisig_set_cause_attr(aap, cause)
/*
+ * Set a cause code in an ATM attribute block from a Cause IE
+ *
+ * Arguments:
+ * aap pointer to attribute block
+ * iep pointer to Cause IE
+ *
+ * Returns:
+ * none
+ *
+ */
+void
+unisig_cause_attr_from_ie(aap, iep)
+ Atm_attributes *aap;
+ struct ie_generic *iep;
+{
+ /*
+ * Set the fields in the attribute block
+ */
+ aap->cause.tag = T_ATM_PRESENT;
+ aap->cause.v.coding_standard = iep->ie_coding;
+ aap->cause.v.location = iep->ie_caus_loc;
+ aap->cause.v.cause_value = iep->ie_caus_cause;
+ KM_ZERO(aap->cause.v.diagnostics, sizeof(aap->cause.v.diagnostics));
+ KM_COPY(iep->ie_caus_diagnostic, aap->cause.v.diagnostics,
+ MIN(sizeof(aap->cause.v.diagnostics), iep->ie_caus_diag_len));
+}
+
+
+/*
* Open a UNI VCC
*
* Called when a user wants to open a VC. This function will construct
@@ -402,7 +434,7 @@ unisig_clear_vcc(usp, uvp, cause)
outstate == UNI_SSCF_RECOV ||
outstate == UNI_PVC_ACT_DOWN ||
outstate == UNI_PVC_ACTIVE) {
- unisig_set_cause_attr(&uvp->uv_connvc->cvc_attr, cause);
+ unisig_cause_attr_from_user(&uvp->uv_connvc->cvc_attr, cause);
atm_cm_cleared(uvp->uv_connvc);
}
OpenPOWER on IntegriCloud