/* ssapexec.c - SPM: exec */
static char *rcsid
= "$Header: /f/osi/ssap/RCS/ssapexec.c,v 7.1 91/02/22 09:45:46 mrose Interim $";
* $Header: /f/osi/ssap/RCS/ssapexec.c,v 7.1 91/02/22 09:45:46 mrose Interim $
* Revision 7.1 91/02/22 09:45:46 mrose
* Revision 7.0 89/11/23 22:25:26 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 SExec (ts
, si
, hook
, setperms
)
struct SSAPindication
*si
;
register struct isoservent
*is
;
register struct ssapkt
*s
;
register struct TSAPdata
*tx
= &txs
;
struct TSAPdisconnect tds
;
register struct TSAPdisconnect
*td
= &tds
;
if (TReadRequest (sd
= ts
-> ts_sd
, tx
, NOTOK
, td
) == NOTOK
)
return ts2sslose (si
, "TReadRequest", td
);
s
= tsdu2spkt (&tx
-> tx_qbuf
, tx
-> tx_cc
, NULLIP
);
if (s
== NULL
|| s
-> s_errno
!= SC_ACCEPT
) {
(void) spktlose (sd
, si
, (s
? s
-> s_errno
: SC_CONGEST
) | SC_REFUSE
,
if ((s
-> s_mask
& SMASK_CN_VRSN
)
&& !(s
-> s_cn_version
& SB_ALLVRSNS
)) {
(void) spktlose (sd
, si
, SC_VERSION
| SC_REFUSE
, NULLCP
,
"version mismatch: expecting 0x%x, got 0x%x",
SB_ALLVRSNS
, s
-> s_cn_version
);
if ((s
-> s_mask
& SMASK_CN_CALLED
) && s
-> s_calledlen
> 0) {
if ((is
= getisoserventbyselector ("ssap", s
-> s_called
,
s
-> s_calledlen
)) == NULL
) {
buffer
[explode (buffer
, (u_char
*) s
-> s_called
,
s
-> s_calledlen
)] = NULL
;
(void) spktlose (sd
, si
, SC_SSAPID
| SC_REFUSE
, NULLCP
,
"ISO service ssap/%s not found", buffer
);
if ((is
= getisoserventbyname ("presentation", "ssap"))
(void) spktlose (sd
, si
, SC_SSUSER
| SC_REFUSE
, NULLCP
,
"default presentation service not found");
if (TSaveState (sd
, is
-> is_tail
, td
) == NOTOK
) {
(void) spktlose (sd
, si
, SC_CONGEST
| SC_REFUSE
, NULLCP
,
if ((*is
-> is_tail
++ = spkt2str (s
)) == NULL
) {
(void) spktlose (sd
, si
, SC_CONGEST
| SC_REFUSE
, NULLCP
,
switch (hook
? (*hook
) (is
, si
) : OK
) {
(void) execv (*is
-> is_vec
, is
-> is_vec
);
SLOG (ssap_log
, LLOG_FATAL
, *is
-> is_vec
,
(void) TRestoreState (cp
, ts
, td
);
(void) spktlose (ts
-> ts_sd
, si
, SC_CONGEST
| SC_REFUSE
,
*is
-> is_vec
, "unable to exec");
(void) spktlose (sd
, si
, SC_PROTOCOL
| SC_REFUSE
, NULLCP
,
"session protocol mangled: expecting 0x%x, got 0x%x",