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

1.1     ! root        1: /* fpkt.h - include file for FTAM provider (FS-PROVIDER) */
        !             2: 
        !             3: /* 
        !             4:  * $Header: /f/osi/h/RCS/fpkt.h,v 7.3 90/07/01 21:03:44 mrose Exp $
        !             5:  *
        !             6:  *
        !             7:  * $Log:       fpkt.h,v $
        !             8:  * Revision 7.3  90/07/01  21:03:44  mrose
        !             9:  * pepsy
        !            10:  * 
        !            11:  * Revision 7.2  90/03/23  10:52:53  mrose
        !            12:  * update
        !            13:  * 
        !            14:  * Revision 7.1  89/12/14  10:03:41  mrose
        !            15:  * bdt
        !            16:  * 
        !            17:  * Revision 7.0  89/11/23  21:55:40  mrose
        !            18:  * Release 6.0
        !            19:  * 
        !            20:  */
        !            21: 
        !            22: /*
        !            23:  *                               NOTICE
        !            24:  *
        !            25:  *    Acquisition, use, and distribution of this module and related
        !            26:  *    materials are subject to the restrictions of a license agreement.
        !            27:  *    Consult the Preface in the User's Manual for the full terms of
        !            28:  *    this agreement.
        !            29:  *
        !            30:  */
        !            31: 
        !            32: 
        !            33: #include "FTAM-types.h"
        !            34: 
        !            35: #ifndef        _FTAM_
        !            36: #include "ftam.h"              /* definitions for FS-USERs */
        !            37: #endif
        !            38: #ifndef        _AcSAP_
        !            39: #include "acsap.h"             /* definitions for AcS-USERs */
        !            40: #endif
        !            41: 
        !            42: /*  */
        !            43: 
        !            44: #define        FS_GEN(fsb) \
        !            45:        ((fsb -> fsb_flags & FSB_INIT) ? FS_GEN_INITIATOR : FS_GEN_RESPONDER)
        !            46: 
        !            47: #define        ftamPsig(fsb, sd) \
        !            48: { \
        !            49:     if ((fsb = findfsblk (sd)) == NULL) { \
        !            50:        (void) sigiomask (smask); \
        !            51:        return ftamlose (fti, FS_GEN_NOREASON, 0, NULLCP, \
        !            52:                            "invalid ftam descriptor"); \
        !            53:     } \
        !            54:     if (!(fsb -> fsb_flags & FSB_CONN)) { \
        !            55:        (void) sigiomask (smask); \
        !            56:        return ftamlose (fti, FS_GEN (fsb), 0, NULLCP, \
        !            57:                            "ftam descriptor not connected"); \
        !            58:     } \
        !            59:     if (fsb -> fsb_flags & FSB_FINN) { \
        !            60:        (void) sigiomask (smask); \
        !            61:        return ftamlose (fti, FS_GEN (fsb), 0, NULLCP, \
        !            62:                            "ftam descriptor finishing"); \
        !            63:     } \
        !            64: }
        !            65: 
        !            66: #define        ftamFsig(fsb, sd) \
        !            67: { \
        !            68:     if ((fsb = findfsblk (sd)) == NULL) { \
        !            69:        (void) sigiomask (smask); \
        !            70:        return ftamlose (fti, FS_GEN_NOREASON, 0, NULLCP, \
        !            71:                            "invalid ftam descriptor"); \
        !            72:     } \
        !            73:     if (!(fsb -> fsb_flags & FSB_CONN)) { \
        !            74:        (void) sigiomask (smask); \
        !            75:        return ftamlose (fti, FS_GEN (fsb), 0, NULLCP, \
        !            76:                            "ftam descriptor not connected"); \
        !            77:     } \
        !            78:     if (!(fsb -> fsb_flags & FSB_FINN)) { \
        !            79:        (void) sigiomask (smask); \
        !            80:        return ftamlose (fti, FS_GEN (fsb), 0, NULLCP, \
        !            81:                            "ftam descriptor not finishing"); \
        !            82:     } \
        !            83: }
        !            84: 
        !            85: #define toomuchP(b,n,m,p) \
        !            86: { \
        !            87:     if (b == NULL) \
        !            88:        n = 0; \
        !            89:     else \
        !            90:        if (n > m) \
        !            91:            return ftamlose (fti, FS_GEN_NOREASON, 0, NULLCP, \
        !            92:                            "too many %ss", p); \
        !            93: }
        !            94: 
        !            95: #define        missingP(p) \
        !            96: { \
        !            97:     if (p == NULL) \
        !            98:        return ftamlose (fti, FS_GEN_NOREASON, 0, NULLCP, \
        !            99:                            "mandatory parameter \"%s\" missing", "p"); \
        !           100: }
        !           101: 
        !           102: #ifndef        lint
        !           103: #ifndef        __STDC__
        !           104: #define        copyFTAMdata(base,len,d) \
        !           105: { \
        !           106:     register int i = len; \
        !           107:     if ((d -> d/* */_cc = min (i, sizeof d -> d/* */_data)) > 0) \
        !           108:        bcopy (base, d -> d/* */_data, d -> d/* */_cc); \
        !           109: }
        !           110: #else
        !           111: #define        copyFTAMdata(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: #endif
        !           118: #else
        !           119: #define        copyFTAMdata(base,len,d)        bcopy (base, (char *) d, len)
        !           120: #endif
        !           121: 
        !           122: 
        !           123: int    ftamlose (), fpktlose (), ftamoops ();
        !           124: 
        !           125: /*  */
        !           126: 
        !           127: struct ftamblk {
        !           128:     struct ftamblk *fsb_forw;  /* doubly-linked list */
        !           129:     struct ftamblk *fsb_back;  /*   .. */
        !           130: 
        !           131:     int            fsb_fd;             /* association descriptor */
        !           132: 
        !           133:     short   fsb_flags;         /* our state */
        !           134: #define        FSB_NULL        0x0000
        !           135: #define        FSB_CONN        0x0001  /* connected */
        !           136: #define        FSB_FINN        0x0002  /* other side wants to finish */
        !           137: #define        FSB_INIT        0x0004  /* this side initiated the association */
        !           138: #define        FSB_ASYN        0x0008  /* asynchronous */
        !           139: #define        FSB_DECHARGE    0x0010  /* responder can using charging on deselect */
        !           140: #define        FSB_CANCEL      0x0020  /* this side started F-CANCEL */
        !           141: #define        FSB_COLLIDE     0x0040  /* collision */
        !           142: 
        !           143:     short   fsb_state;         /* more state */
        !           144: #define        FSB_INITIALIZED 0       /*   initialized */
        !           145: #define        FSB_MANAGEMENT  1       /*   management */
        !           146: #define        FSB_BULKBEGIN   2       /*   bulk data begin */
        !           147: #define        FSB_BULKEND     3       /*   bulk data end */
        !           148: #define        FSB_DATAIDLE    4       /*   data transfer idle */
        !           149: #define        FSB_LOCATE      5       /*   locate in progress */
        !           150: #define        FSB_ERASE       6       /*   erase in progress */
        !           151: #define        FSB_DATAREAD    7       /*   data transfer read */
        !           152: #define        FSB_DATAWRITE   8       /*   data transfer write */
        !           153: #define        FSB_DATAFIN1    9       /*   data transfer done */
        !           154: #define        FSB_DATAFIN2    10      /*     .. */
        !           155: #define        FSB_DATACANCEL  11      /*   cancel in progress */
        !           156:     
        !           157:     int            fsb_group;          /* group flags */
        !           158: 
        !           159:     int            fsb_srequirements;  /* session requirements */
        !           160:     int            fsb_owned;          /* session tokens we own */
        !           161:     int            fsb_avail;          /* session tokens available */
        !           162:     int            fsb_settings;       /* initial and resync settings */
        !           163:     long    fsb_ssn;           /* serial number */
        !           164:     struct SSAPref fsb_connect;        /* session connection reference */
        !           165:     int            fsb_ssdusize;       /* largest atomic SSDU */
        !           166: 
        !           167:     int            fsb_id;             /* FTAM context id */
        !           168:     int            fsb_prequirements;  /* presentation requirements */
        !           169:     struct PSAPctxlist fsb_contexts;/* presentation contexts */
        !           170:     struct FTAMcontentlist fsb_contents; /* FTAM document types */
        !           171: 
        !           172:     OID            fsb_context;        /* application context */
        !           173: 
        !           174:     int            fsb_fqos;           /* ftam-QoS */
        !           175:     int            fsb_class;          /* service-class */
        !           176:     int            fsb_units;          /* functional-units */
        !           177:                                /* mandatory functional-units */
        !           178: #define        FUNITS_TRANSFER (FUNIT_GROUPING)
        !           179: #define        FUNITS_ACCESS   (FUNIT_READ | FUNIT_WRITE | FUNIT_ACCESS)
        !           180: #define        FUNITS_MANAGE   (FUNIT_LIMITED | FUNIT_GROUPING)
        !           181: #define        FUNITS_TM       (FUNIT_GROUPING)
        !           182: #define        FUNITS_UNCONS   (0)
        !           183: 
        !           184:     int            fsb_attrs;          /* attribute-groups */
        !           185: 
        !           186:     IFP            fsb_indication;     /* event handler */
        !           187:     
        !           188:     struct PSAPdata fsb_data;  /* for screwy BDT stuff */
        !           189: 
        !           190:     int            fsb_cancelaction;   /* handle CANCEL collisions */
        !           191:     PE     fsb_cancelshared;
        !           192:     struct FTAMdiagnostic *fsb_canceldiags;
        !           193:     int            fsb_cancelndiag;
        !           194:     
        !           195:     IFP            fsb_trace;          /* user-defined tracing function */
        !           196: };
        !           197: #define        NULLFSB         ((struct ftamblk *) 0)
        !           198: 
        !           199: int    freefsblk ();
        !           200: struct ftamblk *newfsblk (), *findfsblk ();
        !           201: 
        !           202: #ifndef        lint
        !           203: #define        fsbtrace(fsb,a) if ((fsb) -> fsb_trace) (*((fsb) -> fsb_trace)) a
        !           204: #else
        !           205: #define        fsbtrace(fsb,a) FTraceHook a
        !           206: #endif
        !           207: 
        !           208: /*  */
        !           209: 
        !           210: struct pair {
        !           211:     int            p_mask;
        !           212:     int            p_bitno;
        !           213: };
        !           214: 
        !           215: extern struct pair fclass_pairs[],
        !           216:                   funit_pairs[],
        !           217:                   fattr_pairs[],
        !           218:                   fname_pairs[],
        !           219:                   fmode_pairs[],
        !           220:                   frequested_pairs[],
        !           221:                   fpermitted_pairs[];
        !           222: /*  */
        !           223: 
        !           224: struct type_FTAM_Access__Control__List *acl2fpm ();
        !           225: int    fpm2acl ();
        !           226: 
        !           227: struct type_FTAM_Read__Attributes *attr2fpm ();
        !           228: int    fpm2attr ();
        !           229: 
        !           230: PE     bits2fpm ();
        !           231: int    fpm2bits ();
        !           232: 
        !           233: struct type_FTAM_Charging *chrg2fpm ();
        !           234: int    fpm2chrg ();
        !           235: 
        !           236: struct type_FTAM_Concurrency__Access *conacc2fpm ();
        !           237: int    fpm2conacc ();
        !           238: 
        !           239: struct type_FTAM_Concurrency__Control *conctl2fpm ();
        !           240: int    fpm2conctl ();
        !           241: #define        conctl_present(fc) \
        !           242:     ((fc) -> fc_readlock != FLOCK_NOTREQD \
        !           243:        || (fc) -> fc_insertlock != FLOCK_NOTREQD \
        !           244:        || (fc) -> fc_replacelock != FLOCK_NOTREQD \
        !           245:        || (fc) -> fc_extendlock != FLOCK_NOTREQD \
        !           246:        || (fc) -> fc_eraselock != FLOCK_NOTREQD \
        !           247:        || (fc) -> fc_readattrlock != FLOCK_NOTREQD \
        !           248:        || (fc) -> fc_chngattrlock != FLOCK_NOTREQD \
        !           249:        || (fc) -> fc_deletelock != FLOCK_NOTREQD) \
        !           250: 
        !           251: 
        !           252: struct type_FTAM_Diagnostic *diag2fpm ();
        !           253: int    fpm2diag ();
        !           254: 
        !           255: struct type_FTAM_FADU__Identity *faduid2fpm ();
        !           256: int    fpm2faduid ();
        !           257: 
        !           258: struct type_FTAM_Access__Passwords *pass2fpm ();
        !           259: int    fpm2pass ();
        !           260: #define        passes_present(fp) \
        !           261:     ((fp) -> fp_read || (fp) -> fp_insert || (fp) -> fp_replace \
        !           262:        || (fp) -> fp_extend || (fp) -> fp_erase || (fp) -> fp_readattr \
        !           263:        || (fp) -> fp_chngattr || (fp) -> fp_delete) \
        !           264: 
        !           265: struct type_FTAM_Shared__ASE__Information *shared2fpm ();
        !           266: int    fpm2shared ();
        !           267: 
        !           268: /*  */
        !           269: 
        !           270: int    acs2ftamlose (), acs2ftamabort ();
        !           271: int    ps2ftamlose ();

unix.superglobalmegacorp.com

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