Passa al contenuto principale

8. Mapping delle funzioni di protocollo e delle rappresentazioni

I mapping presentati si basano sull'implementazione del protocollo FTAM definita negli Stable Implementation Agreements for Open Systems Interconnection Protocols: Part 9 - FTAM Phase 2, prodotti dal March 1992 Open Systems Environment Implementors' Workshop [NIST92], e in [ISO8571-1], [ISO8571-2],[ISO8571- 3],[ISO8571-4] e [ISO8571-5]. Il protocollo FTP è definito nella Request for Comments [RFC959]. I mapping sono fortemente influenzati dal lavoro di M. A. Wallace et. al. presso il NIST [NIST86] e di John Scott presso MITRE [MITRE87].

Un obiettivo fondamentale dei mapping presentati in questo documento è ridurre al minimo la perdita di funzionalità tra i due protocolli. L'approccio specifico adottato per implementare i mapping è lasciato alla discrezione dell'implementatore del gateway. I mapping delle funzioni di protocollo e delle rappresentazioni si concentrano sull'elaborazione non gravata da errori. Il mapping dei messaggi diagnostici e di errore è trattato separatamente nella sezione 9.

Come minimo, è obbligatorio il supporto, da parte dell'implementazione FTAM nel gateway FTP-FTAM, degli Implementation Profiles T1 (Simple File Transfer) e M1 (Management), come definiti in [NIST92]. Questi Implementation Profiles corrispondono rispettivamente ai profili A/111 e A/13 dello Standards Promotion and Application Group in Europe [NIST92].

Come minimo, è obbligatorio il supporto dei seguenti elementi da parte del gateway:

      ASCII and 8 bit binary file types.  It should also support FTP
File Stream Mode.

I seguenti tipi di documento FTAM: FTAM-1 (file di testo non strutturato), FTAM-3 (file binario non strutturato) e NBS-9 (insieme di voci di directory).

In questi mapping si presuppongono le convenzioni POSIX di denominazione e organizzazione dei file; vale a dire che si presume che i file nei sistemi siano organizzati in una struttura gerarchica in cui tutti i nodi non terminali sono directory e tutti i nodi terminali sono file di qualsiasi altro tipo.

Nelle specifiche dei mapping si utilizza la seguente terminologia:

      argument .......FTP Service Command argument, as used in [RFC959].
      parameter ......FTAM Service Primitive parameters and attributes,
as enumerated in Tables 6, 50, and 51 of [ISO8571-
3].

Nelle specifiche dei mapping si utilizza la seguente notazione:

Gli argomenti e i parametri sono racchiusi tra parentesi angolari; ad esempio,

I valori degli argomenti e dei parametri sono racchiusi tra virgolette; ad esempio, "Success"

      FTP Service Commands and FTAM Primitives are in uppercase; e.g., F-
INITIALIZE

8.1. Servizio di gateway avviato da FTP​

Il mapping di protocollo tra FTP e FTAM può essere uno a zero (ossia non mappabile), uno a uno oppure uno a molti.

I passaggi generali eseguiti dal gateway FTP-FTAM per fornire il servizio avviato da FTP sono:

        1. Accept an FTP Client request at the FTP Server side of the
gateway service.
        2. Map the request to the (set of) corresponding FTAM
Initiator function(s).
        3. Acting as an FTAM Initiator, send the FTAM Initiator
function(s) to the FTAM Responder.
        4. Accept information returned to the FTAM Initiator side of
the gateway. This information originated at the FTAM
Responder.
        5. Map this returned information to the protocol form
understood by the FTP Server side of the gateway.
        6. Send this returned information from the FTP Server side of
the gateway to the FTP Client.

Per ciascuna funzione del protocollo FTP sono identificate le funzioni del protocollo FTAM necessarie per il suo mapping:

   FTP       FTAM
   ------------------------------------------------------------------
   ABOR      F-BEGIN-GROUP, F-CANCEL, F-CLOSE, F-DESELECT, F-END-GROUP
   ACCT      F-INITIALIZE,
   ALLO      none
   APPE      F-BEGIN-GROUP, F-CLOSE, F-CREATE, F-DATA, F-DATA-END, F-
DESELECT, F-END-GROUP, F-OPEN, F-READ-ATTRIBUTES, F-SELECT,
F-TRANSFER-END, F-WRITE
   CDUP      F-BEGIN-GROUP, F-DESELECT, F-END-GROUP, F-SELECT
   CWD       F-BEGIN-GROUP, F-END-GROUP, F-DESELECT, F-SELECT
   DELE      F-BEGIN-GROUP, F-DELETE, F-END-GROUP, F-SELECT
   HELP      none
   LIST      F-BEGIN-GROUP, F-CLOSE, F-DATA, F-DATA-END, F-DESELECT, F-
END-GROUP, F-OPEN, F-READ, F-READ-ATTRIBUTES, F-SELECT, F-
TRANSFER-END
   MKD       none
   MODE      none
   NLST      F-BEGIN-GROUP, F-CLOSE, F-DATA, F-DATA-END, F-DESELECT, F-
END-GROUP, F-OPEN, F-READ, F-SELECT, F-TRANSFER-END
   NOOP      none
   PASS      F-INITIALIZE
   PASV      none
   PORT      none
   PWD       F-BEGIN-GROUP, F-DESELECT, F-END-GROUP, F-READ-ATTRIBUTES,
F-SELECT
   QUIT      F-P-ABORT or F-U-ABORT, F-TERMINATE
   REIN      F-BEGIN-GROUP, F-CANCEL, F-CLOSE, F-DESELECT, F-END-GROUP
   REST      F-CHECK, F-RESTART
   RETR      F-BEGIN-GROUP, F-CLOSE, F-DATA, F-DATA-END, F-DESELECT, F-
