Protocol: Difference between revisions

From Lundman Wiki
No edit summary
No edit summary
 
(32 intermediate revisions by the same user not shown)
Line 81: Line 81:
For SITE structure definition, see [[Site_Definition]]
For SITE structure definition, see [[Site_Definition]]
http://www.lundman.net/wiki/index.php/Site_Definition
http://www.lundman.net/wiki/index.php/Site_Definition


=== SITEADD ===
=== SITEADD ===


Add a new site to the system.
Add a new site to the system.


  [ Minimal required fields ]
  [ Minimal required fields ]
Line 132: Line 129:
only entries which matched string would be queued, and others are
only entries which matched string would be queued, and others are
dropped. Uses same pattern syntax as skiplist.
dropped. Uses same pattern syntax as skiplist.


  [ Extended Optional Arguments ]
  [ Extended Optional Arguments ]
Line 146: Line 142:


  "...|extrafield=somestuff|OS=Unix"
  "...|extrafield=somestuff|OS=Unix"


  [ Returns ]
  [ Returns ]
Line 167: Line 162:
  lundfxp_sitecmd_1=SITE WHO
  lundfxp_sitecmd_1=SITE WHO
  lundfxp_lastlogin=015368281
  lundfxp_lastlogin=015368281


=== SITELIST ===
=== SITELIST ===
Line 173: Line 167:
Lists all defined sites.
Lists all defined sites.


[ Minimal Required Fields]
[ Minimal Required Fields]


[ Optional Arguments ]
>> SHORT          - Send only short list (siteid + name)
>> SITEID=<int>    - Send only specified siteid. Sends no BEGIN/END keys.


[ Optional Arguments ]
[ Returns ]
 
 
>> SITEID=<int>    - Site ID being displayed.
[ Returns ]
>> NAME=<str>      - Name of site. Not used by engine, need not be unique.   
 
>> HOST=<str>      - Hostname of remote FTP server
>> SITEID=<int>    - Site ID being displayed.
>> USER=<str>      - User name for authentication on remote FTP server
>> NAME=<str>      - Name of site. Not used by engine, need not be unique.   
>> PASS=<str>      - and password
>> HOST=<str>      - Hostname of remote FTP server
>> PORT=<int>      - Optional PORT of remote FTP server. [1]
>> USER=<str>      - User name for authentication on remote FTP server
>> PASSIVE=<yna>  - Use passive for directory listings? [See YNA type]
>> PASS=<str>      - and password
>> FXP_PASSIVE=yna - Can this remote FTP only take PASV, or PORT?  
>> PORT=<int>      - Optional PORT of remote FTP server. [1]
>> CONTROL_TLS=yna - Attempt SSL/TLS on Control channel?
>> PASSIVE=<yna>  - Use passive for directory listings? [See YNA type]
>> DATA_TLS=<yna>  - Attempt SSL/TLS on Data channel? Site needs CCSN feat
>> FXP_PASSIVE=yna - Can this remote FTP only take PASV, or PORT?  
>> IFACE=<ip>      - Optional IP to bind() to. [1]
>> CONTROL_TLS=yna - Attempt SSL/TLS on Control channel?
>> IPORT=<int>    - Optional PORT to bind() to. [1]
>> DATA_TLS=<yna>  - Attempt SSL/TLS on Data channel? Site needs CCSN feat
>> DESIRED_TYPE=yna- Binary or Ascii mode transfers. [1]
>> IFACE=<ip>      - Optional IP to bind() to. [1]
>> RESUME=<yna>    - Attempt to Resume before Overwrite. [1]
>> IPORT=<int>    - Optional PORT to bind() to. [1]
>> RESUME_LAST=yna - Re-queue items needed resume last in the queue. [1]
>> DESIRED_TYPE=yna- Binary or Ascii mode transfers. [1]
>> PRET=<yna>      - Send the extended Pre-Transfer command before transfer[1]
>> RESUME=<yna>    - Attempt to Resume before Overwrite. [1]
>> FSKIPLIST=<str> - File skip list [1]
>> RESUME_LAST=yna - Re-queue items needed resume last in the queue. [1]
>> DSKIPLIST=<str> - Directory skip list [1]
>> PRET=<yna>      - Send the extended Pre-Transfer command before transfer[1]
>> FPASSLIST=<str> - File pass list [1]
>> FSKIPLIST=<str> - File skip list [1]
>> DPASSLIST=<str> - Directory pass list [1]
>> DSKIPLIST=<str> - Directory skip list [1]
>> FSKIPEMPTY=<yna>- Skip empty files [1]
>> FPASSLIST=<str> - File pass list [1]
>> DSKIPEMPTY=<yna>- Skip empty directories [1]
>> DPASSLIST=<str> - Directory pass list [1]
>> FMOVEFIRST=<str>- Pattern file matches to force queue at top [1]
>> FSKIPEMPTY=<yna>- Skip empty files [1]
>> DMOVEFIRST=<str>- Pattern directory matches to force queue at top [1]
>> DSKIPEMPTY=<yna>- Skip empty directories [1]
>> BEGIN          - First item sent,  start of list.
>> FMOVEFIRST=<str>- Pattern file matches to force queue at top [1]
>> END            - Final item was sent, end of list.
>> DMOVEFIRST=<str>- Pattern directory matches to force queue at top [1]
>> BEGIN          - First item sent,  start of list.
>> END            - Final item was sent, end of list.


[1] This information is only sent if the current value differs from
[1] This information is only sent if the current value differs from
the default "AUTO" type. Or, in the case of strings, where the string
the default "AUTO" type. Or, in the case of strings, where the string
is defined (not-empty).
is defined (not-empty).
[ Example ]
   
   
<< SITELIST|BEGIN
>> SITELIST|SITEID=2|NAME=localhost|HOST=127.0.0.1|PORT=21|USER=mp3|PASS=mp3|PASSIVE=1|FXP_PASSIVE=2|CONTROL_TLS=2|DATA_TLS=2|optional_variable=roger moore
>> SITELIST|SITEID=1|NAME=localhost2|HOST=127.0.0.1|PORT=56688|USER=mp3|PASS=mp3|PASSIVE=1|FXP_PASSIVE=2|CONTROL_TLS=2|DATA_TLS=2
>> SITELIST|END


[ Example ]
<< SITELIST|SHORT
 
>> SITELIST|BEGIN
<< SITELIST|BEGIN
>> SITELIST|SITEID=1|NAME=localhost
>> SITELIST|SITEID=1|NAME=localhost|HOST=127.0.0.1|PORT=21|USER=mp3|PASS=mp3|PASSIVE=1|FXP_PASSIVE=2|CONTROL_TLS=2|DATA_TLS=2|optional_variable=roger moore
>> SITELIST|END
>> SITELIST|SITEID=0|NAME=localhost2|HOST=127.0.0.1|PORT=56688|USER=mp3|PASS=mp3|PASSIVE=1|FXP_PASSIVE=2|CONTROL_TLS=2|DATA_TLS=2
>> SITELIST|END
 
 
 


<< SITELIST|SITEID=2
>> SITELIST|SITEID=2|NAME=localhost|HOST=127.0.0.1|PORT=21|USER=mp3|PASS=mp3|PASSIVE=1|FXP_PASSIVE=2|CONTROL_TLS=2|DATA_TLS=2|optional_variable=roger moore


 
=== SITEMOD ===
 
 
 
 
 
 
** SITEMOD


Modify an existing site's key/value pairs.  Specify as many items as
Modify an existing site's key/value pairs.  Specify as many items as
Line 238: Line 229:
field. For example "key=".
field. For example "key=".


[ Minimal required fields ]
>> SITEID=<int>    - Site ID of created site.


[ Minimal required fields ]
[ Optional Arguments ]
 
>> SITEID=<int>    - Site ID of created site.
>> NAME=<str>      - Name of site. Not used by engine, need not be unique.   
 
>> HOST=<str>      - Hostname of remote FTP server
 
>> USER=<str>      - User name for authentication on remote FTP server
[ Optional Arguments ]
>> PASS=<str>      - and password
 
>> PORT=<int>      - Optional PORT of remote FTP server. Default 21.
>> NAME=<str>      - Name of site. Not used by engine, need not be unique.   
>> IFACE=<ip>      - Optional IP to bind() to.
>> HOST=<str>      - Hostname of remote FTP server
>> IPORT=<int>    - Optional PORT to bind() to.
>> USER=<str>      - User name for authentication on remote FTP server
>> DESIRED_TYPE=yna- Binary or Ascii mode transfers. [See YNA type]
>> PASS=<str>      - and password
                    - AUTO and engine will set Binary for transfers.
>> PORT=<int>      - Optional PORT of remote FTP server. Default 21.
>> RESUME=<yna>    - Attempt to Resume before Overwrite.  
>> IFACE=<ip>      - Optional IP to bind() to.
>> RESUME_LAST=yna - Re-queue items needed resume last in the queue.
>> IPORT=<int>    - Optional PORT to bind() to.
>> PRET=<yna>      - Send the extended Pre-Transfer command before transfer[1]
>> DESIRED_TYPE=yna- Binary or Ascii mode transfers. [See YNA type]
>> FSKIPLIST=<str> - File skip list [2]
                  - AUTO and engine will set Binary for transfers.
>> DSKIPLIST=<str> - Directory skip list [2]
>> RESUME=<yna>    - Attempt to Resume before Overwrite.  
>> FPASSLIST=<str> - File pass list [3]
>> RESUME_LAST=yna - Re-queue items needed resume last in the queue.
>> DPASSLIST=<str> - Directory pass list [3]
>> PRET=<yna>      - Send the extended Pre-Transfer command before transfer[1]
>> FSKIPEMPTY=<yna>- Skip empty files
>> FSKIPLIST=<str> - File skip list [2]
>> DSKIPEMPTY=<yna>- Skip empty directories
>> DSKIPLIST=<str> - Directory skip list [2]
>> FMOVEFIRST=<str>- Pattern file matches to force queue at top
>> FPASSLIST=<str> - File pass list [3]
>> DMOVEFIRST=<str>- Pattern directory matches to force queue at top
>> DPASSLIST=<str> - Directory pass list [3]
>> FSKIPEMPTY=<yna>- Skip empty files
>> DSKIPEMPTY=<yna>- Skip empty directories
>> FMOVEFIRST=<str>- Pattern file matches to force queue at top
>> DMOVEFIRST=<str>- Pattern directory matches to force queue at top
 
 


[1] AUTO means it will use this feature if it is reported by the
[1] AUTO means it will use this feature if it is reported by the
Line 281: Line 268:
dropped. Uses same pattern syntax as skiplist.
dropped. Uses same pattern syntax as skiplist.


[ Extended Optional Arguments ]
As a special feature to the clients connecting to the FXP.One engine,
we also allow for storing of own, arbitrary, key/value pairs. As long
as the "key" is not the same as any of the above keys, or that of the
predefined reserved keys. (eg. "TYPE", "END")
>> <str>=<str>    - Store extra client information.


[ Extended Optional Arguments ]
For example:
"...|extrafield=somestuff|OS=Unix"


As a special feature to the clients connecting to the FXP.One engine,
[ Returns ]
we also allow for storing of own, arbitrary, key/value pairs. As long
as the "key" is not the same as any of the above keys, or that of the
>> SITEID=<int>    - Site ID of created site.
predefined reserved keys. (eg. "TYPE", "END")
>> CODE=<int>      - Command return status CODE.
 
>> MSG=<str>      - Command return message.
>> <str>=<str>    - Store extra client information.
 
For example:
 
"...|extrafield=somestuff|OS=Unix"
 
 
[ Returns ]
 
>> SITEID=<int>    - Site ID of created site.
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>      - Command return message.
 
 
[ Example ]
 
>> SITEMOD|SITEID=1|fskiplist=*ENGLISH*,*COMPLETE*|fskipempty=YES
<< SITEMOD|CODE=0|SITEID=1|Msg=Modified successfully.
 
 
 
[ Caveat ]
 
It is recommended that all clients that wish to store information
in the site database, to prefix their key values with a unique string,
perhaps the name of the application. For example:
 
lundfxp_sitecmd_1=SITE WHO
lundfxp_lastlogin=015368281


[ Example ]
>> SITEMOD|SITEID=1|fskiplist=*ENGLISH*,*COMPLETE*|fskipempty=YES
<< SITEMOD|CODE=0|SITEID=1|Msg=Modified successfully.


[ Caveat ]
It is recommended that all clients that wish to store information
in the site database, to prefix their key values with a unique string,
perhaps the name of the application. For example:
lundfxp_sitecmd_1=SITE WHO
lundfxp_lastlogin=015368281


 
=== SITEDEL ===
 
 
 
 
 
 
** SITEDEL


Delete an existing site.
Delete an existing site.


[ Minimal required fields ]
>> SITEID=<int>    - Site ID of created site.


[ Minimal required fields ]
[ Optional Arguments ]


>> SITEID=<int>    - Site ID of created site.
[ Extended Optional Arguments ]


[ Returns ]
>> SITEID=<int>    - Site ID of created site.
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>      - Command return message.


[ Optional Arguments ]
[ Example ]
>> SITEDEL|SITEID=12
<< SITEDEL|CODE=0|MSG=Site deleted.


[ Caveat ]
Sites aren't actually deleted, just not saved to disk. This means
active sessions using said siteid created before the SITEDEL command
was issued will continue to work.


[ Extended Optional Arguments ]
[ Returns ]
>> SITEID=<int>    - Site ID of created site.
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>      - Command return message.
[ Example ]
>> SITEDEL|SITEID=12
<< SITEDEL|CODE=0|MSG=Site deleted.




 
== SESSIONS ==
[ Caveat ]
 
Sites aren't actually deleted, just not saved to disk. This means
active sessions using said siteid created before the SITEDEL command
was issued will continue to work.
 
 
 
 
 
 
 
 
 
22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)~~
SESSIONS
22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)~~


A session refer to a site connection. The API will ask for a new
A session refer to a site connection. The API will ask for a new
Line 383: Line 339:
closed_. The API will have to request a new session if so desired.
closed_. The API will have to request a new session if so desired.


 
=== SESSIONNEW ===
** SESSIONNEW


Request a new session to site, returning a SID to session.
Request a new session to site, returning a SID to session.


[ Minimal Required Fields]
[ Minimal Required Fields]
>> SITEID=<int>    - Which remote server to connect to, from SITELIST.


>> SITEID=<int>    - Which remote server to connect to, from SITELIST.
[ Optional Arguments ]
>> LOG=1            - Normal login is silent. With LOG the API received
                      all verbose messages.


[ Optional Arguments ]
[ Returns ]
 
>> LOG            - Normal login is silent. With LOG the API received
>> SID=<int>      - Value of the new SID for all future commands with
                    all verbose messages.
 
[ Returns ]
 
>> SID=<int>      - Value of the new SID for all future commands with
                     sessions
                     sessions
>> CODE=<int>      - Command return status CODE.
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>      - Command return message.
>> MSG=<str>      - Command return message.


[ Example ]
>> sessionnew|siteid=0
<< SESSIONNEW|SITEID=0|SID=1
<< IDLE|SID=1


 
=== SESSIONFREE ===
[ Example ]
 
>> sessionnew|siteid=0
<< SESSIONNEW|SITEID=0|SID=1
<< IDLE|SID=1
 
 
 
 
 
 
** SESSIONFREE


Release a session, and disconnect from remote host.
Release a session, and disconnect from remote host.


[ Minimal Required Fields]
>> SID=<int>        - SID of the session to close.


[ Minimal Required Fields]
[ Optional Arguments ]


>> SID=<int>       - SID of the session to close.
[ Returns ]
>> SID=<int>         - SID of the session closed.
>> CODE=<int>        - Command return status CODE.
>> MSG=<str>        - Command return message.


[ Optional Arguments ]
[ Example ]
>> SESSIONFREE|SID=1
<< SESSIONFREE|CODE=0|SID=1|MSG=Success


=== ASYNC ===


Is not a command but client need to be aware that there are messages that
come in at any time.


[ Returns ]
<< CONNECT|SID=1
Send once a session has successfully logged in and is ready to answer
queries. Initially it was thought that IDLE would be enough, but
clients will generally want to auto-trigger some commands upon
connection establish, so we provide this event.


>> SID=<int>        - SID of the session closed.
<< IDLE|SID=1        
>> CODE=<int>       - Command return status CODE.
>> MSG=<str>        - Command return message.
Site is idle, ready for more commands. Informative only as you can
always issue commands, they will be queued.


<< DISCONNECT|SID=1|CODE=429|MSG=Undefined error: 0
The session was disconnected. Any further references to the SID (in
this case "1") will result in an error.


