DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T r

⟦6b5faf69d⟧ TextFile

    Length: 2645 (0xa55)
    Types: TextFile
    Names: »ro2ssexec.c«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z« 
        └─⟦de7628f85⟧ 
            └─⟦this⟧ »isode-6.0/rosap/ro2ssexec.c« 

TextFile

/* ro2ssexec.c - RTPM: exec */

#ifndef	lint
static char *rcsid = "$Header: /f/osi/rosap/RCS/ro2ssexec.c,v 7.0 89/11/23 22:21:18 mrose Rel $";
#endif

/* 
 * $Header: /f/osi/rosap/RCS/ro2ssexec.c,v 7.0 89/11/23 22:21:18 mrose Rel $
 *
 * Based on an TCP-based implementation by George Michaelson of University
 * College London.
 *
 *
 * $Log:	ro2ssexec.c,v $
 * Revision 7.0  89/11/23  22:21:18  mrose
 * Release 6.0
 * 
 */

/*
 *				  NOTICE
 *
 *    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
 *    this agreement.
 *
 */


/* LINTLIBRARY */

#include <stdio.h>
#include "ropkt.h"
#include "isoservent.h"
#include "tailor.h"

/* \f

   SERVER only */

int	RoExec (ss, roi, arg1, arg2, hook, setperms)
struct SSAPstart *ss;
char   *arg1,
       *arg2;
struct RoSAPindication *roi;
IFP	hook,
	setperms;
{
    int     result,
            result2;
    register struct isoservent *is;
    register PE	    pe;
    struct SSAPref ref;
    struct SSAPindication   sis;
    register struct SSAPindication *si = &sis;

    missingP (ss);
    missingP (roi);
    missingP (arg1);
    missingP (arg2);

    acsap_conntype = CN_OPEN, acsap_data = NULLPE;
    if ((pe = ssdu2pe (ss -> ss_data, ss -> ss_cc, NULLCP, &result)) == NULLPE
	    || parse_OACS_PConnect (pe, 1, NULLIP, NULLVP, NULLCP) == NOTOK) {
	if (pe)
	    pe_free (pe);
	if (result == PS_ERR_NMEM) {
    congest: ;
	    result = SC_CONGESTION, result2 = ROS_CONGEST;
	}
	else
	    result = SC_REJECTED, result2 = ROS_PROTOCOL;
	goto out;
    }

    PLOG (rosap_log, print_OACS_PConnect, pe, "PConnect", 1);

    pe_free (pe);

    if (acsap_conntype != CN_OPEN) {
	result = SC_REJECTED, result2 = ROS_ADDRESS;
	goto out;
    }	
    if (is = getisoserventbyport ("rosap", 
	    (u_short) htons ((u_short) acsap_application))) {
	*is -> is_tail++ = arg1;
	*is -> is_tail++ = arg2;
	*is -> is_tail = NULL;
    }
    else {
	result = SC_REJECTED, result2 = ROS_ADDRESS;
	goto out;
    }

    switch (hook ? (*hook) (is, roi) : OK) {
	case NOTOK: 
	    return NOTOK;

	case DONE: 
	    return OK;

	case OK: 
	    if (setperms)
		(void) (*setperms) (is);
	    (void) execv (*is -> is_vec, is -> is_vec);/* fall */
	    SLOG (rosap_log, LLOG_FATAL, *is -> is_vec, ("unable to exec"));
	default: 
	    goto congest;
    }

out: ;
    SSFREE (ss);

    bzero ((char *) &ref, sizeof ref);
    (void) SConnResponse (ss -> ss_sd, &ref, NULLSA,
		result, 0, 0, SERIAL_NONE, NULLCP, 0, si);
    return rosaplose (roi, result2, NULLCP, NULLCP);
}