跳到主要内容

9. FTP 回复码与 FTAM 参数之间的映射

前几节给出的协议功能和表示映射的重点是不涉及错误的处理过程. 尽管在许多情况下已指定了适当的响应, 但仍期望在网关实现中更全面地运用响应.

本节旨在给出 FTAM 响应 ( 和 ) 与 FTP 响应 (回复码) 之间的一组映射.

FTAM 文件服务原语的 参数所传达的信息, 是对 参数中可用信息的概括. 该值从不小于最严重的诊断值. 此参数的有效取值为 "Success", "Transient Error" 和 "Permanent Error". FTP 响应文本应在 FTAM 响应和中止消息的 序列的 字段中提供.

FTAM 为 "Success" 时, 可能伴随取值为 "Informative Error Type" 的 . 这些 "Success" 诊断消息与下表 (以及 [ISO8571-3]) 中的错误类型 0 相关联. 错误类型 1 表示暂时性错误, 而类型 2 表示永久性错误.

FTP 回复由一个三位数字后跟一些文本组成. 该数字定义为 3 位代码, 其中每一位都有特殊含义. 第一位所传达的信息与 FTAM 参数大致相同, 即肯定, 暂时否定或永久否定.

FTP 规范文档 [RFC959] 明确指出, 回复码列表不应超出 [RFC959] 中给出的范围. 本文档给出的映射遵守这一要求.

9.1. FTP 回复码到 FTAM 参数​

本节给出 FTP 回复码与其等价的 FTAM 动作和诊断参数之间的一组映射. 建议网关支持这些映射, 但这不是必需的. FTAM 动作参数值使用以下缩写: trans = transient error perman = permanent error

      FTP Reply                                    |FTAM Diagnostic
|
|
Code Text |Result Type Id
---------------------------------------------+------------------
110 Restart marker reply |success 0 0
120 Service ready in nnn minutes |success 0 0
125 Data connection open, transfer |
starting |success 0 0
150 File status okay; about to open |
data connection |success 0 0
200 Command okay |success 0 0
202 Command not implemented; |
                superfluous                        |success  0    0
      211       System status, or system help      |
                reply                              |success  0    0
      212       Directory status                   |success  0    0
      213       File status                        |success  0    0
      214       Help message                       |success  0    0
      215       NAME system type                   |success  0    0
      220       Service ready for new user         |success  0    0
      221       Service closing control connection |success  0    0
      225       Data connection; no transfer in    |
                progress                           |success  0    0
      226       Closing data connection            |success  0    0
      227       Entering passive mode (h1,h2,..)   |success  0    0
      230       User logged in, proceed            |success  0    0
      250       Requested file action okay,        |
                completed                          |success  0    0
      257       "PATHNAME" created                 |success  0    0
      331       User name okay, need password      |success  0    0
      332       Need account for logon             |success  0    0
      350       Requested file action pending      |
                further information                |success  0    0
      421       Service not available, closing     |
                control connection                 |trans    1    1
      425       Can't open data connection         |trans    1    3
      426       Connection closed, transfer        |
                aborted                            |trans    1    1014
      450       Requested file action not taken,   |
                file unavailable (e.g., file busy) |trans    1    5041
      451       Requested file action aborted,     |
                local error in processing          |trans    1    5028
      452       Requested action not taken,        |
                insufficient storage space         |trans    1    9
      500       Syntax error, command unrecognized |perman   2    5015
      501       Syntax error in parameters or      |
                arguments                          |perman   2    4004
      502       Command not implemented            |perman   2    5016
      503       Bad sequence of commands           |perman   2    1015
      504       Command not implemented for that   |
                parameter                          |perman   2    4003
      530       Not logged in                      |perman   2    2020
      532       Need account for storing files     |perman   2    2008
      550       Requested action not taken; file   |
                unavailable (e.g., file not found, |
                no access)                         |perman   2    3013
      551       Requested action aborted, page     |
                type                               |perman   2    5002
      552       Requested file action aborted,     |
                exceeded storage allocation        |perman   2    9
      553       Requested file action not taken,   |
file name not allowed |perman 2 3024

9.2. FTAM 参数到 FTP 回复码​