[ Example ]
<< LOG|SID=1|MSG=
You can request a SESSIONNEW to be logged (LOG), or, most of the
commands take an option "LOG" to specify that logging is desired
during the execution of said command. This means the engine will
forward all messages from the remote FTPD to the client. For example:


>> SESSIONFREE|SID=1
>> CWD|SID=2|path=/requests
<< SESSIONFREE|CODE=0|SID=1|MSG=Success
<< CWD|SID=2|CODE=0|MSG=250 CWD command successful.
>> CWD|SID=2|path=requests|LOG
<< CWD|SID=2|CODE=-1|MSG=250-REQUESTS ADMIN: roger
<< CWD|SID=2|CODE=-1|MSG=250-
<< CWD|SID=2|CODE=-1|MSG=250-RULES: Please use format of REQ- and FILLED- 
<< CWD|SID=2|CODE=-1|MSG=250-      and please do not dump single files into 
<< CWD|SID=2|CODE=-1|MSG=250-    root as it just make the folder look untidy!
<< CWD|SID=2|CODE=-1|MSG=250-Available space: 14676.22 MB.
<< CWD|SID=2|CODE=0|MSG=250 CWD command successful.






== FTP COMMANDS ==


=== DIRLIST ===


Request a directory listing from remote server/session.


** ASYNC
[ Minimal Required Fields]
 
 
>> SID=<int>       - SID of the session
<< CONNECT|SID=1
 
Send once a session has successfully logged in and is ready to answer
queries. Initially it was thought that IDLE would be enough, but
clients will generally want to auto-trigger some commands upon
connection establish, so we provide this event.
 
 
<< IDLE|SID=1       
 
Site is idle, ready for more commands. Informative only as you can
always issue commands, they will be queued.
 
 
 
<< DISCONNECT|SID=1|CODE=429|MSG=Undefined error: 0
 
The session was disconnected. Any further references to the SID (in
this case "1") will result in an error.
 
 
 
<< LOG|SID=1|MSG=
 
You can request a SESSIONNEW to be logged (LOG), or, most of the
commands take an option "LOG" to specify that logging is desired
during the execution of said command. This means the engine will
forward all messages from the remote FTPD to the client. For example:
 
>> CWD|SID=2|path=/requests
<< CWD|SID=2|CODE=0|MSG=250 CWD command successful.
 
>> CWD|SID=2|path=requests|LOG
<< CWD|SID=2|CODE=-1|MSG=250-REQUESTS ADMIN: roger
<< CWD|SID=2|CODE=-1|MSG=250-
<< CWD|SID=2|CODE=-1|MSG=250-RULES: Please use format of REQ- and FILLED- 
<< CWD|SID=2|CODE=-1|MSG=250-      and please do not dump single files into 
<< CWD|SID=2|CODE=-1|MSG=250-    root as it just make the folder look untidy!
<< CWD|SID=2|CODE=-1|MSG=250-Available space: 14676.22 MB.
<< CWD|SID=2|CODE=0|MSG=250 CWD command successful.
 
 
 
 
 
 
 
 
22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)~~
FTP COMMANDS
22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)~~
 


[ Optional Arguments ]
   
   
 
// Optional: PATH, ARGS, RAW, CACHEOK, LOG
 
>> PATH=<str>        - Additional path element [1]
** DIRLIST
>> ARGS=<str>        - Additional list options [2]
 
>> RAW=<int>        - Include entire list line in FID reply.(unparsed)
Request a directory listing from remote server/session.
>> CACHEOK          - If cache is populated, avoid remote server
 
>> LOG               - Send all strings with dirlist, like SESSIONNEW
 
[ Minimal Required Fields]
 
>> SID=<int>        - SID of the session
 
 
[ Optional Arguments ]
 
// Optional: PATH, ARGS, RAW, CACHEOK, LOG
>> PATH=<str>        - Additional path element [1]
>> ARGS=<str>        - Additional list options [2]
>> RAW=<int>        - Include entire list line in FID reply.(unparsed)
>> CACHEOK          - If cache is populated, avoid remote server
>> LOG     >        - Send all strings with dirlist, like SESSIONNEW


[1] Warning. It is not recommended that you use this to supply
[1] Warning. It is not recommended that you use this to supply
Line 530: Line 453:
example, "-1" would remove the long listing style.
example, "-1" would remove the long listing style.


[ Returns ]
>> SID=<int>        - SID the dirlist reply is from.
>> FID=<int>        - File ID of this item. For QADD.
>> NAME=<str>        - Name of Directory OR File
>> DATE=<time>      - FID's date/time stamp. In seconds since 1970.
>> SIZE=<int>        - Size of Directory OR File
>> USER=<str>        - Owner of entry
>> GROUP=<str>      - Group of entry
>> PERM=<str>        - Permissions string. TODO - add octal as well.
>> FTYPE=<str>      - Type. "Directory", "File".
>> ITEMS=<int>      - Number of items in the list.
>> BEGIN            - First item sent,  start of list.
>> END              - Final item was sent, end of list.


[ Returns ]
[ Example ]
>> dirlist|sid=1
<< DIRLIST|SID=1|BEGIN|items=2
<<  DIRLIST|SID=1|FID=0|NAME=giana_sounds|DATE=1057590000|SIZE=512|USER=nobody|GROUP=nobody|PERM=drwxrwxrwx|type=directory
<< DIRLIST|SID=1|FID=1|NAME=debug_main.gba|DATE=1057590000|SIZE=417520|USER=nobody|GROUP=nobody|PERM=-rwxr-xr-x|type=file
<< DIRLIST|SID=1|END
<< IDLE|SID=1
>> dirlist|sid=1|RAW
<< DIRLIST|SID=1|BEGIN|items=1
<< DIRLIST|SID=1|FID=0|NAME=giana_sounds|DATE=1057590000|SIZE=512|USER=nobody|GROUP=nobody|PERM=drwxrwxrwx|type=directory|RAW=drwxrwxrwx++1+nobody++nobody+++++512+Jul++8++2003+giana_sounds
<< DIRLIST|SID=1|END
<< IDLE|SID=1


>> SID=<int>        - SID the dirlist reply is from.
=== QUOTE ===
>> FID=<int>        - File ID of this item. For QADD.
>> NAME=<str>        - Name of Directory OR File
>> DATE=<time>      - FID's date/time stamp. In seconds since 1970.
>> SIZE=<int>        - Size of Directory OR File
>> USER=<str>        - Owner of entry
>> GROUP=<str>      - Group of entry
>> PERM=<str>        - Permissions string. TODO - add octal as well.
>> FTYPE=<str>      - Type. "Directory", "File".
>> ITEMS=<int>      - Number of items in the list.
>> BEGIN            - First item sent,  start of list.
>> END              - Final item was sent, end of list.
 
 
[ Example ]
 
>> dirlist|sid=1
<< DIRLIST|SID=1|BEGIN|items=2
<< DIRLIST|SID=1|FID=0|NAME=giana_sounds|DATE=1057590000|SIZE=512|USER=nobody|GROUP=nobody|PERM=drwxrwxrwx|type=directory
<< DIRLIST|SID=1|FID=1|NAME=debug_main.gba|DATE=1057590000|SIZE=417520|USER=nobody|GROUP=nobody|PERM=-rwxr-xr-x|type=file
<< DIRLIST|SID=1|END
<< IDLE|SID=1
 
>> dirlist|sid=1|RAW
<< DIRLIST|SID=1|BEGIN|items=1
<< DIRLIST|SID=1|FID=0|NAME=giana_sounds|DATE=1057590000|SIZE=512|USER=nobody|GROUP=nobody|PERM=drwxrwxrwx|type=directory|RAW=drwxrwxrwx++1+nobody++nobody+++++512+Jul++8++2003+giana_sounds
<< DIRLIST|SID=1|END
<< IDLE|SID=1
 
 
 
 
 
 
 
** QUOTE


Send RAW FTP commands to the remote server without FXP.One's
Send RAW FTP commands to the remote server without FXP.One's
involvement. Typically used for SITE commands.
involvement. Typically used for SITE commands.


[ Minimal Required Fields]
>> SID=<int>        - SID of the session
>> MSG=<str>        - RAW Command to execute.


[ Minimal Required Fields]
[ Optional Arguments ]
>> LOG              - Send all strings with command, like SESSIONNEW


>> SID=<int>        - SID of the session
[ Returns ]
>> MSG=<str>        - RAW Command to execute.
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE. (If FTP reply < 300) code=0
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)


[ Example ]
>> QUOTE|SID=1|MSG=SITE uptime
<< QUOTE|SID=1|CODE=0|MSG=200 Uptime: 2d, 1h, 52m, 50s.
<< IDLE|SID=1
>> QUOTE|SID=1|LOG|MSG=SITE WHO
<< QUOTE|SID=1|CODE=-1|OK|MSG=200- [ WHO ]
<< QUOTE|SID=1|CODE=-1|OK|MSG=Total users online:  1              Total active data:  0   
<< QUOTE|SID=1|CODE=0|MSG=200 WHO command successful.


[ Optional Arguments ]
=== CWD ===
 
>> LOG              - Send all strings with command, like SESSIONNEW
 
 
[ Returns ]
 
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE. (If FTP reply < 300) code=0
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
 
 
[ Example ]
 
>> QUOTE|SID=1|MSG=SITE uptime
<< QUOTE|SID=1|CODE=0|MSG=200 Uptime: 2d, 1h, 52m, 50s.
<< IDLE|SID=1
 
>> QUOTE|SID=1|LOG|MSG=SITE WHO
<< QUOTE|SID=1|CODE=-1|OK|MSG=200- [ WHO ]
<< QUOTE|SID=1|CODE=-1|OK|MSG=Total users online:  1              Total active data:  0   
<< QUOTE|SID=1|CODE=0|MSG=200 WHO command successful.
 
 
 
 
 
 
 
 
** CWD


Change the Current Working Directory of the remote server.  
Change the Current Working Directory of the remote server.  
ie. "cd files/"
ie. "cd files/"


[ Minimal Required Fields]
>> SID=<int>        - SID of the session
>> PATH=<str>      - New desired directory. or:
>> FID=<int>        - or: FID of directory.


[ Minimal Required Fields]
[ Optional Arguments ]
>> LOG              - Send all strings with command, like SESSIONNEW


>> SID=<int>        - SID of the session
[ Returns ]
>> PATH=<str>      - New desired directory. or:
>> FID=<int>        - or: FID of directory.
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)


[ Example ]
>> CWD|SID=1|PATH=Giana_Sisters_GBA
<< CWD|SID=1|CODE=0|MSG=250 CWD command successful.


[ Optional Arguments ]
=== PWD ===
 
>> LOG              - Send all strings with command, like SESSIONNEW
 
 
[ Returns ]
 
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
 
 
[ Example ]
 
>> CWD|SID=1|PATH=Giana_Sisters_GBA
<< CWD|SID=1|CODE=0|MSG=250 CWD command successful.
 
 
 
 
 
** PWD


Return the Current Working Directory path.
Return the Current Working Directory path.


[ Minimal Required Fields]
>> SID=<int>        - SID of the session


[ Minimal Required Fields]
[ Optional Arguments ]
>> LOG              - Send all strings with command, like SESSIONNEW


>> SID=<int>        - SID of the session
[ Returns ]
 
 
>> SID=<int>        - SID of the session
[ Optional Arguments ]
>> CODE=<int>      - Command return status CODE.
 
>> PATH=<str>      - The parsed current PATH.    [1]
>> LOG              - Send all strings with command, like SESSIONNEW
>> MSG=<str>        - Command return message. (Only final message
 
                      unless you issue LOG)
 
[ Returns ]
 
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
>> PATH=<str>      - The parsed current PATH.    [1]
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)


[1] Warning, PATH is only returned if FXP.One successfully managed to
[1] Warning, PATH is only returned if FXP.One successfully managed to
Line 674: Line 567:
and I can fix the parser.
and I can fix the parser.


[ Example ]
>> PWD|SID=1
<< PWD|SID=1|CODE=0|PATH=/Giana_Sisters_GBA/|MSG=257 "/Giana_Sisters_GBA/" is current directory.


[ Example ]
=== SIZE ===
 
>> PWD|SID=1
<< PWD|SID=1|CODE=0|PATH=/Giana_Sisters_GBA/|MSG=257 "/Giana_Sisters_GBA/" is current directory.
 
 
 
 
 
 
 
 
** SIZE


Return the size of a file on the remote server. Not this will give
Return the size of a file on the remote server. Not this will give
errors on directories on most FTPDs.
errors on directories on most FTPDs.


[ Minimal Required Fields]
>> SID=<int>        - SID of the session
>> PATH=<str>      - Name of File.  or:
>> FID=<int>        - or: FID of file.


[ Minimal Required Fields]
[ Optional Arguments ]
>> LOG              - Send all strings with command, like SESSIONNEW


>> SID=<int>        - SID of the session
[ Returns ]
>> PATH=<str>      - Name of Fileor:
>> FID=<int>       - or: FID of file.
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
  >> SIZE=<int>       - The size of the file.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)


[ Example ]
>> SIZE|SID=1|PATH=giana2k.xm.zip
<< SIZE|SID=1|CODE=0|SIZE=287688|MSG=213 287688


[ Optional Arguments ]
=== DELE ===
 
>> LOG              - Send all strings with command, like SESSIONNEW
 
 
[ Returns ]
 
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
>> SIZE=<int>      - The size of the file.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
 
 
[ Example ]
 
>> SIZE|SID=1|PATH=giana2k.xm.zip
<< SIZE|SID=1|CODE=0|SIZE=287688|MSG=213 287688
 
 
 
 
** DELE


Delete a single file on the remote server. You can either issue by
Delete a single file on the remote server. You can either issue by
Line 728: Line 606:
returned by DIRLIST.
returned by DIRLIST.


[ Minimal Required Fields]
>> SID=<int>        - SID of the session
>> PATH=<str>      - Name of File.  or:
>> FID=<int>        - or: FID of file.


[ Minimal Required Fields]
  [ Optional Arguments ]
 
>> SID=<int>        - SID of the session
>> LOG              - Send all strings with command, like SESSIONNEW
>> PATH=<str>      - Name of File. or:
>> FID=<int>        - or: FID of file.
 
 
[ Optional Arguments ]
 
>> LOG              - Send all strings with command, like SESSIONNEW
 
 
[ Returns ]
 
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
 
 
[ Example ]
 
>> DELE|SID=1|PATH=delete_this.bin
<< DELE|SID=1|CODE=0|MSG=213 DELE command successful.


[ Returns ]
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)


[ Example ]
>> DELE|SID=1|PATH=delete_this.bin
<< DELE|SID=1|CODE=0|MSG=213 DELE command successful.


 
=== MKD ===
 
 
** MKD


Create a new directory on the remote server.
Create a new directory on the remote server.


[ Minimal Required Fields]
>> SID=<int>        - SID of the session
>> PATH=<str>      - Name of Directory.


[ Minimal Required Fields]
[ Optional Arguments ]
>> LOG              - Send all strings with command, like SESSIONNEW


>> SID=<int>        - SID of the session
[ Returns ]
>> PATH=<str>      - Name of Directory.
 
>> SID=<int>        - SID of the session
 
>> CODE=<int>      - Command return status CODE.
[ Optional Arguments ]
>> MSG=<str>        - Command return message. (Only final message
 
                      unless you issue LOG)
>> LOG              - Send all strings with command, like SESSIONNEW
 
 
[ Returns ]
 
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
 
 
[ Example ]
 
>> MKD|SID=1|PATH=New Folder
<< MKD|SID=1|CODE=0|MSG=213 MKD command successful.


[ Example ]
>> MKD|SID=1|PATH=New Folder
<< MKD|SID=1|CODE=0|MSG=213 MKD command successful.


** RMD
=== RMD ===


Delete a single directory on the remote server. You can either issue by
Delete a single directory on the remote server. You can either issue by
Line 795: Line 659:
returned by DIRLIST.
returned by DIRLIST.


[ Minimal Required Fields]
>> SID=<int>        - SID of the session
>> PATH=<str>      - Name of Directory.  or:
>> FID=<int>        - or: FID of directory.


[ Minimal Required Fields]
[ Optional Arguments ]
>> LOG              - Send all strings with command, like SESSIONNEW


>> SID=<int>        - SID of the session
[ Returns ]
>> PATH=<str>      - Name of Directoryor:
>> FID=<int>        - or: FID of directory.
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
  >> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)


[ Example ]
>> RMD|SID=1|PATH=delete_this_dir
<< RMD|SID=1|CODE=0|MSG=213 RMD command successful.


