$Id: commands,v 1.10 2003/12/26 14:02:20 uid68112 Exp $

This is the list of all supported commands and their syntax.

In the following description, * is a character used as separator. It should not
appear anywhere else inside the line (except as separator). * can be anything
except \r, \n (return), \0 and space (0x20) and a Direct connect special 
characteres. Direct connect reserves 2 characteres you cannot use: | and $

Argument between [] can be omitted.

At the end of the description of a command, you may see "  = precmd". This means
you can also use this command with the --precmd flag.


I) Search commands
==================


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/SRCH *pattern*filetype

* search something on the current hub.
  pattern is what you want to search.
  filetype is one of the following values: 1=any,2=audio,3=compressed,
   4=document,5=exe,6=picture,7=videos,8=folder

/SRCH *pattern*filetype*sizetype*size

* same function as previous one but with a given size.
  sizetype can be 'L' if it is "at least size" or 'M' for "at most size".
  size is the size you want to use (in bytes).

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/CSRCH *localfile*filetype
/CSRCH *localfile*filetype*sizetype*size

* start a search by file content on the hub. This function try to find a file
  having the same content as the one you gave. For compatibility issue, the
  command also tries to find files with the same name. The local file must be
  inside the download directory.

  See /SRCH for more information.

  This function is a protocol extension and is not supported by DC.DC Compatible
  client may support this feature, contact your client author for more
  information.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/MSRCH *pattern*filetype
/MSRCH *pattern*filetype*sizetype*size

* start a multi-hub search. See /SRCH for more information.
  Note: this command is deprecated. It still is recognized but it does not do
  anything in latest version.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------












II) transfer commands
=====================


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
This command description is only valid since version 0.79.0:
/DL *nick*[localfic]*remotefic*filesize

* This command is a wrapper to GDL function, it creates a new GDL and attachs it
  the given source.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/XFER

* display the list of all running transfers (upload, download, idle)

/XFERKB

* same as /XFER except only "CMDKB]" messages are displayed.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/KILL id

* kill a running transfer (XFERR). id is the number identifying the transfer.
  You can obtain transfer id using /XFER command.

  Note: a not yet started transfer cannot be killed.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/KILLKB string

* Remove the given queued keyboard command (CMDKB) from the queue. The string
  must be the exact command to remove. The string is the string of CMDKB message
  between the first | (after the start time) and the last | (which closes the
  CMDKB message).

/KILLKBN num

* Same as previous command but using the first number of the "CMDKB]" message.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/ULIST
/ULIST_FORCE
/ULIST_FILE filename

* get the list of all users of the hub.
  The _FORCE version doesn't use DCTC user list cache but forces the client to
  retrieve the user list from the hub (and refresh its internal list).

  ULIST_FILE put the user list in the given filename, the line format is left
  unchanged. At the end of the command, a "ULIST]" message is sent.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/LS nickname

* download and display the list of files shared by the user named 'nickname'.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GDLNEW gdlid|filesize|filename

* create a new GDL having the given gdlid. the GDL size will be filesize and 
  its final name will be filename. 

  DCTC prevents creation of 2 files with the same name or creation of a file
  which also exist in "broken$" GDL version.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GDLADD gdlid|nickname|remotefilename|remotefilesize

* add a new source (nickname/filename/filesize) to the given GDL (gdlid). If
  this source still exist, its filesize is update.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GDLEND gdlid

* delete the GDL having the given gdlid. All GDL sources are deleted, connection
  are closed and temporary files are erased.

  Since DCTC 0.85.0, you can also delete broken GDL.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GDLDEL gdlid|nickname|remotefilename

* remove the given source (nickname/filename) of the given GDL (gdlid). if this
  source downloads at the same time, its download is erased.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GDLAS+ gdlid|filetype|searchpattern

* add the given search pattern (nickname/filename) to the given GDL (gdlid).

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GDLAS- gdlid|gasID

* remove the given search pattern (using it ID) to the given GDL (gdlid).

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GDLRENAME gdlid|finalname|finaldirectory
/GDLNORENAME gdlid

* Change the name and the destination directory of a GDL. The NO version removes
  any existing name renaming.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GDLSCRIPT gdlid|programname
/GDLNOSCRIPT gdlid

* Start a script at the end of a GDL. script (or program) parameter is the 
  downloaded filename (w/ path).

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GDLCRC gdlid|crc
/GDLNOCRC gdlid

* (un)assign a checksum to the given GDL. The checksum is computed in the same
  manner as e-donkey2000 does.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GDLQLST
/GDLLST
/SLOWGDLLST