本节给出 FTAM 诊断参数与其等价的 FTP 回复码之间的一组映射. 建议网关支持这些映射, 但这不是必需的. 如前所述, 类型 0 是可能随 "Success" 动作结果返回的信息性错误类型, 类型 1 是暂时性错误类型, 类型 2 是永久性错误类型.

      FTAM Diagnostic                                   |FTP Reply Code
                                                        |
      Type      Id   Reason                             |
      --------------------------------------------------+--------
                                                        |
      1,2       0    No reason                          |    421
      0         1    Responder error                    |    211
      1,2       1    Responder error                    |    421
      1,2       2    System shutdown                    |    421
      0         3    FTAM mgmt problem, unspecific      |    211
      1,2       3    FTAM mgmt problem, unspecific      |    425
      0         4    FTAM mgmt, bad account             |    221
      2         4    FTAM mgmt, bad account             |    532
      0         5    FTAM mgmt, security not passed     |    211
      2         5    FTAM mgmt, security not passed     |    530
      0         6    Delay may be encountered           |    211
      0         7    Initiator error, unspecific        |    211
      1,2       7    Initiator error, unspecific        |    421
      0         8    Subsequent error                   |    211
      1,2       8    Subsequent error                   |    421
      0         9    Temporal insufficiency of resources|    211
      1,2       9    Temporal insufficiency of resources|    452
      1,2       10   Access req. violates VFS security  |    550
      1,2       11   Access req. violates local security|    550
      2         1000 Conflicting parameter values       |    504
      2         1001 Unsupported parameter values       |    504
      2         1002 Mandatory parameter not set        |    504
      2         1003 Unsupported parameter              |    504
      2         1004 Duplicated parameter               |    504
      2         1005 Illegal parameter type             |    504
      2         1006 Unsupported parameter types        |    504
      2         1007 FTAM protocol err., unspecific     |    426
      2         1008 FTAM protocol err., procedure err  |    426
      2         1009 FTAM protocol err., funct. unit err|    426
      2         1010 FTAM protocol err., corruption err.|    426
      2         1011 Lower layer failure                |    426
      1,2       1012 Lower layer addressing error       |    426
      1,2       1013 Timeout                            |    426
      1,2       1014 System shutdown                    |    426
      2         1015 Illegal grouping sequence          |    503
      2         1016 Grouping threshold violation       |    503
      2         1017 Inconsistent PDU request           |    503
      2         2000 Association with user not allowed  |    532
      2         2002 Unsupported service class          |    504
      0         2003 Unsupported functional unit        |    211
      2         2003 Unsupported functional unit        |    502
      0         2004 Attribute group error, unspecific  |    211
      1,2       2004 Attribute group error, unspecific  |    504
      2         2005 Attribute group not supported      |    504
      0         2006 Attribute group not allowed        |    211
      2         2006 Attribute group not allowed        |    504
      0         2007 Bad account                        |    211
      2         2007 Bad account                        |    532
      0         2008 Association management, unspecific |    211
      1,2       2008 Association management, unspecific |    532
      2         2009 Association management, bad address|    532
      1,2       2010 Association management, bad account|    532
      0         2011 Checkpoint window error, too large |    211
      2         2011 Checkpoint window error, too large |    426
      0         2012 Checkpoint window error, too small |    211
      2         2012 Checkpoint window error, too small |    426
      0         2013 Checkpoint window error, unsupp.   |    211
      2         2013 Checkpoint window error, unsupp.   |    504
      0         2014 Communications QoS not supported   |    211
      1,2       2014 Communications QoS not supported   |    504
      2         2015 Initiator identity unacceptable    |    532
      0         2016 Context management refused         |    211
      0         2017 Rollback not available             |    211
      0         2018 Contents type list cut by          |
                     responder                          |    211
      0         2019 Contents type list by              |
                     Presentation Service               |    211
      2         2020 Invalid filestore password         |    530
      2         2021 Incompatible service classes       |    530
      1,2       3000 Filename not found                 |    550
      1,2       3001 Selection attributes not matched   |    550
      2         3002 Initial attributes not possible    |    550
      2         3003 Bad attribute name                 |    550
      1,2       3004 Non-existent file                  |    550
      1,2       3005 File already exists                |    553
      1,2       3006 File cannot be created             |    553
      1,2       3007 File cannot be deleted             |    553
      0         3008 Concurrency control not available  |    211
      2         3008 Concurrency control not available  |    503
      0         3009 Concurrency control not supported  |    211
      2         3009 Concurrency control not supported  |    502
      0         3010 Concurrency control not possible   |    211
      2         3010 Concurrency control not possible   |    503
      0         3011 More restrictive lock              |    211
      1         3011 More restrictive lock              |    450
      1,2       3012 File busy                          |    450
      1,2       3013 File not available                 |    450
      0         3014 Access control not available       |    211
      1,2       3014 Access control not available       |    503
      0         3015 Access control not supported       |    211
      1,2       3015 Access control not supported       |    502
      0         3016 Access control inconsistent        |    211
      1,2       3016 Access control inconsistent        |    503
      0         3017 Filename truncated                 |    211
      0         3018 Initial attributes altered         |    211
      1,2       3019 Bad account                        |    532
      0         3020 Override selected existing file    |    211
      0         3021 Override deleted and recreated     |    211
      0         3022 Create override deleted and        |
                     recreate file with new attributes  |    211
      1,2       3023 Create override, not possible      |    553
      1,2       3024 Ambiguous file specification       |    553
      2         3025 Invalid create password            |    550
      2         3026 Invalid delete password on override|    550
      2         3027 Bad attribute value                |    550
      2         3028 Requested access violation         |    550
      2         3029 Functional unit not available for  |    550
                     requested access                   |
      0         3030 File created but not selected      |    211
      1         3030 Invalid create password            |    550
      0         4000 Attribute non-existent             |    211
      1,2       4000 Attribute non-existent             |    501
      1,2       4001 Attribute cannot be read           |    504
      1,2       4002 Attribute cannot be changed        |    504
      1,2       4003 Attribute not supported            |    504
      2         4004 Bad attribute name                 |    501
      2         4005 Bad attribute value                |    501
      0         4006 Attribute partially supported      |    211
      0         4007 Additional set attribute value     |
                     not distinct                       |    211
      1,2       5000 Bad FADU, unspecific               |    550
      2         5001 Bad FADU, size error               |    501
      2         5002 Bad FADU, type error               |    551
      2         5003 Bad FADU, poorly specified         |    501
      2         5004 Bad FADU, bad location             |    550
      0         5005 FADU does not exist                |    550
      1         5005 FADU does not exist                |    550
      0         5006 FADU not available, unspecific     |    550
      1,2       5006 FADU not available, unspecific     |    550
      1,2       5007 FADU not available for reading     |    550
      1,2       5008 FADU not available for writing     |    550
      1,2       5009 FADU not available for location    |    550
      1,2       5010 FADU not available for erasure     |    550
      1,2       5011 FADU cannot be inserted            |    550
      1,2       5012 FADU cannot be replaced            |    550
      0         5013 FADU cannot be located             |    550
      1,2       5013 FADU cannot be located             |    550
      2         5014 Bad data element type              |    550
      1,2       5015 Operation not available            |    500
      1,2       5016 Operation not supported            |    502
      0         5017 Operation inconsistent             |    211
      2         5017 Operation inconsistent             |    503
      0         5018 Concurrency control not available  |    211
      1,2       5018 Concurrency control not available  |    503
      0         5019 Concurrency control not supported  |    211
      2         5019 Concurrency control not supported  |    502
      0         5020 Concurrency control inconsistent   |    211
      2         5020 Concurrency control inconsistent   |    503
      0         5021 Processing mode not available      |    211
      1,2       5021 Processing mode not available      |    503
      0         5022 Processing mode not supported      |    211
      2         5022 Processing mode not supported      |    504
      0         5023 Processing mode inconsistent       |    211
      2         5023 Processing mode inconsistent       |    503
      0         5024 Access context not available       |    211
      2         5024 Access context not available       |    503
      0         5025 Access context not supported       |    211
      2         5025 Access context not supported       |    504
      1,2       5026 Bad write, unspecific              |    550
      1,2       5027 Bad read, unspecific               |    550
      0         5028 Local failure, unspecific          |    211
      1,2       5028 Local failure, unspecific          |    451
      0         5029 Local failure, filespace exhausted |    211
      1,2       5029 Local failure, filespace exhausted |    552
      0         5030 Local failure, data corrupted      |    211
      1,2       5030 Local failure, data corrupted      |    451
      0         5031 Local failure, data corrupted      |    211
      1,2       5031 Local failure, data corrupted      |    451
      2         5032 Future file size exceeded          |    451
      0         5034 Future file size increased         |    211
      0         5035 Functional unit invalid in         |
                     processing mode                    |    211
      2         5035 Functional unit invalid in         |
                     processing mode                    |    503
      0         5036 Contents type inconsistent         |    211