END-GROUP, F-OPEN, F-READ, F-SELECT, F-TRANSFER-END
   RMD       none
   RNFR      F-BEGIN-GROUP, F-DESELECT, F-END-GROUP, F-SELECT
   RNTO      F-BEGIN-GROUP, F-CHANGE-ATTRIBUTES, F-DESELECT, F-END-
GROUP, F-SELECT
   SITE      F-INITIALIZE
   SMNT      none
   STAT      none
   STOR      F-BEGIN-GROUP,F-CLOSE, F-CREATE, F-DATA, F-DATA-END, F-
DESELECT, F-END-GROUP, F-OPEN, F-READ-ATTRIBUTES, F-SELECT,
F-TRANSFER-END, F-WRITE
   STOU      F-BEGIN-GROUP, F-CLOSE, F-CREATE, F-DATA, F-DATA-END, F-
DESELECT, F-END-GROUP, F-OPEN, F-READ-ATTRIBUTES, F-SELECT,
F-TRANSFER-END, F-WRITE
   STRU      none
   TYPE      none
   USER      F-INITIALIZE

La parte restante di questa sezione presenta procedure di mapping dettagliate per ciascuna funzione del protocollo FTP. Il supporto di questi mapping da parte del gateway è obbligatorio.

8.1.1. ABOR​

        1. Send F-CANCEL to FTAM Responder.
2. Send the following grouped request to the FTAM Responder.
F-BEGIN-GROUP
F-CLOSE
F-DESELECT
F-END-GROUP
3. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
codes to FTP Client.
4. Translate FTP Client reply codes to equivalent FTAM <Action
Result> and <Diagnostic> parameters and send parameters to
FTAM Responder.

8.1.2. ACCT​

        1. Set <Account> parameter value for issuing F-INITIALIZE to
FTAM Responder.
2. If <Called Presentation Address>, <Initiator Identity>, and
<Filestore Password> parameters are available, attempt
connection with FTAM Responder;
Otherwise wait for additional ACCT commands.
3. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
codes to FTP Client.
4. Translate FTP Client reply codes to equivalent FTAM <Action
Result> and <Diagnostic> parameters and send parameters to
           FTAM Responder.
        Note:
a. The ACCT command will be effective with the next PASS
command.

8.1.3. ALLO​

        1. Return a 200 reply code to FTP Client.

8.1.4. APPE​

        1. Save current pathname by appending saved CWD string with
<pathname> argument. If no saved CWD string, proceed to
step 12.
2. Send the following grouped request to FTAM Responder.
F-BEGIN-GROUP
F-SELECT
F-READ-ATTRIBUTES
Save <Contents Type> parameter value
F-DESELECT
F-END-GROUP
3. If the <Contents Type> parameter value returned with the
F-READ-ATTRIBUTES has a value of "NBS-9", proceed to step
12.
4. Send the following grouped request to the FTAM responder.
F-BEGIN-GROUP
F-CREATE
Set the <Override> parameter in the F-CREATE to
"Select Old File".
F-OPEN
F-END-GROUP
5. If the file existed, set the <Contents Type> parameter in
the F-CREATE to match that returned by the
F-READ-ATTRIBUTES.
6. If the file did not exist and no previous FTP TYPE "Image"
command was issued, then set the <Contents Type> parameter
to "FTAM-1";
Otherwise, set the <Contents Type> parameter to "FTAM-3".
7. Send F-WRITE, with <Bulk Data Transfer Specification, FADU
Operation> parameter set to "File Extend", to FTAM
Responder.
8. Loop reading data from FTP data connection, sending the
data in F-DATA PDUs until end-of-file on the FTP
connection.
9. Send F-DATA-END to FTAM Responder.
10. Send F-TRANSFER-END to FTAM Responder.
11. Send the following grouped request to the FTAM Responder.
            F-BEGIN-GROUP
F-CLOSE
F-DESELECT
F-END-GROUP
12. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
code(s) to FTP Client.
13. Translate FTP Client reply codes to equivalent FTAM
<Action Result> and <Diagnostic> parameters and send
parameters to FTAM Responder.
        Note:
a. <pathname> argument is assumed to be a filename, relative
to the currently saved CWD.
b. CWD of the FTAM system must be defined prior to issuance of
APPE.

8.1.5. CDUP​

        1. Determine parent directory from saved CWD string.  If no
saved CWD string, proceed to step 4.
2. Set <Contents Type> parameter to "NBS-9".
3. Send the following grouped request to FTAM Responder.
F-BEGIN-GROUP
F-SELECT
F-DESELECT
F-END-GROUP
4. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
code(s) to FTP Client.
5. Translate FTP Client reply codes to equivalent FTAM <Action
Result> and <Diagnostic> parameters and send parameters to
FTAM Responder.
        Note:
a. A POSIX file organization is assumed; i.e., files in the
systems are organized in a hierarchical structure in which
all of the non-terminal nodes are directories and all of
the terminal nodes are any other type of file.
b. If the parent directory does not exist, the current working
directory remains unchanged.
c. CWD of the FTAM system must be defined prior to issuance of
CDUP.

8.1.6. CWD​

        1. Save <pathname> argument as CWD string.
2. Set <Contents Type> parameter to "NBS-9".
        3. Send the following grouped request to FTAM Responder.
F-BEGIN-GROUP
F-SELECT
F-DESELECT
F-END-GROUP
4. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
code(s) to FTP Client.
5. Translate FTP Client reply codes to equivalent FTAM <Action
Result> and <Diagnostic> parameters and send parameters to
FTAM Responder.
        Note:
