ftam.h

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

H
1,150
字号
    int	    ftce_access;	/* requested access */				/* access-passwords */    struct FTAMpasswords ftce_pwds;				/* concurrency-control */    struct FTAMconcurrency ftce_conctl;    char   *ftce_account;	/* account */				/* RESPONSE only */    int	    ftce_ndiag;		/* diagnostics */    struct FTAMdiagnostic ftce_diags[NFDIAG];};#define	FTCEFREE(ftce) \{ \    if ((ftce) -> ftce_create) \	free ((ftce) -> ftce_create), (ftce) -> ftce_create = NULLCP; \    if ((ftce) -> ftce_delete) \	free ((ftce) -> ftce_delete), (ftce) -> ftce_delete = NULLCP; \    FAFREE(&((ftce) -> ftce_attrs)); \    FPFREE(&((ftce) -> ftce_pwds)); \    if ((ftce) -> ftce_account) \	free ((ftce) -> ftce_account), (ftce) -> ftce_account = NULLCP; \}struct FTAMdelete {		/* F-DELETE.* */				/* RESPONSE only */    int	    ftxe_action;	/* action result */    				/* REQUEST only */    char   *ftxe_delete;	/* delete password */    int	    ftxe_dellen;				/* RESPONSE only */				/* charging */    struct FTAMcharging ftxe_charges;    int     ftxe_ndiag;		/* diagnostics */    struct FTAMdiagnostic   ftxe_diags[NFDIAG];};#define	FTXEFREE(ftxe) \{ \    register int    FXEI; \    register struct fc_charge  *FC; \ \    if ((ftxe) -> ftxe_delete) \	free ((ftxe) -> ftxe_delete), (ftxe) -> ftxe_delete = NULLCP; \ \    for (FC = (ftxe) -> ftxe_charges.fc_charges, FXEI = (ftxe) -> ftxe_charges.fc_ncharge - 1; \	    FXEI >= 0; \	    FC++, FXEI--) { \	if (FC -> fc_resource) \	    free (FC -> fc_resource), FC -> fc_resource = NULL; \	if (FC -> fc_unit) \	    free (FC -> fc_unit), FC -> fc_unit = NULL; \    } \    (ftxe) -> ftxe_charges.fc_ncharge = 0; \}struct FTAMreadattr {		/* F-READ-ATTRIB.* */				/* RESPONSE only */    int	    ftra_action;	/* action result */				/* REQUEST only */    int	    ftra_attrnames;	/* attribute names (from fa_present) */				/* RESPONSE only */    struct FTAMattributes ftra_attrs;    int	    ftra_ndiag;		/* diagnostics */    struct FTAMdiagnostic ftra_diags[NFDIAG];};#define	FTRAFREE(ftra) \{ \    FAFREE(&((ftra) -> ftra_attrs)); \}struct FTAMchngattr {		/* F-CHANGE-ATTRIB.* */				/* RESPONSE only */    int ftca_action;		/* action result */    struct FTAMattributes ftca_attrs;				/* RESPONSE only */    int	    ftca_ndiag;		/* diagnostics */    struct FTAMdiagnostic ftca_diags[NFDIAG];};#define	FTCAFREE(ftca) \{ \    FAFREE(&((ftca) -> ftca_attrs)); \}struct FTAMopen {		/* F-OPEN.* */				/* RESPONSE only */    int	    ftop_state;		/* state result */    int	    ftop_action;	/* action result */				/* REQUEST only */    int	    ftop_mode;		/* processing mode (read..extend) */#define	FA_MODE_MASK	(FA_PERM_READ | FA_PERM_INSERT | FA_PERM_REPLACE \				| FA_PERM_EXTEND | FA_PERM_ERASE)    OID	    ftop_contents;	/* contents type */				/* concurrency-control */    struct FTAMconcurrency ftop_conctl;				/* RESPONSE only */    int	    ftop_ndiag;		/* diagnostics */    struct FTAMdiagnostic ftop_diags[NFDIAG];};#define	FTOPFREE(ftop) \{ \    if ((ftop) -> ftop_contents) \	oid_free ((ftop) -> ftop_contents), \	    (ftop) -> ftop_contents = NULLOID; \}struct FTAMclose {		/* F-CLOSE.* */				/* these are all RESPONSE only */    int	    ftcl_action;	/* action result */    int     ftcl_ndiag;		/* diagnostics */    struct FTAMdiagnostic   ftcl_diags[NFDIAG];};struct FTAMgroup {    int     ftg_threshold;	/* threshold */    int     ftg_flags;#define	FTG_NULL	0x0000#define	FTG_BEGIN	0x0001	/* have begin */#define	FTG_SELECT	0x0002	/*   .. select */#define	FTG_CREATE	0x0004	/*   .. create */#define	FTG_RDATTR	0x0008	/*   .. read attribute */#define	FTG_CHATTR	0x0010	/*   .. change attribute */#define	FTG_OPEN	0x0020	/*   .. open */#define	FTG_CLOSE	0x0040	/*   .. close */#define	FTG_DESELECT	0x0080	/*   .. deselect */#define	FTG_DELETE	0x0100	/*   .. delete */#define	FTG_END		0x0200	/*   .. end */    union {	struct FTAMselect   ftg_un1_select;	struct FTAMcreate   ftg_un1_create;	struct FTAMclose    ftg_un1_close;    }                   ftg_un1;#define	ftg_select	ftg_un1.ftg_un1_select#define	ftg_create	ftg_un1.ftg_un1_create#define	ftg_close	ftg_un1.ftg_un1_close    struct FTAMreadattr ftg_readattr;    struct FTAMchngattr ftg_chngattr;    union {	struct FTAMdeselect ftg_un2_deselect;	struct FTAMdelete   ftg_un2_delete;	struct FTAMopen	    ftg_un2_open;    } ftg_un2;#define	ftg_deselect	ftg_un2.ftg_un2_deselect#define	ftg_delete	ftg_un2.ftg_un2_delete#define	ftg_open	ftg_un2.ftg_un2_open};#define	FTGFREE(ftg) \{ \    if ((ftg) -> ftg_flags & FTG_SELECT) { \	FTSEFREE (&((ftg) -> ftg_select)); \    } \    else \	if ((ftg) -> ftg_flags & FTG_CREATE) \	    FTCEFREE (&((ftg) -> ftg_create)); \ \    if ((ftg) ->ftg_flags & FTG_RDATTR) \	FTRAFREE (&((ftg) -> ftg_readattr)); \ \    if ((ftg) ->ftg_flags & FTG_CHATTR) \	FTCAFREE (&((ftg) -> ftg_chngattr)); \ \    if ((ftg) -> ftg_flags & FTG_DESELECT) { \	FTDEFREE (&((ftg) -> ftg_deselect)); \    } \    else \	if ((ftg) -> ftg_flags & FTG_DELETE) { \	    FTXEFREE (&((ftg) -> ftg_delete)); \	} \	else \	    if ((ftg) -> ftg_flags & FTG_OPEN) \		FTOPFREE (&((ftg) -> ftg_open)); \}struct FTAMaccess {		/* F-{LOCATE,ERASE}.{INDICATION,CONFIRMATION} */    int	    ftac_operation;#define	FA_OPS_LOCATE	0	/* locate */#define	FA_OPS_ERASE	1	/* erase */				/* RESPONSE only */    int	    ftac_action;	/* action result */				/* REQUEST ONLY */				/* fadu-identity */    struct FADUidentity ftac_identity;				/* RESPONSE only */    int     ftac_ndiag;		/* diagnostics */    struct FTAMdiagnostic   ftac_diags[NFDIAG];};#define	FTACFREE(ftac) \{ \    FUFREE (&((ftac) -> ftac_identity)); \}struct FTAMreadwrite {		/* F-{READ,WRITE}.INDICATION */    int	    ftrw_operation;	/* fadu-operation */#define	FA_OPS_READ	(-1)	/*   read (pseudo) */#define	FA_OPS_INSERT	0	/*   insert */#define	FA_OPS_REPLACE	1	/*   replace */#define	FA_OPS_EXTEND	2	/*   extend */				/* fadu-identity */    struct FADUidentity	ftrw_identity;    int	    ftrw_context;	/* access-context */#define	FA_ACC_HA	0	/*   hierarchical-all-data-units */#define	FA_ACC_HN	1	/*   hierarchical-no-data-units */#define	FA_ACC_FA	2	/*   flat-all-data-units */#define	FA_ACC_FL	3	/*   flat-one-level-data-units */#define	FA_ACC_FS	4	/*   flat-single-data-unit */#define	FA_ACC_UA	5	/*   unstructured-all-data-units */#define	FA_ACC_US	6	/*   unstructured-single-data-unit */};#define	FTRWFREE(ftrw) \{ \    FUFREE (&((ftrw) -> ftrw_identity)); \}struct FTAMdataend {		/* F-DATA-END.INDICATION */    int	    ftda_action;	/* action-result */    int     ftda_ndiag;		/* diagnostics */    struct FTAMdiagnostic   ftda_diags[NFDIAG];};struct FTAMcancel {		/* F-CANCEL.{INDICATION,CONFIRMATION} */    int	    ftcn_action;	/* action-result */    int     ftcn_ndiag;		/* diagnostics */    struct FTAMdiagnostic   ftcn_diags[NFDIAG];};struct FTAMtransend {		/* F-TRANSFER-END.{INDICATION,CONFIRMATION} */				/* all these are RESPONSE only */    int	    ftre_action;	/* action-result */    int     ftre_ndiag;		/* diagnostics */    struct FTAMdiagnostic   ftre_diags[NFDIAG];};struct FTAMindication {    int     fti_type;		/* the union element present */#define	FTI_FINISH	0x00#define	FTI_ABORT	0x01#define	FTI_MANAGEMENT	0x02#define	FTI_BULKBEGIN	0x03#define	FTI_BULKEND	0x04#define	FTI_ACCESS	0x05#define	FTI_READWRITE	0x06#define	FTI_DATA	0x07#define	FTI_DATAEND	0x08#define	FTI_CANCEL	0x09#define	FTI_TRANSEND	0x10    union {	struct FTAMfinish   fti_un_finish;	struct FTAMabort    fti_un_abort;	struct FTAMgroup    fti_un_group;	struct FTAMaccess   fti_un_access;	struct FTAMreadwrite fti_un_readwrite;	struct PSAPdata	    fti_un_data;	struct FTAMdataend  fti_un_dataend;	struct FTAMcancel   fti_un_cancel;	struct FTAMtransend fti_un_transend;    }	fti_un;#define	fti_finish	fti_un.fti_un_finish#define	fti_abort	fti_un.fti_un_abort#define	fti_group	fti_un.fti_un_group#define	fti_access	fti_un.fti_un_access#define	fti_readwrite	fti_un.fti_un_readwrite#define	fti_data	fti_un.fti_un_data#define	fti_dataend	fti_un.fti_un_dataend#define	fti_cancel	fti_un.fti_un_cancel#define	fti_transend	fti_un.fti_un_transend};    /* when FTAMindication has PSAPdata, the pe_context indicates whether   each data is from the FTAM PCI or is a data element.	FTAM PCI	- PE_DFLT_CTX	data element	- anything else   three different types of data in the FTAM PCI are handled by the user:	Node-Descriptor-Data-Element ::=	[APPLICATION 21] ...	Enter-Subtree-Data-Element ::=		[APPLICATION 22] ...	Exit-Subtree-Data-Element ::=		[APPLICATION 23] ... */#define	FADU_NODESCR	21	/* Node-Descriptor-Data-Element */#define	FADU_ENTERTREE	22	/* Enter-Subtree-Data-Element */#define	FADU_EXITREE	23	/* Exit-Subtree-Data-Element *//*  */extern char *ftamversion;extern char *ftamfile;int	FInit ();		/* F-INITIALIZE.INDICATION */int	FInitializeResponse ();	/* F-INITIALIZE.RESPONSE */int	FInitializeRequest ();	/* F-INITIALIZE.REQUEST */int	FTerminateRequest ();	/* F-TERMINATE.REQUEST */int	FTerminateResponse ();	/* F-TERMINATE.RESPONSE */int	FUAbortRequest ();	/* F-U-ABORT.REQUEST */int	FWaitRequest ();	/* F-WAIT.REQUEST (pseudo) */int	FManageRequest ();	/* F-MANAGE.REQUEST (group) */int	FManageResponse ();	/* F-MANAGE.RESPONSE (group) */int	FBulkBeginRequest ();	/* F-BULK-BEGIN.REQUEST (group) */int	FBulkBeginResponse ();	/* F-BULK-BEGIN.RESPONSE (group) */int	FBulkEndRequest ();	/* F-BULK-END.REQUEST (group) */int	FBulkEndResponse ();	/* F-BULK-END.RESPONSE (group) */int	FAccessRequest ();	/* F-{LOCATE,ERASE}.REQUEST */int	FAccessResponse ();	/* F-{LOCATE,ERASE}.RESPONSE */int	FReadWriteRequest ();	/* F-{READ,WRITE}.REQUEST */int	FDataRequest ();	/* F-DATA.REQUEST */int	FDataEndRequest ();	/* F-DATA-END.REQUEST */int	FCancelRequest ();	/* F-CANCEL.REQUEST */int	FCancelResponse ();	/* F-CANCEL.RESPONSE */int	FTransEndRequest ();	/* F-TRANSFER-END.REQUEST */int	FTransEndResponse ();	/* F-TRANSFER-END.RESPONSE */int	FSetIndications ();	/* define vector for INDICATION events */int	FSelectMask ();		/* map ftam descriptors for select() */int	FHookRequest ();	/* set tracing */int	FTraceHook ();		/* user-defined tracing */char   *FErrString ();		/* return FTAM error code in string form *//*  */struct isodocument {    char   *id_entry;    OID	    id_type;    OID	    id_constraint;    OID	    id_abstract;    OID	    id_transfer;};int	setisodocument (), endisodocument ();struct isodocument *getisodocument ();struct isodocument *getisodocumentbyentry ();struct isodocument *getisodocumentbytype ();#endif

⌨️ 快捷键说明

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