[ Optional Arguments ]
=== SITE ===
 
>> LOG              - Send all strings with command, like SESSIONNEW
 
 
[ Returns ]
 
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
 
 
[ Example ]
 
>> RMD|SID=1|PATH=delete_this_dir
<< RMD|SID=1|CODE=0|MSG=213 RMD command successful.
 
 
 
 
 
 
 
** SITE


Send a SITE command to the remote server.  
Send a SITE command to the remote server.  


[ Minimal Required Fields]
>> SID=<int>        - SID of the session
>> CMD=<str>        - Command and arguments to send.


[ Minimal Required Fields]
[ Optional Arguments ]
 
>> SID=<int>        - SID of the session
>> LOG              - Send all strings with command, like SESSIONNEW
>> CMD=<str>        - Command and arguments to send.
 
 
[ Optional Arguments ]
 
>> LOG              - Send all strings with command, like SESSIONNEW
 
 
[ Returns ]
 
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
 
 
[ Example ]
 
>> SITE|SID=1|CMD=WHO
<< SITE|SID=1|CODE=0|MSG=200 Command Successful.
 
 
 


[ Returns ]
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)


[ Example ]
>> SITE|SID=1|CMD=WHO
<< SITE|SID=1|CODE=0|MSG=200 Command Successful.


** REN
=== REN ===


Rename a file or directory. Supply the originating name by either
Rename a file or directory. Supply the originating name by either
passing FROM or a valid FID, as well as the resulting TO name.
passing FROM or a valid FID, as well as the resulting TO name.


[ Minimal Required Fields]
>> SID=<int>        - SID of the session
>> FROM=<str>      - Source name. or:
>> FID=<int>        - or: FID of entry.
>> TO=<str>        - Destination name.


[ Minimal Required Fields]
[ Optional Arguments ]
>> LOG              - Send all strings with command, like SESSIONNEW


>> SID=<int>        - SID of the session
[ Returns ]
>> FROM=<str>      - Source name. or:
>> FID=<int>        - or: FID of entry.
>> SID=<int>        - SID of the session
>> TO=<str>        - Destination name.
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)


[ Example ]
>> REN|SID=1|FROM=oldfilename.bin|TO=newfilename.bin
<< REN|SID=1|CODE=0|MSG=250 RNTO command successful.


[ Optional Arguments ]
=== MDTM ===
 
>> LOG              - Send all strings with command, like SESSIONNEW
 
 
[ Returns ]
 
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
 
 
[ Example ]
 
>> REN|SID=1|FROM=oldfilename.bin|TO=newfilename.bin
<< REN|SID=1|CODE=0|MSG=250 RNTO command successful.
 
 
 
 
 
 
 
** MDTM


Return the date and time of a file. (But not directories, according to
Return the date and time of a file. (But not directories, according to
Line 906: Line 741:
path, or absolute path), or optionally use FID as returned by DIRLIST.
path, or absolute path), or optionally use FID as returned by DIRLIST.


[ Minimal Required Fields]
>> SID=<int>        - SID of the session
>> PATH=<str>      - Name of Directory.  or:
>> FID=<int>        - or: FID of directory.


[ Minimal Required Fields]
[ Optional Arguments ]
>> LOG              - Send all strings with command, like SESSIONNEW


>> SID=<int>        - SID of the session
  [ Returns ]
>> PATH=<str>      - Name of Directory. or:
>> FID=<int>        - or: FID of directory.
>> SID=<int>        - SID of the session
 
>> CODE=<int>      - Command return status CODE.
 
>> MSG=<str>        - Command return message. (Only final message
[ Optional Arguments ]
                      unless you issue LOG)
 
>> LOG              - Send all strings with command, like SESSIONNEW
 
 
[ Returns ]
 
>> SID=<int>        - SID of the session
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)


[ Example ]
>> MDTM|SID=1|PATH=somefile.bin
<< MDTM|SID=1|CODE=0|MSG=213 19970205115719


[ Example ]


>> MDTM|SID=1|PATH=somefile.bin
<< MDTM|SID=1|CODE=0|MSG=213 19970205115719


== QUEUES ==


 
=== QUEUENEW ===
 
 
 
 
 
22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)~~
QUEUES
22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)~~
 
** QUEUENEW


Create a new QUEUE by associating two SIDs with it. These are
Create a new QUEUE by associating two SIDs with it. These are
Line 950: Line 774:
destination does not work)
destination does not work)


[ Minimal Required Fields]
>> NORTH_SID=<int>  - SID of the session, out of two.
>> SOUTH_SID=<int>  - SID of the session, out of two.


[ Minimal Required Fields]
[ Optional Arguments ]
[ Returns ]
>> QID=<int>        - Queue ID for queue operations.


>> NORTH_SID=<int> - SID of the session, out of two.
  [ Example ]
>> SOUTH_SID=<int>  - SID of the session, out of two.
 
>> queuenew|north_sid=1|south_sid=2
 
<< QUEUENEW|CODE=0|QID=1|MSG=Queue created.
[ Optional Arguments ]
 
 
 
[ Returns ]
 
>> QID=<int>        - Queue ID for queue operations.


 
=== QADD ===
[ Example ]
 
>> queuenew|north_sid=1|south_sid=2
<< QUEUENEW|CODE=0|QID=1|MSG=Queue created.
 
 
 
 
 
 
 
 
 
** QADD


Add a new items to a specified queue. This is quite a versatile
Add a new items to a specified queue. This is quite a versatile
Line 985: Line 796:
parts to it. Except for special QTYPE values, see below.
parts to it. Except for special QTYPE values, see below.


1) The source information. The easiest way here is to use the FID
# The source information. The easiest way here is to use the FID option, if you have previously done a DIRLIST command. This will take the required source information from the directory cache. If FID is not used, or you wish to override information from the FID, you can specify the source information manually. The name of the item can either be specified by SRCDIR+SRCNAME OR SRCPATH. (SRCPATH = SRCDIR/SRCNAME). The extra SRC options, like SRCSIZE, and SRCREST are optional. Both are used for Resume purposes, as well as finally CPS calculations.
  option, if you have previously done a DIRLIST command. This will
# The destination information. This is copied from the source. However, you can optionally override any of this. For example specifying a different DSTNAME would transfer and rename the file at the same time. The PATH is made up the same way as source, specify one of the two in: (DSTPATH = DSTDIR/DSTNAME)
  take the required source information from the directory cache.
# Queue position. This can be omitted for default queue positioning. However if the specific position is desired, you can use @=<int|FIRST|LAST> to specify Nth position, FIRST position or LAST position in the queue.
 
# Optional modifiers. The default behaviour of a SITE is to always RESUME unless specified otherwise using the "resume" option to the site definition. The default for a queue item is also to resume. You can override this default for THIS queue item by specifying "OVERWRITE" or "RESUME". The latter is useful if the site's default has been changed to OVERWRITE. You can also specify QTYPE for this addition, either due to manual queuing, or to override the FID type. If you get it wrong, the queue processing will also get it wrong.
  If FID is not used, or you wish to override information from the
  FID, you can specify the source information manually. The name of
  the item can either be specified by SRCDIR+SRCNAME OR SRCPATH.
  (SRCPATH = SRCDIR/SRCNAME).
 
  The extra SRC options, like SRCSIZE, and SRCREST are optional. Both
  are used for Resume purposes, as well as finally CPS calculations.
 
2) The destination information. This is copied from the
  source. However, you can optionally override any of this. For
  example specifying a different DSTNAME would transfer and rename
  the file at the same time. The PATH is made up the same way as
  source, specify one of the two in:
  (DSTPATH = DSTDIR/DSTNAME)
 
3) Queue position. This can be omitted for default queue
  positioning. However if the specific position is desired, you can
  use @=<int|FIRST|LAST> to specify Nth position, FIRST position or
  LAST position in the queue.
 
4) Optional modifiers. The default behaviour of a SITE is to always
  RESUME unless specified otherwise using the "resume" option to the
  site definition. The default for a queue item is also to
  resume. You can override this default for THIS queue item by
  specifying "OVERWRITE" or "RESUME". The latter is useful if the
  site's default has been changed to OVERWRITE. You can also specify
  QTYPE for this addition, either due to manual queuing, or to
  override the FID type. If you get it wrong, the queue processing
  will also get it wrong.
 


Alternatively, you can use QTYPE to set non transfer type items. At
Alternatively, you can use QTYPE to set non transfer type items. At
Line 1,026: Line 807:
STOP item. It makes no difference as to which SRC you pick.
STOP item. It makes no difference as to which SRC you pick.


[ Minimal Required Fields]
>> QID=<int>        - Queue ID
>> SRC=<str>        - Specify which SID is the source. Either "NORTH"
                      or "SOUTH".
EITHER:
>> FID=<int>        - File ID to use as source
OR:
>> SRCPATH=<str>    - Full path of the source file
OR:
>> SRCNAME=<str>    - Name of source file.
>> SRCDIR=<str>    - Directory path containing source file.
OR:
>> QTYPE=STOP      - Insert a soft stop item


 
[ Optional Arguments ]
[ Minimal Required Fields]
 
>> SRCNAME=<str>    - Name of source file
>> QID=<int>        - Queue ID
>> SRCDIR=<str>    - Directory path containing source file
>> SRC=<str>        - Specify which SID is the source. Either "NORTH"
>> SRCPATH=<str>    - Full path, ie, SRCDIR/SRCNAME in one.
                      or "SOUTH".
>> SRCSIZE=<int>    - Size of the queue item.
EITHER:
>> SRCREST=<int>    - Restart point of queue item (files only).
>> FID=<int>        - File ID to use as source
>> DSTNAME=<str>    - Name of destination file, OR obtained from source
OR:
>> DSTDIR=<str>    - Directory path containing destination file, OR
>> SRCPATH=<str>    - Full path of the source file
                      obtained from source
OR:
>> DSTPATH=<str>    - Full path, ie, DSTDIR/DSTNAME in one. OR
>> SRCNAME=<str>    - Name of source file.
                      obtained from source.
>> SRCDIR=<str>    - Directory path containing source file.
>> DSTSIZE=<int>    - Size of the queue item.  
OR:
>> DSTREST=<int>    - Restart point of queue item (files only).
>> QTYPE=STOP      - Insert a soft stop item
>> QTYPE=<str>      - Type of queue item. Either "directory",
 
                      "file" or "stop". [1]
 
>> RESUME          - Resume file if possible.
[ Optional Arguments ]
>> OVERWRITE        - Do not resume, overwrite destination
 
>> @=<int|str>      - Queue position, int or FIRST/LAST strings.
>> SRCNAME=<str>    - Name of source file
>> SRCDIR=<str>    - Directory path containing source file
>> SRCPATH=<str>    - Full path, ie, SRCDIR/SRCNAME in one.
>> SRCSIZE=<int>    - Size of the queue item.
>> SRCREST=<int>    - Restart point of queue item (files only).
>> DSTNAME=<str>    - Name of destination file, OR obtained from source
>> DSTDIR=<str>    - Directory path containing destination file, OR
                      obtained from source
>> DSTPATH=<str>    - Full path, ie, DSTDIR/DSTNAME in one. OR
                      obtained from source.
>> DSTSIZE=<int>    - Size of the queue item.  
>> DSTREST=<int>    - Restart point of queue item (files only).
>> QTYPE=<str>      - Type of queue item. Either "directory",
                      "file" or "stop". [1]
>> RESUME          - Resume file if possible.
>> OVERWRITE        - Do not resume, overwrite destination
>> @=<int|str>      - Queue position, int or FIRST/LAST strings.


[1] More types will come. The default type is "file".
[1] More types will come. The default type is "file".


[ Returns ]
>> QID=<int>        - Queue ID
>> CODE=<int>      - Command return status CODE.
>> ITEMS=<int>      - Number of items in the queue
>> MSG=<str>        - Command return message.
>> @=<int>          - Position in the queue item was inserted.
>> SRCPATH=<str>    - Original source path used (to identify QADD reply, and use "@")
>> DSTPATH=<str>    - Original destination path used (to identify QADD reply, and use "@")
>> FID=<int>        - If QADD was called with FID=, the QADD reply will also contain FID.


[ Returns ]
[ Example ]
 
>> QID=<int>        - Queue ID
>> qadd|qid=1|src=north|fid=2
>> CODE=<int>      - Command return status CODE.
<< QADD|CODE=0|QID=1|ITEMS=1|@=0|SRCPATH=/test/srcfile.bin|DSTPATH=/dump/srcfile.bin|FID=2|Msg=Added successfully.
>> ITEMS=<int>      - Number of items in the queue
>> MSG=<str>        - Command return message.
>> QADD|QID=123|SRC=SOUTH|SRCPATH=/archive/thesis/bilingual.pdf|DSTPATH=/old/ducoments/obsolete.pdf|SRCSIZE=43523|OVERWRITE|QTYPE=file
>> @=<int>          - Position in the queue item was inserted.
<< QADD|CODE=0|QID=123|ITEMS=906|@=55|SRCPATH=/archive/thesis/bilingual.pdf|DSTPATH=/old/ducoments/obsolete.pdf|Msg=Added successfully.
 
 
[ Example ]
 
>> qadd|qid=1|src=north|fid=2
<< QADD|CODE=0|QID=1|ITEMS=1|@=0|Msg=Added successfully.
 
>> QADD|QID=123|SRC=SOUTH|SRCPATH=/archive/thesis/bilingual.pdf|DSTPATH=/old/ducoments/obsolete.pdf|SRCSIZE=43523|OVERWRITE|QTYPE=file
<< QADD|CODE=0|QID=123|ITEMS=906|@=55|Msg=Added successfully.
 


What is the default queue position when QADD is called, or during file
What is the default queue position when QADD is called, or during file
Line 1,097: Line 875:
This means, when it is expanding a directory, the queue ends up like:
This means, when it is expanding a directory, the queue ends up like:


FIRST
FIRST
    files that match fmovefirst
    files that match fmovefirst
    all other files
    all other files
    directories.
    directories.
LAST
LAST
 
 
 
 
 


** QLIST
=== QLIST ===


List all queues on the engine, and their current states.  
List all queues on the engine, and their current states.  


[ Minimal Required Fields]


[ Minimal Required Fields]
[ Optional Arguments ]


[ Returns ]
>> QID=<int>        - Queue ID
>> NORTH=<str>      - Name of the North site
>> SOUTH=<str>      - Name of the South site
>> ITEMS=<int>      - Number of queue items
>> STATUS=<str>    - Current processing state
>> ERRORS=<int>    - Number of items in the error queue.
>> KB/s=<int>      - Transfer speed of last completed transfer.
>> SUBSCRIBED      - Sent if client is subscribed to events from this queue.
>> BEGIN            - First item sent,  start of list.
>> END              - Final item was sent, end of list.


[ Example ]
>> qlist
<< QLIST|BEGIN
<< QLIST|QID=20|NORTH=ftp1|SOUTH=ds|ITEMS=1|STATUS=PROCESSING|ERRORS=0|SUBSCRIBED|KB/s=0.00
<< QLIST|END


[ Optional Arguments ]
=== QGET ===
 
 
 
[ Returns ]
 
>> QID=<int>        - Queue ID
>> NORTH=<str>      - Name of the North site
>> SOUTH=<str>      - Name of the South site
>> ITEMS=<int>      - Number of queue items
>> STATUS=<str>    - Current processing state
>> ERRORS=<int>    - Number of items in the error queue.
>> BEGIN          - First item sent,  start of list.
>> END            - Final item was sent, end of list.
 
 
[ Example ]
 
>> qlist
<< QLIST|BEGIN
<< QLIST|QID=1|NORTH=localhost2|SOUTH=localhost|ITEMS=1|STATUS=IDLE|ERRORS=0
<< QLIST|END
 
 
 
 
 
 
** QGET


Get the contents of a specific queue, all its queue items.
Get the contents of a specific queue, all its queue items.


[ Minimal Required Fields]
>> QID=<int>        - Queue ID


[ Minimal Required Fields]
[ Optional Arguments ]
 
>> QID=<int>        - Queue ID
 
 
[ Optional Arguments ]
 
 
 
[ Returns ]
 
>> QID=<int>        - Queue ID
>> @=<int>          - Position in the queue of item.
>> TYPE=<str>      - Item type, directory/file.
>> SRC=<str>        - Source SID is "NORTH" or "SOUTH".
>> SRCPATH=<str>    - Full path of source
>> SRCSIZE=<int>    - Source size, if known.
>> SRCREST=<int>    - Source restart point.
>> DSTPATH=<str>    - Full path of destination
>> DSTSIZE=<int>    - Destination size, if known.
>> DSTREST=<int>    - Destination restart point.
>> BEGIN            - First item sent,  start of list.
>> END              - Final item was sent, end of list.
 
 
[ Example ]
 
