/* psapexec.c - PPM: exec */
static char *rcsid
= "$Header: /f/osi/psap2/RCS/psapexec.c,v 7.4 91/02/22 09:37:30 mrose Interim $";
* $Header: /f/osi/psap2/RCS/psapexec.c,v 7.4 91/02/22 09:37:30 mrose Interim $
* Revision 7.4 91/02/22 09:37:30 mrose
* Revision 7.3 90/10/23 20:43:48 mrose
* Revision 7.2 90/07/01 21:04:58 mrose
* Revision 7.1 89/11/24 16:22:12 mrose
* Revision 7.0 89/11/23 22:14:19 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 PExec (ss
, pi
, arg1
, arg2
, hook
, setperms
)
struct PSAPindication
*pi
;
register struct isoservent
*is
;
register struct psapblk
*pb
;
struct SSAPindication sis
;
register struct SSAPindication
*si
= &sis
;
struct type_PS_CP__type
*cp
;
register struct element_PS_0
*cp_normal
;
register struct type_PS_CPR__type
*cpr
;
if ((pb
= newpblk ()) == NULL
)
pb
-> pb_fd
= ss
-> ss_sd
;
if ((pe
= ssdu2pe (ss
-> ss_data
, ss
-> ss_cc
, NULLCP
, &result
))
if (result
== PS_ERR_NMEM
)
(void) ppktlose (pb
, pi
, PC_PROTOCOL
, PPDU_CP
, NULLCP
, "%s",
if (decode_PS_CP__type (pe
, 1, NULLIP
, NULLVP
, &cp
) == NOTOK
) {
(void) ppktlose (pb
, pi
, PC_UNRECOGNIZED
, PPDU_CP
, NULLCP
, "%s",
PLOGP (psap2_log
,PS_CP__type
, pe
, "CP-type", 1);
if (cp
-> mode
-> parm
!= int_PS_Mode__selector_normal__mode
) {
(void) ppktlose (pb
, pi
, PC_INVALID
, PPDU_CP
, NULLCP
,
"X.410-mode not supported");
cp_normal
= cp
-> normal__mode
;
if (cp_normal
-> called
== NULL
)
if ((base
= qb2str (cp_normal
-> called
)) == NULLCP
)
len
= cp_normal
-> called
-> qb_len
;
is
= getisoserventbyselector ("psap", base
, len
);
result
= SC_REJECTED
, result2
= PC_ADDRESS
;
switch (hook
? (*hook
) (is
, pi
) : OK
) {
(void) execv (*is
-> is_vec
, is
-> is_vec
);
SLOG (psap2_log
, LLOG_FATAL
, *is
-> is_vec
,
(void) psaplose (pi
, result2
= PC_CONGEST
, NULLCP
, NULLCP
);
if (cpr
= (struct type_PS_CPR__type
*) calloc (1, sizeof *cpr
)) {
int_PS_Mode__selector_x410__1984__mode
) {
cpr
-> offset
= type_PS_CPR__type_x410__mode
;
if (pe
= pe_alloc (PE_CLASS_UNIV
, PE_FORM_CONS
, PE_CONS_SET
)) {
cpr
-> un
.x410__mode
= pe
;
(void) set_add (pe
, num2prim ((integer
) (result2
!= PC_CONGEST
? 0 : 3),
register struct element_PS_2
*cpr_normal
;
cpr
-> offset
= type_PS_CPR__type_normal__mode
;
if (cpr_normal
= (struct element_PS_2
*)
calloc (1, sizeof *cpr_normal
)) {
cpr
-> un
.normal__mode
= cpr_normal
;
cpr_normal
-> optionals
|= opt_PS_element_PS_2_reason
;
cpr_normal
-> reason
= result2
- PC_PROV_BASE
;
if (encode_PS_CPR__type (&pe
, 1, 0, NULLCP
, cpr
) != NOTOK
) {
PLOGP (psap2_log
,PS_CPR__type
, pe
, "CPR-type", 0);
(void) pe2ssdu (pe
, &base
, &len
);
bzero ((char *) &ref
, sizeof ref
);
(void) SConnResponse (ss
-> ss_sd
, &ref
, NULLSA
, result
, 0, 0,
SERIAL_NONE
, base
, len
, si
);
(void) psaplose (pi
, result2
, NULLCP
, NULLCP
);