a. The <pathname> argument is assumed to be an absolute
directory specification.
b. If the specified directory does not exist, the current
working directory remains unchanged.
c. Saved CWD string is used in other FTP-to-FTAM mappings,
such as APPE.

8.1.7. DELE​

        1. Save current pathname by appending saved CWD string with
<pathname> argument. If no saved CWD string, proceed to
step 3.
2. Send the following grouped request to FTAM Responder.
F-BEGIN-GROUP
F-SELECT
F-DELETE
F-END-GROUP
3. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
code(s) to FTP Client.
4. Translate FTP Client reply codes to equivalent FTAM
parameters and send parameters to FTAM Responder.
        Note:
a. <pathname> argument is assumed to be a filename, relative
to the currently saved CWD.
b. CWD of the FTAM system must be defined prior to issuance of
DELE.

8.1.8. HELP​

        1. If no <string> argument is provided, send helpful
information about the implementation of the gateway to the
FTP Client. If an argument is provided, send more specific
information.
        2. Return the FTP reply code 214 to the FTP Client.

8.1.9. LIST​

        1. If <pathname> argument is provided, proceed to step 3.
2. Save current pathname by appending saved CWD string with
<pathname> argument; If no saved CWD string, proceed to
step 11.
3. Send the following grouped request to the FTAM Responder.
F-BEGIN-GROUP
F-SELECT
F-READ-ATTRIBUTES
Save <Filename>, <Contents Type>, <Data/Time of Last
Modification>, and <Filesize> parameters
F-DESELECT
F-END-GROUP
4. If the <Contents Type> parameter of the F-READ-ATTRIBUTES
is not "NBS-9", then return the <Filename>, <Contents
Type>, <Date/Time of Last Modification>, and <Filesize>
parameter values, obtained with the previous
F-READ-ATTRIBUTES, to the FTP data connection;
and proceed to step 8.
5. Send the following grouped request to the FTAM Responder.
F-BEGIN-GROUP
F-SELECT
F-OPEN
F-END-GROUP
6. Send F-READ to FTAM Responder.
7. Loop reading F-DATA until F-DATA-END. As data is received,
write the <Filename>, <Permitted Actions>, <Contents Type>,
and <Date/Time of Last Modification> parameter values from
the PDU to the FTP data connection.
8. Send F-TRANSFER-END to FTAM Responder.
9. Send the following grouped request to the FTAM responder.
F-BEGIN-GROUP
F-CLOSE
F-DESELECT
F-END-GROUP
10. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
code(s) to FTP Client.
11. Translate FTP Client reply codes to equivalent FTAM <Action
Result> and <Diagnostic> parameters and send parameters to
FTAM Responder.
        Note:
a. Assume the <pathname> argument is relative to the saved
CWD, whether filename or directory specification.
        b. CWD of the FTAM system must be defined prior to issuance of
LIST.
c. Transfers over data connection should be in ASCII.
e. If list of files with full directory/file specification is
received from FTAM Responder, then gateway should parse
list to strip off directory portion.

8.1.10. MKD​

        1. Return a 502 reply code (Command not implemented) to the
FTP Client.
        Note:
a. As indicated in the NIST Stable Implementation Agreements
for FTAM [NIST92], creation or deletion of NBS-9 files is
outside the scope of the agreements.

8.1.11. MODE​

        1. If <argument> is "Stream", return 200 reply code to FTP
Client; Otherwise return a 504 reply code (Command not
implemented for that parameter).

8.1.12. NLST​

        1. If <pathname> argument is provided, use <pathname> argument
as <Filename> parameter value in F-SELECT issued in step 3.
2. If no argument is provided, use saved CWD value as
<Filename> parameter value in F-SELECT issued in step 3; If
no CWD string is saved and no argument is provided, proceed
to step 9.
3. Set <Contents Type> parameter to "NBS-9".
4. Send the following grouped request to the FTAM Responder.
F-BEGIN-GROUP
F-SELECT
F-OPEN
F-END-GROUP
5. Send F-READ to FTAM Responder.
6. Loop reading F-DATA until F-DATA-END. As data is received,
write the filenames and other useful information from the
PDU to the FTP data connection.
7. Send F-TRANSFER-END to FTAM Responder.
8. Send the following grouped request to the FTAM responder.
F-BEGIN-GROUP
F-CLOSE
F-DESELECT
F-END-GROUP
9. Translate FTAM Responder <Action Result> and <Diagnostic>
           parameters to equivalent FTP reply code(s) and send reply
code(s) to FTP Client.
10. Translate FTP Client reply codes to equivalent FTAM <Action
Result> and <Diagnostic> parameters and send parameters to
FTAM Responder.
        Note:
a. As per RFC 959 (FTP), the NLST <pathname> argument is a
directory.
b. Assume the argument is relative to the saved CWD, whether
filename or directory specification.
c. CWD of the FTAM system must be defined prior to issuance of
NLST.
d. Transfers over data connection should be in ASCII.
e. Gateway should parse full directory/file specifications
received from FTAM Responder to strip off directory
portion. This is required to support the "FTP multiple
get" function that pipes NLST output to the STOR command.

8.1.13. NOOP​

        1. Return a 200 reply code to FTP Client.

8.1.14. PASS​

        1. Set <Filestore Password> parameter for F-INITIALIZE.
