Annotation of 43BSDReno/contrib/isode-beta/h/acpkt.h, revision 1.1

1.1     ! root        1: /* acpkt.h - include file for association control providers (AcS-PROVIDER) */
        !             2: 
        !             3: /* 
        !             4:  * $Header: /f/osi/h/RCS/acpkt.h,v 7.2 90/07/01 21:03:46 mrose Exp $
        !             5:  *
        !             6:  *
        !             7:  * $Log:       acpkt.h,v $
        !             8:  * Revision 7.2  90/07/01  21:03:46  mrose
        !             9:  * pepsy
        !            10:  * 
        !            11:  * Revision 7.1  90/01/11  18:35:57  mrose
        !            12:  * real-sync
        !            13:  * 
        !            14:  * Revision 7.0  89/11/23  21:55:37  mrose
        !            15:  * Release 6.0
        !            16:  * 
        !            17:  */
        !            18: 
        !            19: /*
        !            20:  *                               NOTICE
        !            21:  *
        !            22:  *    Acquisition, use, and distribution of this module and related
        !            23:  *    materials are subject to the restrictions of a license agreement.
        !            24:  *    Consult the Preface in the User's Manual for the full terms of
        !            25:  *    this agreement.
        !            26:  *
        !            27:  */
        !            28: 
        !            29: 
        !            30: #ifndef        _AcSAP_
        !            31: #include "acsap.h"             /* definitions for AcS-USERs */
        !            32: #endif
        !            33: 
        !            34: #ifndef        _PSAP2_
        !            35: #include "psap2.h"             /* definitions for PS-USERs */
        !            36: #endif
        !            37: 
        !            38: /*  */
        !            39: 
        !            40: #ifdef ACSE
        !            41: 
        !            42: #define        AC_ASN          "acse pci version 1"
        !            43: 
        !            44: #define        acsapPsig(acb, sd) \
        !            45: { \
        !            46:     if ((acb = findacblk (sd)) == NULL) { \
        !            47:        (void) sigiomask (smask); \
        !            48:        return acsaplose (aci, ACS_PARAMETER, NULLCP, \
        !            49:                            "invalid association descriptor"); \
        !            50:     } \
        !            51:     if (!(acb -> acb_flags & ACB_CONN)) { \
        !            52:        (void) sigiomask (smask); \
        !            53:        return acsaplose (aci, ACS_OPERATION, NULLCP, \
        !            54:                            "assocation descriptor not connected"); \
        !            55:     } \
        !            56:     if (acb -> acb_flags & ACB_FINN) { \
        !            57:        (void) sigiomask (smask); \
        !            58:        return acsaplose (aci, ACS_OPERATION, NULLCP, \
        !            59:                            "association descriptor finishing"); \
        !            60:     } \
        !            61:     if (acb -> acb_flags & ACB_RELEASE) { \
        !            62:        (void) sigiomask (smask); \
        !            63:        return acsaplose (aci, ACS_OPERATION, NULLCP, \
        !            64:                            "release in progress"); \
        !            65:     } \
        !            66: }
        !            67: 
        !            68: #define        acsapFsig(acb, sd) \
        !            69: { \
        !            70:     if ((acb = findacblk (sd)) == NULL) {\
        !            71:        (void) sigiomask (smask);\
        !            72:        return acsaplose (aci, ACS_PARAMETER, NULLCP, \
        !            73:                            "invalid association descriptor"); \
        !            74:     } \
        !            75:     if (!(acb -> acb_flags & ACB_CONN)) { \
        !            76:        (void) sigiomask (smask); \
        !            77:        return acsaplose (aci, ACS_OPERATION, NULLCP, \
        !            78:                            "assocation descriptor not connected"); \
        !            79:     } \
        !            80:     if (!(acb -> acb_flags & ACB_FINN)) { \
        !            81:        (void) sigiomask (smask); \
        !            82:        return acsaplose (aci, ACS_OPERATION, NULLCP, \
        !            83:                            "association descriptor not finishing"); \
        !            84:     } \
        !            85:     if (acb -> acb_flags & ACB_RELEASE) { \
        !            86:        (void) sigiomask (smask); \
        !            87:        return acsaplose (aci, ACS_OPERATION, NULLCP, \
        !            88:                            "release in progress"); \
        !            89:     } \
        !            90: }
        !            91: 
        !            92: #define        toomuchP(b,n,m,p) \
        !            93: { \
        !            94:     if (b == NULL) \
        !            95:        n = 0; \
        !            96:     else \
        !            97:        if (n > m) \
        !            98:            return acsaplose (aci, ACS_PARAMETER, NULLCP, \
        !            99:                                "too many %s user data elements", p); \
        !           100: }
        !           101: 
        !           102: #define        missingP(p) \
        !           103: { \
        !           104:     if (p == NULL) \
        !           105:        return acsaplose (aci, ACS_PARAMETER, NULLCP, \
        !           106:                            "mandatory parameter \"%s\" missing", "p"); \
        !           107: }
        !           108: 
        !           109: #ifndef        lint
        !           110: #ifndef        __STDC__
        !           111: #define        copyAcSAPdata(base,len,d) \
        !           112: { \
        !           113:     register int i = len; \
        !           114:     if ((d -> d/* */_cc = min (i, sizeof d -> d/* */_data)) > 0) \
        !           115:        bcopy (base, d -> d/* */_data, d -> d/* */_cc); \
        !           116: }
        !           117: #else
        !           118: #define        copyAcSAPdata(base,len,d) \
        !           119: { \
        !           120:     register int i = len; \
        !           121:     if ((d -> d##_cc = min (i, sizeof d -> d##_data)) > 0) \
        !           122:        bcopy (base, d -> d##_data, d -> d##_cc); \
        !           123: }
        !           124: #endif
        !           125: #else
        !           126: #define        copyAcSAPdata(base,len,d)       bcopy (base, (char *) d, len)
        !           127: #endif
        !           128: 
        !           129: 
        !           130: #define        ACS_USER_BASE   ACS_USER_NULL
        !           131: #define        ACS_PROV_BASE   ACS_PROV_NULL
        !           132: 
        !           133: 
        !           134: int    acpktlose (), acsaplose ();
        !           135: 
        !           136: /*  */
        !           137: 
        !           138: int    ps2acslose ();
        !           139: 
        !           140: struct type_ACS_Association__information *info2apdu ();
        !           141: int    apdu2info ();
        !           142: #endif
        !           143: 
        !           144: /*  */
        !           145: 
        !           146: struct assocblk {
        !           147:     struct assocblk *acb_forw; /* doubly-linked list */
        !           148:     struct assocblk *acb_back; /*   .. */
        !           149: 
        !           150:     int            acb_fd;             /* session/presentation descriptor */
        !           151: 
        !           152:     short   acb_flags;         /* our state */
        !           153: #define        ACB_NULL        0x0000
        !           154: #define        ACB_CONN        0x0001  /* connected */
        !           155: #define        ACB_FINN        0x0002  /* other side wants to finish */
        !           156: #define        ACB_INIT        0x0004  /* this side initiated the association */
        !           157: #define        ACB_ASYN        0x0008  /* asynchronous */
        !           158: #define        ACB_TURN        0x0010  /* we have the turn */
        !           159: #define        ACB_TWA         0x0020  /* two-way alternate */
        !           160: #define        ACB_ACT         0x0040  /* activity in progress */
        !           161: #define        ACB_PLEASE      0x0080  /* RTS: RT-TURN-PLEASE received
        !           162:                                   ROS on Session: sent S-PLEASE-TOKENS */
        !           163: #define        ACB_TIMER       0x0100  /* ACTIVITY discarded due to timing
        !           164:                                   constraint */
        !           165: #define        ACB_ROS         0x0200  /* ROS started association */
        !           166: #define        ACB_RTS         0x0400  /* RTS   .. */
        !           167: #define        ACB_ACS         0x0800  /* ACS   .. */
        !           168: #define        ACB_CLOSING     0x1000  /* waiting to close */
        !           169: #define        ACB_FINISH      0x2000  /*   .. */
        !           170: #define        ACB_STICKY      0x4000  /* ROS using RTS (ugh!) */
        !           171: #define        ACB_RELEASE     0x8000  /* release in progress */
        !           172: 
        !           173:     struct SSAPref acb_connect;        /* session connection reference */
        !           174: 
        !           175:     int            acb_requirements;   /* session requirements */
        !           176:     int            acb_owned;          /* session tokens we own */
        !           177:     int            acb_avail;          /* session tokens available */
        !           178:     int            acb_settings;       /* initial settings */
        !           179:     int            acb_ssdusize;       /* largest atomic SSDU */
        !           180: 
        !           181:     IFP            acb_uabort;         /* disconnect underlying service */
        !           182: 
        !           183: /* ACSE */
        !           184:     int            acb_sversion;       /* session service version number */
        !           185:     int            acb_id;             /* ACSE context id */
        !           186:     OID            acb_context;        /* application context name */
        !           187:     int            acb_offset;         /* offset to ACSE PCI */
        !           188:                                /* negative means at END */
        !           189:     PE     acb_retry;          /* final acpkt */
        !           190:     
        !           191: /* RTSE */
        !           192:     int            acb_rtsid;          /* RTSE context id */
        !           193:     int            acb_ckpoint;        /* checkpoint size */
        !           194:     int            acb_window;         /* window size */
        !           195:     int            acb_actno;          /* sending activity serial number */
        !           196:     long    acb_ssn;           /* highest serial number sent */
        !           197:     int            acb_ack;            /* highest serial number acknowledged */
        !           198: 
        !           199:     IFP            acb_pturnrequest;   /* RT-TURN-PLEASE.REQUEST */
        !           200:     IFP            acb_gturnrequest;   /* RT-TURN-GIVE.REQUEST */
        !           201:     IFP            acb_transferequest; /* RT-TRANSER.REQUEST */
        !           202:     IFP            acb_rtwaitrequest;  /* RT-WAIT.REQUEST */
        !           203:     IFP            acb_rtsetindications;/* define vectors for INDICATION events */
        !           204:     IFP            acb_rtselectmask;   /* map association descriptors for select () */
        !           205:     IFP            acb_rtpktlose;      /* protocol-level abort */
        !           206: 
        !           207:     int            acb_priority;       /* priority of please turn */
        !           208:     struct AcSAPfinish acb_finish;
        !           209: 
        !           210:     char   *acb_realbase;      /* APDU in transit */
        !           211:     char   *acb_base;          /*   .. */
        !           212:     int            acb_len;            /*   .. */
        !           213:     
        !           214:     IFP            acb_uptrans;        /* upcall for up-transfer */
        !           215:     IFP            acb_downtrans;      /* upcall for down-transfer */
        !           216: 
        !           217:     IFP            acb_rtsindication;  /* rts event handler */
        !           218: 
        !           219: /* ROSE */
        !           220:     int            acb_rosid;          /* ROSE (SASE) context id */
        !           221:     IFP            acb_putosdu;        /* osdu2acb */
        !           222:     IFP            acb_rowaitrequest;  /* RO-WAIT.REQUEST */
        !           223:     IFP            acb_ready;          /* get HDX permission */
        !           224:     IFP            acb_rosetindications;/* define vectors for INDICATION events */
        !           225:     IFP            acb_roselectmask;   /* map association descriptors for select () */
        !           226:     IFP            acb_ropktlose;      /* protocol-level abort */
        !           227:     PE     (*acb_getosdu) ();  /* for users of THORN... */
        !           228: 
        !           229:     PE     acb_apdu;           /* APDU buffered */
        !           230:     
        !           231:     IFP            acb_rosindication;  /* ros event handler */
        !           232: };
        !           233: #define        NULLACB         ((struct assocblk *) 0)
        !           234: 
        !           235: #define        FREEACB(acb) \
        !           236: { \
        !           237:     if ((acb) -> acb_realbase) \
        !           238:        free ((acb) -> acb_realbase); \
        !           239:     else \
        !           240:        if ((acb) -> acb_base) \
        !           241:            free ((acb) -> acb_base); \
        !           242:     (acb) -> acb_realbase = (acb) -> acb_base = NULL, (acb) -> acb_len = 0; \
        !           243: }
        !           244: 
        !           245: 
        !           246: int    freeacblk ();
        !           247: struct assocblk *newacblk (), *findacblk ();
        !           248: 
        !           249: /*  */
        !           250: 
        !           251: #ifndef        ACSE
        !           252: 
        !           253:                                /* PConnect Types */
        !           254: #define        PCONN_DTS       0       /* Data Transfer Syntax */
        !           255: #define        PCONN_DATA      1       /* User Data */
        !           256: #define          PCONN_DATA_CK 0       /*   Checkpoint Size */
        !           257: #define            PCONN_CK_DFLT 0
        !           258: #define          PCONN_DATA_WD 1       /*   Window Size */
        !           259: #define            PCONN_WD_DFLT 3
        !           260: #define          PCONN_DATA_DM 2       /*   Dialogue-mode */
        !           261: #define            PCONN_DM_MONO 0     /*     monologue */
        !           262: #define            PCONN_DM_TWA  1     /*     two-way alternate */
        !           263: #define            PCONN_DM_DFLT PCONN_DM_MONO
        !           264: #define          PCONN_DATA_CN 3       /*   Connection Data */
        !           265: #define          PCONN_DATA_AP 4       /*   Application Protocol */
        !           266: #define            PCONN_AP_DFLT 1
        !           267: 
        !           268: 
        !           269:                                /* PAccept Types */
        !           270: #define        PACC_DTS        0       /* Data Transfer Syntax */
        !           271: #define        PACC_DATA       1       /* User Data */
        !           272: #define   PACC_DATA_CK  0      /*   Checkpoint Size */
        !           273: #define            PACC_CK_DFLT 0
        !           274: #define   PACC_DATA_WD  1      /*   Window Size */
        !           275: #define            PACC_WD_DFLT 3
        !           276: #define   PACC_DATA_CN  2      /*   Connection Data */
        !           277: 
        !           278: 
        !           279:                                /* PRefuse Types */
        !           280: #define        PREF_REASON     0       /* Refuse Reason */
        !           281: 
        !           282: 
        !           283:                                /* Data Transfer Syntax Types */
        !           284: #define        DTS_SYNTAX      0       /* IMPLICIT INTEGER */
        !           285: #define SYN_X409       0       /* x.409 */
        !           286: 
        !           287: 
        !           288:                                /* Connection Data Types */
        !           289: #define CN_OPEN                0       /* Open */
        !           290: #define        CN_RECOVER      1       /* Recover */
        !           291: 
        !           292: 
        !           293:                                /* Refuse codes */
        !           294: #define        REFUSE_BUSY     0       /* Busy */
        !           295: #define        REFUSE_RECOVER  1       /* Cannot recover */
        !           296: #define        REFUSE_VALIDATE 2       /* Validation failure */
        !           297: #define        REFUSE_MODE     3       /* Unacceptable dialogue mode */
        !           298: 
        !           299: 
        !           300:                                /* Abort codes */
        !           301: #define        ABORT_LSP       0       /* Local system problem */
        !           302: #define        ABORT_INV       1       /* Invalid parameter */
        !           303: #define        ABORT_ACT       2       /* Unrecognized activity */
        !           304: #define        ABORT_TMP       3       /* Temporary problem */
        !           305: #define        ABORT_PROTO     4       /* Protocol error */
        !           306: #define        ABORT_PERM      5       /* Permanent problem */
        !           307: #define        ABORT_USER      6       /* User abort */
        !           308: #define        ABORT_TRANS     7       /* Transfer completed */
        !           309: #endif

unix.superglobalmegacorp.com

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