>> qget|qid=1
<< QGET|QID=1|ITEMS=1|BEGIN
<< QGET|QID=1|@=0|FTYPE=FILE|SRC=NORTH|SRCPATH=/Giana_Sisters_GBA//gfx_blocks.txt|SRCSIZE=9328|SRCREST=0|DSTPATH=/tmp//gfx_blocks.txt|DSTSIZE=0|DSTREST=0
<< QGET|QID=1|END
 


[ Returns ]
>> QID=<int>        - Queue ID
>> @=<int>          - Position in the queue of item.
>> FTYPE=<str>      - Item type, directory/file.
>> SRC=<str>        - Source SID is "NORTH" or "SOUTH".
>> SRCPATH=<str>    - Full path of source
>> SRCSIZE=<int>    - Source size, if known.
>> SRCREST=<int>    - Source restart point.
>> DSTPATH=<str>    - Full path of destination
>> DSTSIZE=<int>    - Destination size, if known.
>> DSTREST=<int>    - Destination restart point.
>> ITEMS=<int>      - Number of items in the list.
>> BEGIN            - First item sent,  start of list.
>> END              - Final item was sent, end of list.


[ Example ]
>> qget|qid=1
<< QGET|QID=1|ITEMS=1|BEGIN
<< QGET|QID=1|@=0|FTYPE=FILE|SRC=NORTH|SRCPATH=/Giana_Sisters_GBA//gfx_blocks.txt|
        SRCSIZE=9328|SRCREST=0|DSTPATH=/tmp//gfx_blocks.txt|DSTSIZE=0|DSTREST=0
<< QGET|QID=1|END


** QERR
=== QERR ===


Get the contents of a specific error queue, all its queue items.
Get the contents of a specific error queue, all its queue items.


[ Minimal Required Fields]
>> QID=<int>        - Queue ID


[ Minimal Required Fields]
[ Optional Arguments ]
 
>> QID=<int>        - Queue ID
 
 
[ Optional Arguments ]


[ Returns ]
>> QID=<int>        - Queue ID
>> QTYPE=<str>      - Item type, directory/file.
>> SRC=<NORTH|SOUTH>- This item's source site is North or South.
>> SRCPATH=<str>    - Full path of source
>> DSTPATH=<str>    - Full path of destination
>> SERR_<int>=<str> - Source errors, incrementing, and the reason string
>> DERR_<int>=<str> - Destination errors, incrementing, and the reason string
>> BEGIN            - First item sent,  start of list.
>> END              - Final item was sent, end of list.


[ Example ]
>> QERR|QID=1|BEGIN|ITEMS=1
<< QERR|QID=1|QTYPE=FILE|SRC=NORTH|SRCPATH=/Giana_Sisters_GBA//gfx_blocks.txt|DSTPATH=/tmp/tmp//gfx_blocks.txt|DERR_0=553 gfx_blocks.txt: Can't open for writing
<< QERR|QID=1|END


[ Returns ]
=== QDEL ===
 
>> QID=<int>        - Queue ID
>> QTYPE=<str>      - Item type, directory/file.
>> SRC=<NORTH|SOUTH>- This item's source site is North or South.
>> SRCPATH=<str>    - Full path of source
>> DSTPATH=<str>    - Full path of destination
>> SERR_<int>=<str> - Source errors, incrementing, and the reason string
>> DERR_<int>=<str> - Destination errors, incrementing, and the reason string
>> BEGIN            - First item sent,  start of list.
>> END              - Final item was sent, end of list.
 
 
[ Example ]
 
>> QERR|QID=1|BEGIN|ITEMS=1
<< QERR|QID=1|QTYPE=FILE|SRC=NORTH|SRCPATH=/Giana_Sisters_GBA//gfx_blocks.txt|DSTPATH=/tmp/tmp//gfx_blocks.txt|DERR_0=553 gfx_blocks.txt: Can't open for writing
<< QERR|QID=1|END
 
 
 
 
** QDEL


Delete an item in the queue. If a client wishes to delete multiple
Delete an item in the queue. If a client wishes to delete multiple
Line 1,242: Line 992:
QDEL commands. Ie, send QDEL commands in the order 8,4,1.
QDEL commands. Ie, send QDEL commands in the order 8,4,1.


[ Minimal Required Fields]
>> QID=<int>        - Queue ID
>> @=<int>          - Queue position of item to delete.


[ Minimal Required Fields]
[ Optional Arguments ]


>> QID=<int>        - Queue ID  
[ Returns ]
>> @=<int>          - Queue position of item to delete.
>> QID=<int>        - Queue ID
>> CODE=<int>      - Command return status CODE.
>> ITEMS=<int>      - Number of items in the queue
>> MSG=<str>        - Command return message.
>> @=<int>          - Position in the queue of item.


[ Example ]
>> qdel|qid=1|@=53
<< QDEL|QID=1|CODE=0|@=53|ITEMS=0


[ Optional Arguments ]
=== QMOVE ===
 
 
 
[ Returns ]
 
>> QID=<int>        - Queue ID
>> CODE=<int>      - Command return status CODE.
>> ITEMS=<int>      - Number of items in the queue
>> MSG=<str>        - Command return message.
>> @=<int>          - Position in the queue of item.
 
 
 
[ Example ]
 
>> qdel|qid=1|@=53
<< QDEL|QID=1|CODE=0|@=53|ITEMS=0
 
 
 
 
 
 
** QMOVE


Move an item in the queue from one position to a new position. It is
Move an item in the queue from one position to a new position. It is
Line 1,279: Line 1,018:
when a queue is active.
when a queue is active.


[ Minimal Required Fields]
>> QID=<int>        - Queue ID
>> FROM=<int>      - Queue position of item to move
>> TO=<str|int>    - New position, either <int> Nth place, or string
                      placement like in QADD. ("FIRST"/"LAST")


[ Minimal Required Fields]
[ Optional Arguments ]


>> QID=<int>        - Queue ID  
[ Returns ]
>> FROM=<int>      - Queue position of item to move
>> TO=<str|int>     - New position, either <int> Nth place, or string
>> QID=<int>        - Queue ID
                      placement like in QADD. ("FIRST"/"LAST")
>> CODE=<int>      - Command return status CODE.
>> ITEMS=<int>      - Number of items in the queue
>> MSG=<str>        - Command return message.
>> @=<int>         - Position where item was inserted.
>> FROM=<int>       - Position where item was originally from.


[ Example ]
>> qmove|qid=1|from=0|to=last
<< QMOVE|QID=1|@=23|FROM=0|CODE=0|ITEMS=3|MSG=Moved


[ Optional Arguments ]
=== QGRAB ===
 
 
 
[ Returns ]
 
>> QID=<int>        - Queue ID
>> CODE=<int>      - Command return status CODE.
>> ITEMS=<int>      - Number of items in the queue
>> MSG=<str>        - Command return message.
>> @=<int>          - Position where item was inserted.
>> FROM=<int>      - Position where item was originally from.
 
 
 
[ Example ]
 
>> qmove|qid=1|from=0|to=last
<< QMOVE|QID=1|@=23|FROM=0|CODE=0|ITEMS=3|MSG=Moved
 
 
 
 
 
 
 
** QGRAB


QGRAB lets a client take control of an idle queue, and the queue's
QGRAB lets a client take control of an idle queue, and the queue's
Line 1,322: Line 1,049:
messages.  
messages.  


[ Minimal Required Fields]
>> QID=<int>        - Queue id in question


[ Minimal Required Fields]
[ Optional Arguments ]
 
>> QID=<int>        - Queue id in question
 
 
[ Optional Arguments ]


 
[ Returns ]
 
[ Returns ]
>> QID=<int>        - Queue id
 
>> ITEMS=<int>      - Current number of items in queue
>> QID=<int>        - Queue id
>> NORTH_SID=<int>  - Session ID of North site, if connected.
>> ITEMS=<int>      - Current number of items in queue
>> SOUTH_SID=<int>  - Session ID of South site, if connected.
>> NORTH_SID=<int>  - Session ID of North site, if connected.
>> NORTH_SITEID=int - Site ID of North site, for future SESSIONNEW
>> SOUTH_SID=<int>  - Session ID of South site, if connected.
>> SOUTH_SITEID=int - Site ID of South site, for future SESSIONNEW
>> NORTH_SITEID=int - Site ID of North site, for future SESSIONNEW
>> NORTH_NAME=<str> - Site name of North site
>> SOUTH_SITEID=int - Site ID of South site, for future SESSIONNEW
>> SOUTH_NAME=<str> - Site name of South site
>> NORTH_NAME=<str> - Site name of North site
>> CODE=<int>      - Command return status CODE.
>> SOUTH_NAME=<str> - Site name of South site
>> CODE=<int>      - Command return status CODE.


As well as potential async commands.
As well as potential async commands.


[ Example ]
[ Example ]
 
 
>> qgrab|qid=1
>> qgrab|qid=1
<< CONNECT|SID=34
<< CONNECT|SID=34
<< IDLE|SID=34
<< IDLE|SID=34
<< CONNECT|SID=35
<< CONNECT|SID=35
<< IDLE|SID=35
<< IDLE|SID=35
<< QGRAB|QID=1|CODE=0|ITEMS=0|NORTH_SID=34|SOUTH_SID=35|NORTH_SITEID=0|SOUTH_SITEID=4|NORTH_NAME=localhost|SOUTH_NAME=distro_site
<< QGRAB|QID=1|CODE=0|ITEMS=0|NORTH_SID=34|SOUTH_SID=35|NORTH_SITEID=0|SOUTH_SITEID=4|NORTH_NAME=localhost|SOUTH_NAME=distro_site


 
=== QCOMPARE ===
 
 
 
 
 
** QCOMPARE


Compare the two directories in the session cache against each other,
Compare the two directories in the session cache against each other,
Line 1,371: Line 1,088:
with the smaller size should they differ.
with the smaller size should they differ.


[ Minimal Required Fields]
>> QID=<int>        - Queue ID


[ Minimal Required Fields]
[ Optional Arguments ]
 
>> QID=<int>        - Queue ID
 
 
[ Optional Arguments ]
 
 
 
[ Returns ]
 
>> QID=<int>        - Queue ID
>> NORTH_FID=<int,> - Comma separated list of FIDs for the NORTH site.
>> SOUTH_FID=<int,> - Comma separated list of FIDs for the NORTH site.
>> BEGIN            - First item sent,  start of list.
>> END              - Final item was sent, end of list.
 
 
 
[ Example ]
 
>> qcompare|qid=1
<< QCOMPARE|QID=1|BEGIN
<< QCOMPARE|QID=1|NORTH_FID=1,3,4,5,6,7,8,10,13,15,16,17,18,19,21,22,23,24,25,26,28,29,31,33,35,36,37,38,39,40,41,42,43,44,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,69,70,71,72,73,74,75,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,104,105,107,108,109,110,111,112,113,115,116,117,118
<< QCOMPARE|QID=1|NORTH_FID=119,120,121,122,123,124,125,126,127,128,129,130,132,133,134,135,136,137,138,139,140,141,142,144,145,146,147,148,149
<< QCOMPARE|QID=1|SOUTH_FID=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,77,78,79,80,81,82,84,85,87,88,89,90,91,92,93,95,96,97,98,99,100,101,102,104,105,106,107,109
<< QCOMPARE|QID=1|SOUTH_FID=110,113,114,115
<< QCOMPARE|QID=1|END|MSG=Completed comparison.
 
 


[ Returns ]
>> QID=<int>        - Queue ID
>> NORTH_FID=<int,> - Comma separated list of FIDs for the NORTH site.
>> SOUTH_FID=<int,> - Comma separated list of FIDs for the NORTH site.
>> BEGIN            - First item sent,  start of list.
>> END              - Final item was sent, end of list.


[ Example ]
>> qcompare|qid=1
<< QCOMPARE|QID=1|BEGIN
<< QCOMPARE|QID=1|NORTH_FID=1,3,4,5,6,7,8,10,13,15,16,17,18,19,21,22,23,24,25,26,28,29,31,33,35,36,37,38
,39,40,41,42,43,44,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,69,70,71,72,73,
74,75,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,104,105,
107,108,109,110,111,112,113,115,116,117,118
<< QCOMPARE|QID=1|NORTH_FID=119,120,121,122,123,124,125,126,127,128,129,130,132,133,134,135,136,137,
138,139,140,141,142,144,145,146,147,148,149
<< QCOMPARE|QID=1|SOUTH_FID=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,
29,30,31,32,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,
64,65,66,67,68,69,70,71,72,73,74,75,77,78,79,80,81,82,84,85,87,88,89,90,91,92,93,95,96,97,98,99,100,
101,102,104,105,106,107,109
<< QCOMPARE|QID=1|SOUTH_FID=110,113,114,115
<< QCOMPARE|QID=1|END|MSG=Completed comparison.


 
=== QUEUEFREE ===
 
 
** QUEUEFREE


Release an existing queue, release its sessions, and queue items.
Release an existing queue, release its sessions, and queue items.


[ Minimal Required Fields]
>> QID=<int>        - Queue ID


[ Minimal Required Fields]
[ Optional Arguments ]


>> QID=<int>        - Queue ID
[ Returns ]
 
 
>> QID=<int>        - Queue ID
[ Optional Arguments ]
>> CODE=<int>      - Command return status CODE.
 
>> MSG=<str>        - Command return message.
 
 
[ Returns ]
 
>> QID=<int>        - Queue ID
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>        - Command return message.
 
 
[ Example ]
 
>> QUEUEFREE|QID=1
<< QUEUEFREE|CODE=0|QID=1|Msg=Queue released.


[ Example ]
>> QUEUEFREE|QID=1
<< QUEUEFREE|CODE=0|QID=1|Msg=Queue released.


 
=== GO ===
 
 
 
 
 
 
 
 
 
 
 
** GO


Issue "GO" to a queue. Request FXP.One engine to start processing the
Issue "GO" to a queue. Request FXP.One engine to start processing the
Line 1,456: Line 1,149:
command to receive controls of the SIDs, if still existing.
command to receive controls of the SIDs, if still existing.


[ Minimal Required Fields]
>> QID=<int>        - Queue ID


[ Minimal Required Fields]
[ Optional Arguments ]
>> SUBSCRIBE        - Subscribe to queue status (QS) and queue changes (QC) 


>> QID=<int>        - Queue ID
[ Returns ]
>> QID=<int>        - Queue ID
>> CODE=<int>      - Command return status CODE if failed.
>> MSG=<str>        - Command return message.


 
  [ Example ]
[ Optional Arguments ]
 
>> GO|QID=1
>> SUBSCRIBE        - Subscribe to queue status (QS) and queue changes (QC)  
<< GO|QID=1|CODE=0|MSG=Queue processing started.
 
 
 
[ Returns ]
 
>> QID=<int>        - Queue ID
>> CODE=<int>      - Command return status CODE if failed.
>> MSG=<str>        - Command return message.
 
 
[ Example ]
 
>> GO|QID=1
<< GO|QID=1|CODE=0|MSG=Queue processing started.




=== STOP ===


Issue "STOP" to a queue. Request FXP.One engine to attempt to stop processing the
queue and its items. There are currently three types on STOP levels, the default is
"SOFT", which will stop once the current transfer is complete. "HARD" which will attempt to send the FTP command 'ABOR' to both FTPDs to gracefully interrupt the current transfer. (local client might need ABOR support added) Finally, the "DROP" method which will log out of both FTPDs and hence forcing the transfer to stop. Once the queue processing has stopped, the FXP.One engine will issue a "QC|IDLE" command, after which the client can issue QGRAB.




[ Minimal Required Fields]
>> QID=<int>        - Queue ID


[ Optional Arguments ]
>> HARD            - Send FTP 'ABOR' to FTP daemons
>> DROP            - Drop connections to FTP daemons to cancel transfers. 


[ Returns ]
>> QID=<int>        - Queue ID
>> CODE=<int>      - Command return status CODE if failed.
>> MSG=<str>        - Command return message.


[ Example ]
>> STOP|QID=1
<< STOP|QID=1|CODE=0|MSG=Stop initiated, please wait..
<< QC|QID=1|IDLE|MSG=Stop command successful.


 
=== QC ===
** QC


This is a receive-only command, sent by the FXP.One engine when there
This is a receive-only command, sent by the FXP.One engine when there
is a Queue-Change. It is only sent if the client requested to
is a Queue-Change. It is only sent if the client requested to
SUBSCRIBE to a queue, either using the "GO" command, or the "QGET"
SUBSCRIBE to a queue, either using the "GO" command, or the "QGET"
(Not yet implemented).