* display the (quick) list of GDL(s). The "slow" version works exactly like the
  normal version. The only difference is the command is taken into account only
  1 time per 8 seconds slices. This function has been introduced because
  sometimes, UI sends several /GDLLST and is very busy during several seconds
  because the GDL list is huge at this time.

  since DCTC 0.85.0, broken GDL list is embedded inside the GDL list and uses
  the same line format to keep compatibility.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GDLATTACH filename

* attach an unused GDL to this client. DCTC search for the given filename inside
  the GDL/ directory. If it exists and is unused (.lock is not locked), it tries
  to load the last known GDL status (.cmd file).

  since DCTC 0.85.0, you can also attach broken GDL (the one with a name 
  starting with "broken$" and having a ".crc" instead of a ".lock" file. To
  attach a broken GDL, discard the "broken$" at the beginning of the filename.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GDLDETACH gdlid

* detach a running GDL of this client. When DCTC terminates, internally, it does
  this to allow attachement later.

  since DCTC 0.85.0, you can also detach broken GDL.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/WAKEUGDL nickname

  Wake up waiting GDL source having the given nickname. This command takes into
  account the 'min_gdl_wake_up_delay' value. This command is NOT relayed by 
  dctc-link.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GDLMETFILE gdlid|filename

  Try to take e-donkey 2000 partial checksums from the given filename and attach
  them as L0CRC of the given gdl.

  Note: the file currently supported is the one generated by lmule and ending
  with the '.met' extension. If the given file is invalid, contains no partial
  checksum or has a global CRC which does not match, the command is ignored.
       
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GDLMETDIR dirname

  Define a directory containing e-donkey 2000 partial checksums files as 
  directory to poll periodically for new partial checksums.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GDLMETPOLL duration

  Set the number of minutes between 2 poll of the directory defined in above.
  The delay must be between 1 and 60. Default is 5 minutes.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------













III) chat commands
==================


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/CHAT msg

* send a message (msg) to the public chat.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

/PRIV *nick*msg

* send a private message (msg) to a user (nick)


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------












IV) description/configuration commands
======================================


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/DESC desc

* change your description to a new one (desc). 
  desc can be empty but be careful, in this case, the space after DESC is
  mandatory.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/CNX type

* change your connection type to a new one (type).
  type must be one of the following value:
    56Kbps, 33.6Kbps, 28.8Kbps, Satellite, ISDN, DSL, Cable, LAN(T1), LAN(T3)

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/EMAIL email

* change your email to a new one (email). 
  email can be empty but be careful, in this case, the space after EMAIL is
  mandatory.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/SLOT number

* change the number of upload slots to a new one (number)
  number must be positive or null.
  Note: if the number of upload in progress is bigger than the new number, the
  client doesn't close any upload connection. If you want, you must kill them
  manually using /KILL

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/PORT number

* change the port number used by active mode.
  number must be between 1 (included) and 65535.

  While in active mode, modifying the com port can generated transfer error.
  Running transfers are not affected but if the client tries at the same time
  to established a connection with another client (you in active mode or the
  remote client in passive mode), your client may send a port which will be
  closed when the remote client want to use it. To avoid the problem, don't have
  queued transfer orders inside the client (see /XFER) when you do the /PORT
  command.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/OFFSET number

* artificially change the size of shared data. The given number (in bytes) is
  added to the size of really shared data.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/IP [host_ip]

* Note: Only in active mode (not behind a firewall). Unused in passive mode.

  change the address you report to other client. It can be either an IP
  (xxx.yyy.zzz.aaa) or an interface name (eth0, ppp0, ...).
  If not parameter is provided, the client will return to its default mode (use
  the IP of the interface used to go to the gateway). Note: when no parameter is
  given, the space (" ") following /IP MUST be provided else the command is 
  not recognized.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/PASSIVE
/ACTIVE

* Switch into passive (/PASSIVE) or active (/ACTIVE) mode.

  In passive mode, some functions don't work:
    * it is impossible to do download/upload with another client in passive mode
    * multi hub search doesn't work.
  In active mode, you may encounter problem if you want to use the normal
  direct connect transfer port (412) and you are not root. You can bypass this 
  problem either using another port (-p when starting the client) or switching
  into passive mode.

  Note: in active mode, to do transfer, the client sends its IP. If you don't 
  define it, the client uses the IP of the network card used by the default
  route (thus, it should always work). You can manually override this setting on
  the fly using the command /IP (see above).

  Note: if you have started in passive mode (using -f), switching into active
  mode creates the communication socket used by active mode.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/UINFO nick

* get nick's information (description,email, amount of shared data).

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/AWAY
/HERE

