Annotation of 43BSDReno/contrib/isode-beta/h/ppkt.h, revision 1.1.1.1

1.1       root        1: /* ppkt.h - include file for presentation providers (PS-PROVIDER) */
                      2: 
                      3: /* 
                      4:  * $Header: /f/osi/h/RCS/ppkt.h,v 7.0 89/11/23 21:55:51 mrose Rel $
                      5:  *
                      6:  * RFC1085 (LPP) support contributed by the Wollongong Group, Inc.
                      7:  *
                      8:  *
                      9:  * $Log:       ppkt.h,v $
                     10:  * Revision 7.0  89/11/23  21:55:51  mrose
                     11:  * Release 6.0
                     12:  * 
                     13:  */
                     14: 
                     15: /*
                     16:  *                               NOTICE
                     17:  *
                     18:  *    Acquisition, use, and distribution of this module and related
                     19:  *    materials are subject to the restrictions of a license agreement.
                     20:  *    Consult the Preface in the User's Manual for the full terms of
                     21:  *    this agreement.
                     22:  *
                     23:  */
                     24: 
                     25: 
                     26: #ifndef        _PSAP2_
                     27: #include "psap2.h"             /* definitions for PS-USERs */
                     28: #endif
                     29: 
                     30: #include "ssap.h"              /* definitinos for SS-USERs */
                     31: 
                     32: /*  */
                     33: 
                     34: #define        psapPsig(pb, sd) \
                     35: { \
                     36:     if ((pb = findpblk (sd)) == NULL) { \
                     37:        (void) sigiomask (smask); \
                     38:        return psaplose (pi, PC_PARAMETER, NULLCP, \
                     39:                            "invalid presentation descriptor"); \
                     40:     } \
                     41:     if (!(pb -> pb_flags & PB_CONN)) { \
                     42:        (void) sigiomask (smask); \
                     43:        return psaplose (pi, PC_OPERATION, NULLCP, \
                     44:                            "presentation descriptor not connected"); \
                     45:     } \
                     46:     if (pb -> pb_flags & PB_FINN) { \
                     47:        (void) sigiomask (smask); \
                     48:        return psaplose (pi, PC_OPERATION, NULLCP, \
                     49:                            "presentation descriptor finishing"); \
                     50:     } \
                     51:     if (pb -> pb_flags & PB_RELEASE) { \
                     52:        (void) sigiomask (smask); \
                     53:        return psaplose (pi, PC_OPERATION, NULLCP, \
                     54:                            "release in progress"); \
                     55:     } \
                     56: }
                     57: 
                     58: #define        psapFsig(pb, sd) \
                     59: { \
                     60:     if ((pb = findpblk (sd)) == NULL) { \
                     61:        (void) sigiomask (smask); \
                     62:        return psaplose (pi, PC_PARAMETER, NULLCP, \
                     63:                            "invalid presentation descriptor"); \
                     64:     } \
                     65:     if (!(pb -> pb_flags & PB_CONN)) { \
                     66:        (void) sigiomask (smask); \
                     67:        return psaplose (pi, PC_OPERATION, NULLCP, \
                     68:                            "presentation descriptor not connected"); \
                     69:     } \
                     70:     if (!(pb -> pb_flags & PB_FINN)) { \
                     71:        (void) sigiomask (smask); \
                     72:        return psaplose (pi, PC_OPERATION, NULLCP, \
                     73:                            "presentation descriptor not finishing"); \
                     74:     } \
                     75:     if (pb -> pb_flags & PB_RELEASE) { \
                     76:        (void) sigiomask (smask); \
                     77:        return psaplose (pi, PC_OPERATION, NULLCP, \
                     78:                            "release in progress"); \
                     79:     } \
                     80: }
                     81: 
                     82: #define toomuchP(b,n,m,p) \
                     83: { \
                     84:     if (b == NULL) \
                     85:        n = 0; \
                     86:     else \
                     87:        if (n > m) \
                     88:            return psaplose (pi, PC_PARAMETER, NULLCP, \
                     89:                            "too many %s user data elements", p); \
                     90: }
                     91: 
                     92: #define        missingP(p) \
                     93: { \
                     94:     if (p == NULL) \
                     95:        return psaplose (pi, PC_PARAMETER, NULLCP, \
                     96:                            "mandatory parameter \"%s\" missing", "p"); \
                     97: }
                     98: 
                     99: #ifndef        lint
                    100: #ifndef        __STDC__
                    101: #define        copyPSAPdata(base,len,d) \
                    102: { \
                    103:     register int i = len; \
                    104:     if ((d -> d/* */_cc = min (i, sizeof d -> d/* */_data)) > 0) \
                    105:        bcopy (base, d -> d/* */_data, d -> d/* */_cc); \
                    106: }
                    107: #else
                    108: #define        copyPSAPdata(base,len,d) \
                    109: { \
                    110:     register int i = len; \
                    111:     if ((d -> d##_cc = min (i, sizeof d -> d##_data)) > 0) \
                    112:        bcopy (base, d -> d##_data, d -> d##_cc); \
                    113: }
                    114: #endif
                    115: #else
                    116: #define        copyPSAPdata(base,len,d)        bcopy (base, (char *) d, len)
                    117: #endif
                    118: 
                    119: 
                    120: #define        pylose(p) \
                    121:        ppktlose (pb, pi, PC_UNRECOGNIZED, (p), NULLCP, "%s", PY_pepy)
                    122: 
                    123: 
                    124: int    ppktlose (), psaplose ();
                    125: 
                    126: /*  */
                    127: 
                    128: #define        DFLT_ASN        "iso asn.1 abstract syntax"
                    129: #define        DFLT_ATN        BER
                    130: 
                    131: #define        atn_is_ok(pb,atn)       atn_is_ber ((pb), (atn))
                    132: #define        atn_is_ber(pb,atn)      (!oid_cmp (pb -> pb_ber, atn))
                    133: 
                    134: 
                    135: struct psapblk {
                    136:     struct psapblk *pb_forw;   /* doubly-linked list */
                    137:     struct psapblk *pb_back;   /*   .. */
                    138: 
                    139:     int            pb_fd;              /* session descriptor */
                    140: 
                    141:     short   pb_flags;          /* our state */
                    142: #define        PB_NULL         0x00
                    143: #define        PB_CONN         0x01    /* connected */
                    144: #define        PB_FINN         0x02    /* other side wants to finish */
                    145: #define        PB_ASYN         0x04    /* asynchronous */
                    146: #define        PB_DFLT         0x10    /* respond with default context result */
                    147: #define        PB_RELEASE      0x20    /* release in progress */
                    148: 
                    149: #ifndef        LPP
                    150:     char   *pb_retry;          /* initial/final ppkt */
                    151:     char   *pb_realbase;
                    152:     int            pb_len;
                    153: #else
                    154:     PE      pb_retry;
                    155:     PE     pb_response;
                    156: 
                    157:     struct type_PS_SessionConnectionIdentifier *pb_reference;
                    158: 
                    159:     PS     pb_stream;
                    160: 
                    161:     int            pb_reliability;
                    162: 
                    163:     int            pb_maxtries;
                    164:     int            pb_tries;
                    165: #endif
                    166: 
                    167:     int            pb_ncontext;        /* presentation context set */
                    168:     struct PSAPcontext pb_contexts[NPCTX];
                    169: 
                    170:     OID            pb_asn;             /* default: abstract syntax name */
                    171:     OID            pb_atn;             /*   ..     abstract transfer name */
                    172:     int            pb_result;          /*          response */
                    173:     
                    174:     OID            pb_ber;             /* BER */
                    175: 
                    176:     int            pb_prequirements;   /* presentation requirements */
                    177: 
                    178:     int            pb_srequirements;   /* our session requirements */
                    179:     int            pb_urequirements;   /* user's session requirements */
                    180:     int            pb_owned;           /* session tokens we own */
                    181:     int            pb_avail;           /* session tokens available */
                    182:     int            pb_ssdusize;        /* largest atomic SSDU */
                    183: 
                    184: #ifdef LPP
                    185:     struct NSAPaddr pb_initiating;     /* initiator */
                    186: #endif
                    187:     struct PSAPaddr pb_responding;     /* responder */
                    188: 
                    189:     IFP            pb_DataIndication;          /* INDICATION handlers */
                    190:     IFP            pb_TokenIndication;         /*   .. */
                    191:     IFP            pb_SyncIndication;          /*   .. */
                    192:     IFP            pb_ActivityIndication;      /*   .. */
                    193:     IFP            pb_ReportIndication;        /*   .. */
                    194:     IFP            pb_ReleaseIndication;       /*   .. */
                    195:     IFP            pb_AbortIndication;         /*   .. */
                    196: 
                    197: #ifdef LPP
                    198:     IFP            pb_retryfnx;
                    199:     IFP     pb_closefnx;
                    200:     IFP            pb_selectfnx;
                    201:     IFP            pb_checkfnx;
                    202: #endif
                    203: };
                    204: #define        NULLPB          ((struct psapblk *) 0)
                    205: 
                    206: int    freepblk ();
                    207: struct psapblk *newpblk (), *findpblk ();
                    208: 
                    209: #ifndef        LPP
                    210: #define        PC_PROV_BASE            PC_NOTSPECIFIED
                    211: #define        PC_ABORT_BASE \
                    212:        (PC_UNRECOGNIZED - int_PS_Abort__reason_unrecognized__ppdu)
                    213: #define        PC_REASON_BASE \
                    214:        (PC_ABSTRACT - int_PS_provider__reason_abstract__syntax__not__supported)
                    215: 
                    216: 
                    217: struct type_PS_User__data *info2ppdu ();
                    218: int    ppdu2info ();
                    219: 
                    220: int    info2ssdu (), ssdu2info (), qbuf2info ();
                    221: 
                    222: struct qbuf *info2qb ();
                    223: int    qb2info ();
                    224: 
                    225: struct type_PS_Identifier__list *silly_list ();
                    226: 
                    227: int    ss2pslose (), ss2psabort ();
                    228: 
                    229: 
                    230: struct pair {
                    231:     int            p_mask;
                    232:     int            p_bitno;
                    233: };
                    234: 
                    235: extern struct pair preq_pairs[], sreq_pairs[];
                    236: #endif
                    237: 
                    238: /*  */
                    239: 
                    240: #define        REASON_BASE     PC_NOTSPECIFIED
                    241: 
                    242: #ifndef        LPP
                    243: #define        PPDU_NONE       (-1)
                    244: #define        PPDU_CP         0
                    245: #define        PPDU_CPA        1
                    246: #define        PPDU_CPR        2
                    247: #define        PPDU_ARU        3
                    248: #define        PPDU_ARP        4
                    249: #define        PPDU_TD         7
                    250: #define        PPDU_RS        12
                    251: #define        PPDU_RSA       13
                    252: #else
                    253: #define        PR_KERNEL       0x0000  /* kernel (yuk) */
                    254: 
                    255: #define        NPCTX_PS        2       /* maximum number of contexts */
                    256: #define        NPDATA_PS       1       /* maximum number of PDVs in a request */
                    257: #define        PCI_ROSE        1       /* PCI for SASE using ROSE */
                    258: #define        PCI_ACSE        3       /* PCI for ACSE */
                    259: 
                    260: #define        PT_TCP          'T'     /* TCP providing backing */
                    261: #define        PT_UDP          'U'     /* UDP providing backing */
                    262: 
                    263: #define        NULLRF  ((struct type_PS_SessionConnectionIdentifier *) 0)
                    264: 
                    265: 
                    266: #define        pslose(pi,reason) \
                    267:     (reason != PS_ERR_NONE && reason != PS_ERR_IO \
                    268:        ? psaplose ((pi), PC_CONGEST, NULLCP, "%s", ps_error (reason)) \
                    269:        : psaplose ((pi), PC_SESSION, NULLCP, NULLCP))
                    270: 
                    271: 
                    272: int    pdu2sel (), refcmp ();
                    273: struct SSAPref *pdu2ref ();
                    274: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.