[ Minimal Required Fields]


[ Minimal Required Fields]
[ Optional Arguments ]


[ Returns ]
>> MOVE            - Item has moved to a new position. Comes with
                      FROM= and TO= keys.
>> REMOVE          - Remove items from queue. All items with higher
                      position are decremented by one. Uses @.
>> INSERT          - New item inserted into queue. Uses @, SRCPATH,
  DSTPATH, QTYPE, SRCSIZE.
>> EMPTY            - Empty queue, processing stops.
>> IDLE            - Queue moved into IDLE state, either from QTYPE=STOP or
                      in response to a STOP command.


[ Example ]
<< QC|QID=1|REMOVE|@=0
<< QC|QID=1|MOVE|FROM=0|TO=18
<< QC|QID=1|INSERT|@=0|SRCPATH=/testfile.dat|DSTPATH=/tmp/testing.bin|QTYPE=FILE|SRCSIZE=29734


[ Optional Arguments ]
When the FXP.One is expanding a directory, it may send a large amount of '''QC|INSERT''' items to the clients,
 
so in an attempt to assist clients to avoid frequent display refreshing, the engine will add the tag '''|EXPANDING''' to some items, and
 
follow with a '''QS|REFRESH''' command to indicate the directory expansion has completed. It is considered an optimisation and can
 
be ignored.
[ Returns ]
 
>> MOVE            - Item has moved to a new position. Comes with
                      FROM= and TO= keys.
>> REMOVE          - Remove items from queue. All items with higher
                      position are decremented by one. Uses @.
>> INSERT          - New item inserted into queue. Uses @, SRCPATH,
  DSTPATH, QTYPE, SRCSIZE.
>> EMPTY            - Empty queue, processing stops.


 
=== QS ===
[ Example ]
 
<< QC|QID=1|REMOVE|@=0
<< QC|QID=1|MOVE|FROM=0|TO=18
<< QC|QID=1|INSERT|@=0|SRCPATH=/testfile.dat|DSTPATH=/tmp/testing.bin|QTYPE=FILE|SRCSIZE=29734
 
 
 
 
 
 
 
 
 
** QS


This is a receive-only command, sent by the FXP.One engine when there
This is a receive-only command, sent by the FXP.One engine when there
Line 1,542: Line 1,243:
"@=0" is implied.
"@=0" is implied.


[ Minimal Required Fields]


[ Minimal Required Fields]
[ Optional Arguments ]


 
[ Returns ]
 
[ Optional Arguments ]
>> START            - Started processing the item at the top of queue.
 
      SRCPATH=<str>  - Included for human readability.
 
>> SRCCWD=<str>    - Changed to new directory on source
 
>> DSTCWD=<str>    - Changed to new directory on destination
[ Returns ]
>> MKD=<str>        - Created new directory on destination
 
>> XFRACT          - File transfer has started (received 150)
>> START            - Started processing the item at the top of queue.
      SECURE=<yes/no>- Was Secure Data negotiations successful.
    SRCNAME=<str>  - Included for human readability.
      REST=<int>    - Are we resuming this file
>> SRCCWD=<str>    - Changed to new directory on source
      SIZE=<int>    - Final source size (from SIZE command)
>> DSTCWD=<str>    - Changed to new directory on destination
>> XFREND          - File transfer finished (successfully, 226).
>> MKD=<str>        - Created new directory on destination
      TIME=<int>    - Duration of transfer [1]
>> XFRACT          - File transfer has started (received 150)
      KB/s=<int>    - Estimated speed of transfer [1]
    SECURE=<yes/no>- Was Secure Data negotiations successful.
>> FAILED          - Attempted transfer failed
    REST=<int>    - Are we resuming this file
      SERR=<str>    - Error reasons (source failed)
    SIZE=<int>    - Final source size (from SIZE command)
      DERR=<str>    - Error reasons (destination failed)
>> XFREND          - File transfer finished (successfully, 226).
      COUNT=<int>    - This failure count.
    TIME=<int>    - Duration of transfer [1]
    KB/s=<int>    - Estimated speed of transfer [1]
>> FAILED          - Attempted transfer failed
    SERR=<str>    - Error reasons (source failed)
    DERR=<str>    - Error reasons (destination failed)
    COUNT=<int>    - This failure count.


[1] Please be aware that we can only measure the time difference
[1] Please be aware that we can only measure the time difference
Line 1,577: Line 1,273:
transfer is, the more inaccurate the speed computation will be.
transfer is, the more inaccurate the speed computation will be.


[ Example ]
<< QS|QID=1|MSG=Processing directory|SRCPATH=/Giana_Sisters_GBA//giana_sounds|DSTPATH=/tmp/tmp//giana_sounds
<< QS|QID=1|SRCCWD=/Giana_Sisters_GBA/
<< QS|QID=1|START|@=0|SRCPATH=/Giana_Sisters_GBA//giana_sounds/might_be_game_sounds.pcm
<< QS|QID=1|SRCCWD=/Giana_Sisters_GBA/giana_sounds/
<< QS|QID=1|DSTMKD=/tmp/tmp//giana_sounds
<< QS|QID=1|MSG=Transfer started|SECURE=YES|REST=0|SIZE=29734
<< QS|QID=1|MSG=Transfer complete|TIME=0.00|KB/s=0.00


[ Log of a complete session ]
>> GO|QID=1|SUBSCRIBE
<< QS|QID=1|MSG=Processing directory|SRCPATH=/Giana_Sisters_GBA//giana_sounds|DSTPATH=/tmp/tmp//giana_sounds
<< QS|QID=1|SRCCWD=/Giana_Sisters_GBA/
<< QC|QID=1|REMOVE|@=0
<< QC|QID=1|INSERT|@=0|SRCPATH=/Giana_Sisters_GBA/giana_sounds//might_be_game_sounds.pcm|DSTPATH=/tmp/tmp//giana_sounds/might_be_game_sounds.pcm|QTYPE=FILE|SRCSIZE=29734
<< QS|QID=1|START|@=0|SRCNAME=might_be_game_sounds.pcm
<< QS|QID=1|SRCCWD=/Giana_Sisters_GBA/giana_sounds/
<< QS|QID=1|MKD=/tmp/tmp//giana_sounds
<< QS|QID=1|MSG=Transfer started|SECURE=YES|REST=0|SIZE=29734
<< QS|QID=1|MSG=Transfer complete|TIME=0.00|KB/s=0.00
<< QC|QID=1|REMOVE|@=0


[ Example ]
=== SUBSCRIBE ===
 
<< QS|QID=1|MSG=Processing directory|SRCPATH=/Giana_Sisters_GBA//giana_sounds|DSTPATH=/tmp/tmp//giana_sounds
<< QS|QID=1|SRCCWD=/Giana_Sisters_GBA/
<< QS|QID=1|START|@=0|SRCNAME=might_be_game_sounds.pcm
<< QS|QID=1|SRCCWD=/Giana_Sisters_GBA/giana_sounds/
<< QS|QID=1|DSTMKD=/tmp/tmp//giana_sounds
<< QS|QID=1|MSG=Transfer started|SECURE=YES|REST=0|SIZE=29734
<< QS|QID=1|MSG=Transfer complete|TIME=0.00|KB/s=0.00
 
 
 
[ Log of a complete session ]
 
>> GO|QID=1|SUBSCRIBE
<< QS|QID=1|MSG=Processing directory|SRCPATH=/Giana_Sisters_GBA//giana_sounds|DSTPATH=/tmp/tmp//giana_sounds
<< QS|QID=1|SRCCWD=/Giana_Sisters_GBA/
<< QC|QID=1|REMOVE|@=0
<< QC|QID=1|INSERT|@=0|SRCPATH=/Giana_Sisters_GBA/giana_sounds//might_be_game_sounds.pcm|DSTPATH=/tmp/tmp//giana_sounds/might_be_game_sounds.pcm|QTYPE=FILE|SRCSIZE=29734
<< QS|QID=1|START|@=0|SRCNAME=might_be_game_sounds.pcm
<< QS|QID=1|SRCCWD=/Giana_Sisters_GBA/giana_sounds/
<< QS|QID=1|MKD=/tmp/tmp//giana_sounds
<< QS|QID=1|MSG=Transfer started|SECURE=YES|REST=0|SIZE=29734
<< QS|QID=1|MSG=Transfer complete|TIME=0.00|KB/s=0.00
<< QC|QID=1|REMOVE|@=0
 
 
 
 
 
 
 
** SUBSCRIBE


Request to receive the QS and QC commands from a processing queue. A
Request to receive the QS and QC commands from a processing queue. A
Line 1,617: Line 1,303:
not started by itself.
not started by itself.


[ Minimal Required Fields]
>> QID=<int>        - Queue ID
[ Optional Arguments ]
>> TOGGLE          - If already subscribed, issue un-subscribe instead.


[ Minimal Required Fields]
[ Returns ]
>> QID=<int>        - Queue ID
>> MSG=<str>        - Command return message.
>> UNSUBSCRIBED    - If issued TOGGLE the result was to be un-subscribed.


>> QID=<int>        - Queue ID
[ Example ]
>> SUBSCRIBE|QID=1|TOGGLE
<< SUBSCRIBE|QID=1|CODE=0|MSG=Subscribed


=== UNSUBSCRIBE ===


[ Optional Arguments ]
Stop being subscribed to a queue.


>> TOGGLE          - If already subscribed, issue un-subscribe instead.
[ Minimal Required Fields]
>> QID=<int>        - Queue ID


[ Optional Arguments ]


[ Returns ]
>> QID=<int>        - Queue ID
>> MSG=<str>        - Command return message.


[ Returns ]
[ Example ]
>> UNSUBSCRIBE|QID=1
<< UNSUBSCRIBE|QID=1|CODE=0|MSG=Unsubscribed


>> QID=<int>        - Queue ID
>> MSG=<str>        - Command return message.
>> UNSUBSCRIBED    - If issued TOGGLE the result was to be un-subscribed.


=== QCLONE (v1.7) ===


[ Example ]
Take a created queue (idle or active) and make an exact copy of the queue. If source queue is active, connect both sides and start processing. Some clients refer to this as "add another thread".


>> SUBSCRIBE|QID=1|TOGGLE
[ Minimal Required Fields]
<< SUBSCRIBE|QID=1|CODE=0|MSG=Subscribed
>> QID=<int>        - Queue ID


[ Optional Arguments ]
>> START=<yna>      - Start processing (Y), do not start processing (N), or copy source (A). Default is (A).
>> SUBSCRIBE        - Also subscribe to queue processing notices.


[ Returns ]
>> QID=<int>        - Source Queue ID, same as given.
>> NEWQID=<int>        - Newly created clone Queue ID
>> MSG=<str>        - Command return message.


[ Example ]
>> QCLONE|QID=123
<< QCLONE|QID=123|NEWQID=124|CODE=0|MSG=Queue 124 processing started.


In reality, it is a little more verbose, here is an actual example:
>> QCLONE|QID=1
<< SESSIONNEW|SITEID=15|CODE=0|SID=3
<< SESSIONNEW|SITEID=16|CODE=0|SID=4
<< QUEUENEW|CODE=0|QID=2|NORTH_SID=3|SOUTH_SID=4|MSG=Queue created.
<< QCLONE|CODE=0|QID=1|NEW_QID=2|Msg=Cloned and created queue
<< CONNECT|SID=3|SSL
<< IDLE|SID=3
<< CONNECT|SID=4|SSL
<< IDLE|SID=4
<< GO|QID=2|CODE=0|MSG=Queue processing started.


** UNSUBSCRIBE
== ADMINISTRATIVE COMMANDS ==


Stop being subscribed to a queue.
=== QUIT ===


Disconnect from the FXP.One engine. The client can also just close the connection without worry.


[ Minimal Required Fields]


[ Minimal Required Fields]
[ Optional Arguments ]


>> QID=<int>        - Queue ID
[ Returns ]
>> Will disconnect on you, how rude.


[ Example ]
>> QUIT
<< Connection closed by remote host.


[ Optional Arguments ]
=== HELP ===


Display available commands at this privilege level.


[ Minimal Required Fields]


[ Optional Arguments ]


[ Returns ]
[ Returns ]
>> MSG=<str>        - Command return message.
>> CODE=<int>      - Command return status CODE.


>> QID=<int>        - Queue ID
[ Example ]
>> MSG=<str>        - Command return message.
>> HELP
<< HELP|CODE=0|Msg= QUIT HELP WHO SHUTDOWN SITEADD SITELIST SITEMOD SITEDEL SESSIONNEW SESSIONFREE
        DIRLIST QUEUENEW QADD QLIST QGET QERR QGRAB QDEL QMOVE QCOMPARE QUEUEFREE GO STOP CWD PWD
        SIZE DELE MKD RMD SITE REN MDTM QUOTE SUBSCRIBE UNSUBSCRIBE.


=== WHO ===


[ Example ]
Display a list of users connected to this FXP.One engine.


>> UNSUBSCRIBE|QID=1
[ Minimal Required Fields]
<< UNSUBSCRIBE|QID=1|CODE=0|MSG=Unsubscribed


[ Optional Arguments ]


[ Returns ]
>> NAME=<str>      - User name of login session
>> HOST=<ip>        - IP address of login session
>> PORT=<port>      - Remote port number
>> SSL=<yes|no>    - Is connection encrypted
>> CLIENTS=<int>    - Number of items in the queue
>> BEGIN            - First item sent,  start of list.
>> END              - Final item was sent, end of list.


[ Example ]
>> WHO
<< WHO|BEGIN|CLIENTS=3
<< WHO|NAME=admin|HOST=127.0.0.1|PORT=58597|SSL=yes
<< WHO|NAME=admin|HOST=220.150.239.57|PORT=1135|SSL=yes
<< WHO|NAME=admin|HOST=127.0.0.1|PORT=58540|SSL=no
<< WHO|END|Msg=Command Completed.


=== SETPASS ===


Change the login password on the FXP.One engine. This is strongly encouraged.


[ Minimal Required Fields]
>> OLD=<str>        - Old/current password of this login session.
>> NEW=<str>        - New/future password for this login session.


22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)~~
  [ Optional Arguments ]
  ADMINISTRATIVE COMMANDS
22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)22:18, 27 February 2006 (MST)~~


[ Returns ]
>> MSG=<str>        - Command return message.
>> CODE=<int>      - Command return status CODE.


[ Example ]
>> SETPASS|OLD=admin|NEW=newpass
<< SETPASS|CODE=0|MSG=New password has been set.
<< SETPASS|CODE=1502|MSG=Login incorrect


** SHUTDOWN
=== SHUTDOWN ===


Shutdown the FXP.One engine have it completely exit.  
Shutdown the FXP.One engine have it completely exit.  


[ Minimal Required Fields]


[ Minimal Required Fields]
[ Optional Arguments ]
>> LASTCLIENT      - Only shutdown if THIS client is the last one.


>>  
[ Returns ]
>> Might disconnect on you, how rude.


[ Optional Arguments ]
[ Example ]
 
>> LASTCLIENT      - Only shutdown if THIS client is the last one.
>> SHUTDOWN
 
<< SHUTDOWN|CODE=0
 
<< Connection closed by remote host.
[ Returns ]
 
>> Might disconnect on you, how rude.
 
 
[ Example ]
 
>> SHUTDOWN
<< SHUTDOWN|CODE=0
<< Connection closed by remote host.

Latest revision as of 02:34, 23 May 2018

Documentation for FXP.One API commands and protocol. This documentation file is maintained at http://www.lundman.net/wiki/index.php?title=Protocol and exported to other formats. This documentation is purposly maintained rigorously as to aid all client developers of FXP.One.


Connecting

WELCOME

When you connect to the FXP.One server, you should receive a greeting string, similar to:

>> WELCOME|name=FXP.Oned|version=0.1|build=18|SSL=optional

Pay special attention to the SSL flag here, since if it is enforced, and you attempt plain text authentication (which will fail) you are exposing the user and password.

The "version" is the server version and build The "protocol" is the protocol version, which you can check to be of the same Major type as your application knows.

The "SSL" field can be "disabled", "optional", and "forced".


SSL

Initiate SSL challenge. This is sent by clients requesting the remainder of the session to be in SSL. This requires that FXP.One engine's WELCOME message is either "forced" or "optional".


[ Minimal Required Fields]
[ Optional Arguments ]
[ Returns ]

>> CODE=<int>       - Command return status CODE.
>> OK               - Initiation request accepted, start SSL phase.
>> MSG              - Human-readable message string
[ Example ]

