/* ssapwrite.c - SPM: write various SPDUs */
static char *rcsid
= "$Header: /f/osi/ssap/RCS/ssapwrite.c,v 7.1 91/02/22 09:46:10 mrose Interim $";
* $Header: /f/osi/ssap/RCS/ssapwrite.c,v 7.1 91/02/22 09:46:10 mrose Interim $
* Revision 7.1 91/02/22 09:46:10 mrose
* Revision 7.0 89/11/23 22:25:52 mrose
* Acquisition, use, and distribution of this module and related
* materials are subject to the restrictions of a license agreement.
* Consult the Preface in the User's Manual for the full terms of
int SWriteRequestAux (sb
, code
, data
, cc
, type
, ssn
, settings
,
register struct ssapblk
*sb
;
struct SSAPindication
*si
;
register struct ssapkt
*s
,
struct TSAPdisconnect tds
;
register struct TSAPdisconnect
*td
= &tds
;
register struct udvec
*uv
;
if (sb
-> sb_flags
& SB_EXPD
)
if ((p
= newspkt (SPDU_PR
)) == NULL
)
return ssaplose (si
, SC_CONGEST
, NULLCP
, "out of memory");
p
-> s_mask
|= SMASK_PR_TYPE
;
result
= spkt2sd (p
, sb
-> sb_fd
, 1, si
);
uvs
[0].uv_base
= uvs
[1].uv_base
= NULL
;
#ifdef notdef /* aka SPDU_MAP */
if (s
= newspkt (SPDU_GT
))
s
-> s_mask
|= SMASK_SPDU_GT
;
return ssaplose (si
, SC_CONGEST
, NULLCP
, "out of memory");
if (spkt2tsdu (s
, &uv
-> uv_base
, &uv
-> uv_len
) == NOTOK
) {
(void) ssaplose (si
, s
-> s_errno
, NULLCP
, NULLCP
);
if ((s
= newspkt (code
)) == NULL
) {
(void) ssaplose (si
, SC_CONGEST
, NULLCP
, "out of memory");
s
-> s_mask
|= SMASK_MAP_SYNC
;
s
-> s_mask
|= SMASK_MAP_SERIAL
;
s
-> s_mask
|= SMASK_MAA_SERIAL
;
if (type
== SYNC_NOCONFIRM
) {
s
-> s_mask
|= SMASK_MIP_SYNC
;
s
-> s_mip_sync
= MIP_SYNC_NOEXPL
;
s
-> s_mask
|= SMASK_MIP_SERIAL
;
s
-> s_mask
|= SMASK_MIA_SERIAL
;
if (sb
-> sb_requirements
& SR_TOKENS
) {
s
-> s_mask
|= SMASK_RS_SET
;
s
-> s_rs_settings
= settings
;
s
-> s_mask
|= SMASK_RS_TYPE
;
s
-> s_mask
|= SMASK_RS_SSN
;
if (sb
-> sb_requirements
& SR_TOKENS
) {
s
-> s_mask
|= SMASK_RA_SET
;
s
-> s_ra_settings
= settings
;
s
-> s_mask
|= SMASK_RA_SSN
;
s
-> s_mask
|= SMASK_AS_ID
;
s
-> s_as_id
= *id
; /* struct copy */
s
-> s_mask
|= SMASK_AR_OID
| SMASK_AR_SSN
| SMASK_AR_ID
;
s
-> s_ar_oid
= *oid
; /* struct copy */
s
-> s_ar_id
= *id
; /* struct copy */
s
-> s_mask
|= SMASK_AR_REF
;
s
-> s_ar_reference
= *ref
; /* struct copy */
s
-> s_mask
|= SMASK_AI_REASON
;
s
-> s_mask
|= SMASK_AD_REASON
;
s
-> s_mask
|= SMASK_ED_REASON
;
s
-> s_mask
|= SMASK_UDATA_PGI
;
s
-> s_udata
= data
, s
-> s_ulen
= cc
;
s
-> s_udata
= NULL
, s
-> s_ulen
= 0;
result
= spkt2tsdu (s
, &uv
-> uv_base
, &uv
-> uv_len
);
s
-> s_mask
&= ~SMASK_UDATA_PGI
;
s
-> s_udata
= NULL
, s
-> s_ulen
= 0;
(void) ssaplose (si
, s
-> s_errno
, NULLCP
, NULLCP
);
if ((result
= TWriteRequest (sb
-> sb_fd
, uvs
, td
)) == NOTOK
)
(void) ts2sslose (si
, "TWriteRequest", td
);