/* ppkt.h - include file for presentation providers (PS-PROVIDER) */
* $Header: /f/osi/h/RCS/ppkt.h,v 7.1 91/02/22 09:24:53 mrose Interim $
* RFC1085 (LPP) support contributed by the Wollongong Group, Inc.
* Revision 7.1 91/02/22 09:24:53 mrose
* Revision 7.0 89/11/23 21:55:51 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
#include "psap2.h" /* definitions for PS-USERs */
#include "ssap.h" /* definitinos for SS-USERs */
#define psapPsig(pb, sd) \
if ((pb = findpblk (sd)) == NULL) { \
(void) sigiomask (smask); \
return psaplose (pi, PC_PARAMETER, NULLCP, \
"invalid presentation descriptor"); \
if (!(pb -> pb_flags & PB_CONN)) { \
(void) sigiomask (smask); \
return psaplose (pi, PC_OPERATION, NULLCP, \
"presentation descriptor not connected"); \
if (pb -> pb_flags & PB_FINN) { \
(void) sigiomask (smask); \
return psaplose (pi, PC_OPERATION, NULLCP, \
"presentation descriptor finishing"); \
if (pb -> pb_flags & PB_RELEASE) { \
(void) sigiomask (smask); \
return psaplose (pi, PC_OPERATION, NULLCP, \
"release in progress"); \
#define psapFsig(pb, sd) \
if ((pb = findpblk (sd)) == NULL) { \
(void) sigiomask (smask); \
return psaplose (pi, PC_PARAMETER, NULLCP, \
"invalid presentation descriptor"); \
if (!(pb -> pb_flags & PB_CONN)) { \
(void) sigiomask (smask); \
return psaplose (pi, PC_OPERATION, NULLCP, \
"presentation descriptor not connected"); \
if (!(pb -> pb_flags & PB_FINN)) { \
(void) sigiomask (smask); \
return psaplose (pi, PC_OPERATION, NULLCP, \
"presentation descriptor not finishing"); \
if (pb -> pb_flags & PB_RELEASE) { \
(void) sigiomask (smask); \
return psaplose (pi, PC_OPERATION, NULLCP, \
"release in progress"); \
#define toomuchP(b,n,m,p) \
return psaplose (pi, PC_PARAMETER, NULLCP, \
"too many %s user data elements", p); \
return psaplose (pi, PC_PARAMETER, NULLCP, \
"mandatory parameter \"%s\" missing", "p"); \
#define copyPSAPdata(base,len,d) \
if ((d -> d/* */_cc = min (i, sizeof d -> d/* */_data)) > 0) \
bcopy (base, d -> d/* */_data, d -> d/* */_cc); \
#define copyPSAPdata(base,len,d) \
if ((d -> d##_cc = min (i, sizeof d -> d##_data)) > 0) \
bcopy (base, d -> d##_data, d -> d##_cc); \
#define copyPSAPdata(base,len,d) bcopy (base, (char *) d, len)
ppktlose (pb, pi, PC_UNRECOGNIZED, (p), NULLCP, "%s", PY_pepy)
int ppktlose (), psaplose ();
#define DFLT_ASN "iso asn.1 abstract syntax"
#define atn_is_ok(pb,atn) atn_is_ber ((pb), (atn))
#define atn_is_ber(pb,atn) (!oid_cmp (pb -> pb_ber, atn))
struct psapblk
*pb_forw
; /* doubly-linked list */
struct psapblk
*pb_back
; /* .. */
int pb_fd
; /* session descriptor */
short pb_flags
; /* our state */
#define PB_CONN 0x01 /* connected */
#define PB_FINN 0x02 /* other side wants to finish */
#define PB_ASYN 0x04 /* asynchronous */
#define PB_DFLT 0x10 /* respond with default context result */
#define PB_RELEASE 0x20 /* release in progress */
char *pb_retry
; /* initial/final ppkt */
struct type_PS_SessionConnectionIdentifier
*pb_reference
;
int pb_ncontext
; /* presentation context set */
struct PSAPcontext pb_contexts
[NPCTX
];
OID pb_asn
; /* default: abstract syntax name */
OID pb_atn
; /* .. abstract transfer name */
int pb_result
; /* response */
int pb_prequirements
; /* presentation requirements */
int pb_srequirements
; /* our session requirements */
int pb_urequirements
; /* user's session requirements */
int pb_owned
; /* session tokens we own */
int pb_avail
; /* session tokens available */
int pb_ssdusize
; /* largest atomic SSDU */
struct NSAPaddr pb_initiating
; /* initiator */
struct PSAPaddr pb_responding
; /* responder */
IFP pb_DataIndication
; /* INDICATION handlers */
IFP pb_TokenIndication
; /* .. */
IFP pb_SyncIndication
; /* .. */
IFP pb_ActivityIndication
; /* .. */
IFP pb_ReportIndication
; /* .. */
IFP pb_ReleaseIndication
; /* .. */
IFP pb_AbortIndication
; /* .. */
#define NULLPB ((struct psapblk *) 0)
struct psapblk
*newpblk (), *findpblk ();
#define PC_PROV_BASE PC_NOTSPECIFIED
(PC_UNRECOGNIZED - int_PS_Abort__reason_unrecognized__ppdu)
(PC_ABSTRACT - int_PS_provider__reason_abstract__syntax__not__supported)
struct type_PS_User__data
*info2ppdu ();
int info2ssdu (), ssdu2info (), qbuf2info ();
struct type_PS_Identifier__list
*silly_list ();
int ss2pslose (), ss2psabort ();
extern struct pair preq_pairs
[], sreq_pairs
[];
#define REASON_BASE PC_NOTSPECIFIED
#define PR_KERNEL 0x0000 /* kernel (yuk) */
#define NPCTX_PS 2 /* maximum number of contexts */
#define NPDATA_PS 1 /* maximum number of PDVs in a request */
#define PCI_ROSE 1 /* PCI for SASE using ROSE */
#define PCI_ACSE 3 /* PCI for ACSE */
#define PT_TCP 'T' /* TCP providing backing */
#define PT_UDP 'U' /* UDP providing backing */
#define NULLRF ((struct type_PS_SessionConnectionIdentifier *) 0)
#define pslose(pi,reason) \
(reason != PS_ERR_NONE && reason != PS_ERR_IO \
? psaplose ((pi), PC_CONGEST, NULLCP, "%s", ps_error (reason)) \
: psaplose ((pi), PC_SESSION, NULLCP, NULLCP))
int pdu2sel (), refcmp ();
struct SSAPref
*pdu2ref ();