2 5036 Contents type inconsistent | 503
0 5037 Contents type simplified | 211
0 5038 Duplicate FADU name | 211
1,2 5039 Damage to select/open regime | 553
1,2 5040 FADU locking not available on file | 450
1,2 5041 FADU locked by another user | 450

9.3. 未来的映射问题​

在将来某个时候, FTAM 参数可能被用于当前用途之外的目的, 目前在 FTAM 发起的网关服务中它用于传递最终目的地址 [NIST86]. 如果发生这种情况, 目的地址将不得不在别处传递, 例如在 的 "@host" 部分. 目前, FTP-FTAM 网关规范允许采用其中任一种机制来存放最终目的地址.

9.4. 错误处理​

对于 FTAM 发起的服务错误, 最低限度可接受的解决方案是把 FTP 失败映射为 FTAM "Unrecoverable error", 并在 FTAM 字段中返回 FTP 诊断字符串. 类似地, 对于 FTP 发起的服务错误, 最低限度可接受的解决方案是返回回复码 221, "Service closing control connection, Logged out if appropriate". 尽管这一最低限度的方案可以接受, 但向网关开发者推荐的做法是实现第 9.1 节 "FTP Reply Codes to FTAM Parameters" 和第 9.2 节 "FTAM Parameters to FTP Reply Codes" 中给出的映射.