2. If <Called Presentation Address>, <User Identity>, and
<Filestore Password> are available, issue F- INITIALIZE to
FTAM Responder.
3. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
code(s) to FTP Client.
4. Translate FTP Client reply codes to equivalent FTAM <Action
Result> and <Diagnostic> parameters and send parameters to
FTAM Responder.

8.1.15. PASV​

        1. Wait for data transfer on default data port or data port
specified by PORT command.
2. Return a 200 reply code to FTP Client.

8.1.16. PORT​

        1. Return a 200 reply code to FTP Client.

8.1.17. PWD​

        1. If there is a saved CWD string, return it to the FTP client
and proceed to step 4.
2. Set <Contents Type> attribute to "NBS-9".
3. Send the following grouped request to FTAM Responder.
F-BEGIN-GROUP
F-SELECT
F-READ-ATTRIBUTES
F-DESELECT
F-END-GROUP
4. Return the current directory name to the FTP client.
5. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
code(s) to FTP Client.
6. Translate FTP Client reply codes to equivalent FTAM <Action
Result> and <Diagnostic> parameters and send parameters to
FTAM Responder.

8.1.18. QUIT​

        1. If user is not logged in, proceed to step 5.
2. If file transfer is in progress, send F-P-ABORT or
F-U-ABORT to FTAM Responder.
3. If file transfer is not in progress, send and F-TERMINATE
to FTAM Responder.
4. Return charge information to FTP Client.
5. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
code(s) to FTP Client.
6. Translate FTP Client reply codes to equivalent FTAM <Action
Result> and <Diagnostic> parameters and send parameters to
FTAM Responder.

8.1.19. REIN​

        1. Flush all I/O and account information.
2. Allow all transfers in progress to be completed.
3. Set all parameters to default values.
4. Send F-CANCEL to FTAM Responder.
5. Send the following grouped request to FTAM Responder.
F-BEGIN-GROUP
F-CLOSE
F-DESELECT
F-END-GROUP
6. Leave the control connection open.
7. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
           code(s) to FTP Client.
8. Translate FTP Client reply codes to equivalent FTAM <Action
Result> and <Diagnostic> parameters and send parameters to
FTAM Responder.
        Note:
a. Typically followed by a USER command.

8.1.20. REST​

        1. Send F-CHECK to FTAM Responder.
2. Send F-RESTART to FTAM Responder.
3. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
code(s) to FTP Client.
4. Translate FTP Client reply codes to equivalent FTAM <Action
Result> and <Diagnostic> parameters and send parameters to
FTAM Responder.
        Notes:
a. Will only have affect on FTAM Responder if the restart
functional unit is negotiated on F-INITIALIZE.
b. Refer to ISO 8571-3 for additional subtleties of FTAM
checkpoint and restart.

8.1.21. RETR​

        1. Save current pathname by appending saved CWD string with
<pathname> argument. If no saved CWD string, proceed to
step 9.
2. Set <Contents Type> parameter to appropriate type of file.
3. Send the following grouped request to the FTAM Responder.
F-BEGIN-GROUP
F-SELECT
F-OPEN
F-END-GROUP
4. If file does not exist, proceed to step 9.
5. Send F-READ to FTAM Responder.
6. Loop reading F-DATA until F-DATA-END. As data is received,
write it to the FTP data connection.
7. Send F-TRANSFER-END to FTAM Responder.
8. Send the following grouped request to the FTAM Responder.
F-BEGIN-GROUP
F-CLOSE
F-DESELECT
F-END-GROUP
9. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
           code(s) to FTP Client.
10. Translate FTP Client reply codes to equivalent FTAM <Action
Result> and <Diagnostic> parameters and send parameters to
FTAM Responder.
        Note:
a. <pathname> argument is assumed to be a filename, relative
to the currently saved CWD.
b. CWD of the FTAM system must be defined prior to issuance of
RETR.

8.1.22. RMD​

        1. Return a 502 reply code (Command not implemented) to the
FTP Client.
        Note:
a. As indicated in the NIST Stable Implementation Agreements
for FTAM [NIST92], creation or deletion of NBS-9 files is
outside the scope of the agreements.

8.1.23. RNFR​

        1. Save current pathname by appending saved CWD string with
<pathname> argument. If no saved CWD string, proceed to
step 3.
2. Send the following grouped request to the FTAM Responder.
F-BEGIN-GROUP
F-SELECT
Get <Filename> parameter value from RNFR <pathname>
argument.
F-DESELECT
F-END-GROUP
3. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
code(s) to FTP Client.
4. Translate FTP Client reply codes to equivalent FTAM <Action
Result> and <Diagnostic> parameters and send parameters to
FTAM Responder.
        Note:
a. <pathname> argument is assumed to be a filename, relative
to the currently saved CWD.
b. Together with RNTO, this command causes a file to be
renamed.
c. CWD of the FTAM system must be defined prior to issuance of
RNFR.

8.1.24. RNTO​

        1. Save current pathname by appending saved CWD string with
<pathname> argument. If no saved CWD string, proceed to
step 3.
2. Send the following grouped request to the FTAM Responder.
F-BEGIN-GROUP
F-SELECT
F-CHANGE-ATTRIBUTES
Get <Filename> parameter from arguments provided by
RNTO and previous RNFR.
F-DESELECT
F-END-GROUP
3. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
code(s) to FTP Client.
4. Translate FTP Client reply codes to equivalent FTAM <Action
Result> and <Diagnostic> parameters and send parameters to
FTAM Responder.
        Note:
a. <pathname> argument is assumed to be a filename, relative
to the currently saved CWD.
b. Together with RNFR, this command causes a file to be
renamed.
c. CWD of the FTAM system must be defined prior to issuance of
RNTO.

8.1.25. SITE​

        1. Save the specified destination address information.