<< SSL   
>> SSL|CODE=0|Msg=Attempting SSL negotiations.


AUTH

Send USER and PASS for authentication. This requires a valid user and password pair already registered on FXP.One. If FXP.One was started with no user database files, it will create one with the account user "admin" and password "admin".


[ Minimal Required Fields]

>> USER=<str>       - USER name
>> PASS=<str>       - PASSWORD
[ Optional Arguments ]
[ Returns ]

>> CODE=<int>       - Failure code.
>> MSG=<str>        - Human readable string message.
[ Example ]

<< AUTH|USER=admin|PASS=admin
>> AUTH|CODE=0|MSG=Successful

>> AUTH|CODE=502|MSG=Login incorrect

>> AUTH|CODE=503|MSG=Secure channel enforced.


SITES

For SITE structure definition, see Site_Definition http://www.lundman.net/wiki/index.php/Site_Definition

SITEADD

Add a new site to the system.

[ Minimal required fields ]

>> NAME=<str>      - Name of site. Not used by engine, need not be unique.  
>> HOST=<str>      - Hostname of remote FTP server
>> USER=<str>      - User name for authentication on remote FTP server
>> PASS=<str>      - and password
[ Optional Arguments ]

>> PORT=<int>      - Optional PORT of remote FTP server. Default 21.
>> PASSIVE=<yna>   - Use passive for directory listings? [See YNA type]
>> FXP_PASSIVE=yna - Can this remote FTP only take PASV, or PORT? 
>> CONTROL_TLS=yna - Attempt SSL/TLS on Control channel?
>> DATA_TLS=<yna>  - Attempt SSL/TLS on Data channel? Site needs CCSN feat
>> IFACE=<ip>      - Optional IP to bind() to.
>> IPORT=<int>     - Optional PORT to bind() to.
>> DESIRED_TYPE=yna- Binary or Ascii mode transfers. [See YNA type]
                   - AUTO and engine will set Binary for transfers.
>> RESUME=<yna>    - Attempt to Resume before Overwrite. 
>> RESUME_LAST=yna - Re-queue items needed resume last in the queue.
>> PRET=<yna>      - Send the extended Pre-Transfer command before transfer[1]
>> FSKIPLIST=<str> - File skip list [2]
>> DSKIPLIST=<str> - Directory skip list [2]
>> FPASSLIST=<str> - File pass list [3]
>> DPASSLIST=<str> - Directory pass list [3]
>> FSKIPEMPTY=<yna>- Skip empty files
>> DSKIPEMPTY=<yna>- Skip empty directories
>> FMOVEFIRST=<str>- Pattern file matches to force queue at top
>> DMOVEFIRST=<str>- Pattern directory matches to force queue at top

[1] AUTO means it will use this feature if it is reported by the remote FTPD in the FEAT/features command reply.

[2] Uses fnmatch(3) syntax pattern matching. Most file globbal you can do on the command line, including "*?[]", but excluding "{}". String consists of slash separated patterns. eg "*.dat/*readme.txt*".

All skiplists, passlists and movefirst are processed on the DESTINATION site.

[3] Opposite to skiplist. The default is for passlist to be empty, which is the equivalent of "*". A syntax like "*ENGLISH*" would ensure only entries which matched string would be queued, and others are dropped. Uses same pattern syntax as skiplist.

[ Extended Optional Arguments ]

As a special feature to the clients connecting to the FXP.One engine,
we also allow for storing of own, arbitrary, key/value pairs. As long
as the "key" is not the same as any of the above keys, or that of the
predefined reserved keys. (eg. "TYPE", "END")

>> <str>=<str>     - Store extra client information.

For example:

"...|extrafield=somestuff|OS=Unix"
[ Returns ]

>> SITEID=<int>     - Site ID of created site.
>> CODE=<int>       - Command return status CODE.
>> MSG=<str>        - Command return message.
[ Example ]

>> SITEADD|NAME=local|host=localhost|port=56688|user=mp3|pass=mp3|passive=1|fxp_passive=2|control_TLS=2|data_TLS=2|extrafield=somestuff|OS=Unix
<< SITEADD|CODE=0|SITEID=12|Msg=Added successfully.
[ Caveat ]

It is recommended that all clients that wish to store information
in the site database, to prefix their key values with a unique string,
perhaps the name of the application. For example:

lundfxp_sitecmd_1=SITE WHO
lundfxp_lastlogin=015368281

SITELIST

Lists all defined sites.

[ Minimal Required Fields]

[ Optional Arguments ]
>> SHORT           - Send only short list (siteid + name)
>> SITEID=<int>    - Send only specified siteid. Sends no BEGIN/END keys.
[ Returns ]

>> SITEID=<int>    - Site ID being displayed.
>> NAME=<str>      - Name of site. Not used by engine, need not be unique.  
>> HOST=<str>      - Hostname of remote FTP server
>> USER=<str>      - User name for authentication on remote FTP server
>> PASS=<str>      - and password
>> PORT=<int>      - Optional PORT of remote FTP server. [1]
>> PASSIVE=<yna>   - Use passive for directory listings? [See YNA type]
>> FXP_PASSIVE=yna - Can this remote FTP only take PASV, or PORT? 
>> CONTROL_TLS=yna - Attempt SSL/TLS on Control channel?
>> DATA_TLS=<yna>  - Attempt SSL/TLS on Data channel? Site needs CCSN feat
>> IFACE=<ip>      - Optional IP to bind() to. [1]
>> IPORT=<int>     - Optional PORT to bind() to. [1]
>> DESIRED_TYPE=yna- Binary or Ascii mode transfers. [1]
>> RESUME=<yna>    - Attempt to Resume before Overwrite. [1]
>> RESUME_LAST=yna - Re-queue items needed resume last in the queue. [1]
>> PRET=<yna>      - Send the extended Pre-Transfer command before transfer[1]
>> FSKIPLIST=<str> - File skip list [1]
>> DSKIPLIST=<str> - Directory skip list [1]
>> FPASSLIST=<str> - File pass list [1]
>> DPASSLIST=<str> - Directory pass list [1]
>> FSKIPEMPTY=<yna>- Skip empty files [1]
>> DSKIPEMPTY=<yna>- Skip empty directories [1]
>> FMOVEFIRST=<str>- Pattern file matches to force queue at top [1]
>> DMOVEFIRST=<str>- Pattern directory matches to force queue at top [1]
>> BEGIN           - First item sent,   start of list.
>> END             - Final item was sent, end of list.

[1] This information is only sent if the current value differs from the default "AUTO" type. Or, in the case of strings, where the string is defined (not-empty).

[ Example ]

<< SITELIST|BEGIN
>> SITELIST|SITEID=2|NAME=localhost|HOST=127.0.0.1|PORT=21|USER=mp3|PASS=mp3|PASSIVE=1|FXP_PASSIVE=2|CONTROL_TLS=2|DATA_TLS=2|optional_variable=roger moore
>> SITELIST|SITEID=1|NAME=localhost2|HOST=127.0.0.1|PORT=56688|USER=mp3|PASS=mp3|PASSIVE=1|FXP_PASSIVE=2|CONTROL_TLS=2|DATA_TLS=2
>> SITELIST|END
<< SITELIST|SHORT
>> SITELIST|BEGIN
>> SITELIST|SITEID=1|NAME=localhost
>> SITELIST|END
<< SITELIST|SITEID=2
>> SITELIST|SITEID=2|NAME=localhost|HOST=127.0.0.1|PORT=21|USER=mp3|PASS=mp3|PASSIVE=1|FXP_PASSIVE=2|CONTROL_TLS=2|DATA_TLS=2|optional_variable=roger moore

SITEMOD

Modify an existing site's key/value pairs. Specify as many items as desired to be changed. Items not specified in the command are left as they are. To delete a key/pair, send the key with an empty value field. For example "key=".

[ Minimal required fields ]

>> SITEID=<int>    - Site ID of created site.
[ Optional Arguments ]

>> NAME=<str>      - Name of site. Not used by engine, need not be unique.  
>> HOST=<str>      - Hostname of remote FTP server
>> USER=<str>      - User name for authentication on remote FTP server
>> PASS=<str>      - and password
>> PORT=<int>      - Optional PORT of remote FTP server. Default 21.
>> IFACE=<ip>      - Optional IP to bind() to.
>> IPORT=<int>     - Optional PORT to bind() to.
>> DESIRED_TYPE=yna- Binary or Ascii mode transfers. [See YNA type]
                   - AUTO and engine will set Binary for transfers.
>> RESUME=<yna>    - Attempt to Resume before Overwrite. 
>> RESUME_LAST=yna - Re-queue items needed resume last in the queue.
>> PRET=<yna>      - Send the extended Pre-Transfer command before transfer[1]
>> FSKIPLIST=<str> - File skip list [2]
>> DSKIPLIST=<str> - Directory skip list [2]
>> FPASSLIST=<str> - File pass list [3]
>> DPASSLIST=<str> - Directory pass list [3]
>> FSKIPEMPTY=<yna>- Skip empty files
>> DSKIPEMPTY=<yna>- Skip empty directories
>> FMOVEFIRST=<str>- Pattern file matches to force queue at top
>> DMOVEFIRST=<str>- Pattern directory matches to force queue at top

[1] AUTO means it will use this feature if it is reported by the remote FTPD in the FEAT/features command reply.

[2] Uses fnmatch(3) syntax pattern matching. Most file globbal you can do on the command line, including "*?[]", but excluding "{}". String consists of slash separated patterns. eg "*.dat/*readme.txt*".

[3] Opposite to skiplist. The default is for passlist to be empty, which is the equivalent of "*". A syntax like "*ENGLISH*" would ensure only entries which matched string would be queued, and others are dropped. Uses same pattern syntax as skiplist.

[ Extended Optional Arguments ]

As a special feature to the clients connecting to the FXP.One engine,
we also allow for storing of own, arbitrary, key/value pairs. As long
as the "key" is not the same as any of the above keys, or that of the
predefined reserved keys. (eg. "TYPE", "END")

>> <str>=<str>     - Store extra client information.
For example:

"...|extrafield=somestuff|OS=Unix"
[ Returns ]

>> SITEID=<int>    - Site ID of created site.
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>       - Command return message.
[ Example ]

>> SITEMOD|SITEID=1|fskiplist=*ENGLISH*,*COMPLETE*|fskipempty=YES
<< SITEMOD|CODE=0|SITEID=1|Msg=Modified successfully.
[ Caveat ]

It is recommended that all clients that wish to store information
in the site database, to prefix their key values with a unique string,
perhaps the name of the application. For example:

lundfxp_sitecmd_1=SITE WHO
lundfxp_lastlogin=015368281

SITEDEL

Delete an existing site.

[ Minimal required fields ]

>> SITEID=<int>    - Site ID of created site.
[ Optional Arguments ]
[ Extended Optional Arguments ]
[ Returns ]

>> SITEID=<int>    - Site ID of created site.
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>       - Command return message.
[ Example ]

>> SITEDEL|SITEID=12
<< SITEDEL|CODE=0|MSG=Site deleted.
[ Caveat ]

Sites aren't actually deleted, just not saved to disk. This means
active sessions using said siteid created before the SITEDEL command
was issued will continue to work.


SESSIONS

A session refer to a site connection. The API will ask for a new session to a specific site (specified with SITEID) and a session will be created. If the connection is lost or closed, _the session is closed_. The API will have to request a new session if so desired.

SESSIONNEW

Request a new session to site, returning a SID to session.

[ Minimal Required Fields]

>> SITEID=<int>    - Which remote server to connect to, from SITELIST.
[ Optional Arguments ]

>> LOG=1             - Normal login is silent. With LOG the API received
                     all verbose messages.
[ Returns ]

>> SID=<int>       - Value of the new SID for all future commands with
                    sessions
>> CODE=<int>      - Command return status CODE.
>> MSG=<str>       - Command return message.
[ Example ]

>> sessionnew|siteid=0
<< SESSIONNEW|SITEID=0|SID=1
<< IDLE|SID=1

SESSIONFREE

Release a session, and disconnect from remote host.

[ Minimal Required Fields]

>> SID=<int>        - SID of the session to close.
[ Optional Arguments ]
[ Returns ]

>> SID=<int>         - SID of the session closed.
>> CODE=<int>        - Command return status CODE.
>> MSG=<str>         - Command return message.
[ Example ]

>> SESSIONFREE|SID=1
<< SESSIONFREE|CODE=0|SID=1|MSG=Success

ASYNC

Is not a command but client need to be aware that there are messages that come in at any time.

<< CONNECT|SID=1

Send once a session has successfully logged in and is ready to answer
queries. Initially it was thought that IDLE would be enough, but
clients will generally want to auto-trigger some commands upon
connection establish, so we provide this event.
<< IDLE|SID=1        

Site is idle, ready for more commands. Informative only as you can
always issue commands, they will be queued.
<< DISCONNECT|SID=1|CODE=429|MSG=Undefined error: 0

The session was disconnected. Any further references to the SID (in
this case "1") will result in an error. 
<< LOG|SID=1|MSG=

You can request a SESSIONNEW to be logged (LOG), or, most of the
commands take an option "LOG" to specify that logging is desired
during the execution of said command. This means the engine will
forward all messages from the remote FTPD to the client. For example:
>> CWD|SID=2|path=/requests
<< CWD|SID=2|CODE=0|MSG=250 CWD command successful.

>> CWD|SID=2|path=requests|LOG
<< CWD|SID=2|CODE=-1|MSG=250-REQUESTS ADMIN: roger
<< CWD|SID=2|CODE=-1|MSG=250- 
<< CWD|SID=2|CODE=-1|MSG=250-RULES: Please use format of REQ- and FILLED-  
<< CWD|SID=2|CODE=-1|MSG=250-       and please do not dump single files into  
<< CWD|SID=2|CODE=-1|MSG=250-     root as it just make the folder look untidy!
<< CWD|SID=2|CODE=-1|MSG=250-Available space: 14676.22 MB.
<< CWD|SID=2|CODE=0|MSG=250 CWD command successful.


FTP COMMANDS

DIRLIST

Request a directory listing from remote server/session.

[ Minimal Required Fields]

>> SID=<int>        - SID of the session
[ Optional Arguments ]

// Optional: PATH, ARGS, RAW, CACHEOK, LOG
>> PATH=<str>        - Additional path element [1]
>> ARGS=<str>        - Additional list options [2]
>> RAW=<int>         - Include entire list line in FID reply.(unparsed)
>> CACHEOK           - If cache is populated, avoid remote server
>> LOG               - Send all strings with dirlist, like SESSIONNEW

[1] Warning. It is not recommended that you use this to supply different paths as the internal cache engine will get mighty confused. [2] Some "ls"/LIST options will break the internal parser. For example, "-1" would remove the long listing style.

[ Returns ] 

>> SID=<int>         - SID the dirlist reply is from.
>> FID=<int>         - File ID of this item. For QADD.
>> NAME=<str>        - Name of Directory OR File 
>> DATE=
[ Example ]

>> dirlist|sid=1
<< DIRLIST|SID=1|BEGIN|items=2
<<  DIRLIST|SID=1|FID=0|NAME=giana_sounds|DATE=1057590000|SIZE=512|USER=nobody|GROUP=nobody|PERM=drwxrwxrwx|type=directory
<< DIRLIST|SID=1|FID=1|NAME=debug_main.gba|DATE=1057590000|SIZE=417520|USER=nobody|GROUP=nobody|PERM=-rwxr-xr-x|type=file
<< DIRLIST|SID=1|END
<< IDLE|SID=1

>> dirlist|sid=1|RAW
<< DIRLIST|SID=1|BEGIN|items=1
<< DIRLIST|SID=1|FID=0|NAME=giana_sounds|DATE=1057590000|SIZE=512|USER=nobody|GROUP=nobody|PERM=drwxrwxrwx|type=directory|RAW=drwxrwxrwx++1+nobody++nobody+++++512+Jul++8++2003+giana_sounds
<< DIRLIST|SID=1|END
<< IDLE|SID=1

QUOTE

Send RAW FTP commands to the remote server without FXP.One's involvement. Typically used for SITE commands.

[ Minimal Required Fields]

>> SID=<int>        - SID of the session
>> MSG=<str>        - RAW Command to execute.
[ Optional Arguments ]

>> LOG              - Send all strings with command, like SESSIONNEW
[ Returns ]

>> SID=<int>        - SID of the session
>> CODE=<int>       - Command return status CODE. (If FTP reply < 300) code=0
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
[ Example ]

>> QUOTE|SID=1|MSG=SITE uptime
<< QUOTE|SID=1|CODE=0|MSG=200 Uptime: 2d, 1h, 52m, 50s.
<< IDLE|SID=1