* change your status. When away, you don't receive public chat message. You
  still receive private message.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/DLON
/DLOFF

* enable or disable remote client download capability. If you use /DLOFF, nobody
  will be able to download from your client. Your client still reports the
  value you provide as number of free download slot but if someone tries to 
  start a download from you, the client will return a "no more slot" messages.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/DONE
/UNDONE

* enable or disable usage of the done/ directory. When enabled (/DONE), when a
  download ends, the received file is moved into a done/ directory located 
  inside the directory currently containing the received file.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/PASSWD password

* specify a password to use when the hub wants one.
  When a password has been entered, it is automatically used again when the 
  client has to reconnect to the hub.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/UBL num
/DBL num
/GBL num

* change the (UBL) upload or (DBL) download bandwidth limit to num x 512
  bytes/s (1KB/s for DBL).
  GDL allows a limitation of the amount of bytes copied per second when client
  gathers parts of GDLs into the final file.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/REUINFO

  not very useful for the user, mainly used internally. Resent user information
  to the hub. For example, this command is called internally after the periodic
  /RESHARE.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/FOLLOWFORCE
/UNFOLLOWFORCE

* Use these command to toggle the follow_force_move value. This defines what the
  hub does when it receives a hub redirection (either go to the specified hub or
  disconnect and come back later).

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/DDL
/NODDL

* enable/disable direct download (capability to start a download from a remote
  client without hub help). Default: DDL is disabled.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/LINK
/NOLINK

* enable/disable inter dctc communication (capability to send search and
  download request to other running dctc client). Default: LINK is disabled.

  = precmd

Note: this command is removed since v0.85.6.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GBANIP
/NOGBANIP

* enable/disable IP grabbing of banned users. When a user is kicked or banned 
  from a hub, there is a message on the global chat containing its IP. DCTC
  can get this IP and puts it in its UADDR list allowing you to download from
  this user as soon as DCTC has performed some work on this IP.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/DLFORCE
/NODLFORCE

* enable/disable download direction override. If you have something to download,
  even if the remote client also wants to download, your download query is sent.
  DC client seems to be fairly unstable in the way it handles this "twin
  download" case, that's why it is possible to start a download, sometimes even
  if there is no download slot...

  = precmd

Note: this command is removed since v0.85.6.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/HIDE_ABS
/SHOW_ABS

* hide/show absolute path in search result and file list. If with /share COMmand
  you use an absolute path, when a search result is sent, it will start with a \
  and the file list contains this character  at the beginning. If all your
  shared directories have absolute paths, you can hide this \. 

  Note: it is not a good idea to switch this flag after the client has been
  started because until the next shared file database rebuilding, your shared
  file list will be erroneous (in fact, other users won't be able to download
  because the file names you returned do not exist).

  = precmd

Note: this command is removed since v0.85.6.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/ABORTLEAVED
/NOABORTLEAVED

* when a remote user leaves the hub where you are, if this user downloads from
  your client, the client can either let its downloads run or it can stop them
  to let users still on the hub download.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/MAXRUNGDLSRC num

* this command permits adjustment of the maximum running sources of a GDL. When
  too many sources of a GDL are running, instead of increasing the download 
  speed, the speed goes down due to a great number of packet collision.
  The default value is 10. The limits are 0 (no download) up to a big number
  with lot of digits :)

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GDLASOFFAFT num

* To avoid bandwidth wasting, it is advisable to disable the autoscan of GDL
  when this GDL as enough running sources.
  The default value is 7. Limits are 0 (disable GDL autoscans without removing
  them) up to ... and more than that.

  = precmd
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/HIDE_KICK
/SHOW_KICK

* Hide/show message displayed on the global chat by "<Hub-Security>" when a
  user is kicked.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/DFLAG flag_name value

  Put the given value into the flag named "flag_name". Possible values of
  "flag_name" are in Documentation/VAR file as well as their compatibility with
  this command.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/TOS hub,udp,dl,ul

  Modify the TOS (Type Of Service) of connection. hub TOS alters the connection
  to the current hub, udp TOS alters all search queries, replies and autoscans.
  dl TOS alters the TOS of future download connections (running ones are not 
  affected) and ul TOS alters the TOS of future upload connections.

  Each value is one of the following one (note: the given value is the value
  of the TOS as it appears in the IP header (in bit 4-2) :
	0 = normal
   2 = low cost (non essential traffic like upload for example :) ).
   4 = high reliability (any UDP-based transcation like search results).
   8 = high throughput (bandwidth-sensitive application like download for
                        example).
  16 = low latency (keystroke and other urgent data).

  A typical configuration can use: 16,4,8,2 instead of 0,0,0,0.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/MAXUDL num

  Maximum number of simultaneous downloads on the same user. If 'num' is below
  1, the number of downloads is not limited.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GDLASPORTS num1,num2

  Set the GDL autoscan port range to the range [num1:num2]. If num1==0, then
  no range is set. If num1!=0 and num2==0, only the port numbered num1 is used.
  num1 and num2 must be greater than 0 and smaller than 65536.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/UNODEPORT num

  Change the port used by your UNODE.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------