2. Set the <Called Presentation Address> parameter value equal
to the <string> argument. This parameter will be used when
the F-INITIALIZE is sent to the FTAM Responder.
3. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
code(s) to FTP Client.
4. Translate FTP Client reply codes to equivalent FTAM <Action
Result> and <Diagnostic> parameters and send parameters to
FTAM Responder.
        Note:
a. The <string> argument to the SITE command may include a
Distinguished Name or a User Friendly Name.

8.1.26. SMNT​

        1. Return a 502 reply code to FTP Client.
        Note:
a. Argument is ignored.

8.1.27. STAT​

        1. Provide the gateway session status to the FTP Client.
2. Return a 211 reply code to FTP Client.
        Note:
a. Argument is ignored.

8.1.28. STOR​

        1. Save current pathname by appending saved CWD string with
<pathname> argument. If no saved CWD string, proceed to
step 11.
2. Send the following grouped request to FTAM Responder.
F-BEGIN-GROUP
F-SELECT
F-READ-ATTRIBUTES
Save <Contents Type> parameter value
F-DESELECT
F-END-GROUP
3. If the <Contents Type> parameter returned with the F-READ-
ATTRIBUTES indicates a directory, proceed to step 11.
4. Send the following grouped request to the FTAM responder.
F-BEGIN-GROUP
F-CREATE
Set the <Override> parameter in the F-CREATE to
"Delete and create with new attributes.".
F-OPEN
F-END-GROUP
5. If the file existed, set the <Contents Type> parameter in
the F-CREATE to match the F-READ-ATTRIBUTES. If the file
did not exist, set the <Contents Type> parameter to
"FTAM-1". If TYPE "Image" was previously requested, set
the <Contents Type> parameter to "FTAM-3".
6. Send F-WRITE, with <Bulk Data Transfer Specification, FADU
Operation> parameter set to "File Extend", to FTAM Responder.
7. Loop reading data from FTP data connection, sending the
data in F-DATA PDUs until end-of-file on the FTP
connection.
8. Send F-DATA-END to FTAM Responder.
9. Send F-TRANSFER-END to FTAM Responder.
        10. Send the following grouped request to the FTAM Responder.
F-BEGIN-GROUP
F-CLOSE
F-DESELECT
F-END-GROUP
11. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
code(s) to FTP Client.
12. Translate FTP Client reply codes to equivalent FTAM
<Action Result> and <Diagnostic> parameters and send
parameters to FTAM Responder.
        Note:
a. <pathname> argument is assumed to be a filename, relative
to the currently saved CWD.
b. CWD of the FTAM system must be defined prior to issuance of
STOR.

8.1.29. STOU​

        1. Save current pathname by appending saved CWD string with
<pathname> argument. If no saved CWD string, proceed to
step 11.
2. Send the following grouped request to FTAM Responder.
F-BEGIN-GROUP
F-SELECT
F-READ-ATTRIBUTES
Save <Contents Type> parameter value
F-DESELECT
F-END-GROUP
3. If the file already exists, proceed to step 12.
4. If the <Contents Type> parameter returned with the F-READ-
ATTRIBUTES indicates a directory, proceed to step 11.
5. Send the following grouped request to the FTAM responder.
F-BEGIN-GROUP
F-CREATE
Set the <Override> parameter in the F-CREATE to
"Delete and create with new attributes.".
F-OPEN
F-END-GROUP
6. If the file existed, set the <Contents Type> parameter in
the F-CREATE to match the F-READ-ATTRIBUTES. If the file
did not exist, set the <Contents Type> parameter to
"FTAM-1". If TYPE "Image" was previously requested, set
the <Contents Type> parameter to "FTAM-3".
7. Send F-WRITE, with <Bulk Data Transfer Specification, FADU
Operation> parameter set to "File Extend", to FTAM Responder.
8. Loop reading data from FTP data connection, sending the
           data in F-DATA PDUs until end-of-file on the FTP
connection.
9. Send F-DATA-END to FTAM Responder.
10. Send F-TRANSFER-END to FTAM Responder.
11. Send the following grouped request to the FTAM Responder.
F-BEGIN-GROUP
F-CLOSE
F-DESELECT
F-END-GROUP
12. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
code(s) to FTP Client.
13. Translate FTP Client reply codes to equivalent FTAM
<Action Result> and <Diagnostic> parameters and send
parameters to FTAM Responder.
        Note:
a. <pathname> argument is assumed to be a filename, relative
to the currently saved CWD.
b. Same as STOR, except the name of the created file must be
unique in that directory.
c. CWD of the FTAM system must be defined prior to issuance of
STOU.

8.1.30. STRU​

        1. If <structure code> argument is not "File", return 504
reply code to FTP Client; Otherwise return 200 reply code
to FTP Client.

8.1.31. SYST​

        1. Return 502 reply code to FTP client.

8.1.32. TYPE​

        1. If no <type code> argument is provided, set <Contents Type>
parameter equal to "FTAM-1".
2. If argument is provided, and equal to "ASCII", set <Contents
Type> parameter to "FTAM-1".
3. If argument is provided, and equal to "Image", set <Contents
Type> parameter to "FTAM-3".
4. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
code(s) to FTP Client.
5. Translate FTP Client reply codes to equivalent FTAM <Action
Result> and <Diagnostic> parameters and send parameters to
FTAM Responder.
        Note:
a. Default to ASCII if no <type code> argument is provided.

8.1.33. USER​

        1. Set <Initiator Identity> parameter for issuing F-INITIALIZE