>> QUOTE|SID=1|LOG|MSG=SITE WHO
<< QUOTE|SID=1|CODE=-1|OK|MSG=200- [ WHO ]
<< QUOTE|SID=1|CODE=-1|OK|MSG=Total users online:   1              Total active data:   0     
<< QUOTE|SID=1|CODE=0|MSG=200 WHO command successful.

CWD

Change the Current Working Directory of the remote server. ie. "cd files/"

[ Minimal Required Fields]

>> SID=<int>        - SID of the session
>> PATH=<str>       - New desired directory. or:
>> FID=<int>        - or: FID of directory.
[ Optional Arguments ]

>> LOG              - Send all strings with command, like SESSIONNEW
[ Returns ]

>> SID=<int>        - SID of the session
>> CODE=<int>       - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
[ Example ]

>> CWD|SID=1|PATH=Giana_Sisters_GBA
<< CWD|SID=1|CODE=0|MSG=250 CWD command successful.

PWD

Return the Current Working Directory path.

[ Minimal Required Fields]

>> SID=<int>        - SID of the session
[ Optional Arguments ]

>> LOG              - Send all strings with command, like SESSIONNEW
[ Returns ]

>> SID=<int>        - SID of the session
>> CODE=<int>       - Command return status CODE.
>> PATH=<str>       - The parsed current PATH.    [1]
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)

[1] Warning, PATH is only returned if FXP.One successfully managed to parse out the path from the reply. Some FTPD send non-standard replies. If you find one of these, send me an example output string and I can fix the parser.

[ Example ]

>> PWD|SID=1
<< PWD|SID=1|CODE=0|PATH=/Giana_Sisters_GBA/|MSG=257 "/Giana_Sisters_GBA/" is current directory.

SIZE

Return the size of a file on the remote server. Not this will give errors on directories on most FTPDs.

[ Minimal Required Fields]

>> SID=<int>        - SID of the session
>> PATH=<str>       - Name of File.  or:
>> FID=<int>        - or: FID of file.
[ Optional Arguments ]

>> LOG              - Send all strings with command, like SESSIONNEW
[ Returns ]

>> SID=<int>        - SID of the session
>> CODE=<int>       - Command return status CODE.
>> SIZE=<int>       - The size of the file.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
[ Example ]

>> SIZE|SID=1|PATH=giana2k.xm.zip
<< SIZE|SID=1|CODE=0|SIZE=287688|MSG=213 287688

DELE

Delete a single file on the remote server. You can either issue by name (relative path, or absolute path), or optionally use FID as returned by DIRLIST.

[ Minimal Required Fields]

>> SID=<int>        - SID of the session
>> PATH=<str>       - Name of File.  or:
>> FID=<int>        - or: FID of file.
[ Optional Arguments ]

>> LOG              - Send all strings with command, like SESSIONNEW
[ Returns ]

>> SID=<int>        - SID of the session
>> CODE=<int>       - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
[ Example ]

>> DELE|SID=1|PATH=delete_this.bin
<< DELE|SID=1|CODE=0|MSG=213 DELE command successful.

MKD

Create a new directory on the remote server.

[ Minimal Required Fields]

>> SID=<int>        - SID of the session
>> PATH=<str>       - Name of Directory.
[ Optional Arguments ]

>> LOG              - Send all strings with command, like SESSIONNEW
[ Returns ]

>> SID=<int>        - SID of the session
>> CODE=<int>       - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
[ Example ]

>> MKD|SID=1|PATH=New Folder
<< MKD|SID=1|CODE=0|MSG=213 MKD command successful.

RMD

Delete a single directory on the remote server. You can either issue by name (relative path, or absolute path), or optionally use FID as returned by DIRLIST.

[ Minimal Required Fields]

>> SID=<int>        - SID of the session
>> PATH=<str>       - Name of Directory.  or:
>> FID=<int>        - or: FID of directory.
[ Optional Arguments ]

>> LOG              - Send all strings with command, like SESSIONNEW
[ Returns ]

>> SID=<int>        - SID of the session
>> CODE=<int>       - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
[ Example ]

>> RMD|SID=1|PATH=delete_this_dir
<< RMD|SID=1|CODE=0|MSG=213 RMD command successful.

SITE

Send a SITE command to the remote server.

[ Minimal Required Fields]

>> SID=<int>        - SID of the session
>> CMD=<str>        - Command and arguments to send.
[ Optional Arguments ]

>> LOG              - Send all strings with command, like SESSIONNEW
[ Returns ]

>> SID=<int>        - SID of the session
>> CODE=<int>       - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
[ Example ]

>> SITE|SID=1|CMD=WHO
<< SITE|SID=1|CODE=0|MSG=200 Command Successful.

REN

Rename a file or directory. Supply the originating name by either passing FROM or a valid FID, as well as the resulting TO name.

[ Minimal Required Fields]

>> SID=<int>        - SID of the session
>> FROM=<str>       - Source name. or:
>> FID=<int>        - or: FID of entry.
>> TO=<str>         - Destination name.
[ Optional Arguments ]

>> LOG              - Send all strings with command, like SESSIONNEW
[ Returns ]

>> SID=<int>        - SID of the session
>> CODE=<int>       - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
[ Example ]

>> REN|SID=1|FROM=oldfilename.bin|TO=newfilename.bin
<< REN|SID=1|CODE=0|MSG=250 RNTO command successful.

MDTM

Return the date and time of a file. (But not directories, according to FTP RFC). The return data is in the format of yyyyMMddHHmmSS. For example, "213 19970205115719". You can either issue by name (relative path, or absolute path), or optionally use FID as returned by DIRLIST.

[ Minimal Required Fields]

>> SID=<int>        - SID of the session
>> PATH=<str>       - Name of Directory.  or:
>> FID=<int>        - or: FID of directory.
[ Optional Arguments ]

>> LOG              - Send all strings with command, like SESSIONNEW
[ Returns ]

>> SID=<int>        - SID of the session
>> CODE=<int>       - Command return status CODE.
>> MSG=<str>        - Command return message. (Only final message
                      unless you issue LOG)
[ Example ]

>> MDTM|SID=1|PATH=somefile.bin
<< MDTM|SID=1|CODE=0|MSG=213 19970205115719


QUEUES

QUEUENEW

Create a new QUEUE by associating two SIDs with it. These are currently named NORTH and SOUTH as a means to refer to either one uniquely without implying direction of transfer. (source and destination does not work)

[ Minimal Required Fields]

>> NORTH_SID=<int>  - SID of the session, out of two.
>> SOUTH_SID=<int>  - SID of the session, out of two.
[ Optional Arguments ]

[ Returns ]

>> QID=<int>        - Queue ID for queue operations.
[ Example ]

>> queuenew|north_sid=1|south_sid=2
<< QUEUENEW|CODE=0|QID=1|MSG=Queue created.

QADD

Add a new items to a specified queue. This is quite a versatile command which looks to take many arguments. As a command it has four parts to it. Except for special QTYPE values, see below.

  1. The source information. The easiest way here is to use the FID option, if you have previously done a DIRLIST command. This will take the required source information from the directory cache. If FID is not used, or you wish to override information from the FID, you can specify the source information manually. The name of the item can either be specified by SRCDIR+SRCNAME OR SRCPATH. (SRCPATH = SRCDIR/SRCNAME). The extra SRC options, like SRCSIZE, and SRCREST are optional. Both are used for Resume purposes, as well as finally CPS calculations.
  2. The destination information. This is copied from the source. However, you can optionally override any of this. For example specifying a different DSTNAME would transfer and rename the file at the same time. The PATH is made up the same way as source, specify one of the two in: (DSTPATH = DSTDIR/DSTNAME)
  3. Queue position. This can be omitted for default queue positioning. However if the specific position is desired, you can use @=<int|FIRST|LAST> to specify Nth position, FIRST position or LAST position in the queue.
  4. Optional modifiers. The default behaviour of a SITE is to always RESUME unless specified otherwise using the "resume" option to the site definition. The default for a queue item is also to resume. You can override this default for THIS queue item by specifying "OVERWRITE" or "RESUME". The latter is useful if the site's default has been changed to OVERWRITE. You can also specify QTYPE for this addition, either due to manual queuing, or to override the FID type. If you get it wrong, the queue processing will also get it wrong.

Alternatively, you can use QTYPE to set non transfer type items. At this time, there is only type "STOP". If you issue QTYPE=STOP there is no need to send information for 1), 2) or 4). Part 3) is optional. There is currently a bug where you have to specify SRC= field with the STOP item. It makes no difference as to which SRC you pick.

[ Minimal Required Fields]

>> QID=<int>        - Queue ID 
>> SRC=<str>        - Specify which SID is the source. Either "NORTH"
                      or "SOUTH".
EITHER:
>> FID=<int>        - File ID to use as source
OR:
>> SRCPATH=<str>    - Full path of the source file
OR:
>> SRCNAME=<str>    - Name of source file.
>> SRCDIR=<str>     - Directory path containing source file.
OR:
>> QTYPE=STOP       - Insert a soft stop item
[ Optional Arguments ]

>> SRCNAME=<str>    - Name of source file
>> SRCDIR=<str>     - Directory path containing source file
>> SRCPATH=<str>    - Full path, ie, SRCDIR/SRCNAME in one.
>> SRCSIZE=<int>    - Size of the queue item.
>> SRCREST=<int>    - Restart point of queue item (files only).
>> DSTNAME=<str>    - Name of destination file, OR obtained from source
>> DSTDIR=<str>     - Directory path containing destination file, OR
                      obtained from source
>> DSTPATH=<str>    - Full path, ie, DSTDIR/DSTNAME in one. OR
                      obtained from source.
>> DSTSIZE=<int>    - Size of the queue item. 
>> DSTREST=<int>    - Restart point of queue item (files only).
>> QTYPE=<str>      - Type of queue item. Either "directory",
                      "file" or "stop". [1]
>> RESUME           - Resume file if possible.
>> OVERWRITE        - Do not resume, overwrite destination
>> @=<int|str>      - Queue position, int or FIRST/LAST strings.

[1] More types will come. The default type is "file".

[ Returns ]

>> QID=<int>        - Queue ID
>> CODE=<int>       - Command return status CODE.
>> ITEMS=<int>      - Number of items in the queue
>> MSG=<str>        - Command return message.
>> @=<int>          - Position in the queue item was inserted.
>> SRCPATH=<str>    - Original source path used (to identify QADD reply, and use "@")
>> DSTPATH=<str>    - Original destination path used (to identify QADD reply, and use "@")
>> FID=<int>        - If QADD was called with FID=, the QADD reply will also contain FID.
[ Example ]

>> qadd|qid=1|src=north|fid=2
<< QADD|CODE=0|QID=1|ITEMS=1|@=0|SRCPATH=/test/srcfile.bin|DSTPATH=/dump/srcfile.bin|FID=2|Msg=Added successfully.

>> QADD|QID=123|SRC=SOUTH|SRCPATH=/archive/thesis/bilingual.pdf|DSTPATH=/old/ducoments/obsolete.pdf|SRCSIZE=43523|OVERWRITE|QTYPE=file
<< QADD|CODE=0|QID=123|ITEMS=906|@=55|SRCPATH=/archive/thesis/bilingual.pdf|DSTPATH=/old/ducoments/obsolete.pdf|Msg=Added successfully.

What is the default queue position when QADD is called, or during file transfers? When the API queues items, they will always be placed LAST unless otherwise specified.

