updates.
authorPekka Riikonen <priikone@silcnet.org>
Thu, 7 Jun 2001 18:49:53 +0000 (18:49 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Thu, 7 Jun 2001 18:49:53 +0000 (18:49 +0000)
CHANGES
README
README.CVS
TODO
apps/irssi/src/silc/core/client_ops.c
apps/irssi/src/silc/core/silc-channels.c
apps/silc/client_ops.c
lib/silcclient/client.c
lib/silcclient/client.h
lib/silcutil/silcutil.c
lib/silcutil/silcutil.h

diff --git a/CHANGES b/CHANGES
index 8b223f56e92f3ba1a11429032c5bc9385090a499..2d784a575ffb2f58367e98ded81a4340cd07cf95 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,9 @@ Thu Jun  7 16:29:56 EEST 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
          if the server disconnected us and the connection is not valid
          anymore.  Affected file irssi/src/silc/core/silc-channels.c.
 
+       * Moved the silc_client_[chmode|chumode|chumode_char] away from
+         the library to the lib/silcutil/silcutil.[ch].
+
 Thu Jun  7 08:57:16 CEST 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
 
        * Close log file after open.  Affected file 
diff --git a/README b/README
index 5b8b3e46138dee89ac6834ae18b23d8acd597034..13e88e5ae66ab5e638a0eef252164a1cdcfbe7db 100644 (file)
--- a/README
+++ b/README
@@ -29,314 +29,6 @@ server give the command:
 This will launch the server on to the background.
 
 
-SILC Commands
-=============
-
-
-       /SERVER [<server>[:<port>]]
-
-               Connects to remote SILC server.
-
-       /NICK   [<nickname>]
-
-               Changes/sets nickname.  Note that in SILC there can be
-               multiple same nicknames.  However, the logic on working
-               with multiple nicknames on user interface is pretty much
-               still missing.  Also note that nicknames in SILC are
-               case-sensitive.
-
-       /JOIN   <channel>
-
-               Joins to a channel.  Channel names start with `#'
-               character.
-
-       /LEAVE  <channel>
-
-               Leaves the channel.  If /leave * is given the client
-               leaves the current channel.
-
-       /CMODE  <channel> +|-<modes> [{ <arguments>}]
-
-               Changes/sets channel mode.  Most of the modes require
-               special privileges, such as channel operator or channel
-               founder privileges to work.  The mode is added by adding
-               + before the option(s) and removed by adding - before
-               the option(s).  Following modes are available:
-
-               p               Set/unset channel as private channel
-               s               Set/unset channel as secret channel
-               k               Set/unset that channel uses private channel key
-               i               Set/unset channel as invite only channel
-               t               Set/unset that only channel operator or 
-                               founder may set channel topic
-               l <limit>       Set/unset channel's user limit
-               a <passphrase>  Set/unset passphrase for channel that must
-                               be provided when joining to the channel.
-               c <cipher>      Set/unset channel's cipher
-               h <hmac>        Set/unset channel's hmac
-               f <-pubkey|<password>
-                               Set/unset channel founder authentication.
-                               Channel founder may set this mode so that
-                               if the client leaves the channel it can
-                               claim the founder rights when it returns
-                               to the channel.  If -pubkey is set then
-                               the authentication will be done using the
-                               client's public key.  You can claim the
-                               founder rights using the CUMODE command.
-
-               Multiple modes can be set/unset at once if the modes does not
-               require any arguments.  If mode requires an argument then only
-               one mode can be set at once.
-
-       /CUMODE <channel> +|-<modes> <nickname>[@<server>] [-pubkey|<passwd>]
-
-               Changes/set user's mode on a channel.  Most of the modes 
-               require that the client who changes some client's mode must
-               be channel founder or channel operator.  Following channel
-               user modes are available:
-
-               a <nickname>[@<server>]
-
-                               Set/unset all modes (cannot be used to set
-                               both founder and operator rights, can be used
-                               only to remove both modes at once).
-
-               f <nickname>[@<server>] [-pubkey|<password>]
-
-                               Set/Unset channel founder.  If the -pubkey
-                               option or <password> is provided then the
-                               client is claiming the founder rights by
-                               providing the channel founder authentication
-                               data.  If the -pubkey is provided then the
-                               authentication is performed using the
-                               client's public key.  If you are channel
-                               founder you can set the channel founder
-                               authentication using CMODE command.
-
-               o <nickname>[@<server>]
-
-                               Set/unset channel operator.  Requires that 
-                               you are channel operator or channel founder.
-
-       /UMODE  +|-<modes>
-
-               Sets/unsets user mode.  Note that some of the modes the
-               client cannot set itself.  The following user modes are
-               available:
-
-               a       Unset all modes
-               s       Unset server operator privileges
-               r       Unset router operator privileges
-               g       Set/unset to be gone (or use /AWAY command)
-
-
-       /MSG    <nickname> <message>
-
-               Sends private message to remote client.  Support for
-               handling multiple same nicknames with /MSG command is
-               still missing.
-
-       /WHOIS  <nickname>[@<server>] [<count>]
-
-               Gives a little information about a client.  Support for
-               handling multiple same nicknames with this command is
-               still missing.
-
-       /WHOWAS  <nickname>[@<server>] [<count>]
-
-               Gives a little history information about a client.
-
-       /INVITE <channel> [<nickname>[@server>]
-               [+|-[<nickname>[@<server>[!<username>[@hostname>]]]]]
-
-               Invites client to a channel or manages the invite list of
-               the channel.  The first <nickname> argument is used if an
-               client is invited to the channel.  The second +|-<nickname>
-               argument is used to either add or delete invite from the
-               channel's invite list.  Wildcards may be used with this
-               command.
-
-       /BAN    <channel> [+|-[<nickname>[@<server>[!<username>[@hostname>]]]]]
-
-               Manages the ban list of the channel.  Wildcards may be used
-               with this command.  You must be channel operator to be
-               able to use this command.
-
-        /KICK   <channel> <nickname>[@<server>] [<comment>]
-
-                Kicks client from channel. You have to be at least channel
-               operator to be able to kick client from channel.  Note:
-               you cannot kick channel founder even if you are channel
-               operator.
-
-       /PING   [<server>]
-
-               Pings server.  Only locally connected server may be 
-               pinged.
-
-       /INFO   [<server>]
-
-               Requests information about a server.  If argument is
-               not specified current server is used.
-
-       /AWAY   [<message>]
-
-               Sets away message.  When private message is received and
-               away message is set the client automatically replies to
-               the sender with the away message.  To remove away message
-               give the command without arguments.
-
-       /QUIT
-
-               Quits session.  Connection to remote server is closed.
-
-       /CLEAR
-
-               Clears current screen.
-
-       /VERSION
-
-               Shows client version.
-
-       /OPER   <username> [<public key>]
-
-               Obtains server operator privileges.
-
-       /SILCOPER <username> [<public key>]
-
-               Obtains router operator privileges.
-
-       /KILL   <nickname> [<comment>]
-
-               Router operator can use this command to remove an client
-               from the SILC Network temporarily.
-
-       /CONNECT <server> [<port>]
-
-               Connects to server the remote <server>.  You must be
-               server operator to be able to do this.
-
-
-       /CLOSE  <server> [<port>]
-
-               Closes connection to the <server>.  You must be server
-               operator to be able to do this.
-
-       /SHUTDOWN
-
-               Shutdowns the server.  You must be server operator to be
-               able to do this.
-
-       /MOTD   [<server>]
-
-               Display the MOTD of the server.  If server is not specified
-               the current server is used.
-
-       /LIST   [<channel>]
-
-               Lists all channels in the current server, or the channel
-               specified.  If the channel cannot be found then all
-               channels are listed.
-
-       /KEY    msg|channel <nickname|channel> 
-               set|unset|list|agreement|negotiate [<arguments>]
-
-               This command is used to set and unset private keys for
-               channels, set and unset private keys for private messages
-               with remote clients and to send key agreement requests and
-               negotiate the key agreement protocol with remote client.
-               The key agreement is supported only to negotiate private
-               message keys, it currently cannot be used to negotiate
-               private keys for channels, as it is not convenient for that
-               purpose.
-
-               Types:          
-
-               msg     The command is performed for private messages
-                       affecting the <nickname>.
-
-               channel The command is performed for channel affecting
-                       the <channel>.
-
-
-               Commands:
-
-               set     [<key> [<cipher>] [<hmac>]]
-
-                       Set the key into use.  If the <key> is provided it
-                       is used as the key material.  If the <key> is not
-                       provided the negotiated key material is used.  If
-                       the negotiation has not been performed this command
-                       has no effect.
-
-                       If the type is `msg' and the <key> is `*' then
-                       random key will be generated automatically.
-
-                       The <cipher> may be set for both private message
-                       and channel private keys and the <hmac> may be set
-                       only to the channel private keys.
-
-               unset   [<number>]
-
-                       Unset the key.  The private key is not used after
-                       this command.  The key must be set again or the key
-                       material must be re-negotiated to be able to use
-                       the private keys again.
-
-                       The channel may have several private keys set.  The
-                       <number> can be used to indicate what key is being
-                       unset.  If it is not provided all keys are removed.
-
-
-               list    List all private keys that has been set.
-
-                       If the type is `msg' and the <nickname> is ยด*' then
-                       all private message keys that you've set will be
-                       listed.
-
-               agreement [<hostname> [<port>]]
-
-                       Send key agreement request to remote client.  If
-                       the <hostname> is provided it is sent in the request.
-                       The receiver may use the hostname to start the
-                       key agreement.  If the <port> is also provided your
-                       key agreement protocol server is bound to that
-                       port.  Note that it cannot be privileged port (<1023).
-                       If the <hostname> and <port> is not provided then
-                       the receiver will never initiate the key agreement.
-                       In this case you must start the key agreement after
-                       receiving the reply to the request, by giving the
-                       /KEYAGR start command.
-
-                       This command may be used to send reply to the
-                       remote client.  When receiving empty key agreement
-                       you can reply to the sender with the hostname and
-                       port of your key agreement server with this command.
-
-               negotiate [<hostname> [<port>]]
-
-                       This may be called to start the key agreement with
-                       <nickname>.  This command has effect only if the
-                       <nickname> has replied to your key agreement request.
-                       You will see a notify on the screen when the reply
-                       arrives.  The <hostname> and <port> is the hostname
-                       and port of the remote client's key agreement
-                       server.
-
-       /ME     <channel> <action message>
-
-               This command is used to send an action to the channel.
-               This equals to CTCP's ACTION (IRC's /ME) command.
-
-       /NOTICE <channel> <message>
-
-               This command is used to send for example informational
-               notice messages to the channel.
-
-       /GETKEY <nickname>
-
-               Fetches remote client's public key.
-
 Features
 ========
 
index 9db7980e332f52118d2fcc87bd76c793aa776d48..486a221e80f313a15990d8f3e17c17a9e476d44c 100644 (file)
@@ -19,21 +19,21 @@ There are no password restrictions in the SILC anonymous CVS repository.
 
 For those who are using sh/ksh/bash the check out is done as follows:
 
-export CVSROOT=:pserver:silc@silc.pspt.fi:/storage/silc/CVS
+export CVSROOT=:pserver:cvs@cvs.silcnet.org:/cvs/silc
 cvs login
 cvs co silc
 
 For those who are using csh/tcsh the check out is done as follows:
 
-setenv CVSROOT :pserver:silc@silc.pspt.fi:/storage/silc/CVS
+setenv CVSROOT :pserver:cvs@cvs.silcnet.org:/cvs/silc
 cvs login
 cvs co silc
 
 If you don't want to set $CVSROOT environment variable you can set the
 path to the cvs as command line options:
 
-cvs -d:pserver:silc@silc.pspt.fi:/storage/silc/CVS login
-cvs -d:pserver:silc@silc.pspt.fi:/storage/silc/CVS co silc
+cvs -d:pserver:cvs@cvs.silcnet.org:/cvs/silc login
+cvs -d:pserver:cvs@cvs.silcnet.org:/cvs/silc co silc
 
 What ever method you decide to use, after you have done cvs login you will
 be prompted for password:
@@ -69,11 +69,58 @@ Following directories currently exist in SILC source tree.
 
         Includes SILC include files.
 
+  irssi/
+
+       Includes the Irssi SILC Client.
+
   lib/
 
         Includes SILC libraries.  There maybe libraries on the CVS that
         does not appear on public distribution.
 
+  lib/contrib/
+
+        Contrib directory for routines that some of the platforms might
+        not have.  In that case these routines are provided by the SILC.
+
+  lib/silcclient/
+
+        The SILC Client library. Implementation of the SILC Client without
+        the user interface.  The library provides an interface for user
+        interface designers.
+
+  lib/silccore/
+
+        The SILC Protocol Core library.  Implementation of all the core
+        components of the SILC Protocol.  This is used by all the SILC
+        applications.
+
+  lib/silccrypt/
+
+        The SILC Crypto library. Provides all cryptographic algorithms
+        used in the SILC.  Provides also the Cryptographically strong
+        random number generator.
+
+  lib/silcmath/
+
+        The SILC Math library. Provides the Math and MP routines for
+        SILC applications.  The MP library is actually the GMP.
+
+  lib/silsim/
+
+        The SILC Modules library.  Provides the dynamically loadable
+        modules.
+
+  lib/silcske/
+
+        The SILC Key Exchange (SKE) library.  Implementation of the
+        SKE protocol.  This is used by all SILC applications.
+
+  lib/silcutil/
+
+        The SILC Utility library.  Provides various utility functions
+        for the appliations.
+
   public_html/
 
         Includes the official SILC web pages and everything that relates
diff --git a/TODO b/TODO
index a2541e33992f33866da7b2b576e379a431f28fa1..4b01996c4549c7e76c3c737bbd67f3218e222798 100644 (file)
--- a/TODO
+++ b/TODO
@@ -35,9 +35,6 @@ TODO/bugs In SILC Client Library
 
  o silc_client_close_connection leaks memory.  Read the XXX from code.
 
- o Move the silc_client_[chmode|chumode|chumode_char] away from the library,
-   may be to util library.
-
  o Some of the ops->say's should be removed and moved to the application
    from the library.  Go through these.
 
index c11963da6d6fd8835b785c49cf6092169fedc2df..2e315f79998dd6cc164af3c16a0c1be53dda9df7 100644 (file)
@@ -484,7 +484,9 @@ silc_command_reply(SilcClient client, SilcClientConnection conn,
        signal_emit("channel topic changed", 1, chanrec);
       }
 
-      mode = silc_client_chmode(modei, channel_entry);
+      mode = silc_client_chmode(modei, 
+                               channel_entry->channel_key->cipher->name,
+                               channel_entry->hmac->hmac->name);
       g_free_not_null(chanrec->mode);
       chanrec->mode = g_strdup(mode == NULL ? "" : mode);
       signal_emit("channel mode changed", 1, chanrec);
index 1614ff44b187abb1a8b44906b721bef6d4c18b5f..f6dc52f89351cf4795110edcd92473357ebbce11 100644 (file)
@@ -290,7 +290,9 @@ static void event_cmode(SILC_SERVER_REC *server, va_list va)
   (void)va_arg(va, char *);
   channel = va_arg(va, SilcChannelEntry);
 
-  mode = silc_client_chmode(modei, channel);
+  mode = silc_client_chmode(modei, 
+                           channel->channel_key->cipher->name,
+                           channel->hmac->hmac->name);
   
   chanrec = silc_channel_find_entry(server, channel);
   if (chanrec != NULL) {
index 33de05c6690b4b2c0c2820ec6c4777d1b6648a7d..47761266bedf11c78c0142df67e0746fca660953 100644 (file)
@@ -363,7 +363,9 @@ void silc_notify(SilcClient client, SilcClientConnection conn,
     (void)va_arg(vp, char *);
     channel_entry = va_arg(vp, SilcChannelEntry);
     
-    tmp = silc_client_chmode(tmp_int, channel_entry);
+    tmp = silc_client_chmode(tmp_int, 
+                            channel_entry->channel_key->cipher->name,
+                            channel_entry->hmac->hmac->name);
     
     if (tmp) {
       if (client_entry) {
@@ -819,7 +821,9 @@ void silc_command_reply(SilcClient client, SilcClientConnection conn,
                           app->screen->bottom_line->channel, topic);
        
        app->screen->bottom_line->channel_mode = 
-         silc_client_chmode(mode, channel);
+         silc_client_chmode(mode,
+                            channel->channel_key->cipher->name,
+                            channel->hmac->hmac->name);
        silc_screen_print_bottom_line(app->screen, 0);
 
        /* Resolve the client information */
index 583d0221f9216325078e1840c3d18259b0989576..0fbc909d2c6ee78558c89245e2beba485463f7cc 100644 (file)
@@ -1408,102 +1408,6 @@ void silc_client_replace_from_channels(SilcClient client,
   silc_idcache_list_free(list);
 }
 
-/* Parses mode mask and returns the mode as string. */
-
-char *silc_client_chmode(uint32 mode, SilcChannelEntry channel)
-{
-  char string[100];
-
-  if (!mode)
-    return NULL;
-
-  memset(string, 0, sizeof(string));
-
-  if (mode & SILC_CHANNEL_MODE_PRIVATE)
-    strncat(string, "p", 1);
-
-  if (mode & SILC_CHANNEL_MODE_SECRET)
-    strncat(string, "s", 1);
-
-  if (mode & SILC_CHANNEL_MODE_PRIVKEY)
-    strncat(string, "k", 1);
-
-  if (mode & SILC_CHANNEL_MODE_INVITE)
-    strncat(string, "i", 1);
-
-  if (mode & SILC_CHANNEL_MODE_TOPIC)
-    strncat(string, "t", 1);
-
-  if (mode & SILC_CHANNEL_MODE_ULIMIT)
-    strncat(string, "l", 1);
-
-  if (mode & SILC_CHANNEL_MODE_PASSPHRASE)
-    strncat(string, "a", 1);
-
-  if (mode & SILC_CHANNEL_MODE_FOUNDER_AUTH)
-    strncat(string, "f", 1);
-
-  if (mode & SILC_CHANNEL_MODE_CIPHER) {
-    char cipher[30];
-    memset(cipher, 0, sizeof(cipher));
-    snprintf(cipher, sizeof(cipher), " c (%s)", 
-            channel->channel_key->cipher->name);
-    strncat(string, cipher, strlen(cipher));
-  }
-
-  if (mode & SILC_CHANNEL_MODE_HMAC) {
-    char hmac[30];
-    memset(hmac, 0, sizeof(hmac));
-    snprintf(hmac, sizeof(hmac), " h (%s)", 
-            channel->hmac->hmac->name);
-    strncat(string, hmac, strlen(hmac));
-  }
-
-  /* Rest of mode is ignored */
-
-  return strdup(string);
-}
-
-/* Parses channel user mode mask and returns te mode as string */
-
-char *silc_client_chumode(uint32 mode)
-{
-  char string[4];
-
-  if (!mode)
-    return NULL;
-
-  memset(string, 0, sizeof(string));
-
-  if (mode & SILC_CHANNEL_UMODE_CHANFO)
-    strncat(string, "f", 1);
-
-  if (mode & SILC_CHANNEL_UMODE_CHANOP)
-    strncat(string, "o", 1);
-
-  return strdup(string);
-}
-
-/* Parses channel user mode and returns it as special mode character. */
-
-char *silc_client_chumode_char(uint32 mode)
-{
-  char string[4];
-
-  if (!mode)
-    return NULL;
-
-  memset(string, 0, sizeof(string));
-
-  if (mode & SILC_CHANNEL_UMODE_CHANFO)
-    strncat(string, "*", 1);
-
-  if (mode & SILC_CHANNEL_UMODE_CHANOP)
-    strncat(string, "@", 1);
-
-  return strdup(string);
-}
-
 /* Registers failure timeout to process the received failure packet
    with timeout. */
 
index bd1c7e88042d0f4e40bded5338a1754ab2e5fbf5..fff7d0174f3c1d26d8b63ba20afc523680880775 100644 (file)
@@ -280,9 +280,6 @@ void silc_client_replace_from_channels(SilcClient client,
                                       SilcClientConnection conn,
                                       SilcClientEntry old,
                                       SilcClientEntry new);
-char *silc_client_chmode(uint32 mode, SilcChannelEntry channel);
-char *silc_client_chumode(uint32 mode);
-char *silc_client_chumode_char(uint32 mode);
 void silc_client_process_failure(SilcClient client,
                                 SilcSocketConnection sock,
                                 SilcPacketContext *packet);
index 3e969c73998fbd4638520bf13e0e3935d35aa672..5f21beebdacafd49c41c5a241641aa6110ef5021 100644 (file)
@@ -919,3 +919,89 @@ bool silc_hash_data_compare(void *key1, void *key2, void *user_context)
   uint32 len = (uint32)user_context;
   return !memcmp(key1, key2, len);
 }
+
+/* Parses mode mask and returns the mode as string. */
+
+char *silc_client_chmode(uint32 mode, const char *cipher, const char *hmac)
+{
+  char string[100];
+
+  if (!mode)
+    return NULL;
+
+  memset(string, 0, sizeof(string));
+
+  if (mode & SILC_CHANNEL_MODE_PRIVATE)
+    strncat(string, "p", 1);
+
+  if (mode & SILC_CHANNEL_MODE_SECRET)
+    strncat(string, "s", 1);
+
+  if (mode & SILC_CHANNEL_MODE_PRIVKEY)
+    strncat(string, "k", 1);
+
+  if (mode & SILC_CHANNEL_MODE_INVITE)
+    strncat(string, "i", 1);
+
+  if (mode & SILC_CHANNEL_MODE_TOPIC)
+    strncat(string, "t", 1);
+
+  if (mode & SILC_CHANNEL_MODE_ULIMIT)
+    strncat(string, "l", 1);
+
+  if (mode & SILC_CHANNEL_MODE_PASSPHRASE)
+    strncat(string, "a", 1);
+
+  if (mode & SILC_CHANNEL_MODE_FOUNDER_AUTH)
+    strncat(string, "f", 1);
+
+  if (mode & SILC_CHANNEL_MODE_CIPHER)
+    strncat(string, cipher, strlen(cipher));
+
+  if (mode & SILC_CHANNEL_MODE_HMAC)
+    strncat(string, hmac, strlen(hmac));
+
+  /* Rest of mode is ignored */
+
+  return strdup(string);
+}
+
+/* Parses channel user mode mask and returns te mode as string */
+
+char *silc_client_chumode(uint32 mode)
+{
+  char string[4];
+
+  if (!mode)
+    return NULL;
+
+  memset(string, 0, sizeof(string));
+
+  if (mode & SILC_CHANNEL_UMODE_CHANFO)
+    strncat(string, "f", 1);
+
+  if (mode & SILC_CHANNEL_UMODE_CHANOP)
+    strncat(string, "o", 1);
+
+  return strdup(string);
+}
+
+/* Parses channel user mode and returns it as special mode character. */
+
+char *silc_client_chumode_char(uint32 mode)
+{
+  char string[4];
+
+  if (!mode)
+    return NULL;
+
+  memset(string, 0, sizeof(string));
+
+  if (mode & SILC_CHANNEL_UMODE_CHANFO)
+    strncat(string, "*", 1);
+
+  if (mode & SILC_CHANNEL_UMODE_CHANOP)
+    strncat(string, "@", 1);
+
+  return strdup(string);
+}
index 4556699cd355f35995f2a72445cb273060a3db39..33cf92c06defea42493c172a64e575571e3ecdcb 100644 (file)
@@ -59,5 +59,8 @@ bool silc_hash_string_compare(void *key1, void *key2, void *user_context);
 bool silc_hash_id_compare(void *key1, void *key2, void *user_context);
 bool silc_hash_client_id_compare(void *key1, void *key2, void *user_context);
 bool silc_hash_data_compare(void *key1, void *key2, void *user_context);
+char *silc_client_chmode(uint32 mode, const char *cipher, const char *hmac);
+char *silc_client_chumode(uint32 mode);
+char *silc_client_chumode_char(uint32 mode);
 
 #endif