to FTAM Responder.
2. If the destination address was specified in the Domain Name
used to attach to the gateway, use it to set the value of
the <Called Presentation Address> parameter of the
to-be-issued F-INITIALIZE command.
3. If the destination address is not known, check if it was
specified in a previously issued SITE command. If
available, set <Called Presentation Address> parameter for
issuing F-INITIALIZE to FTAM Responder.
4. If the destination address is still not available, check if
it is encoded in the user identity (e.g., user@host). If
encoded, set <Called Presentation Address> parameter for
issuing F-INITIALIZE to FTAM Responder using the "host"
portion.
5. If no destination address is available, proceed to step 7.
6. Prompt user for password.
7. Translate FTAM Responder <Action Result> and <Diagnostic>
parameters to equivalent FTP reply code(s) and send reply
code(s) to FTP Client.
8. Translate FTP Client reply codes to equivalent FTAM <Action
Result> and <Diagnostic> parameters and send parameters to
FTAM Responder.
        Note:
a. A USER command should be acceptable in any state.
b. Multiple mechanisms are available for specifying the
destination address: 1) Domain Name used in connecting to
gateway (see section 4, Use of Gateway Services); 2) SITE
command argument; and 3) user@host format.

8.2. Servizio di gateway avviato da FTAM​

Il mapping di protocollo tra FTP e FTAM può essere uno a zero (ossia non mappabile), uno a uno oppure uno a molti.

I passaggi generali eseguiti dal gateway FTP-FTAM per fornire il servizio avviato da FTAM sono:

        1. Accept an FTAM Initiator request at the FTAM Responder side
of the gateway.
        2. Map the request to the (set of) corresponding FTP Client

funzione/i.

        3. Acting as an FTP Client, send the FTP Client function(s) to
the FTP Server.
        4. Accept information returned to the FTP Client side of the
gateway. This information originated at the FTP Server.
        5. Map this returned information to a form understood by the
FTAM Responder side of the gateway.
        6. Send this returned information from the FTAM Responder side
of the gateway to the FTAM Initiator.

Per ciascuna funzione del protocollo FTAM sono identificate le funzioni del protocollo FTP necessarie per il suo mapping:

      FTAM                FTP
      -----------------------------------------------------------------
      F-BEGIN-GROUP       none
      F-CANCEL            ABOR
      F-CHANGE-ATTRIBUTE  RNFR, RNTO
      F-CHECK             none
      F-CLOSE             none
      F-CREATE            STOR
      F-DATA              ALLO, STOR or RETR or APPE
      F-DATA-END          none
      F-DELETE            DELE
      F-DESELECT          none
      F-END-GROUP         STAT
      F-ERASE             DELE
      F-INITIALIZE        ACCT, PASS, USER
      F-LOCATE            none
      F-OPEN              MODE, STRU, TYPE
      F-READ              MODE, NLST, RETR, TYPE
      F-READ-ATTRIBUTE    LIST
      F-RECOVER           REST
      F-RESTART           ABOR, REST
      F-SELECT            LIST
      F-TERMINATE         QUIT
      F-TRANSFER          none
      F-P-ABORT           QUIT
      F-U-ABORT           QUIT
      F-WRITE             APPE or STOR, NOOP

La parte restante di questa sezione presenta procedure di mapping dettagliate per ciascuna funzione del protocollo FTAM. Ove opportuno, ciascuna primitiva di servizio FTAM è seguita dai parametri pertinenti al mapping. Il supporto di questi mapping da parte del gateway è obbligatorio.

8.2.1. F-BEGIN-GROUP REQ​

        1. Send F-BEGIN-GROUP RESP PDU to FTAM Initiator signifying
that processes are available to handle concatenated
requests.

8.2.2. F-CANCEL REQ​

        1. Close FTP data connection.
2. Send ABOR to FTP Server.
3. Translate FTP Server reply code to equivalent FTAM
Responder action and diagnostic parameters and send
parameters to FTAM Initiator via F-CANCEL RESP PDU.
4. Translate FTAM Initiator action and diagnostic parameters
to equivalent FTP reply codes and send reply codes to FTP
Server.
        Note:
a. F-U-ABORT REQ is a viable alternative to F-CANCEL REQ.
b. Note that since ABOR is not implemented by all FTP Servers,

il file remoto può risultare danneggiato, benché accessibile.

8.2.3. F-CHANGE-ATTRIBUTE REQ​

        1. Get original filename from <Filename> parameter and send it
with an RNFR to the FTP Server.
2. Get new filename from <Filename> parameter and send it with
an RNTO to the FTP Server.
3. Translate FTP Server reply code to equivalent FTAM
Responder action and diagnostic parameters and send
parameters to FTAM Initiator via F-CHANGE-ATTRIBUTE RESP
PDU.
4. Translate FTAM Initiator action and diagnostic parameters
to equivalent FTP reply codes and send reply codes to FTP
Server.
        Note:
a. Allow for processing an arbitrary number attributes at one
time.
b. Allow for responses of "Attribute currently unavailable for
change" and "Attribute not currently supported".
c. At a minimum, support the <Filename>, <Permitted Actions>,
and <Contents Type> parameters.

8.2.4. F-CHECK REQ​

        1. Send an F-CHECK RESP PDU to the FTAM Initiator.

8.2.5. F-CLOSE REQ​

        1. Send F-CLOSE RESP PDU , with <Action Result> parameter
value of "Success", to FTAM Initiator.
        Note:
a. If an error had occurred during transfer, it would have
been noted before the F-CLOSE REQ.

8.2.6. F-CREATE REQ​

        1. Send STOR and zero data bytes to FTP Server.
