ftam.h

来自「ftam等标准协议服务器和客户端的源代码。」· C头文件 代码 · 共 1,150 行 · 第 1/3 页

H
1,150
字号
};#define	FLFREE(fl) \{ \    FEFREE ((fl) -> fl_insert) \    (fl) -> fl_insert = NULL; \ \    FEFREE ((fl) -> fl_delete) \    (fl) -> fl_delete = NULL; \}/*  */struct FTAMattributes {    long    fa_present;		/* values present */    long    fa_novalue;		/* no value available */#define	FA_NULL		0x00000#define	FA_FILENAME	0x00001	/* filename */#define	FA_CONTENTS	0x00002	/* contents-type */#define	FA_ACCOUNT	0x00004	/* account */#define	FA_DATE_CREATE	0x00008	/* date-and-time-of-creation */#define	FA_DATE_MODIFY	0x00010	/* date-and-time-of-last-modification */#define	FA_DATE_READ	0x00020	/* date-and-time-of-last-read-access */#define	FA_DATE_ATTR	0x00040	/* date-and-time-of-last-attribute-modification */#define	FA_ID_CREATE	0x00080	/* identity-of-creator */#define	FA_ID_MODIFY	0x00100	/* identity-of-last-modifier */#define	FA_ID_READ	0x00200	/* identity-of-last-reader */#define	FA_ID_ATTR	0x00400	/* identity-of-last-attribute-modifier */#define	FA_AVAILABILITY	0x00800	/* file-availability */#define	FA_ACTIONS	0x01000	/* permitted-actions */#define	FA_FILESIZE	0x02000	/* filesize */#define	FA_FUTURESIZE	0x04000	/* future-filesize */#define	FA_CONTROL	0x08000	/* access-control */#define	FA_ENCRYPT	0x10000	/* encryption-name */#define	FA_LEGAL	0x20000	/* legal-qualifications */#define	FA_PRIVATE	0x40000	/* private-use */#define	FA_STORAGE	(FA_ACCOUNT | FA_DATE_CREATE | FA_DATE_MODIFY \			    | FA_DATE_READ | FA_DATE_ATTR | FA_ID_CREATE \ 			    | FA_ID_MODIFY | FA_ID_READ | FA_ID_ATTR \			    | FA_AVAILABILITY | FA_ACTIONS | FA_FILESIZE \			    | FA_FUTURESIZE)#define	FA_SECURITY	(FA_CONTROL | FA_ENCRYPT | FA_LEGAL)#define	NFFILE	5		/* arbitrary */    int	    fa_nfile;		/* filename */    char   *fa_files[NFFILE];	/*   .. */        OID	    fa_contents;	/* contents-type */    char   *fa_account;		/* account */				/* date-and-time-of- ... */    struct UTCtime fa_date_create;    struct UTCtime fa_date_modify;    struct UTCtime fa_date_read;    struct UTCtime fa_date_attribute;				/* identity-of- ... */    char   *fa_id_create;    char   *fa_id_modify;    char   *fa_id_read;    char   *fa_id_attribute;    int	    fa_availability;	/* file-availability */#define	FA_AVAIL_IMMED	0	/*   immediate */#define	FA_AVAIL_DEFER	1	/*   deferred */    int	    fa_permitted;	/* permitted-actions,				   same as fe_actions, plus: */#define	FA_PERM_TRAV		0x0100	/* traversal */#define	FA_PERM_RVTRAV		0x0200	/* reverse-traversal */#define	FA_PERM_RANDOM		0x0400	/* random-order */#define	FA_PERM_TRAVERSAL	(FA_PERM_TRAV | FA_PERM_RVTRAV \					| FA_PERM_RANDOM)    int	    fa_filesize;	/* filesize */    int	    fa_futuresize;	/* future-filesize */    struct FTAMaclist fa_control;/* access-control */    char   *fa_encrypt;		/* encryption-name */    char   *fa_legal;		/* legal-qualification */};void	FAFREE ();/*  */struct FTAMconcurrency {#define	FLOCK_SHARED	00	/* shared */#define	FLOCK_EXCLUSIVE	01	/* exclusive */#define	FLOCK_NOTREQD	02	/* not-required */#define	FLOCK_NOACCESS	03	/* no-access */#define	FLOCK_MASK	03#define	FLOCK_PRESENT	FLOCK_EXCLUSIVE#define	FLOCK_RESTRICT	01    char    fc_readlock;    char    fc_insertlock;    char    fc_replacelock;    char    fc_eraselock;    char    fc_extendlock;    char    fc_readattrlock;    char    fc_chngattrlock;    char    fc_deletelock;};#define	FCINIT(fc) \{ \    (fc) -> fc_readlock = FLOCK_NOTREQD; \    (fc) -> fc_insertlock = FLOCK_NOTREQD; \    (fc) -> fc_replacelock = FLOCK_NOTREQD; \    (fc) -> fc_eraselock = FLOCK_NOTREQD; \    (fc) -> fc_extendlock = FLOCK_NOTREQD; \    (fc) -> fc_readattrlock = FLOCK_NOTREQD; \    (fc) -> fc_chngattrlock = FLOCK_NOTREQD; \    (fc) -> fc_deletelock = FLOCK_NOTREQD; \}/*  */struct FADUidentity {    int	    fa_type;#define	FA_FIRSTLAST	0	/* first-last */#define	FA_RELATIVE	1	/* relative */#define	FA_BEGINEND	2	/* begin-end */#define	FA_SINGLE	3	/* single-name */#define	FA_NAMELIST	4	/* name-list */#define	FA_FADUNUMBER	5	/* fadu-number */    union {	int	fa_un_firstlast;#define	FA_FIRST	0#define	FA_LAST		1	int	fa_un_relative;#define	FA_PREVIOUS	0#define	FA_CURRENT	1#define	FA_NEXT		2	int	fa_un_beginend;#define	FA_BEGIN	0#define	FA_END		1	char   *fa_un_singlename;#define	NANAME	5		/* arbitrary */	struct {	    char   *fa_un_names[NANAME];	    int	    fa_un_nname;	}	fa_un_list;	int	fa_un_fadunumber;    }	fa_un;#define	fa_firstlast	fa_un.fa_un_firstlast#define	fa_relative	fa_un.fa_un_relative#define	fa_beginend	fa_un.fa_un_beginend#define	fa_singlename	fa_un.fa_un_singlename#define	fa_names	fa_un.fa_un_list.fa_un_names#define	fa_nname	fa_un.fa_un_list.fa_un_nname#define	fa_fadunumber	fa_un.fa_un_fadunumber    int	    fa_levelnumber;};#define	FUFREE(fu) \{ \    register int    FUI; \ \    if ((fu) -> fa_singlename) \	free ((fu) -> fa_singlename), (fu) -> fa_singlename = NULL; \ \    for (FUI = (fu) -> fa_nname - 1; FUI >= 0; FUI--) \	if ((fu) -> fa_names[FUI]) \	    free ((fu) -> fa_names[FUI]), (fu) -> fa_names[FUI] = NULL; \}/*  */struct FTAMstart {		/* F-INITIALIZE.INDICATION */    int	    fts_sd;		/* FTAM descriptor */    AEInfo fts_callingtitle;	/* info on calling application-entity */    AEInfo fts_calledtitle;	/* info called application-entity */    struct PSAPaddr fts_calledaddr;/* called presentation address */    struct PSAPaddr fts_callingaddr;/* calling presentation address */    int	    fts_manage;		/* presentation context management */    int	    fts_level;		/* service level */    int	    fts_class;		/* service class */    int	    fts_units;		/* functional units */    int	    fts_attrs;		/* attribute groups */    int	    fts_rollback;	/* rollback availability */    struct FTAMcontentlist fts_contents;/* contents type list */    char   *fts_initiator;	/* initiator */    char   *fts_account;	/* account */    char   *fts_password;	/* password */    int	    fts_passlen;	/*   .. */    int	    fts_ssdusize;	/* largest atomic SSDU */    struct QOStype fts_qos;	/* quality of service */};#define	FTSFREE(fts) \{ \    register int FSI; \ \    AEIFREE (&(fts) -> fts_callingtitle); \    AEIFREE (&(fts) -> fts_calledtitle); \ \    for (FSI = (fts) -> fts_contents.fc_ncontent - 1; FSI >= 0; FSI--) \	oid_free ((fts) -> fts_contents.fc_contents[FSI].fc_dtn), \		(fts) -> fts_contents.fc_contents[FSI].fc_dtn = NULLOID; \    (fts) -> fts_contents.fc_ncontent = 0; \ \    if ((fts) -> fts_initiator) \	free ((fts) -> fts_initiator), (fts) -> fts_initiator = NULL; \    if ((fts) -> fts_account) \	free ((fts) -> fts_account), (fts) -> fts_account = NULL; \    if ((fts) -> fts_password) \	free ((fts) -> fts_password), (fts) -> fts_password = NULL; \}struct FTAMconnect {		/* F-INITIALIZE.CONFIRMATION */    int	    ftc_sd;		/* FTAM descriptor */    int	    ftc_state;		/* state result */    int	    ftc_action;		/* action result */    AEInfo ftc_respondtitle;	/* responding application-entity title */    struct PSAPaddr ftc_respondaddr;/* responding presentation address */    int	    ftc_manage;		/* presentation context management */    int	    ftc_units;		/* functional units */    int	    ftc_attrs;		/* attribute groups */    int	    ftc_rollback;	/* rollback availability */    struct FTAMcontentlist ftc_contents;/* contents type list */#define	NFDIAG	5		/* diagnostics */    int	    ftc_ndiag;    struct FTAMdiagnostic  ftc_diags[NFDIAG];    int	    ftc_ssdusize;	/* largest atomic SSDU */    struct QOStype ftc_qos;	/* quality of service */};#define	FTCFREE(ftc) \{ \    register int FCI; \ \    AEIFREE (&(ftc) -> ftc_respondtitle); \ \    for (FCI = (ftc) -> ftc_contents.fc_ncontent - 1; FCI >= 0; FCI--) \	oid_free ((ftc) -> ftc_contents.fc_contents[FCI].fc_dtn), \		(ftc) -> ftc_contents.fc_contents[FCI].fc_dtn = NULLOID; \    (ftc) -> ftc_contents.fc_ncontent = 0; \}struct FTAMfinish {		/* F-TERMINATE.INDICATION */    int	    ftf_dummy;};struct FTAMrelease {		/* F-TERMINATE.CONFIRMATION */				/* charging */    struct FTAMcharging ftr_charges;};#define	FTRFREE(ftr) \{ \    register int    FRI; \    register struct fc_charge  *FC; \ \    for (FC = (ftr) -> ftr_charges.fc_charges, FRI = (ftr) -> ftr_charges.fc_ncharge - 1; \	    FRI >= 0; \	    FC++, FRI--) { \	if (FC -> fc_resource) \	    free (FC -> fc_resource), FC -> fc_resource = NULL; \	if (FC -> fc_unit) \	    free (FC -> fc_unit), FC -> fc_unit = NULL; \    } \    (ftr) -> ftr_charges.fc_ncharge = 0; \}struct FTAMabort {		/* F-{U,P}-ABORT.INDICATION */    int	    fta_peer;		/* T   = F-U-ABORT.INDICATION				   NIL = F-P-ABORT.INDICATION */    int	    fta_action;		/* action result */        int	    fta_ndiag;		/* diagnostics */    struct FTAMdiagnostic fta_diags[NFDIAG];};struct FTAMselect {		/* F-SELECT.* */				/* RESPONSE only */    int     ftse_state;		/* state result */    int     ftse_action;	/* action result */				/* attributes (FILENAME only) */    struct FTAMattributes ftse_attrs;				/* REQUEST only */    int	    ftse_access;	/* requested access */#define	FA_REQ_MASK	(FA_PERM_READ | FA_PERM_INSERT | FA_PERM_REPLACE \				| FA_PERM_EXTEND | FA_PERM_ERASE \				| FA_PERM_READATTR | FA_PERM_CHNGATTR \				| FA_PERM_DELETE)				/* access-passwords */    struct FTAMpasswords ftse_pwds;				/* concurrency-control */    struct FTAMconcurrency ftse_conctl;    char   *ftse_account;	/* account */				/* RESPONSE only */    int	    ftse_ndiag;		/* diagnostics */    struct FTAMdiagnostic ftse_diags[NFDIAG];};#define	FTSEFREE(ftse) \{ \    FAFREE(&((ftse) -> ftse_attrs)); \    FPFREE(&((ftse) -> ftse_pwds)); \    if ((ftse) -> ftse_account) \	free ((ftse) -> ftse_account), (ftse) -> ftse_account = NULLCP; \}struct FTAMdeselect {		/* F-DESELECT.* */				/* these are all RESPONSE only */    int     ftde_action;	/* action result */				/* charging */    struct FTAMcharging ftde_charges;    int     ftde_ndiag;		/* diagnostics */    struct FTAMdiagnostic   ftde_diags[NFDIAG];};#define	FTDEFREE(ftde) \{ \    register int    FDEI; \    register struct fc_charge  *FC; \ \    for (FC = (ftde) -> ftde_charges.fc_charges, FDEI = (ftde) -> ftde_charges.fc_ncharge - 1; \	    FDEI >= 0; \	    FC++, FDEI--) { \	if (FC -> fc_resource) \	    free (FC -> fc_resource), FC -> fc_resource = NULL; \	if (FC -> fc_unit) \	    free (FC -> fc_unit), FC -> fc_unit = NULL; \    } \    (ftde) -> ftde_charges.fc_ncharge = 0; \}struct FTAMcreate {		/* F-CREATE.* */				/* RESPONSE only */    int     ftce_state;		/* state result */    int     ftce_action;	/* action result */				/* REQUEST only */    int	    ftce_override;	/* override */#define	FOVER_FAIL	0	/* fail, if already exists */#define	FOVER_SELECT	1	/* select, if it already exists */#define	FOVER_WRITE	2	/* zero-truncate, if it already exists */#define	FOVER_DELETE	3	/* delete, if it already exists */    char   *ftce_create;	/* create password */    int	    ftce_crelen;	/*   .. */    char   *ftce_delete;	/* delete password */    int	    ftce_dellen;	/*   .. */				/* initial attributes */    struct FTAMattributes ftce_attrs;				/* REQUEST only */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?