As a default, files are added after all the (top) files, but before the first directory. Directories are added after all files, but before the first directory. (yes, it's the same). Which the exception of if the name matches "fmovefirst" or "dmovefirst", then it is inserted with "FIRST" position.

This means, when it is expanding a directory, the queue ends up like:

FIRST
    files that match fmovefirst
    all other files
    directories.
LAST

QLIST

List all queues on the engine, and their current states.

[ Minimal Required Fields]
[ Optional Arguments ]
[ Returns ]

>> QID=<int>        - Queue ID
>> NORTH=<str>      - Name of the North site
>> SOUTH=<str>      - Name of the South site
>> ITEMS=<int>      - Number of queue items
>> STATUS=<str>     - Current processing state
>> ERRORS=<int>     - Number of items in the error queue.
>> KB/s=<int>       - Transfer speed of last completed transfer.
>> SUBSCRIBED       - Sent if client is subscribed to events from this queue.
>> BEGIN            - First item sent,   start of list.
>> END              - Final item was sent, end of list.
[ Example ]

>> qlist
<< QLIST|BEGIN
<< QLIST|QID=20|NORTH=ftp1|SOUTH=ds|ITEMS=1|STATUS=PROCESSING|ERRORS=0|SUBSCRIBED|KB/s=0.00
<< QLIST|END

QGET

Get the contents of a specific queue, all its queue items.

[ Minimal Required Fields] 

>> QID=<int>        - Queue ID 
[ Optional Arguments ]
[ Returns ]

>> QID=<int>        - Queue ID
>> @=<int>          - Position in the queue of item.
>> FTYPE=<str>      - Item type, directory/file.
>> SRC=<str>        - Source SID is "NORTH" or "SOUTH".
>> SRCPATH=<str>    - Full path of source
>> SRCSIZE=<int>    - Source size, if known.
>> SRCREST=<int>    - Source restart point.
>> DSTPATH=<str>    - Full path of destination
>> DSTSIZE=<int>    - Destination size, if known.
>> DSTREST=<int>    - Destination restart point.
>> ITEMS=<int>      - Number of items in the list.
>> BEGIN            - First item sent,   start of list.
>> END              - Final item was sent, end of list.
[ Example ]

>> qget|qid=1
<< QGET|QID=1|ITEMS=1|BEGIN
<< QGET|QID=1|@=0|FTYPE=FILE|SRC=NORTH|SRCPATH=/Giana_Sisters_GBA//gfx_blocks.txt|
        SRCSIZE=9328|SRCREST=0|DSTPATH=/tmp//gfx_blocks.txt|DSTSIZE=0|DSTREST=0
<< QGET|QID=1|END

QERR

Get the contents of a specific error queue, all its queue items.

[ Minimal Required Fields]

>> QID=<int>        - Queue ID 
[ Optional Arguments ]
[ Returns ]

>> QID=<int>        - Queue ID
>> QTYPE=<str>      - Item type, directory/file.
>> SRC=<NORTH|SOUTH>- This item's source site is North or South.
>> SRCPATH=<str>    - Full path of source
>> DSTPATH=<str>    - Full path of destination
>> SERR_<int>=<str> - Source errors, incrementing, and the reason string
>> DERR_<int>=<str> - Destination errors, incrementing, and the reason string
>> BEGIN            - First item sent,   start of list.
>> END              - Final item was sent, end of list.
[ Example ]

>> QERR|QID=1|BEGIN|ITEMS=1
<< QERR|QID=1|QTYPE=FILE|SRC=NORTH|SRCPATH=/Giana_Sisters_GBA//gfx_blocks.txt|DSTPATH=/tmp/tmp//gfx_blocks.txt|DERR_0=553 gfx_blocks.txt: Can't open for writing
<< QERR|QID=1|END

QDEL

Delete an item in the queue. If a client wishes to delete multiple items, it is advised that the client pre-sorts the items list, and send it with highest queue position first, in descending order. It is an error to attempt to delete queue item at first position (@=0) if the queue is active.

Please be aware that since deleting a queue item early in the list, will affect queue items in a later position. That is to say, if you intend to delete items 1,4,8 from the queue, and you issue 3 QDEL commands "blindly" in the same order (1,4,8), the net effect will be that queue items 1,5,10 are actually deleted. When queue item 1 is deleted, item at position 4 is now 3, and item 5 is at position 4.

Either the clients need to be aware of the re-numbering and compensate for later commands, OR, much easier is to sort the list in descending order before issuing the QDEL commands. Ie, send QDEL commands in the order 8,4,1.

[ Minimal Required Fields]

>> QID=<int>        - Queue ID 
>> @=<int>          - Queue position of item to delete.
[ Optional Arguments ]
[ Returns ]

>> QID=<int>        - Queue ID
>> CODE=<int>       - Command return status CODE.
>> ITEMS=<int>      - Number of items in the queue
>> MSG=<str>        - Command return message.
>> @=<int>          - Position in the queue of item.
[ Example ]

>> qdel|qid=1|@=53
<< QDEL|QID=1|CODE=0|@=53|ITEMS=0

QMOVE

Move an item in the queue from one position to a new position. It is an error to move a queue item from, or to, the first position (@=0) when a queue is active.

[ Minimal Required Fields]

>> QID=<int>        - Queue ID 
>> FROM=<int>       - Queue position of item to move
>> TO=<str|int>     - New position, either <int> Nth place, or string
                      placement like in QADD. ("FIRST"/"LAST")
[ Optional Arguments ]
[ Returns ]

>> QID=<int>        - Queue ID
>> CODE=<int>       - Command return status CODE.
>> ITEMS=<int>      - Number of items in the queue
>> MSG=<str>        - Command return message.
>> @=<int>          - Position where item was inserted.
>> FROM=<int>       - Position where item was originally from.
[ Example ]

>> qmove|qid=1|from=0|to=last
<< QMOVE|QID=1|@=23|FROM=0|CODE=0|ITEMS=3|MSG=Moved

QGRAB

QGRAB lets a client take control of an idle queue, and the queue's sessions, if any. This is currently the only way to gain access to sessions given away with the "GO" command. If the queue had any connected sessions, the client should receive appropriate CONNECT messages.

[ Minimal Required Fields]

>> QID=<int>        - Queue id in question
[ Optional Arguments ]
[ Returns ]

>> QID=<int>        - Queue id
>> ITEMS=<int>      - Current number of items in queue
>> NORTH_SID=<int>  - Session ID of North site, if connected.
>> SOUTH_SID=<int>  - Session ID of South site, if connected.
>> NORTH_SITEID=int - Site ID of North site, for future SESSIONNEW
>> SOUTH_SITEID=int - Site ID of South site, for future SESSIONNEW
>> NORTH_NAME=<str> - Site name of North site
>> SOUTH_NAME=<str> - Site name of South site
>> CODE=<int>       - Command return status CODE.

As well as potential async commands.

[ Example ]
 
>> qgrab|qid=1
<< CONNECT|SID=34
<< IDLE|SID=34
<< CONNECT|SID=35
<< IDLE|SID=35
<< QGRAB|QID=1|CODE=0|ITEMS=0|NORTH_SID=34|SOUTH_SID=35|NORTH_SITEID=0|SOUTH_SITEID=4|NORTH_NAME=localhost|SOUTH_NAME=distro_site

QCOMPARE

Compare the two directories in the session cache against each other, sending back list of FIDs that would be queued by FXP.One. This gives GUIs an easy way to show which items would be queued, and processed in a given set of directories. The compare function uses all the logic, including skiplists, passlists, movefirst and skipempty. It compares file sizes to ignore those of the same size, but highlights the side with the smaller size should they differ.

[ Minimal Required Fields]

>> QID=<int>        - Queue ID 
[ Optional Arguments ]
[ Returns ]

>> QID=<int>        - Queue ID
>> NORTH_FID=<int,> - Comma separated list of FIDs for the NORTH site.
>> SOUTH_FID=<int,> - Comma separated list of FIDs for the NORTH site.
>> BEGIN            - First item sent,   start of list.
>> END              - Final item was sent, end of list.
[ Example ]

>> qcompare|qid=1
<< QCOMPARE|QID=1|BEGIN
<< QCOMPARE|QID=1|NORTH_FID=1,3,4,5,6,7,8,10,13,15,16,17,18,19,21,22,23,24,25,26,28,29,31,33,35,36,37,38
,39,40,41,42,43,44,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,69,70,71,72,73,
74,75,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,104,105,
107,108,109,110,111,112,113,115,116,117,118
<< QCOMPARE|QID=1|NORTH_FID=119,120,121,122,123,124,125,126,127,128,129,130,132,133,134,135,136,137,
138,139,140,141,142,144,145,146,147,148,149
<< QCOMPARE|QID=1|SOUTH_FID=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,
29,30,31,32,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,
64,65,66,67,68,69,70,71,72,73,74,75,77,78,79,80,81,82,84,85,87,88,89,90,91,92,93,95,96,97,98,99,100,
101,102,104,105,106,107,109
<< QCOMPARE|QID=1|SOUTH_FID=110,113,114,115
<< QCOMPARE|QID=1|END|MSG=Completed comparison.

QUEUEFREE

Release an existing queue, release its sessions, and queue items.

[ Minimal Required Fields]

>> QID=<int>        - Queue ID
[ Optional Arguments ]
[ Returns ]

>> QID=<int>        - Queue ID
>> CODE=<int>       - Command return status CODE.
>> MSG=<str>        - Command return message.
[ Example ]

>> QUEUEFREE|QID=1
<< QUEUEFREE|CODE=0|QID=1|Msg=Queue released.

GO

Issue "GO" to a queue. Request FXP.One engine to start processing the queue and its items. The client loses ownership of the two SIDS at the issue of the "GO" command. You may no longer issue commands directory to the SIDs. Once a queue is idle, either from the QC|EMPTY message, or after issuing the STOP command, the client can issue the "QGRAB" command to receive controls of the SIDs, if still existing.

[ Minimal Required Fields]

>> QID=<int>        - Queue ID
[ Optional Arguments ]

>> SUBSCRIBE        - Subscribe to queue status (QS) and queue changes (QC)  
[ Returns ]

>> QID=<int>        - Queue ID
>> CODE=<int>       - Command return status CODE if failed.
>> MSG=<str>        - Command return message.
[ Example ]

>> GO|QID=1
<< GO|QID=1|CODE=0|MSG=Queue processing started.


STOP

Issue "STOP" to a queue. Request FXP.One engine to attempt to stop processing the queue and its items. There are currently three types on STOP levels, the default is "SOFT", which will stop once the current transfer is complete. "HARD" which will attempt to send the FTP command 'ABOR' to both FTPDs to gracefully interrupt the current transfer. (local client might need ABOR support added) Finally, the "DROP" method which will log out of both FTPDs and hence forcing the transfer to stop. Once the queue processing has stopped, the FXP.One engine will issue a "QC|IDLE" command, after which the client can issue QGRAB.


[ Minimal Required Fields]

>> QID=<int>        - Queue ID
[ Optional Arguments ]

>> HARD             - Send FTP 'ABOR' to FTP daemons
>> DROP             - Drop connections to FTP daemons to cancel transfers.  
[ Returns ]

>> QID=<int>        - Queue ID
>> CODE=<int>       - Command return status CODE if failed.
>> MSG=<str>        - Command return message.
[ Example ]

>> STOP|QID=1
<< STOP|QID=1|CODE=0|MSG=Stop initiated, please wait..
<< QC|QID=1|IDLE|MSG=Stop command successful.

QC

This is a receive-only command, sent by the FXP.One engine when there is a Queue-Change. It is only sent if the client requested to SUBSCRIBE to a queue, either using the "GO" command, or the "QGET"

[ Minimal Required Fields]
[ Optional Arguments ]
[ Returns ]

>> MOVE             - Item has moved to a new position. Comes with
                      FROM= and TO= keys. 
>> REMOVE           - Remove items from queue. All items with higher
                      position are decremented by one. Uses @.
>> INSERT           - New item inserted into queue. Uses @, SRCPATH,
					  DSTPATH, QTYPE, SRCSIZE.
>> EMPTY            - Empty queue, processing stops.

>> IDLE             - Queue moved into IDLE state, either from QTYPE=STOP or
                      in response to a STOP command. 
[ Example ]

<< QC|QID=1|REMOVE|@=0
<< QC|QID=1|MOVE|FROM=0|TO=18
<< QC|QID=1|INSERT|@=0|SRCPATH=/testfile.dat|DSTPATH=/tmp/testing.bin|QTYPE=FILE|SRCSIZE=29734

When the FXP.One is expanding a directory, it may send a large amount of QC|INSERT items to the clients, so in an attempt to assist clients to avoid frequent display refreshing, the engine will add the tag |EXPANDING to some items, and follow with a QS|REFRESH command to indicate the directory expansion has completed. It is considered an optimisation and can be ignored.

QS

This is a receive-only command, sent by the FXP.One engine when there is Queue-Status information to relay. Client can safely ignore this command as it does not reflect on any queue changes. It is merely meant as a way for clients to be able to track progress of a queue being processed. It is only sent if the client requested to SUBSCRIBE to a queue, either using the "GO" command, or the "QGET" (Not yet implemented). All QS messages are related to the item at the top of the queue. So "@=0" is implied.

[ Minimal Required Fields]
[ Optional Arguments ]
[ Returns ]

>> START            - Started processing the item at the top of queue.
     SRCPATH=<str>  - Included for human readability.
>> SRCCWD=<str>     - Changed to new directory on source
>> DSTCWD=<str>     - Changed to new directory on destination
>> MKD=<str>        - Created new directory on destination
>> XFRACT           - File transfer has started (received 150)
     SECURE=<yes/no>- Was Secure Data negotiations successful.
     REST=<int>     - Are we resuming this file
     SIZE=<int>     - Final source size (from SIZE command)
>> XFREND           - File transfer finished (successfully, 226).
     TIME=<int>     - Duration of transfer [1]
     KB/s=<int>     - Estimated speed of transfer [1]
>> FAILED           - Attempted transfer failed
     SERR=<str>     - Error reasons (source failed)
     DERR=<str>     - Error reasons (destination failed)
     COUNT=<int>    - This failure count.

[1] Please be aware that we can only measure the time difference between the 150 FTP message, and the 226 FTP message as received by FXP.One. This may not reflect the actual time taken for the transfer, subsequently the KB/s computation is based on said time, and will most likely only be an estimate. The shorter the duration of a file transfer is, the more inaccurate the speed computation will be.

[ Example ]

<< QS|QID=1|MSG=Processing directory|SRCPATH=/Giana_Sisters_GBA//giana_sounds|DSTPATH=/tmp/tmp//giana_sounds
<< QS|QID=1|SRCCWD=/Giana_Sisters_GBA/
<< QS|QID=1|START|@=0|SRCPATH=/Giana_Sisters_GBA//giana_sounds/might_be_game_sounds.pcm
<< QS|QID=1|SRCCWD=/Giana_Sisters_GBA/giana_sounds/
<< QS|QID=1|DSTMKD=/tmp/tmp//giana_sounds
<< QS|QID=1|MSG=Transfer started|SECURE=YES|REST=0|SIZE=29734
<< QS|QID=1|MSG=Transfer complete|TIME=0.00|KB/s=0.00
[ Log of a complete session ]

>> GO|QID=1|SUBSCRIBE
<< QS|QID=1|MSG=Processing directory|SRCPATH=/Giana_Sisters_GBA//giana_sounds|DSTPATH=/tmp/tmp//giana_sounds
<< QS|QID=1|SRCCWD=/Giana_Sisters_GBA/
<< QC|QID=1|REMOVE|@=0
<< QC|QID=1|INSERT|@=0|SRCPATH=/Giana_Sisters_GBA/giana_sounds//might_be_game_sounds.pcm|DSTPATH=/tmp/tmp//giana_sounds/might_be_game_sounds.pcm|QTYPE=FILE|SRCSIZE=29734
<< QS|QID=1|START|@=0|SRCNAME=might_be_game_sounds.pcm
<< QS|QID=1|SRCCWD=/Giana_Sisters_GBA/giana_sounds/
<< QS|QID=1|MKD=/tmp/tmp//giana_sounds
<< QS|QID=1|MSG=Transfer started|SECURE=YES|REST=0|SIZE=29734
<< QS|QID=1|MSG=Transfer complete|TIME=0.00|KB/s=0.00
<< QC|QID=1|REMOVE|@=0

SUBSCRIBE

Request to receive the QS and QC commands from a processing queue. A client may subscribe to as many queues as it wants, including those not started by itself.

[ Minimal Required Fields]

>> QID=<int>        - Queue ID
[ Optional Arguments ]

>> TOGGLE           - If already subscribed, issue un-subscribe instead.
[ Returns ]

>> QID=<int>        - Queue ID
>> MSG=<str>        - Command return message.
>> UNSUBSCRIBED     - If issued TOGGLE the result was to be un-subscribed.
[ Example ]

>> SUBSCRIBE|QID=1|TOGGLE
<< SUBSCRIBE|QID=1|CODE=0|MSG=Subscribed

UNSUBSCRIBE

Stop being subscribed to a queue.

[ Minimal Required Fields]

>> QID=<int>        - Queue ID
[ Optional Arguments ]
[ Returns ]

>> QID=<int>        - Queue ID
>> MSG=<str>        - Command return message.
[ Example ]

>> UNSUBSCRIBE|QID=1
<< UNSUBSCRIBE|QID=1|CODE=0|MSG=Unsubscribed


QCLONE (v1.7)

Take a created queue (idle or active) and make an exact copy of the queue. If source queue is active, connect both sides and start processing. Some clients refer to this as "add another thread".

[ Minimal Required Fields]

>> QID=<int>        - Queue ID
[ Optional Arguments ]

>> START=<yna>      - Start processing (Y), do not start processing (N), or copy source (A). Default is (A). 
>> SUBSCRIBE        - Also subscribe to queue processing notices.
[ Returns ]

>> QID=<int>        - Source Queue ID, same as given.
>> NEWQID=<int>        - Newly created clone Queue ID
>> MSG=<str>        - Command return message.
[ Example ]

>> QCLONE|QID=123
<< QCLONE|QID=123|NEWQID=124|CODE=0|MSG=Queue 124 processing started.
In reality, it is a little more verbose, here is an actual example:
>> QCLONE|QID=1 
<< SESSIONNEW|SITEID=15|CODE=0|SID=3
<< SESSIONNEW|SITEID=16|CODE=0|SID=4
<< QUEUENEW|CODE=0|QID=2|NORTH_SID=3|SOUTH_SID=4|MSG=Queue created.
<< QCLONE|CODE=0|QID=1|NEW_QID=2|Msg=Cloned and created queue
<< CONNECT|SID=3|SSL
<< IDLE|SID=3
<< CONNECT|SID=4|SSL
<< IDLE|SID=4
<< GO|QID=2|CODE=0|MSG=Queue processing started.

ADMINISTRATIVE COMMANDS

QUIT

Disconnect from the FXP.One engine. The client can also just close the connection without worry.

[ Minimal Required Fields]
[ Optional Arguments ]
[ Returns ]

>> Will disconnect on you, how rude.
[ Example ]

>> QUIT
<< Connection closed by remote host.

HELP

Display available commands at this privilege level.

[ Minimal Required Fields]
[ Optional Arguments ]
[ Returns ]

>> MSG=<str>        - Command return message.
>> CODE=<int>       - Command return status CODE.

[ Example ]

>> HELP
<< HELP|CODE=0|Msg= QUIT HELP WHO SHUTDOWN SITEADD SITELIST SITEMOD SITEDEL SESSIONNEW SESSIONFREE
        DIRLIST QUEUENEW QADD QLIST QGET QERR QGRAB QDEL QMOVE QCOMPARE QUEUEFREE GO STOP CWD PWD
        SIZE DELE MKD RMD SITE REN MDTM QUOTE SUBSCRIBE UNSUBSCRIBE.

WHO

Display a list of users connected to this FXP.One engine.

[ Minimal Required Fields]
[ Optional Arguments ]
[ Returns ]

>> NAME=<str>       - User name of login session
>> HOST=<ip>        - IP address of login session
>> PORT=<port>      - Remote port number
>> SSL=<yes|no>     - Is connection encrypted
>> CLIENTS=<int>    - Number of items in the queue
>> BEGIN            - First item sent,   start of list.
>> END              - Final item was sent, end of list.
[ Example ]

>> WHO
<< WHO|BEGIN|CLIENTS=3
<< WHO|NAME=admin|HOST=127.0.0.1|PORT=58597|SSL=yes
<< WHO|NAME=admin|HOST=220.150.239.57|PORT=1135|SSL=yes
<< WHO|NAME=admin|HOST=127.0.0.1|PORT=58540|SSL=no
<< WHO|END|Msg=Command Completed.

SETPASS

Change the login password on the FXP.One engine. This is strongly encouraged.

[ Minimal Required Fields]
>> OLD=<str>        - Old/current password of this login session.
>> NEW=<str>        - New/future password for this login session.
[ Optional Arguments ]
[ Returns ]

>> MSG=<str>        - Command return message.
>> CODE=<int>       - Command return status CODE.
[ Example ]

>> SETPASS|OLD=admin|NEW=newpass
<< SETPASS|CODE=0|MSG=New password has been set.

<< SETPASS|CODE=1502|MSG=Login incorrect

SHUTDOWN

Shutdown the FXP.One engine have it completely exit.

[ Minimal Required Fields]
[ Optional Arguments ]

>> LASTCLIENT       - Only shutdown if THIS client is the last one.
[ Returns ]

>> Might disconnect on you, how rude.
[ Example ]

>> SHUTDOWN
<< SHUTDOWN|CODE=0
<< Connection closed by remote host.