2. Translate FTP Server reply code to equivalent FTAM
Responder <Action Result> and <Diagnostic> parameters and
send parameters to FTAM Initiator.
3. Translate FTAM Initiator <Action Result> and <Diagnostic>
parameters to equivalent FTP reply codes and send reply
codes to FTP Server.

8.2.7. F-DATA PDU​

        1. If necessary, send ALLO command to FTP Server.
2. Depending on whether reading or writing, send STOR, RETR,
or APPE command to FTP Server.
3. Translate FTP Server reply code to equivalent FTAM
Responder <Action Result> and <Diagnostic> parameters and
send parameters to FTAM Initiator.
4. Translate FTAM Initiator <Action Result> and <Diagnostic>
parameters to equivalent FTP reply codes and send reply
codes to FTP Server.
        Note:
a. The use of an FTP command may be unnecessary. Sending the
data on the data connection may be adequate.

8.2.8. F-DATA-END REQ​

        1. Close the data connection.
2. Save mandatory Diagnostic parameter for later use.
3. Translate FTP Server reply code to equivalent FTAM
Responder <Action Result> and <Diagnostic> parameters and
send parameters to FTAM Initiator.
4. Translate FTAM Initiator <Action Result> and <Diagnostic>
parameters to equivalent FTP reply codes and send reply
codes to FTP Server.

8.2.9. F-DELETE REQ​

        1. Send DELE to FTP server.
2. Translate FTP Server reply code to equivalent FTAM
Responder <Action Result> and <Diagnostic> parameters and
send parameters to FTAM Initiator via F-DELETE RESP PDU.
3. Translate FTAM Initiator <Action Result> and <Diagnostic>
parameters to equivalent FTP reply codes and send reply
codes to FTP Server.

8.2.10. F-DESELECT REQ​

        1. Return F-DESELECT RESP PDU, with <Action Result> parameter
value of "Success", to FTAM Initiator.

8.2.11. F-END-GROUP REQ​

        1. Send STAT command sequence to FTP Server.
2. Translate FTP Server reply code to equivalent FTAM
Responder <Action Result> and <Diagnostic>
parameters and send parameters to FTAM Initiator via F-END
           GROUP RESP.
3. Translate FTAM Initiator <Action Result> and <Diagnostic>
parameters to equivalent FTP reply codes and send reply
codes to FTP Server.

8.2.12. F-ERASE REQ​

        1. Send DELE to FTP Server.
2. Translate FTP Server reply code to equivalent FTAM
Responder <Action Result> and <Diagnostic> parameters and
send parameters to FTAM Initiator via F-ERASE RESP PDU.
3. Translate FTAM Initiator <Action Result> and <Diagnostic>
parameters to equivalent FTP reply codes and send reply
codes to FTP Server.

8.2.13. F-INITIALIZE REQ​

        1. Establish initial area for activity attributes.
2. Save <Responding Presentation Address>, <Initiator
Identity>, and <Filestore Password> parameter values
received from FTAM Initiator.
3. If the destination address was specified in the
Distinguished Name (or User Friendly Name) used to attach
to the gateway, save it as the ultimate destination
address.
4. If the ultimate destination address is not yet known, look
at the "@host" portion of the <Initiator Identity>
parameter for the ultimate destination parameter.
5. If the ultimate destination address is still not known,
check if it is available in the <Responding Presentation
Address> parameter.
6. Get userid from <Initiator Identity> and send it with USER
command to FTP Server.
7. Get password from <Filestore Password> and send it with
PASS command to FTP Server.
8. If necessary, send ACCT command to FTP Server.
9. Negotiate acceptance of mandatory functional units, service
classes, service types, presentation contexts, and
attribute groups.
10. Accept context management functional unit passed by
Presentation service provider.
11. Translate FTP Server reply code to equivalent FTAM
Responder <Action Result> and <Diagnostic> parameters and
send parameters to FTAM Initiator via F-INIT RESP PDU.
12. Translate FTAM Initiator <Action Result> and <Diagnostic>
parameters to equivalent FTP reply codes and send reply
codes to FTP Server.
        Note:
a. Multiple mechanisms are available for specifying the
destination address: 1) Distinguished Name, or User
Friendly Name, used in connecting to the gateway (see
section 4, Use of Gateway Services); 2) user@host format;
and 3) Inclusion as <Responding Presentation Address>
parameter value.

8.2.14. F-LOCATE REQ​

        Note:
a. Not supported since FTAM-1 and FTAM-3 don't support this
primitive.

8.2.15. F-OPEN REQ​

        1. Get <Contents Type> and <Processing Mode> parameter values
from FTAM Initiator.
2. Send TYPE command to FTP Server.
3. Send MODE command to FTP Server.
4. Send STRU command to FTP Server.
5. Translate FTP Server reply code to equivalent FTAM
Responder <Action Result> and <Diagnostic>
parameters and send parameters to FTAM Initiator via F-OPEN
RESP PDU.
6. Translate FTAM Initiator <Action Result> and <Diagnostic>
parameters to equivalent FTP reply codes and send reply
codes to FTP Server.
        Note:
a. Establishes definite value for presentation context name
parameter for this data transfer.
b. Assumes that the <Requested Access> parameter is permitted.

8.2.16. F-READ REQ​

        1. If requested file type and file mode are different than
current settings, send TYPE and MODE to FTP Server.
2. If <Contents Type> is FTAM-1 or FTAM-3, then send RETR to
FTP Server.
3. If <Contents Type> is "NBS-9", then send NLST to FTP
Server.
4. If reply code from FTP Server is 1xx, open FTP data
connection and loop until End-of-File is read on FTP data
connection. Inside loop, read block from FTP data
connection, format FTAM DATA PDU, and send FTAM PDU to FTAM
Initiator. At End-of-File on FTP data connection, send
F-DATA-END and return.
        5. If reply code from FTP Server is not 1xx, send F-CANCEL REQ
