📄 ftam.h
字号:
/* ftam.h - include file for FTAM users (FS-USER) *//* * $Header: /f/iso/h/RCS/ftam.h,v 5.0 88/07/21 14:38:56 mrose Rel $ * * * $Log$ *//* * NOTICE * * Acquisition, use, and distribution of this module and related * materials are subject to the restrictions of a license agreement. * Consult the Preface in the User's Manual for the full terms of * this agreement. * */#ifndef _FTAM_#define _FTAM_#include "psap2.h"/* */ /* service levels */#define FLEVEL_RELIABLE 0 /* reliable */#define FLEVEL_USER 1 /* user-correctable */#define MY_FLEVEL FLEVEL_RELIABLE /* service classes */#define FCLASS_TRANSFER 0 /* transfer-class */#define FCLASS_ACCESS 1 /* access-class */#define FCLASS_MANAGE 2 /* management-class */#define FCLASS_TM 3 /* transfer-and-management-class */#define FCLASS_UNCONS 4 /* unconstrained-class */ /* functional units */#define FUNIT_READ 0x01 /* read */#define FUNIT_WRITE 0x02 /* write */#define FUNIT_ACCESS 0x04 /* file-access */#define FUNIT_LIMITED 0x08 /* limited-file-managment */#define FUNIT_ENHANCED 0x10 /* enhanced-file-management */#define FUNIT_GROUPING 0x20 /* grouping */#define FUNIT_RECOVERY 0x40 /* recovery */#define FUNIT_RESTART 0x80 /* restart-data-transfer */#define MY_FUNIT (FUNIT_READ | FUNIT_WRITE | FUNIT_ACCESS \ | FUNIT_LIMITED | FUNIT_ENHANCED \ | FUNIT_GROUPING) /* attribute groups */#define FATTR_STORAGE 0x01 /* storage */#define FATTR_SECURITY 0x02 /* security */#define FATTR_PRIVATE 0x04 /* private */#define MY_FATTR (FATTR_STORAGE | FATTR_SECURITY) /* state results */#define FSTATE_SUCCESS 0 /* success */#define FSTATE_FAILURE 1 /* failure */ /* action result */#define FACTION_SUCCESS 0 /* success */#define FACTION_TRANS 1 /* transient-error */#define FACTION_PERM 2 /* permanent-error *//* */struct FTAMcontent { OID fc_dtn; /* document type name */ /* associated presentation context info */ int fc_id; /* identifier */ int fc_result; /* status */}; struct FTAMcontentlist { /* list of FTAM contents */ int fc_ncontent; /* number of contents */#define NFCONT (NPCTX - 2) /* not-so-arbitrary */ struct FTAMcontent fc_contents[NFCONT];};/* */struct FTAMdiagnostic { int ftd_type; /* diagnostic-type */#define DIAG_INFORM 0 /* informative */#define DIAG_TRANS 1 /* transient */#define DIAG_PERM 2 /* permanent */ int ftd_identifier; /* error-identifier */#define FS_CODE2OFF(c) ((c) % 1000)#define FS_GEN_BASE 0 /* General FTAM diagnostics */#define FS_GEN_NOREASON 0 /* No reason */#define FS_GEN_RESPONDER 1 /* Responder error (unspecific) */#define FS_GEN_SHUTDOWN 2 /* System shutdown */#define FS_GEN_MGMT 3 /* FTAM management problem (unspecific) */#define FS_GEN_MGMTACCT 4 /* FTAM management - bad account */#define FS_GEN_MGMTPASS 5 /* FTAM management - security not passed */#define FS_GEN_DELAY 6 /* Delay may be encountered */#define FS_GEN_INITIATOR 7 /* Initiator error (unspecific) */#define FS_GEN_SUBSEQ 8 /* Subsequent error */#define FS_GEN_WAITING 9 /* Indications waiting (unofficial) */#define FS_PRO_BASE 1000 /* Protocol and supporting service related diagnostics */#define FS_PRO_CONFLICT 1000 /* Conflicting parameter values */#define FS_PRO_UNSUPORT 1001 /* Unsupported parameter values */#define FS_PRO_MANDATORY 1002 /* Mandatory parameter not set */#define FS_PRO_UNPARAM 1003 /* Unsupported parameter */#define FS_PRO_DUPARAM 1004 /* Duplicated parameter */#define FS_PRO_ILLEGAL 1005 /* Illegal parameter type */#define FS_PRO_UNTYPE 1006 /* Unsupported parameter type */#define FS_PRO_ERR 1007 /* FTAM protocol error (unspecific) */#define FS_PRO_ERRPROC 1008 /* FTAM protocol error - procedure error */#define FS_PRO_ERRFUNIT 1009 /* FTAM protocol error - functional unit error */#define FS_PRO_ERRMSG 1010 /* FTAM protocol error - message error */#define FS_PRO_LOWFAIL 1011 /* Lower layer failure */#define FS_PRO_LOWADDR 1012 /* Lower layer addressing error */#define FS_PRO_TIMEOUT 1013 /* Timeout */#define FS_PRO_SHUTDOWN 1014 /* System shutdown */#define FS_PRO_GROUPING 1015 /* Illegal grouping sequence */#define FS_PRO_THRESH 1016 /* Grouping threshold violation */#define FS_ACS_BASE 2000 /* Association related diagnostics */#define FS_ACS_USER 2000 /* Association with user not allowed */#define FS_ACS_LEVEL 2001 /* Unsupported service level */#define FS_ACS_CLASS 2002 /* Unsupported service class */#define FS_ACS_FUNIT 2003 /* Unsupported functional unit */#define FS_ACS_GRP 2004 /* Attribute group error (unspecific) */#define FS_ACS_GRPSUP 2005 /* Attribute group not supported */#define FS_ACS_GRPALL 2006 /* Attribute group not allowed */#define FS_ACS_ACCT 2007 /* Bad account */#define FS_ACS_MGMT 2008 /* Association management (unspecific) */#define FS_ACS_MGMTADDR 2009 /* Association management - bad address */#define FS_ACS_MGMTACCT 2010 /* Association management - bad account */#define FS_ACS_CKPLARGE 2011 /* Checkpoint window error - too large */#define FS_ACS_CKPSMALL 2012 /* Checkpoint window error - too small */#define FS_ACS_CKPERR 2013 /* Checkpoint window error - unsupported */#define FS_ACS_QOS 2014 /* Communications QOS not supported */#define FS_ACS_IDENTITY 2015 /* Initiator identity unacceptable */#define FS_ACS_CONTEXT 2016 /* Context management refused */#define FS_ACS_ROLLBACK 2017 /* Rollback not available */#define FS_ACS_CNTRESP 2018 /* Contents type list cut by responder */#define FS_ACS_CNTPSAP 2019 /* Contents type list cut by Presentation service */#define FS_ACS_PASSWORD 2020 /* Invalid filestore password */#define FS_SEL_BASE 3000 /* Selection related diagnostics */#define FS_SEL_FILENAME 3000 /* Filename not found */#define FS_SEL_MATCHED 3001 /* Selection attributes not matched */#define FS_SEL_INITIAL 3002 /* Initial attributes not possible */#define FS_SEL_ATTRNAME 3003 /* Bad attribute name */#define FS_SEL_NOEXIST 3004 /* Non-existent file */#define FS_SEL_EXISTS 3005 /* File already exists */#define FS_SEL_CREATE 3006 /* File can not be created */#define FS_SEL_DELETE 3007 /* File can not be deleted */#define FS_SEL_CONAVAIL 3008 /* Concurrency control not available */#define FS_SEL_CONSUPRT 3009 /* Concurrency control not supported */#define FS_SEL_CONPOSS 3010 /* Concurrency control not possible */#define FS_SEL_RESTRICT 3011 /* More restrictive lock */#define FS_SEL_BUSY 3012 /* File busy */#define FS_SEL_AVAIL 3013 /* File not available */#define FS_SEL_ACCAVAIL 3014 /* Access control not available */#define FS_SEL_ACCSUPRT 3015 /* Access control not supported */#define FS_SEL_ACCINCON 3016 /* Access control inconsistent */#define FS_SEL_TRUNC 3017 /* Filename truncated */#define FS_SEL_ALTER 3018 /* Initial attributes altered */#define FS_SEL_ACCOUNT 3019 /* Bad account */#define FS_SEL_CREEXIST 3020 /* Create override selected existing file */#define FS_SEL_CREOLD 3021 /* Create override deleted and recreated file with old attributes */#define FS_SEL_CRENEW 3022 /* Create override deleted and recreated file with new attributes */#define FS_SEL_CRELOSE 3023 /* Create override - not possible */#define FS_SEL_AMBIG 3024 /* Ambiguous file specification */#define FS_SEL_CREPASS 3025 /* Invalid create password */#define FS_SEL_DELPASS 3026 /* Invalid delete password on override */#define FS_SEL_ATRVALUE 3027 /* Bad attribute value */#define FS_MGT_BASE 4000 /* File management related diagnostics */#define FS_MGT_EXIST 4000 /* Attribute non-existant */#define FS_MGT_READ 4001 /* Attribute cannot be read */#define FS_MGT_CHANGE 4002 /* Attribute cannot be changed */#define FS_MGT_SUPPORT 4003 /* Attribute not supported */#define FS_MGT_NAME 4004 /* Bad attribute name */#define FS_MGT_VALUE 4005 /* Bad attribute value */#define FS_ACC_BASE 5000 /* Access related diagnostics */#define FS_ACC_FADU 5000 /* Bad FADU (unspecific) */#define FS_ACC_FADUSIZE 5001 /* Bad FADU - size error */#define FS_ACC_FADUTYPE 5002 /* Bad FADU - type error */#define FS_ACC_FADUSPEC 5003 /* Bad FADU - poorly specified */#define FS_ACC_FADULOC 5004 /* Bad FADU - bad location */#define FS_ACC_EXIST 5005 /* FADU does not exist */#define FS_ACC_AVL 5006 /* FADU not available (unspecific) */#define FS_ACC_AVLREAD 5007 /* FADU not available for reading */#define FS_ACC_AVLWRITE 5008 /* FADU not available for writing */#define FS_ACC_AVLLOC 5009 /* FADU not available for location */#define FS_ACC_AVLERASE 5010 /* FADU not available for erasure */#define FS_ACC_INSERT 5011 /* FADU cannot be inserted */#define FS_ACC_REPLACE 5012 /* FADU cannot be replaced */#define FS_ACC_LOCATE 5013 /* FADU cannot be located */#define FS_ACC_ELEMENT 5014 /* Bad data element type */#define FS_ACC_OPAVAIL 5015 /* Operation not available */#define FS_ACC_OPSUPRT 5016 /* Operation not supported */#define FS_ACC_OPCONS 5017 /* Operation inconsistent */#define FS_ACC_CONAVAIL 5018 /* Concurrency control not available */#define FS_ACC_CONSUPRT 5019 /* Concurrency control not supported */#define FS_ACC_CONINCON 5020 /* Concurrency control inconsistent */#define FS_ACC_MODAVAIL 5021 /* Processing mode not available */#define FS_ACC_MODSUPRT 5022 /* Processing mode not supported */#define FS_ACC_MODINCON 5023 /* Processing mode inconsistent */#define FS_ACC_CTXAVAIL 5024 /* Access context not available */#define FS_ACC_CTXSUPRT 5025 /* Access context not supported */#define FS_ACC_WRITE 5026 /* Bad write (unspecific) */#define FS_ACC_READ 5027 /* Bad read (unspecific) */#define FS_ACC_LCL 5028 /* Local failure (unspecific) */#define FS_ACC_LCLSPACE 5029 /* Local failure - file space exhausted */#define FS_ACC_LCLDATA 5030 /* Local failure - data corrupted */#define FS_ACC_LCLDEV 5031 /* Local failure - device failure */#define FS_ACC_FFSEXCEED 5032 /* Future filesize exceeded */#define FS_ACC_FFSINCRES 5034 /* Future filesize increased */#define FS_ACC_FUNIT 5035 /* Functional unit invalid in processing mode */#define FS_ACC_TYPINCON 5036 /* Contents type inconsistent */#define FS_ACC_TYPSIMPL 5037 /* Contents type simplified */#define FS_RVY_BASE 6000 /* Recovery related diagnostics */#define FS_RVY_CKP 6000 /* Bad checkpoint (unspecific) */#define FS_RVY_UNIQUE 6001 /* Activity not unique */#define FS_RVY_WINDOW 6002 /* Checkpoint outside window */#define FS_RVY_EXISTS 6003 /* Activity no longer exists */#define FS_RVY_RECOG 6004 /* Activity not recognized */#define FS_RVY_NODOCKET 6005 /* No docket */#define FS_RVY_CODOCKET 6006 /* Corrupt docket */#define FS_RVY_WAITING 6007 /* File waiting restart */#define FS_RVY_RECOVERY 6008 /* Bad recovery point */#define FS_RVY_NOPOINT 6009 /* Non-existent recovery point */#define FS_RVY_MODAVAIL 6010 /* Recovery mode not available */#define FS_RVY_MODINCON 6011 /* Recovery mode inconsistent */#define FS_RVY_MODREDUCE 6012 /* Recovery mode reduced */#define FS_RVY_ACCAVAIL 6013 /* Access control not available */#define FS_RVY_ACCSUPRT 6014 /* Access control not supported */#define FS_RVY_ACCINCON 6015 /* Access control inconsistent */#define FS_RVY_TYPINCON 6016 /* Contents type inconsistent */#define FS_RVY_TYPSIMPL 6017 /* Contents type simplified */ int ftd_observer; /* error-observer */ int ftd_source; /* error-source */#define EREF_NONE 0 /* no-categorizaton-possible */#define EREF_IFSU 1 /* initiating-file-service-user */#define EREF_IFPM 2 /* initiating-file-protocol-machine */#define EREF_SERV 3 /* service-supporting-the-file-protocol-machine */#define EREF_RFPM 4 /* responding-file-protocol-machine */#define EREF_RFSU 5 /* responding-file-service-user */ int ftd_delay; /* suggested-delay */#define DIAG_NODELAY (-1) /* further-details */#define FTD_SIZE 512 /* should be unlimited... */ int ftd_cc; /* length */ char ftd_data[FTD_SIZE]; /* data */};/* */struct FTAMcharging { /* FTAM charging */ int fc_ncharge; /* number of charges */#define NFCHRG 5 /* arbitrary */ struct fc_charge { char *fc_resource; /* resource-identifier */ char *fc_unit; /* charging-unit */ int fc_value; /* charging-value */ } fc_charges[NFCHRG];};/* */struct FTAMpasswords { char *fp_read; /* read-password */ int fp_readlen; char *fp_insert; /* insert-password */ int fp_insertlen; char *fp_replace; /* replace-password */ int fp_replacelen; char *fp_erase; /* erase-password */ int fp_eraselen; char *fp_extend; /* extend-password */ int fp_extendlen; char *fp_readattr; /* read-attribute-password */ int fp_readattrlen; char *fp_chngattr; /* change-attribute-password */ int fp_chngattrlen; char *fp_delete; /* delete-password */ int fp_deletelen;};#define FPFREE(fp) \{ \ register struct FTAMpasswords *FP = (fp); \ \ if (FP -> fp_read) \ free (FP -> fp_read), FP -> fp_read = NULL; \ if (FP -> fp_insert) \ free (FP -> fp_insert), FP -> fp_insert = NULL; \ if (FP -> fp_replace) \ free (FP -> fp_replace), FP -> fp_replace = NULL; \ if (FP -> fp_erase) \ free (FP -> fp_erase), FP -> fp_erase = NULL; \ if (FP -> fp_extend) \ free (FP -> fp_extend), FP -> fp_extend = NULL; \ if (FP -> fp_readattr) \ free (FP -> fp_readattr), FP -> fp_readattr = NULL; \ if (FP -> fp_chngattr) \ free (FP -> fp_chngattr), FP -> fp_chngattr = NULL; \ if (FP -> fp_delete) \ free (FP -> fp_delete), FP -> fp_delete = NULL; \}/* */struct FTAMacelement { int fe_actions; /* action-list */#define FA_PERM_READ 0x0001 /* read */#define FA_PERM_INSERT 0x0002 /* insert */#define FA_PERM_REPLACE 0x0004 /* replace */#define FA_PERM_EXTEND 0x0008 /* extend */#define FA_PERM_ERASE 0x0010 /* erase */#define FA_PERM_READATTR 0x0020 /* read-attribute */#define FA_PERM_CHNGATTR 0x0040 /* change-attribute */#define FA_PERM_DELETE 0x0080 /* delete-file */ char *fe_identity; /* user-identity */ struct FTAMpasswords fe_passwords; char *fe_aet; /* actually, could be EXTERNAL, but we support only GraphicString for now */ struct FTAMacelement *fe_next;};#define FEFREE(fe) \{ \ register struct FTAMacelement *FE, \ *FN; \ \ for (FE = (fe); FE; FE = FN) { \ FN = FE -> fe_next; \ \ if (FE -> fe_identity) \ free (FE -> fe_identity), FE -> fe_identity = NULL; \ \ FPFREE (&FE -> fe_passwords); \ \ if (FE -> fe_aet) \ free (FE -> fe_aet), FE -> fe_aet = NULL; \ \ FE -> fe_next = NULL; \ \ free ((char *) FE); \ } \}struct FTAMaclist { struct FTAMacelement *fl_insert; struct FTAMacelement *fl_delete;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -