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

1.1       root        1: /* ftam.h - include file for FTAM users (FS-USER) */
                      2: 
                      3: /* 
                      4:  * $Header: /f/osi/h/RCS/ftam.h,v 7.1 90/03/23 10:52:56 mrose Exp $
                      5:  *
                      6:  *
                      7:  * $Log:       ftam.h,v $
                      8:  * Revision 7.1  90/03/23  10:52:56  mrose
                      9:  * update
                     10:  * 
                     11:  * Revision 7.0  89/11/23  21:55:41  mrose
                     12:  * Release 6.0
                     13:  * 
                     14:  */
                     15: 
                     16: /*
                     17:  *                               NOTICE
                     18:  *
                     19:  *    Acquisition, use, and distribution of this module and related
                     20:  *    materials are subject to the restrictions of a license agreement.
                     21:  *    Consult the Preface in the User's Manual for the full terms of
                     22:  *    this agreement.
                     23:  *
                     24:  */
                     25: 
                     26: 
                     27: #ifndef        _FTAM_
                     28: #define        _FTAM_
                     29: 
                     30: #ifndef        _PSAP2_
                     31: #include "psap2.h"             /* definitions for PS-USERs */
                     32: #endif
                     33: #include "logger.h"
                     34: 
                     35: /*  */
                     36: 
                     37:                                /* FTAM-QoS */
                     38: #define        FQOS_NORECOVERY 0       /*   no-recovery */
                     39: #define        FQOS_CLASS1     1       /*   class-1-recovery */
                     40: #define        FQOS_CLASS2     2       /*   class-2-recovery */
                     41: #define        FQOS_CLASS3     3       /*   class-3-recovery */
                     42: #define        MY_FQOS         FQOS_NORECOVERY
                     43: 
                     44: 
                     45:                                /* Service-Class */
                     46: #define        FCLASS_UNCONS   0x01    /*   unconstrained-class */
                     47: #define        FCLASS_MANAGE   0x02    /*   management-class */
                     48: #define        FCLASS_TRANSFER 0x04    /*   transfer-class */
                     49: #define        FCLASS_TM       0x08    /*   transfer-and-management-class */
                     50: #define        FCLASS_ACCESS   0x10    /*   access-class */
                     51: 
                     52:                                /* Functional-Units */
                     53: #define        FUNIT_READ      0x001   /*   read */
                     54: #define        FUNIT_WRITE     0x002   /*   write */
                     55: #define        FUNIT_ACCESS    0x004   /*   file-access */
                     56: #define        FUNIT_LIMITED   0x008   /*   limited-file-managment */
                     57: #define        FUNIT_ENHANCED  0x010   /*   enhanced-file-management */
                     58: #define        FUNIT_GROUPING  0x020   /*   grouping */
                     59: #define        FUNIT_FADULOCK  0x040   /*   fadu-locking */
                     60: #define        FUNIT_RECOVERY  0x080   /*   recovery */
                     61: #define        FUNIT_RESTART   0x100   /*   restart-data-transfer */
                     62: #define        MY_FUNIT        (FUNIT_READ | FUNIT_WRITE | FUNIT_ACCESS \
                     63:                                | FUNIT_LIMITED | FUNIT_ENHANCED \
                     64:                                | FUNIT_GROUPING | FUNIT_FADULOCK)
                     65: 
                     66:                                /* Attribute-Groups */
                     67: #define        FATTR_STORAGE   0x01    /*   storage */
                     68: #define        FATTR_SECURITY  0x02    /*   security */
                     69: #define        FATTR_PRIVATE   0x04    /*   private */
                     70: #define        MY_FATTR        (FATTR_STORAGE | FATTR_SECURITY)
                     71: 
                     72: 
                     73:                                /* State-Result */
                     74: #define        FSTATE_SUCCESS  0       /*   success */
                     75: #define        FSTATE_FAILURE  1       /*   failure */
                     76: 
                     77:                                /* Action-Result */
                     78: #define        FACTION_SUCCESS 0       /*   success */
                     79: #define        FACTION_TRANS   1       /*   transient-error */
                     80: #define        FACTION_PERM    2       /*   permanent-error */
                     81: 
                     82: /*  */
                     83: 
                     84: struct FTAMcontent {
                     85:     OID            fc_dtn;             /* Document-Type-Name */
                     86: 
                     87:                                /* associated presentation context info */
                     88:     int            fc_id;              /*   identifier */
                     89:     int            fc_result;          /*   status */
                     90: };
                     91:     
                     92:     
                     93: struct FTAMcontentlist {       /* Contents-Type-List */
                     94:     int            fc_ncontent;        /* number of contents */
                     95: 
                     96: #define        NFCONT  (NPCTX - 2)     /* not-so-arbitrary */
                     97:     struct FTAMcontent fc_contents[NFCONT];
                     98: };
                     99: 
                    100: /*  */
                    101: 
                    102: struct FTAMdiagnostic {                /* Diagnostic */
                    103:     int            ftd_type;           /* diagnostic-type */
                    104: #define        DIAG_INFORM     0       /*   informative */
                    105: #define        DIAG_TRANS      1       /*   transient */
                    106: #define        DIAG_PERM       2       /*   permanent */
                    107: 
                    108:     int            ftd_identifier;     /* error-identifier */
                    109: #define        FS_CODE2OFF(c)  ((c) % 1000)
                    110: 
                    111: #define        FS_GEN_BASE     0       /* General FTAM diagnostics */
                    112: #define        FS_GEN_NOREASON 0       /* No reason */
                    113: #define        FS_GEN_RESPONDER 1      /* Responder error (unspecific) */
                    114: #define        FS_GEN_SHUTDOWN 2       /* System shutdown */
                    115: #define        FS_GEN_MGMT     3       /* FTAM management problem (unspecific) */
                    116: #define        FS_GEN_MGMTACCT 4       /* FTAM management, bad account */
                    117: #define        FS_GEN_MGMTPASS 5       /* FTAM management, security not passed */
                    118: #define        FS_GEN_DELAY    6       /* Delay may be encountered */
                    119: #define        FS_GEN_INITIATOR 7      /* Initiator error (unspecific) */
                    120: #define        FS_GEN_SUBSEQ   8       /* Subsequent error */
                    121: #define        FS_GEN_TEMPORAL 9       /* Temporal insufficiency of resources */
                    122: #define        FS_GEN_VFSECURE 10      /* Access request violates VFS security */
                    123: #define        FS_GEN_LSECURE  11      /* Access request violates local security */
                    124: #define        FS_GEN_WAITING  12      /* Indications waiting (unofficial) */
                    125: 
                    126: #define        FS_PRO_BASE     1000    /* Protocol and supporting service related
                    127:                                   diagnostics */
                    128: #define        FS_PRO_CONFLICT 1000    /* Conflicting parameter values */
                    129: #define        FS_PRO_UNSUPORT 1001    /* Unsupported parameter values */
                    130: #define        FS_PRO_MANDATORY 1002   /* Mandatory parameter not set */
                    131: #define        FS_PRO_UNPARAM  1003    /* Unsupported parameter */
                    132: #define        FS_PRO_DUPARAM  1004    /* Duplicated parameter */
                    133: #define        FS_PRO_ILLEGAL  1005    /* Illegal parameter type */
                    134: #define        FS_PRO_UNTYPE   1006    /* Unsupported parameter type */
                    135: #define        FS_PRO_ERR      1007    /* FTAM protocol error (unspecific) */
                    136: #define        FS_PRO_ERRPROC  1008    /* FTAM protocol error, procedure error */
                    137: #define        FS_PRO_ERRFUNIT 1009    /* FTAM protocol error, functional unit error*/
                    138: #define        FS_PRO_ERRMSG   1010    /* FTAM protocol error, corruption error */
                    139: #define        FS_PRO_LOWFAIL  1011    /* Lower layer failure */
                    140: #define        FS_PRO_LOWADDR  1012    /* Lower layer addressing error */
                    141: #define        FS_PRO_TIMEOUT  1013    /* Timeout */
                    142: #define        FS_PRO_SHUTDOWN 1014    /* System shutdown */
                    143: #define        FS_PRO_GROUPING 1015    /* Illegal grouping sequence */
                    144: #define        FS_PRO_THRESH   1016    /* Grouping threshold violation */
                    145: #define        FS_PRO_PDU      1017    /* Specific PDU request inconsistent with the
                    146:                                   current requested access */
                    147: 
                    148: #define        FS_ACS_BASE     2000    /* Association related diagnostics */
                    149: #define        FS_ACS_USER     2000    /* Association with user not allowed */
                    150: #define        FS_ACS_2001     2001    /* not assigned, #2001  */
                    151: #define        FS_ACS_CLASS    2002    /* Unsupported service class */
                    152: #define        FS_ACS_FUNIT    2003    /* Unsupported functional unit */
                    153: #define        FS_ACS_GRP      2004    /* Attribute group error (unspecific) */
                    154: #define        FS_ACS_GRPSUP   2005    /* Attribute group not supported */
                    155: #define        FS_ACS_GRPALL   2006    /* Attribute group not allowed */
                    156: #define        FS_ACS_ACCT     2007    /* Bad account */
                    157: #define        FS_ACS_MGMT     2008    /* Association management (unspecific) */
                    158: #define        FS_ACS_MGMTADDR 2009    /* Association management - bad address */
                    159: #define        FS_ACS_MGMTACCT 2010    /* Association management - bad account */
                    160: #define        FS_ACS_CKPLARGE 2011    /* Checkpoint window error - too large */
                    161: #define        FS_ACS_CKPSMALL 2012    /* Checkpoint window error - too small */
                    162: #define        FS_ACS_CKPERR   2013    /* Checkpoint window error - unsupported */
                    163: #define        FS_ACS_QOS      2014    /* Communications QoS not supported */
                    164: #define        FS_ACS_IDENTITY 2015    /* Initiator identity unacceptable */
                    165: #define        FS_ACS_CONTEXT  2016    /* Context management refused */
                    166: #define        FS_ACS_ROLLBACK 2017    /* Rollback not available */
                    167: #define        FS_ACS_CNTRESP  2018    /* Contents type list cut by responder */
                    168: #define        FS_ACS_CNTPSAP  2019    /* Contents type list cut by Presentation
                    169:                                   service */
                    170: #define        FS_ACS_PASSWORD 2020    /* Invalid filestore password */
                    171: #define        FS_ACS_SERVICES 2021    /* Incompatible service classes */
                    172: 
                    173: #define        FS_SEL_BASE     3000    /* Selection related diagnostics */
                    174: #define        FS_SEL_FILENAME 3000    /* Filename not found */
                    175: #define        FS_SEL_MATCHED  3001    /* Selection attributes not matched */
                    176: #define        FS_SEL_INITIAL  3002    /* Initial attributes not possible */
                    177: #define        FS_SEL_ATTRNAME 3003    /* Bad attribute name */
                    178: #define        FS_SEL_NOEXIST  3004    /* Non-existent file */
                    179: #define        FS_SEL_EXISTS   3005    /* File already exists */
                    180: #define        FS_SEL_CREATE   3006    /* File can not be created */
                    181: #define        FS_SEL_DELETE   3007    /* File can not be deleted */
                    182: #define        FS_SEL_CONAVAIL 3008    /* Concurrency control not available */
                    183: #define        FS_SEL_CONSUPRT 3009    /* Concurrency control not supported */
                    184: #define        FS_SEL_CONPOSS  3010    /* Concurrency control not possible */
                    185: #define        FS_SEL_RESTRICT 3011    /* More restrictive lock */
                    186: #define        FS_SEL_BUSY     3012    /* File busy */
                    187: #define        FS_SEL_AVAIL    3013    /* File not available */
                    188: #define        FS_SEL_ACCAVAIL 3014    /* Access control not available */
                    189: #define        FS_SEL_ACCSUPRT 3015    /* Access control not supported */
                    190: #define        FS_SEL_ACCINCON 3016    /* Access control inconsistent */
                    191: #define        FS_SEL_TRUNC    3017    /* Filename truncated */
                    192: #define        FS_SEL_ALTER    3018    /* Initial attributes altered */
                    193: #define        FS_SEL_ACCOUNT  3019    /* Bad account */
                    194: #define        FS_SEL_CREEXIST 3020    /* Override selected existing file */
                    195: #define        FS_SEL_CREOLD   3021    /* Override deleted and recreated file
                    196:                                   with old attributes */
                    197: #define        FS_SEL_CRENEW   3022    /* Create override deleted and recreated file
                    198:                                   with new attributes */
                    199: #define        FS_SEL_CRELOSE  3023    /* Create override - not possible */
                    200: #define        FS_SEL_AMBIG    3024    /* Ambiguous file specification */
                    201: #define        FS_SEL_CREPASS  3025    /* Invalid create password */
                    202: #define        FS_SEL_DELPASS  3026    /* Invalid delete password on override */
                    203: #define        FS_SEL_ATRVALUE 3027    /* Bad attribute value */
                    204: #define        FS_SEL_VIOLATES 3028    /* Requested access violates permitted
                    205:                                   actions */
                    206: #define        FS_SEL_NOTAVAIL 3029    /* Functional unit not available for requested
                    207:                                   access */
                    208: #define        FS_SEL_CRENOSEL 3030    /* File created but not selected */
                    209: 
                    210: #define        FS_MGT_BASE     4000    /* File management related diagnostics */
                    211: #define        FS_MGT_EXIST    4000    /* Attribute non-existant */
                    212: #define        FS_MGT_READ     4001    /* Attribute cannot be read */
                    213: #define        FS_MGT_CHANGE   4002    /* Attribute cannot be changed */
                    214: #define        FS_MGT_SUPPORT  4003    /* Attribute not supported */
                    215: #define        FS_MGT_NAME     4004    /* Bad attribute name */
                    216: #define        FS_MGT_VALUE    4005    /* Bad attribute value */
                    217: #define        FS_MGT_PARTIAL  4006    /* Attribute partially supported */
                    218: #define        FS_MGMT_DISTINCT 4007   /* Additional set attribute not distinct */
                    219: 
                    220: #define        FS_ACC_BASE     5000    /* Access related diagnostics */
                    221: #define        FS_ACC_FADU     5000    /* Bad FADU (unspecific) */
                    222: #define        FS_ACC_FADUSIZE 5001    /* Bad FADU - size error */
                    223: #define        FS_ACC_FADUTYPE 5002    /* Bad FADU - type error */
                    224: #define        FS_ACC_FADUSPEC 5003    /* Bad FADU - poorly specified */
                    225: #define        FS_ACC_FADULOC  5004    /* Bad FADU - bad location */
                    226: #define        FS_ACC_EXIST    5005    /* FADU does not exist */
                    227: #define        FS_ACC_AVL      5006    /* FADU not available (unspecific) */
                    228: #define        FS_ACC_AVLREAD  5007    /* FADU not available for reading */
                    229: #define        FS_ACC_AVLWRITE 5008    /* FADU not available for writing */
                    230: #define        FS_ACC_AVLLOC   5009    /* FADU not available for location */
                    231: #define        FS_ACC_AVLERASE 5010    /* FADU not available for erasure */
                    232: #define        FS_ACC_INSERT   5011    /* FADU cannot be inserted */
                    233: #define        FS_ACC_REPLACE  5012    /* FADU cannot be replaced */
                    234: #define        FS_ACC_LOCATE   5013    /* FADU cannot be located */
                    235: #define        FS_ACC_ELEMENT  5014    /* Bad data element type */
                    236: #define        FS_ACC_OPAVAIL  5015    /* Operation not available */
                    237: #define        FS_ACC_OPSUPRT  5016    /* Operation not supported */
                    238: #define        FS_ACC_OPCONS   5017    /* Operation inconsistent */
                    239: #define        FS_ACC_CONAVAIL 5018    /* Concurrency control not available */
                    240: #define        FS_ACC_CONSUPRT 5019    /* Concurrency control not supported */
                    241: #define        FS_ACC_CONINCON 5020    /* Concurrency control inconsistent */
                    242: #define        FS_ACC_MODAVAIL 5021    /* Processing mode not available */
                    243: #define        FS_ACC_MODSUPRT 5022    /* Processing mode not supported */
                    244: #define        FS_ACC_MODINCON 5023    /* Processing mode inconsistent */
                    245: #define        FS_ACC_CTXAVAIL 5024    /* Access context not available */
                    246: #define        FS_ACC_CTXSUPRT 5025    /* Access context not supported */
                    247: #define        FS_ACC_WRITE    5026    /* Bad write (unspecific) */
                    248: #define        FS_ACC_READ     5027    /* Bad read (unspecific) */
                    249: #define        FS_ACC_LCL      5028    /* Local failure (unspecific) */
                    250: #define        FS_ACC_LCLSPACE 5029    /* Local failure - file space exhausted */
                    251: #define        FS_ACC_LCLDATA  5030    /* Local failure - data corrupted */
                    252: #define        FS_ACC_LCLDEV   5031    /* Local failure - device failure */
                    253: #define        FS_ACC_FFSEXCEED 5032   /* Future file size exceeded */
                    254: #define        FS_ACC_FFSINCRES 5034   /* Future file size increased */
                    255: #define        FS_ACC_FUNIT    5035    /* Functional unit invalid in processing
                    256:                                   mode */
                    257: #define        FS_ACC_TYPINCON 5036    /* Contents type inconsistent */
                    258: #define        FS_ACC_TYPSIMPL 5037    /* Contents type simplified */
                    259: #define        FS_ACC_DUPLICATE 5038   /* Duplicate FADU name */
                    260: #define        FS_ACC_DAMAGED  5039    /* Damage to select/open regime */
                    261: #define        FS_ACC_NOLOCKS  5040    /* FADU locking not available on file */
                    262: #define        FS_ACC_LOCKED   5041    /* FADU locked by another user */
                    263: 
                    264: #define        FS_RVY_BASE     6000    /* Recovery related diagnostics */
                    265: #define        FS_RVY_CKP      6000    /* Bad checkpoint (unspecific) */
                    266: #define        FS_RVY_UNIQUE   6001    /* Activity not unique */
                    267: #define        FS_RVY_WINDOW   6002    /* Checkpoint outside window */
                    268: #define        FS_RVY_EXISTS   6003    /* Activity no longer exists */
                    269: #define        FS_RVY_RECOG    6004    /* Activity not recognized */
                    270: #define        FS_RVY_NODOCKET 6005    /* No docket */
                    271: #define        FS_RVY_CODOCKET 6006    /* Corrupt docket */
                    272: #define        FS_RVY_WAITING  6007    /* File waiting restart */
                    273: #define        FS_RVY_RECOVERY 6008    /* Bad recovery point */
                    274: #define        FS_RVY_NOPOINT  6009    /* Non-existent recovery point */
                    275: #define        FS_RVY_MODAVAIL 6010    /* Recovery mode not available */
                    276: #define        FS_RVY_MODINCON 6011    /* Recovery mode inconsistent */
                    277: #define        FS_RVY_MODREDUCE 6012   /* Recovery mode reduced */
                    278: #define        FS_RVY_ACCAVAIL 6013    /* Access control not available */
                    279: #define        FS_RVY_ACCSUPRT 6014    /* Access control not supported */
                    280: #define        FS_RVY_ACCINCON 6015    /* Access control inconsistent */
                    281: #define        FS_RVY_TYPINCON 6016    /* Contents type inconsistent */
                    282: #define        FS_RVY_TYPSIMPL 6017    /* Contents type simplified */
                    283: 
                    284:     int            ftd_observer;       /* error-observer */
                    285:     int            ftd_source;         /* error-source */
                    286: #define        EREF_NONE       0       /*   no-categorizaton-possible */
                    287: #define        EREF_IFSU       1       /*   initiating-file-service-user */
                    288: #define        EREF_IFPM       2       /*   initiating-file-protocol-machine */
                    289: #define        EREF_SERV       3       /*   service-supporting-the-file-protocol-machine */
                    290: #define        EREF_RFPM       4       /*   responding-file-protocol-machine */
                    291: #define        EREF_RFSU       5       /*   responding-file-service-user */
                    292: 
                    293:     int            ftd_delay;          /* suggested-delay */
                    294: #define        DIAG_NODELAY    (-1)
                    295: 
                    296:                                /* further-details */
                    297: #define        FTD_SIZE        512     /* should be unlimited... */
                    298:     int            ftd_cc;             /*   length */
                    299:     char    ftd_data[FTD_SIZE];        /*   data */
                    300: };
                    301: 
                    302: /*  */
                    303: 
                    304: struct FTAMcharging {          /* Charging */
                    305:     int            fc_ncharge;         /* number of charges */
                    306: 
                    307: #define        NFCHRG  5               /* arbitrary */
                    308:     struct fc_charge {
                    309:        char   *fc_resource;    /* resource-identifier */
                    310:        char   *fc_unit;        /* charging-unit */
                    311:        int     fc_value;       /* charging-value */
                    312:     }      fc_charges[NFCHRG];
                    313: };
                    314: 
                    315: /*  */
                    316: 
                    317: struct FTAMpasswords {         /* Access-Passwords */
                    318:     char   *fp_read;           /* read-password */
                    319:     int            fp_readlen;
                    320: 
                    321:     char   *fp_insert;         /* insert-password */
                    322:     int            fp_insertlen;
                    323: 
                    324:     char   *fp_replace;                /* replace-password */
                    325:     int            fp_replacelen;
                    326: 
                    327:     char   *fp_extend;         /* extend-password */
                    328:     int            fp_extendlen;
                    329: 
                    330:     char   *fp_erase;          /* erase-password */
                    331:     int            fp_eraselen;
                    332: 
                    333:     char   *fp_readattr;       /* read-attribute-password */
                    334:     int            fp_readattrlen;
                    335: 
                    336:     char   *fp_chngattr;       /* change-attribute-password */
                    337:     int            fp_chngattrlen;
                    338: 
                    339:     char   *fp_delete;         /* delete-password */
                    340:     int            fp_deletelen;
                    341: };
                    342: #define        FPFREE(fp) \
                    343: { \
                    344:     register struct FTAMpasswords *FP = (fp); \
                    345:  \
                    346:     if (FP -> fp_read) \
                    347:        free (FP -> fp_read), FP -> fp_read = NULL; \
                    348:     if (FP -> fp_insert) \
                    349:        free (FP -> fp_insert), FP -> fp_insert = NULL; \
                    350:     if (FP -> fp_replace) \
                    351:        free (FP -> fp_replace), FP -> fp_replace = NULL; \
                    352:     if (FP -> fp_extend) \
                    353:        free (FP -> fp_extend), FP -> fp_extend = NULL; \
                    354:     if (FP -> fp_erase) \
                    355:        free (FP -> fp_erase), FP -> fp_erase = NULL; \
                    356:     if (FP -> fp_readattr) \
                    357:        free (FP -> fp_readattr), FP -> fp_readattr = NULL; \
                    358:     if (FP -> fp_chngattr) \
                    359:        free (FP -> fp_chngattr), FP -> fp_chngattr = NULL; \
                    360:     if (FP -> fp_delete) \
                    361:        free (FP -> fp_delete), FP -> fp_delete = NULL; \
                    362: }
                    363: 
                    364: /*  */
                    365: 
                    366: struct FTAMconcurrency {       /* Concurrency-Control/Concurrency-Access */
                    367: #define        FLOCK_SHARED    00      /* shared */
                    368: #define        FLOCK_EXCLUSIVE 01      /* exclusive */
                    369: #define        FLOCK_NOTREQD   02      /* not-required */
                    370: #define        FLOCK_NOACCESS  03      /* no-access */
                    371: #define        FLOCK_MASK      03
                    372: #define        FLOCK_PRESENT   FLOCK_EXCLUSIVE
                    373: #define        FLOCK_RESTRICT  01
                    374: 
                    375:     char    fc_readlock;
                    376:     char    fc_insertlock;
                    377:     char    fc_replacelock;
                    378:     char    fc_extendlock;
                    379:     char    fc_eraselock;
                    380:     char    fc_readattrlock;
                    381:     char    fc_chngattrlock;
                    382:     char    fc_deletelock;
                    383: };
                    384: #define        FCINIT(fc) \
                    385: { \
                    386:     (fc) -> fc_readlock = FLOCK_NOTREQD; \
                    387:     (fc) -> fc_insertlock = FLOCK_NOTREQD; \
                    388:     (fc) -> fc_replacelock = FLOCK_NOTREQD; \
                    389:     (fc) -> fc_eraselock = FLOCK_NOTREQD; \
                    390:     (fc) -> fc_extendlock = FLOCK_NOTREQD; \
                    391:     (fc) -> fc_readattrlock = FLOCK_NOTREQD; \
                    392:     (fc) -> fc_chngattrlock = FLOCK_NOTREQD; \
                    393:     (fc) -> fc_deletelock = FLOCK_NOTREQD; \
                    394: }
                    395: 
                    396: /*  */
                    397: 
                    398: struct FTAMacelement {         /* SET OF Access-Control-Element */
                    399:     int            fe_actions;         /* action-list */
                    400: #define        FA_PERM_READ            0x0001  /* read */
                    401: #define        FA_PERM_INSERT          0x0002  /* insert */
                    402: #define        FA_PERM_REPLACE         0x0004  /* replace */
                    403: #define        FA_PERM_EXTEND          0x0008  /* extend */
                    404: #define        FA_PERM_ERASE           0x0010  /* erase */
                    405: #define        FA_PERM_READATTR        0x0020  /* read-attribute */
                    406: #define        FA_PERM_CHNGATTR        0x0040  /* change-attribute */
                    407: #define        FA_PERM_DELETE          0x0080  /* delete-file */
                    408: 
                    409:     struct FTAMconcurrency fe_concurrency; /* concurrency-access */
                    410: 
                    411:     char   *fe_identity;       /* user-identity */
                    412: 
                    413:     struct FTAMpasswords fe_passwords;
                    414: 
                    415:     AEI     fe_aet;            /* application-entity-title */
                    416: 
                    417:     struct FTAMacelement *fe_next;
                    418: };
                    419: #define        FEFREE(fe) \
                    420: { \
                    421:     register struct FTAMacelement  *FE, \
                    422:                                   *FN; \
                    423:  \
                    424:     for (FE = (fe); FE; FE = FN) { \
                    425:        FN = FE -> fe_next; \
                    426:  \
                    427:        if (FE -> fe_identity) \
                    428:            free (FE -> fe_identity), FE -> fe_identity = NULL; \
                    429:  \
                    430:        FPFREE (&FE -> fe_passwords); \
                    431:  \
                    432:        if (FE -> fe_aet) { \
                    433:            AEIFREE (FE -> fe_aet); \
                    434:            free ((char *) FE -> fe_aet), FE -> fe_aet = NULL; \
                    435:        } \
                    436:  \
                    437:        FE -> fe_next = NULL; \
                    438:  \
                    439:        free ((char *) FE); \
                    440:     } \
                    441: }
                    442: 
                    443: /*  */
                    444: 
                    445: struct FTAMattributes {                /* {Change,Create,Read,Select}-Attributes */
                    446:     long    fa_present;                /* values present */
                    447:     long    fa_novalue;                /* no value available */
                    448: #define        FA_NULL         0x00000
                    449: #define        FA_FILENAME     0x00001 /* filename */
                    450: #define        FA_ACTIONS      0x00002 /* permitted-actions */
                    451: #define        FA_CONTENTS     0x00004 /* contents-type */
                    452: #define        FA_ACCOUNT      0x00008 /* account */
                    453: #define        FA_DATE_CREATE  0x00010 /* date-and-time-of-creation */
                    454: #define        FA_DATE_MODIFY  0x00020 /* date-and-time-of-last-modification */
                    455: #define        FA_DATE_READ    0x00040 /* date-and-time-of-last-read-access */
                    456: #define        FA_DATE_ATTR    0x00080 /* date-and-time-of-last-attribute-modification */
                    457: #define        FA_ID_CREATE    0x00100 /* identity-of-creator */
                    458: #define        FA_ID_MODIFY    0x00200 /* identity-of-last-modifier */
                    459: #define        FA_ID_READ      0x00400 /* identity-of-last-reader */
                    460: #define        FA_ID_ATTR      0x00800 /* identity-of-last-attribute-modifier */
                    461: #define        FA_AVAILABILITY 0x01000 /* file-availability */
                    462: #define        FA_FILESIZE     0x02000 /* filesize */
                    463: #define        FA_FUTURESIZE   0x04000 /* future-filesize */
                    464: #define        FA_CONTROL      0x08000 /* access-control */
                    465: #define        FA_LEGAL        0x10000 /* legal-qualifications */
                    466: #define        FA_PRIVATE      0x20000 /* private-use */
                    467: 
                    468: #define        FA_KERNEL       (FA_FILENAME | FA_ACTIONS | FA_CONTENTS)
                    469: #define        FA_STORAGE      (FA_ACCOUNT | FA_DATE_CREATE | FA_DATE_MODIFY \
                    470:                            | FA_DATE_READ | FA_DATE_ATTR | FA_ID_CREATE \
                    471:                            | FA_ID_MODIFY | FA_ID_READ | FA_ID_ATTR \
                    472:                            | FA_AVAILABILITY | FA_FILESIZE | FA_FUTURESIZE)
                    473: #define        FA_SECURITY     (FA_CONTROL | FA_LEGAL)
                    474: 
                    475: #define        NFFILE  5               /* arbitrary */
                    476:     int            fa_nfile;           /* filename */
                    477:     char   *fa_files[NFFILE];  /*   .. */
                    478:     
                    479:     int            fa_permitted;       /* permitted-actions,
                    480:                                   same as fe_actions, plus: */
                    481: #define        FA_PERM_TRAV            0x0100  /* traversal */
                    482: #define        FA_PERM_RVTRAV          0x0200  /* reverse-traversal */
                    483: #define        FA_PERM_RANDOM          0x0400  /* random-order */
                    484: #define        FA_PERM_TRAVERSAL       (FA_PERM_TRAV | FA_PERM_RVTRAV \
                    485:                                        | FA_PERM_RANDOM)
                    486: 
                    487:     OID            fa_contents;        /* contents-type */
                    488:     PE     fa_parameter;       /*   .. parameter */
                    489: 
                    490:     char   *fa_account;                /* account */
                    491: 
                    492:                                /* date-and-time-of- ... */
                    493:     struct UTCtime fa_date_create;
                    494:     struct UTCtime fa_date_modify;
                    495:     struct UTCtime fa_date_read;
                    496:     struct UTCtime fa_date_attribute;
                    497: 
                    498:                                /* identity-of- ... */
                    499:     char   *fa_id_create;
                    500:     char   *fa_id_modify;
                    501:     char   *fa_id_read;
                    502:     char   *fa_id_attribute;
                    503: 
                    504:     int            fa_availability;    /* file-availability */
                    505: #define        FA_AVAIL_IMMED  0       /*   immediate */
                    506: #define        FA_AVAIL_DEFER  1       /*   deferred */
                    507: 
                    508:     int            fa_filesize;        /* filesize */
                    509:     int            fa_futuresize;      /* future-filesize */
                    510: 
                    511:     struct FTAMacelement *fa_control;/* access-control */
                    512:     char   *fa_legal;          /* legal-qualification */
                    513: 
                    514:     char   *fa_private;                /* XXX */
                    515: };
                    516: 
                    517: void   FAFREE ();
                    518: 
                    519: /*  */
                    520: 
                    521: struct FADUidentity {          /* FADU-Identity */
                    522:     int            fa_type;
                    523: #define        FA_FIRSTLAST    0       /* first-last */
                    524: #define        FA_RELATIVE     1       /* relative */
                    525: #define        FA_BEGINEND     2       /* begin-end */
                    526: #define        FA_SINGLE       3       /* single-name */
                    527: #define        FA_NAMELIST     4       /* name-list */
                    528: #define        FA_FADUNUMBER   5       /* fadu-number */
                    529: 
                    530:     union {
                    531:        int     fa_un_firstlast;
                    532: #define        FA_FIRST        0
                    533: #define        FA_LAST         1
                    534: 
                    535:        int     fa_un_relative;
                    536: #define        FA_PREVIOUS     0
                    537: #define        FA_CURRENT      1
                    538: #define        FA_NEXT         2
                    539: 
                    540:        int     fa_un_beginend;
                    541: #define        FA_BEGIN        0
                    542: #define        FA_END          1
                    543: 
                    544:        char   *fa_un_singlename;
                    545: 
                    546: #define        NANAME  5               /* arbitrary */
                    547:        struct {
                    548:            char   *fa_un_names[NANAME];
                    549:            int     fa_un_nname;
                    550:        }       fa_un_list;
                    551: 
                    552:        int     fa_un_fadunumber;
                    553:     }  fa_un;
                    554: #define        fa_firstlast    fa_un.fa_un_firstlast
                    555: #define        fa_relative     fa_un.fa_un_relative
                    556: #define        fa_beginend     fa_un.fa_un_beginend
                    557: #define        fa_singlename   fa_un.fa_un_singlename
                    558: #define        fa_names        fa_un.fa_un_list.fa_un_names
                    559: #define        fa_nname        fa_un.fa_un_list.fa_un_nname
                    560: #define        fa_fadunumber   fa_un.fa_un_fadunumber
                    561: };
                    562: #define        FUFREE(fu) \
                    563: { \
                    564:     register int    FUI; \
                    565:  \
                    566:     if ((fu) -> fa_singlename) \
                    567:        free ((fu) -> fa_singlename), (fu) -> fa_singlename = NULL; \
                    568:  \
                    569:     for (FUI = (fu) -> fa_nname - 1; FUI >= 0; FUI--) \
                    570:        if ((fu) -> fa_names[FUI]) \
                    571:            free ((fu) -> fa_names[FUI]), (fu) -> fa_names[FUI] = NULL; \
                    572: }
                    573: 
                    574: /*  */
                    575: 
                    576: struct FTAMstart {             /* F-INITIALIZE.INDICATION */
                    577:     int            fts_sd;             /* FTAM descriptor */
                    578: 
                    579:     AEInfo fts_callingtitle;   /* info on calling application-entity */
                    580:     AEInfo fts_calledtitle;    /* info called application-entity */
                    581: 
                    582:     struct PSAPaddr fts_calledaddr;/* called presentation address */
                    583:     struct PSAPaddr fts_callingaddr;/* calling presentation address */
                    584: 
                    585:     OID            fts_context;        /* application context name */
                    586: 
                    587:     int            fts_manage;         /* presentation-context-management */
                    588: 
                    589:     int            fts_class;          /* service-class */
                    590: 
                    591:     int            fts_units;          /* functional-units */
                    592:     int            fts_attrs;          /* attribute-groups */
                    593: 
                    594:     PE     fts_sharedASE;      /* shared-ASE-information */
                    595: 
                    596:     int            fts_fqos;           /* ftam-QoS */
                    597: 
                    598:     struct FTAMcontentlist fts_contents;/* contents-type-list */
                    599: 
                    600:     char   *fts_initiator;     /* initiator-identity */
                    601:     char   *fts_account;       /* account */
                    602:     char   *fts_password;      /* filestore-password */
                    603:     int            fts_passlen;        /*   .. */
                    604: 
                    605:     int            fts_ssdusize;       /* largest atomic SSDU */
                    606: 
                    607:     struct QOStype fts_qos;    /* Communications QoS */
                    608: };
                    609: #define        FTSFREE(fts) \
                    610: { \
                    611:     register int FSI; \
                    612:  \
                    613:     AEIFREE (&(fts) -> fts_callingtitle); \
                    614:     AEIFREE (&(fts) -> fts_calledtitle); \
                    615:     if ((fts) -> fts_context) \
                    616:        oid_free ((fts) -> fts_context), (fts) -> fts_context = NULLOID; \
                    617:  \
                    618:     if ((fts) -> fts_sharedASE) \
                    619:        pe_free ((fts) -> fts_sharedASE), (fts) -> fts_sharedASE = NULLPE; \
                    620:  \
                    621:     for (FSI = (fts) -> fts_contents.fc_ncontent - 1; FSI >= 0; FSI--) \
                    622:        oid_free ((fts) -> fts_contents.fc_contents[FSI].fc_dtn), \
                    623:                (fts) -> fts_contents.fc_contents[FSI].fc_dtn = NULLOID; \
                    624:     (fts) -> fts_contents.fc_ncontent = 0; \
                    625:  \
                    626:     if ((fts) -> fts_initiator) \
                    627:        free ((fts) -> fts_initiator), (fts) -> fts_initiator = NULL; \
                    628:     if ((fts) -> fts_account) \
                    629:        free ((fts) -> fts_account), (fts) -> fts_account = NULL; \
                    630:     if ((fts) -> fts_password) \
                    631:        free ((fts) -> fts_password), (fts) -> fts_password = NULL; \
                    632: }
                    633: 
                    634: 
                    635: struct FTAMconnect {           /* F-INITIALIZE.CONFIRMATION */
                    636:     int            ftc_sd;             /* FTAM descriptor */
                    637: 
                    638:     AEInfo ftc_respondtitle;   /* responding application-entity title */
                    639: 
                    640:     struct PSAPaddr ftc_respondaddr;/* responding presentation address */
                    641: 
                    642:     OID            ftc_context;        /* application context name */
                    643: 
                    644:     int            ftc_state;          /* state-result */
                    645:     int            ftc_action;         /* action-result */
                    646: 
                    647:     int            ftc_manage;         /* presentation-context-management */
                    648: 
                    649:     int            ftc_class;          /* service-class */
                    650: 
                    651:     int            ftc_units;          /* functional-units */
                    652:     int            ftc_attrs;          /* attribute-groups */
                    653: 
                    654:     PE     ftc_sharedASE;      /* shared-ASE-information */
                    655: 
                    656:     int            ftc_fqos;           /* ftam-QoS */
                    657: 
                    658:     struct FTAMcontentlist ftc_contents;/* contents-type-list */
                    659: 
                    660: #define        NFDIAG  5               /* diagnostic */
                    661:     int            ftc_ndiag;
                    662:     struct FTAMdiagnostic  ftc_diags[NFDIAG];
                    663: 
                    664:     int            ftc_ssdusize;       /* largest atomic SSDU */
                    665: 
                    666:     struct QOStype ftc_qos;    /* communications QoS */
                    667: };
                    668: #define        FTCFREE(ftc) \
                    669: { \
                    670:     register int FCI; \
                    671:  \
                    672:     AEIFREE (&(ftc) -> ftc_respondtitle); \
                    673:     if ((ftc) -> ftc_context) \
                    674:        oid_free ((ftc) -> ftc_context), (ftc) -> ftc_context = NULLOID; \
                    675:  \
                    676:     if ((ftc) -> ftc_sharedASE) \
                    677:        pe_free ((ftc) -> ftc_sharedASE), (ftc) -> ftc_sharedASE = NULLPE; \
                    678:  \
                    679:     for (FCI = (ftc) -> ftc_contents.fc_ncontent - 1; FCI >= 0; FCI--) \
                    680:        oid_free ((ftc) -> ftc_contents.fc_contents[FCI].fc_dtn), \
                    681:                (ftc) -> ftc_contents.fc_contents[FCI].fc_dtn = NULLOID; \
                    682:     (ftc) -> ftc_contents.fc_ncontent = 0; \
                    683: }
                    684: 
                    685: 
                    686: struct FTAMfinish {            /* F-TERMINATE.INDICATION */
                    687:     PE     ftf_sharedASE;      /* shared-ASE-information */
                    688: };
                    689: #define        FTFFREE(ftf) \
                    690: { \
                    691:       if ((ftf) -> ftf_sharedASE) \
                    692:          pe_free ((ftf) -> ftf_sharedASE), (ftf) -> ftf_sharedASE = NULLPE; \
                    693: }
                    694: 
                    695: struct FTAMrelease {           /* F-TERMINATE.CONFIRMATION */
                    696:     PE     ftr_sharedASE;      /* shared-ASE-information */
                    697:                                /* charging */
                    698:     struct FTAMcharging ftr_charges;
                    699: };
                    700: #define        FTRFREE(ftr) \
                    701: { \
                    702:     register int    FRI; \
                    703:     register struct fc_charge  *FC; \
                    704:  \
                    705:     if ((ftr) -> ftr_sharedASE) \
                    706:        pe_free ((ftr) -> ftr_sharedASE), (ftr) -> ftr_sharedASE = NULLPE; \
                    707:  \
                    708:     for (FC = (ftr) -> ftr_charges.fc_charges, FRI = (ftr) -> ftr_charges.fc_ncharge - 1; \
                    709:            FRI >= 0; \
                    710:            FC++, FRI--) { \
                    711:        if (FC -> fc_resource) \
                    712:            free (FC -> fc_resource), FC -> fc_resource = NULL; \
                    713:        if (FC -> fc_unit) \
                    714:            free (FC -> fc_unit), FC -> fc_unit = NULL; \
                    715:     } \
                    716:     (ftr) -> ftr_charges.fc_ncharge = 0; \
                    717: }
                    718: 
                    719: 
                    720: struct FTAMabort {             /* F-{U,P}-ABORT.INDICATION */
                    721:     int            fta_peer;           /* T   = F-U-ABORT.INDICATION
                    722:                                   NIL = F-P-ABORT.INDICATION */
                    723: 
                    724:     int            fta_action;         /* action-result */
                    725:     
                    726:     int            fta_ndiag;          /* diagnostic */
                    727:     struct FTAMdiagnostic fta_diags[NFDIAG];
                    728: };
                    729: 
                    730: 
                    731: struct FTAMselect {            /* F-SELECT.* */
                    732:                                /* RESPONSE only */
                    733:     int     ftse_state;                /* state-result */
                    734:     int     ftse_action;       /* action-result */
                    735: 
                    736:                                /* attributes (FILENAME only) */
                    737:     struct FTAMattributes ftse_attrs;
                    738: #define        FA_SEL_ATTRS    FA_FILENAME
                    739: 
                    740:                                /* REQUEST only */
                    741:     int            ftse_access;        /* requested-access */
                    742: #define        FA_REQ_MASK     (FA_PERM_READ | FA_PERM_INSERT | FA_PERM_REPLACE \
                    743:                                | FA_PERM_EXTEND | FA_PERM_ERASE \
                    744:                                | FA_PERM_READATTR | FA_PERM_CHNGATTR \
                    745:                                | FA_PERM_DELETE)
                    746:                                /* access-passwords */
                    747:     struct FTAMpasswords ftse_pwds;
                    748:                                /* concurrency-control */
                    749:     struct FTAMconcurrency ftse_conctl;
                    750:     PE     ftse_sharedASE;     /* shared-ASE-information */
                    751:     char   *ftse_account;      /* account */
                    752: 
                    753:                                /* RESPONSE only */
                    754:     int            ftse_ndiag;         /* diagnostic */
                    755:     struct FTAMdiagnostic ftse_diags[NFDIAG];
                    756: };
                    757: #define        FTSEFREE(ftse) \
                    758: { \
                    759:     FAFREE (&((ftse) -> ftse_attrs)); \
                    760:     FPFREE (&((ftse) -> ftse_pwds)); \
                    761:     if ((ftse) -> ftse_sharedASE) \
                    762:        pe_free ((ftse) -> ftse_sharedASE), (ftse) -> ftse_sharedASE = NULLPE; \
                    763:     if ((ftse) -> ftse_account) \
                    764:        free ((ftse) -> ftse_account), (ftse) -> ftse_account = NULLCP; \
                    765: }
                    766: 
                    767: 
                    768: struct FTAMdeselect {          /* F-DESELECT.* */
                    769:                                /* RESPONSE only */
                    770:     int     ftde_action;       /* action-result */
                    771: 
                    772:     PE     ftde_sharedASE;     /* shared-ASE-information */
                    773: 
                    774:                                /* RESPONSE only */
                    775:                                /* charging */
                    776:     struct FTAMcharging ftde_charges;
                    777:     int     ftde_ndiag;                /* diagnostic */
                    778:     struct FTAMdiagnostic   ftde_diags[NFDIAG];
                    779: };
                    780: #define        FTDEFREE(ftde) \
                    781: { \
                    782:     register int    FDEI; \
                    783:     register struct fc_charge  *FC; \
                    784:  \
                    785:     for (FC = (ftde) -> ftde_charges.fc_charges, FDEI = (ftde) -> ftde_charges.fc_ncharge - 1; \
                    786:            FDEI >= 0; \
                    787:            FC++, FDEI--) { \
                    788:        if (FC -> fc_resource) \
                    789:            free (FC -> fc_resource), FC -> fc_resource = NULL; \
                    790:        if (FC -> fc_unit) \
                    791:            free (FC -> fc_unit), FC -> fc_unit = NULL; \
                    792:     } \
                    793:     (ftde) -> ftde_charges.fc_ncharge = 0; \
                    794:     if ((ftde) -> ftde_sharedASE) \
                    795:        pe_free ((ftde) -> ftde_sharedASE), (ftde) -> ftde_sharedASE = NULLPE; \
                    796: }
                    797: 
                    798: 
                    799: struct FTAMcreate {            /* F-CREATE.* */
                    800:                                /* RESPONSE only */
                    801:     int     ftce_state;                /* state-result */
                    802:     int     ftce_action;       /* action-result */
                    803: 
                    804:                                /* REQUEST only */
                    805:     int            ftce_override;      /* override */
                    806: #define        FOVER_FAIL      0       /* fail, if already exists */
                    807: #define        FOVER_SELECT    1       /* select, if it already exists */
                    808: #define        FOVER_WRITE     2       /* zero-truncate, if it already exists */
                    809: #define        FOVER_DELETE    3       /* delete, if it already exists */
                    810: 
                    811:                                /* initial-attributes */
                    812:     struct FTAMattributes ftce_attrs;
                    813: #define        FA_CRE_ATTRS    (FA_FILENAME | FA_ACTIONS | FA_CONTENTS | FA_ACCOUNT \
                    814:                            | FA_AVAILABILITY | FA_FUTURESIZE | FA_CONTROL \
                    815:                            | FA_LEGAL | FA_PRIVATE)
                    816: 
                    817:                                /* REQUEST only */
                    818:     char   *ftce_create;       /* create-password */
                    819:     int            ftce_crelen;        /*   .. */
                    820:     int            ftce_access;        /* requested-access */
                    821:                                /* access-passwords */
                    822:     struct FTAMpasswords ftce_pwds;
                    823:                                /* concurrency-control */
                    824:     struct FTAMconcurrency ftce_conctl;
                    825: 
                    826:     PE     ftce_sharedASE;     /* shared-ASE-information */
                    827: 
                    828:                                /* REQUEST only */
                    829:     char   *ftce_account;      /* account */
                    830: 
                    831:                                /* RESPONSE only */
                    832:     int            ftce_ndiag;         /* diagnostic */
                    833:     struct FTAMdiagnostic ftce_diags[NFDIAG];
                    834: };
                    835: #define        FTCEFREE(ftce) \
                    836: { \
                    837:     FAFREE (&((ftce) -> ftce_attrs)); \
                    838:     if ((ftce) -> ftce_create) \
                    839:        free ((ftce) -> ftce_create), (ftce) -> ftce_create = NULLCP; \
                    840:     FPFREE (&((ftce) -> ftce_pwds)); \
                    841:     if ((ftce) -> ftce_sharedASE) \
                    842:        pe_free ((ftce) -> ftce_sharedASE), (ftce) -> ftce_sharedASE = NULLPE; \
                    843:     if ((ftce) -> ftce_account) \
                    844:        free ((ftce) -> ftce_account), (ftce) -> ftce_account = NULLCP; \
                    845: }
                    846: 
                    847: 
                    848: struct FTAMdelete {            /* F-DELETE.* */
                    849:                                /* RESPONSE only */
                    850:     int            ftxe_action;        /* action-result */
                    851:     
                    852:     PE     ftxe_sharedASE;     /* shared-ASE-information */
                    853: 
                    854:                                /* RESPONSE only */
                    855:                                /* charging */
                    856:     struct FTAMcharging ftxe_charges;
                    857:     int     ftxe_ndiag;                /* diagnostic */
                    858:     struct FTAMdiagnostic   ftxe_diags[NFDIAG];
                    859: };
                    860: #define        FTXEFREE(ftxe) \
                    861: { \
                    862:     register int    FXEI; \
                    863:     register struct fc_charge  *FC; \
                    864:  \
                    865:     if ((ftxe) -> ftxe_sharedASE) \
                    866:        pe_free ((ftxe) -> ftxe_sharedASE), (ftxe) -> ftxe_sharedASE = NULLPE; \
                    867:  \
                    868:     for (FC = (ftxe) -> ftxe_charges.fc_charges, FXEI = (ftxe) -> ftxe_charges.fc_ncharge - 1; \
                    869:            FXEI >= 0; \
                    870:            FC++, FXEI--) { \
                    871:        if (FC -> fc_resource) \
                    872:            free (FC -> fc_resource), FC -> fc_resource = NULL; \
                    873:        if (FC -> fc_unit) \
                    874:            free (FC -> fc_unit), FC -> fc_unit = NULL; \
                    875:     } \
                    876:     (ftxe) -> ftxe_charges.fc_ncharge = 0; \
                    877: }
                    878: 
                    879: 
                    880: struct FTAMreadattr {          /* F-READ-ATTRIB.* */
                    881:                                /* RESPONSE only */
                    882:     int            ftra_action;        /* action-result */
                    883: 
                    884:                                /* REQUEST only */
                    885:     int            ftra_attrnames;     /* attribute names (from fa_present) */
                    886: 
                    887:                                /* RESPONSE only */
                    888:     struct FTAMattributes ftra_attrs;
                    889:     int            ftra_ndiag;         /* diagnostic */
                    890:     struct FTAMdiagnostic ftra_diags[NFDIAG];
                    891: };
                    892: #define        FTRAFREE(ftra) \
                    893: { \
                    894:     FAFREE (&((ftra) -> ftra_attrs)); \
                    895: }
                    896: 
                    897: 
                    898: struct FTAMchngattr {          /* F-CHANGE-ATTRIB.* */
                    899:                                /* RESPONSE only */
                    900:     int ftca_action;           /* action-result */
                    901: 
                    902:     struct FTAMattributes ftca_attrs;
                    903: #define        FA_CHG_ATTRS    (FA_FILENAME | FA_ACCOUNT | FA_AVAILABILITY \
                    904:                            | FA_FUTURESIZE | FA_CONTROL | FA_LEGAL \
                    905:                            | FA_PRIVATE)
                    906: 
                    907:                                /* RESPONSE only */
                    908:     int            ftca_ndiag;         /* diagnostic */
                    909:     struct FTAMdiagnostic ftca_diags[NFDIAG];
                    910: };
                    911: #define        FTCAFREE(ftca) \
                    912: { \
                    913:     FAFREE (&((ftca) -> ftca_attrs)); \
                    914: }
                    915: 
                    916: 
                    917: struct FTAMopen {              /* F-OPEN.* */
                    918:                                /* RESPONSE only */
                    919:     int            ftop_state;         /* state-result */
                    920:     int            ftop_action;        /* action-result */
                    921: 
                    922:                                /* REQUEST only */
                    923:     int            ftop_mode;          /* processing-mode (read..erase) */
                    924: #define        FA_MODE_MASK    (FA_PERM_READ | FA_PERM_INSERT | FA_PERM_REPLACE \
                    925:                                | FA_PERM_EXTEND | FA_PERM_ERASE)
                    926: 
                    927:     OID            ftop_contents;      /* contents-type */
                    928:     PE     ftop_parameter;     /*   .. */
                    929:                                /* concurrency-control */
                    930:     struct FTAMconcurrency ftop_conctl;
                    931:     PE     ftop_sharedASE;     /* shared-ASE-information */
                    932: 
                    933:                                /* REQUEST only */
                    934:     int            ftop_locking;       /* enable-fadu-locking */
                    935: 
                    936:                                /* RESPONSE only */
                    937:     int            ftop_ndiag;         /* diagnostic */
                    938:     struct FTAMdiagnostic ftop_diags[NFDIAG];
                    939: };
                    940: #define        FTOPFREE(ftop) \
                    941: { \
                    942:     if ((ftop) -> ftop_contents) \
                    943:        oid_free ((ftop) -> ftop_contents), \
                    944:            (ftop) -> ftop_contents = NULLOID; \
                    945:     if ((ftop) -> ftop_parameter) \
                    946:        pe_free ((ftop) -> ftop_parameter), \
                    947:            (ftop) -> ftop_parameter = NULLPE; \
                    948:     if ((ftop) -> ftop_sharedASE) \
                    949:        pe_free ((ftop) -> ftop_sharedASE), (ftop) -> ftop_sharedASE = NULLPE; \
                    950: }
                    951: 
                    952: 
                    953: struct FTAMclose {             /* F-CLOSE.* */
                    954:     int            ftcl_action;        /* action-result */
                    955: 
                    956:     PE     ftcl_sharedASE;     /* shared-ASE-information */
                    957: 
                    958:     int     ftcl_ndiag;                /* diagnostic */
                    959:     struct FTAMdiagnostic   ftcl_diags[NFDIAG];
                    960: };
                    961: #define        FTCLFREE(ftcl) \
                    962: { \
                    963:     if ((ftcl) -> ftcl_sharedASE) \
                    964:        pe_free ((ftcl) -> ftcl_sharedASE), (ftcl) -> ftcl_sharedASE = NULLPE; \
                    965: }
                    966: 
                    967: 
                    968: struct FTAMgroup {
                    969:     int     ftg_threshold;     /* threshold */
                    970: 
                    971:     int     ftg_flags;
                    972: #define        FTG_NULL        0x0000
                    973: #define        FTG_BEGIN       0x0001  /* have begin */
                    974: #define        FTG_SELECT      0x0002  /*   .. select */
                    975: #define        FTG_CREATE      0x0004  /*   .. create */
                    976: #define        FTG_RDATTR      0x0008  /*   .. read attribute */
                    977: #define        FTG_CHATTR      0x0010  /*   .. change attribute */
                    978: #define        FTG_OPEN        0x0020  /*   .. open */
                    979: #define        FTG_CLOSE       0x0040  /*   .. close */
                    980: #define        FTG_DESELECT    0x0080  /*   .. deselect */
                    981: #define        FTG_DELETE      0x0100  /*   .. delete */
                    982: #define        FTG_END         0x0200  /*   .. end */
                    983: 
                    984:     union {
                    985:        struct FTAMselect   ftg_un1_select;
                    986:        struct FTAMcreate   ftg_un1_create;
                    987:        struct FTAMclose    ftg_un1_close;
                    988:     }                   ftg_un1;
                    989: #define        ftg_select      ftg_un1.ftg_un1_select
                    990: #define        ftg_create      ftg_un1.ftg_un1_create
                    991: #define        ftg_close       ftg_un1.ftg_un1_close
                    992: 
                    993:     struct FTAMreadattr ftg_readattr;
                    994: 
                    995:     struct FTAMchngattr ftg_chngattr;
                    996: 
                    997:     union {
                    998:        struct FTAMdeselect ftg_un2_deselect;
                    999:        struct FTAMdelete   ftg_un2_delete;
                   1000:        struct FTAMopen     ftg_un2_open;
                   1001:     } ftg_un2;
                   1002: #define        ftg_deselect    ftg_un2.ftg_un2_deselect
                   1003: #define        ftg_delete      ftg_un2.ftg_un2_delete
                   1004: #define        ftg_open        ftg_un2.ftg_un2_open
                   1005: };
                   1006: #define        FTGFREE(ftg) \
                   1007: { \
                   1008:     if ((ftg) -> ftg_flags & FTG_SELECT) { \
                   1009:        FTSEFREE (&((ftg) -> ftg_select)); \
                   1010:     } \
                   1011:     else \
                   1012:        if ((ftg) -> ftg_flags & FTG_CREATE) { \
                   1013:            FTCEFREE (&((ftg) -> ftg_create)); \
                   1014:        } \
                   1015:        else \
                   1016:            if ((ftg) -> ftg_flags & FTG_CLOSE) \
                   1017:                FTCLFREE (&((ftg) -> ftg_close)); \
                   1018:  \
                   1019:     if ((ftg) ->ftg_flags & FTG_RDATTR) \
                   1020:        FTRAFREE (&((ftg) -> ftg_readattr)); \
                   1021:  \
                   1022:     if ((ftg) ->ftg_flags & FTG_CHATTR) \
                   1023:        FTCAFREE (&((ftg) -> ftg_chngattr)); \
                   1024:  \
                   1025:     if ((ftg) -> ftg_flags & FTG_DESELECT) { \
                   1026:        FTDEFREE (&((ftg) -> ftg_deselect)); \
                   1027:     } \
                   1028:     else \
                   1029:        if ((ftg) -> ftg_flags & FTG_DELETE) { \
                   1030:            FTXEFREE (&((ftg) -> ftg_delete)); \
                   1031:        } \
                   1032:        else \
                   1033:            if ((ftg) -> ftg_flags & FTG_OPEN) \
                   1034:                FTOPFREE (&((ftg) -> ftg_open)); \
                   1035: }
                   1036: 
                   1037: 
                   1038: struct FTAMaccess {            /* F-{LOCATE,ERASE}.{INDICATION,CONFIRMATION} */
                   1039:     int            ftac_operation;
                   1040: #define        FA_OPS_LOCATE   0       /* locate */
                   1041: #define        FA_OPS_ERASE    1       /* erase */
                   1042: 
                   1043:                                /* CONFIRMATION only */
                   1044:     int            ftac_action;        /* action-result */
                   1045: 
                   1046:                                /* *.INDICATION OR F-LOCATE.CONFIRMATION */
                   1047:                                /* fadu-identity */
                   1048:     struct FADUidentity ftac_identity;
                   1049: 
                   1050:                                /* F-LOCATE.INDICATION only */
                   1051:     int            ftac_locking;       /* fadu-lock (on, off) */
                   1052: 
                   1053:                                /* CONFIRMATION only */
                   1054:     int     ftac_ndiag;                /* diagnostic */
                   1055:     struct FTAMdiagnostic   ftac_diags[NFDIAG];
                   1056: };
                   1057: #define        FTACFREE(ftac) \
                   1058: { \
                   1059:     FUFREE (&((ftac) -> ftac_identity)); \
                   1060: }
                   1061: 
                   1062: 
                   1063: struct FTAMreadwrite {         /* F-{READ,WRITE}.INDICATION */
                   1064:     int            ftrw_operation;     /* fadu-operation */
                   1065: #define        FA_OPS_READ     (-1)    /*   read (pseudo) */
                   1066: #define        FA_OPS_INSERT   0       /*   insert */
                   1067: #define        FA_OPS_REPLACE  1       /*   replace */
                   1068: #define        FA_OPS_EXTEND   2       /*   extend */
                   1069: 
                   1070:                                /* fadu-identity */
                   1071:     struct FADUidentity        ftrw_identity;
                   1072: 
                   1073:                                /* F-READ.INDICATION only */
                   1074:     int            ftrw_context;       /* access-context */
                   1075: #define        FA_ACC_HA       0       /*   hierarchical-all-data-units */
                   1076: #define        FA_ACC_HN       1       /*   hierarchical-no-data-units */
                   1077: #define        FA_ACC_FA       2       /*   flat-all-data-units */
                   1078: #define        FA_ACC_FL       3       /*   flat-one-level-data-units */
                   1079: #define        FA_ACC_FS       4       /*   flat-single-data-unit */
                   1080: #define        FA_ACC_UA       5       /*   unstructured-all-data-units */
                   1081: #define        FA_ACC_US       6       /*   unstructured-single-data-unit */
                   1082:     int            ftrw_level;         /* level for FL */
                   1083: 
                   1084:     int            ftrw_locking;       /* fadu-lock */
                   1085: };
                   1086: #define        FTRWFREE(ftrw) \
                   1087: { \
                   1088:     FUFREE (&((ftrw) -> ftrw_identity)); \
                   1089: }
                   1090: 
                   1091: 
                   1092: struct FTAMdataend {           /* F-DATA-END.INDICATION */
                   1093:     int            ftda_action;        /* action-result */
                   1094: 
                   1095:     int     ftda_ndiag;                /* diagnostic */
                   1096:     struct FTAMdiagnostic   ftda_diags[NFDIAG];
                   1097: };
                   1098: 
                   1099: 
                   1100: struct FTAMtransend {          /* F-TRANSFER-END.{INDICATION,CONFIRMATION} */
                   1101:                                /* RESPONSE only */
                   1102:     int            ftre_action;        /* action-result */
                   1103: 
                   1104:     PE     ftre_sharedASE;     /* shared-ASE-information */
                   1105: 
                   1106:                                /* RESPONSE only */
                   1107:     int     ftre_ndiag;                /* diagnostic */
                   1108:     struct FTAMdiagnostic   ftre_diags[NFDIAG];
                   1109: };
                   1110: #define        FTREFREE(ftre) \
                   1111: { \
                   1112:     if ((ftre) -> ftre_sharedASE) \
                   1113:        pe_free ((ftre) -> ftre_sharedASE), (ftre) -> ftre_sharedASE = NULLPE; \
                   1114: }
                   1115: 
                   1116: 
                   1117: struct FTAMcancel {            /* F-CANCEL.{INDICATION,CONFIRMATION} */
                   1118:     int            ftcn_action;        /* action-result */
                   1119: 
                   1120:     PE     ftcn_sharedASE;     /* shared-ASE-information */
                   1121: 
                   1122:     int     ftcn_ndiag;                /* diagnostic */
                   1123:     struct FTAMdiagnostic   ftcn_diags[NFDIAG];
                   1124: };
                   1125: #define        FTCNFREE(ftcn) \
                   1126: { \
                   1127:     if ((ftcn) -> ftcn_sharedASE) \
                   1128:        pe_free ((ftcn) -> ftcn_sharedASE), (ftcn) -> ftcn_sharedASE = NULLPE; \
                   1129: }
                   1130: 
                   1131: 
                   1132: struct FTAMindication {
                   1133:     int     fti_type;          /* the union element present */
                   1134: #define        FTI_FINISH      0x00
                   1135: #define        FTI_ABORT       0x01
                   1136: #define        FTI_MANAGEMENT  0x02
                   1137: #define        FTI_BULKBEGIN   0x03
                   1138: #define        FTI_BULKEND     0x04
                   1139: #define        FTI_ACCESS      0x05
                   1140: #define        FTI_READWRITE   0x06
                   1141: #define        FTI_DATA        0x07
                   1142: #define        FTI_DATAEND     0x08
                   1143: #define        FTI_CANCEL      0x09
                   1144: #define        FTI_TRANSEND    0x10
                   1145: 
                   1146:     union {
                   1147:        struct FTAMfinish   fti_un_finish;
                   1148:        struct FTAMabort    fti_un_abort;
                   1149:        struct FTAMgroup    fti_un_group;
                   1150:        struct FTAMaccess   fti_un_access;
                   1151:        struct FTAMreadwrite fti_un_readwrite;
                   1152:        struct PSAPdata     fti_un_data;
                   1153:        struct FTAMdataend  fti_un_dataend;
                   1154:        struct FTAMcancel   fti_un_cancel;
                   1155:        struct FTAMtransend fti_un_transend;
                   1156:     }  fti_un;
                   1157: #define        fti_finish      fti_un.fti_un_finish
                   1158: #define        fti_abort       fti_un.fti_un_abort
                   1159: #define        fti_group       fti_un.fti_un_group
                   1160: #define        fti_access      fti_un.fti_un_access
                   1161: #define        fti_readwrite   fti_un.fti_un_readwrite
                   1162: #define        fti_data        fti_un.fti_un_data
                   1163: #define        fti_dataend     fti_un.fti_un_dataend
                   1164: #define        fti_cancel      fti_un.fti_un_cancel
                   1165: #define        fti_transend    fti_un.fti_un_transend
                   1166: };
                   1167:     
                   1168: /* when FTAMindication has PSAPdata, the pe_context indicates whether
                   1169:    each data is from the FTAM PCI or is a data element.
                   1170: 
                   1171:        FTAM PCI        - PE_DFLT_CTX
                   1172: 
                   1173:        data element    - anything else
                   1174: 
                   1175:    three different types of data in the FTAM PCI are handled by the user:
                   1176: 
                   1177:        Node-Descriptor-Data-Element ::=        [APPLICATION 0] ...
                   1178:        Enter-Subtree-Data-Element ::=          [APPLICATION 1] ...
                   1179:        Exit-Subtree-Data-Element ::=           [APPLICATION 2] ...
                   1180:  */
                   1181: 
                   1182: #define        FADU_NODESCR    0       /* Node-Descriptor-Data-Element */
                   1183: #define        FADU_ENTERTREE  1       /* Enter-Subtree-Data-Element */
                   1184: #define        FADU_EXITREE    2       /* Exit-Subtree-Data-Element */
                   1185: 
                   1186: /*  */
                   1187: 
                   1188: extern char *ftamversion;
                   1189: 
                   1190: extern LLog _ftam_log, *ftam_log;
                   1191: 
                   1192: 
                   1193: int    FInit ();               /* F-INITIALIZE.INDICATION */
                   1194: int    FInitializeResponse (); /* F-INITIALIZE.RESPONSE */
                   1195: int    FInitializeRequest ();  /* F-INITIALIZE.REQUEST */
                   1196: int    FTerminateRequest ();   /* F-TERMINATE.REQUEST */
                   1197: int    FTerminateResponse ();  /* F-TERMINATE.RESPONSE */
                   1198: int    FUAbortRequest ();      /* F-U-ABORT.REQUEST */
                   1199: 
                   1200: int    FWaitRequest ();        /* F-WAIT.REQUEST (pseudo) */
                   1201: 
                   1202: int    FManageRequest ();      /* F-MANAGE.REQUEST (group) */
                   1203: int    FManageResponse ();     /* F-MANAGE.RESPONSE (group) */
                   1204: int    FBulkBeginRequest ();   /* F-BULK-BEGIN.REQUEST (group) */
                   1205: int    FBulkBeginResponse ();  /* F-BULK-BEGIN.RESPONSE (group) */
                   1206: int    FBulkEndRequest ();     /* F-BULK-END.REQUEST (group) */
                   1207: int    FBulkEndResponse ();    /* F-BULK-END.RESPONSE (group) */
                   1208: 
                   1209: int    FAccessRequest ();      /* F-{LOCATE,ERASE}.REQUEST */
                   1210: int    FAccessResponse ();     /* F-{LOCATE,ERASE}.RESPONSE */
                   1211: 
                   1212: int    FReadWriteRequest ();   /* F-{READ,WRITE}.REQUEST */
                   1213: int    FDataRequest ();        /* F-DATA.REQUEST */
                   1214: int    FDataEndRequest ();     /* F-DATA-END.REQUEST */
                   1215: int    FCancelRequest ();      /* F-CANCEL.REQUEST */
                   1216: int    FCancelResponse ();     /* F-CANCEL.RESPONSE */
                   1217: int    FTransEndRequest ();    /* F-TRANSFER-END.REQUEST */
                   1218: int    FTransEndResponse ();   /* F-TRANSFER-END.RESPONSE */
                   1219: 
                   1220: int    FSetIndications ();     /* define vector for INDICATION events */
                   1221: int    FSelectMask ();         /* map ftam descriptors for select() */
                   1222: 
                   1223: int    FHookRequest ();        /* set tracing */
                   1224: int    FTraceHook ();          /* user-defined tracing */
                   1225: 
                   1226: char   *FErrString ();         /* return FTAM error code in string form */
                   1227: 
                   1228: /*  */
                   1229: 
                   1230: struct isodocument {
                   1231:     char   *id_entry;
                   1232: 
                   1233:     OID            id_type;
                   1234: 
                   1235:     OID            id_abstract;
                   1236:     OID            id_transfer;
                   1237:     OID            id_model;
                   1238:     OID            id_constraint;
                   1239: };
                   1240: 
                   1241: int    setisodocument (), endisodocument ();
                   1242: 
                   1243: struct isodocument *getisodocument ();
                   1244: 
                   1245: struct isodocument *getisodocumentbyentry ();
                   1246: struct isodocument *getisodocumentbytype ();
                   1247: 
                   1248: #endif

unix.superglobalmegacorp.com

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