to FTAM Initiator.
6. Translate FTP Server reply code to equivalent FTAM
Responder <Action Result> and <Diagnostic> parameters and
send parameters to FTAM Initiator via F-READ RESP PDU.
7. Translate FTAM Initiator <Action Result> and <Diagnostic>
parameters to equivalent FTP reply codes and send reply
codes to FTP Server.
        Note:
a. To send NLST response, TYPE must be ASCII.

8.2.17. F-READ-ATTRIBUTE REQ​

        1. Send LIST to FTP Server.
2. Translate returned information into the <Filename>,
<Contents Type>, and <Permitted Actions> parameter values
and return them to the FTAM Initiator.
3. Translate FTP Server reply code to equivalent FTAM
Responder <Action Result> and <Diagnostic> parameters and
send parameters to FTAM Initiator via F-READ-ATTRIBUTE RESP
PDU.
4. Translate FTAM Initiator <Action Result> and <Diagnostic>
parameters to equivalent FTP reply codes and send reply
codes to FTP Server.

8.2.18. F-RECOVER REQ​

        1. Send REST command to FTP Server.
2. Translate FTP Server reply code to equivalent FTAM
Responder <Action Result> and <Diagnostic> parameters and
send parameters to FTAM Initiator.
3. Translate FTAM Initiator <Action Result> and <Diagnostic>
parameters to equivalent FTP reply codes and send reply
codes to FTP Server.
        Note:
a. Regime recovery is only possible if the <Recovery
Functional Unit> parameter was negotiated previously by an
F-INITIALIZE.

8.2.19. F-RESTART REQ​

        1. To interrupt any bulk data transfer in progress, send ABOR
to FTP Server.
2. To negotiate the point at which data transfer is to be
restarted, get <Checkpoint Identifier> parameter from FTAM
Initiator and send it with REST to FTP Server.
        3. Translate FTP Server reply code to equivalent FTAM
Responder <Action Result> and <Diagnostic> parameters and
send parameters to FTAM Initiator via F-RESTART RESP PDU.
4. Translate FTAM Initiator <Action Result> and <Diagnostic>
parameters to equivalent FTP reply codes and send reply
codes to FTP Server.

8.2.20. F-SELECT REQ​

        1. Get <Filename> parameter and send with LIST command to FTP
Server to determine whether or not the file exists.
2. If file exists, compare the POSIX file access rights with
the <Requested Access> parameter sent by the FTAM
Initiator. If the access rights match, return <Action
Result> parameter value of "Success", otherwise return
<Action Result> parameter value of "Failure".
3. Translate FTP Server reply code to equivalent FTAM
Responder <Action Result> and <Diagnostic> parameters and
send parameters to FTAM Initiator via F-SELECT RESP PDU.
4. Translate FTAM Initiator <Action Result> and <Diagnostic>
parameters to equivalent FTP reply codes and send reply
codes to FTP Server.
        Note:
a. The specified file is binary/text file if one record is
received or is a directory file if multiple records are
received.

8.2.21. F-TERMINATE REQ​

        1. Send QUIT to FTP Server.
2. Translate FTP Server reply code to equivalent FTAM
Responder <Action Result> and <Diagnostic> parameters and
send parameters to FTAM Initiator via F-TERMINATE RESP PDU.
3. Translate FTAM Initiator <Action Result> and <Diagnostic>
parameters to equivalent FTP reply codes and send reply
codes to FTP Server.

8.2.22. F-TRANSFER-END​

        1. Get <Action Result> parameter value from last F-DATA-END
and return it to FTAM Initiator as <Action Result>
parameter of this F-TRANSFER-END.

8.2.23. F-P-ABORT REQ​

        1. Send QUIT to FTP Server.
2. Return <Action Result> parameter value of "Permanent Error"
           to FTAM Initiator.
3. Translate FTP Server reply code to equivalent FTAM
Responder <Action Result> and <Diagnostic> parameters and
send parameters to FTAM Initiator.
4. Translate FTAM Initiator <Action Result> and <Diagnostic>
parameters to equivalent FTP reply codes and send reply
codes to FTP Server.

8.2.24. F-U-ABORT REQ​

        1. Send QUIT to FTP Server.
2. Return <Action Result> parameter value of "Permanent Error"
to FTAM Initiator.
3. Translate FTP Server reply code to equivalent FTAM
Responder <Action Result> and <Diagnostic> parameters and
send parameters to FTAM Initiator.
4. Translate FTAM Initiator <Action Result> and <Diagnostic>
parameters to equivalent FTP reply codes and send reply
codes to FTP Server.

8.3. F-WRITE REQ​

        1. Save bulk transfer specification parameter from PDU.
2. Send NOOP to FTP Server to receive status information.
3. If the <Bulk Data Transfer Specification, FADU Operation>
parameter has a value of "File Extend", then send an APPE
to the FTP Server, otherwise send a STOR to the FTP Server.
4. If reply code from FTP Server is 200, then accept FTP data
connection; otherwise send F-CANCEL REQ to FTAM Initiator.
5. Translate FTP Server reply code to equivalent FTAM Responder
<Action Result> and <Diagnostic> parameters and send
parameters to FTAM Initiator.
6. Translate FTAM Initiator <Action Result> and <Diagnostic>
parameters to equivalent FTP reply codes and send reply
codes to FTP Server.