V) share commands
=================


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/SHARE directory
/UNSHARE directory

* add/remove a directory from the list of shared directories.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/LPATH directory

* change the download directory.

  WARNING: when a download is in progress and this command is used, if the 
  download is interrupted, when the download resumes, the file is put inside the
  new directory (and download restarts from the beginning if the file doesn't
  exist in this new directory).

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/RESHARE

  refresh the shared file database. This command rebuilds the database to take
  into account added/removed files/directories.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/REBUILD num

* change the delay between two rebuilding of the shared database. Default value
  is 900 seconds. Possibles values are 0 to disable auto-rebuilding or a value
  between 900 and 1966020 (~1365 days).

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/VSHARE [directory]

  Add a virtual share directory. If no directory is given, the current virtual
  share directory is removed.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------












VI) misc commands
=================


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/QUIT

* quit the client. 

  Note: the client doesn't quit really until all transfer are over. However,
  after this order, you are deconnected from the hub and you can't enter new
  order on the command line.
  Note: you still receive messages generated by transfer thread(s) so, you are
  able to know how and when transfers end.

/FORCEQUIT

* same as /QUIT except the client doesn't want end of transfer thread(s) and 
  end immediatly.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/DEBUG

* switch between debug and normal mode.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/LOG filename
/NOLOG

* enable or disable message logging. All messages generated by the client are 
  saved into the log file. Message format is exactly the same as the displayed
  message.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/RECON

* First, you will never be able to call this function. This description is only
  here for people looking inside the source. When the client losts the hub 
  connection, it will internally send this command to force a reconnection.
  If the hub address is a FQDN, hub IP will be computed again. Thus, if the hub
  has a static FQDN but a dynamic IP, the client will be able to recontact it,
  even if its IP has changed.

  Note: this command is ignored if the hub connection is still here, else, a
  hub reconnection is tried.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/HUBNAME

* Redisplay the name of the current hub.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/ERRLOG filename
/NOERRLOG

* enable or disable logging of "ERR ]" messages. Even if this option is enabled,
  "ERR ]" messages remain logged into /LOG file (if also enabled).

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/RECOND num

* change the delay to wait after a hub connection loss before trying to esta-
  blish a new connection. num is a number of seconds. Min value is 30, max value
  is 1800. Default delay is 30 seconds.

  = precmd

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/GOTO hubaddress

* you can use this command to go to another hub without living the running
  client. The current hub connection is closed (if exist) and a new one is
  established.

  Note: the given hubaddress is NOT checked before closing hub connection. If
  the client fails to establish a new connection, it will retry later and later
  and so on...

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/LOCATEUSER nickname

  Find on which online hub(s) a user is. This command produces LUSER messages.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/KICK nickname

  kick the user having the given nickname. This command requires special
  privilege (OP).

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------












VII) UADDR commands
===================


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/UADDRUADD nickname|hostip:hostport
/UADDRUDEL nickname
/UADDRIPDEL hostip:hostport
/UADDRIPADD hostip:hostport

* UADDR is part of direct download (DDL). UADDR is a database storing 
  (nickname;host address:host port) couple used by DDL.
  Using these commands, you can add a new couple, delete a couple by nickname or
  by host address, add a host address:host port, UADDR will find automagically
  (if the given host exists and reply) the associated nickname.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/UADDRLST

* display the list of all known UADDR.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------












VIII) reserved commands (internal use only)
===========================================


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/XDL|gdl_id|nickname|

* Don't use this command, it is used internally. This command is used by the GDL
  subsystem to try to start new transfer. In the worst case, you will just
  accidentally start a transfer.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/MD4GET|global_crc|file_length|

* Don't use this command, it is used internally. This command is used by a 
  client when it needs partial CRC associated to a global_crc (e-donkey2000 CRC)
  In the worst case, you will obtain a partial_crc you queried.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/MD4SET|global_crc|file_length|partial_crc|filename|

* Don't use this command, client uses it to propage a partial_crc among
  themselves (locally). In the worst case, you will set an incorrect CRC and 
  corrupt one of your own downloaded file.


