update updates-s-
authorPekka Riikonen <priikone@silcnet.org>
Wed, 30 May 2001 14:19:20 +0000 (14:19 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 30 May 2001 14:19:20 +0000 (14:19 +0000)
CHANGES
TODO
apps/irssi/config
apps/irssi/src/fe-common/silc/module-formats.c
apps/irssi/src/fe-common/silc/module-formats.h
apps/irssi/src/silc/core/silc-channels.c
apps/irssi/src/silc/core/silc-servers.c
apps/silc/testi.conf
apps/silc/testi2.conf

diff --git a/CHANGES b/CHANGES
index db41d029d649f0c525f2c8ec5d661e8a7e30d93a..5418a1e95459d1b093617ac71652726124a52c59 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,22 @@
+Tue May 29 22:16:40 EEST 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
+
+       * Added Makefile.defines_int to include the actual definitions
+         for Makefile.defines.in.  Tested the new distribution system,
+         created distributions and tested installation.
+
+       * Added AWAY message printing to the Irssi SILC client.  Added
+         the messages to the irssi/src/fe-common/silc/module-formats.[ch].
+
+       * Added SCONNECT command to call the SILC's CONNECT command.
+         Cannot use CONNECT directly since Irssi uses that internally.
+         Affected file irssi/src/silc/core/silc-servers.c.
+
+         Added ACTION local command.  It is same as ME command but takes
+         the channel as mandatory argument.
+
+         Rewrote some of the Irssi's help files to suite for SILC
+         protocol.
+
 Mon May 28 19:05:22 EEST 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
 
        * Added Makefile.defines[.in] that should for now on be included
diff --git a/TODO b/TODO
index 60920cdaa24ffa8c2cca10c446ed6cab6aa0cded..9ff6f4f8f6dfa4551a24e17916358325dacf26cb 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,3 +1,12 @@
+TODO/bugs in Irssi SILC client
+==============================
+
+ o Add KNOCKOUT local command.  It should kick an client from channel and
+   set a ban for it for number of seconds.
+
+ o Add KICKBAN local command.  Kicks and bans the specified client.
+
+
 TODO/bugs In SILC Client Library
 ================================
 
index 38dc7478ba3bf1d5d7b36c705e650cd2a647012c..fc346a2dc6c5a92cce10fe2db82f132e70ff9a8c 100644 (file)
@@ -46,6 +46,7 @@ aliases = {
   WN = "window new hide";
   GOTO = "sb goto";
   CHAT = "dcc chat";
+  ADMIN = "info";
 };
 
 settings = {
index 90c35129531d5c96e04939465f0d3d89abe5767e..9e8ddfb043b69544b60c7930dca69a44fda5744e 100644 (file)
@@ -83,7 +83,7 @@ FORMAT_REC fecommon_silc_formats[] = {
        { "pubkey_maybe_expired", "It is possible that the key has expired or changed", 0 },
        { "pubkey_mitm_attach", "It is also possible that someone is performing man-in-the-middle attack", 0 },
 
-       /* Key management and key agreement */
+       /* Misc messages */
        { NULL, "Misc", 0 },
 
        { "server_oper", "You are now {hilight server operator}", 0 },
@@ -101,6 +101,8 @@ FORMAT_REC fecommon_silc_formats[] = {
        { "ke_unknown_hmac", "Server does not support one of your proposed HMAC", 0 },
        { "ke_incorrect_signature", "Incorrect signature", 0 },
        { "auth_failed", "Authentication failed", 0 },
+       { "set_away", "You have meen marked as being away (away message: {hilight $0})", 1, { 0 } },
+       { "unset_away", "You are no longer marked as being away", 0 },
 
        { NULL, NULL, 0 }
 };
index 13284445ebf2f3b0abb3a6187ec6dd879707a171..b1de61713684b243e74501c9358dfc425c7fbd21 100644 (file)
@@ -88,7 +88,6 @@ enum {
   SILCTXT_UNKNOWN_NOTIFY,
   SILCTXT_KE_BAD_VERSION,
   SILCTXT_KE_UNSUPPORTED_PUBLIC_KEY,
-  SILCTXT_KE_UNKNOWN_PUBLIC_KEY,
   SILCTXT_KE_UNKNOWN_GROUP,
   SILCTXT_KE_UNKNOWN_CIPHER,
   SILCTXT_KE_UNKNOWN_PKCS,
@@ -96,6 +95,8 @@ enum {
   SILCTXT_KE_UNKNOWN_HMAC,
   SILCTXT_KE_INCORRECT_SIGNATURE,
   SILCTXT_AUTH_FAILED,
+  SILCTXT_SET_AWAY,
+  SILCTXT_UNSET_AWAY,
 };
 
 extern FORMAT_REC fecommon_silc_formats[];
index c299f65f928c053fe0e64c7c83d46e64aafdf4a7..ac588e64b21fa5ce46e03c7594f8b3d504fe9844 100644 (file)
@@ -487,6 +487,53 @@ static void command_me(const char *data, SILC_SERVER_REC *server,
   silc_free(argv_types);
 }
 
+/* ACTION local command. Same as ME but takes the channel as mandatory
+   argument. */
+
+static void command_action(const char *data, SILC_SERVER_REC *server,
+                          WI_ITEM_REC *item)
+{
+  SILC_CHANNEL_REC *chanrec;
+  char *tmpcmd = "ME", *tmp;
+  uint32 argc = 0;
+  unsigned char **argv;
+  uint32 *argv_lens, *argv_types;
+  int i;
+  if (!IS_SILC_SERVER(server) || !server->connected)
+    cmd_return_error(CMDERR_NOT_CONNECTED);
+
+  if (!IS_SILC_CHANNEL(item))
+    cmd_return_error(CMDERR_NOT_JOINED);
+
+  /* Now parse all arguments */
+  tmp = g_strconcat(tmpcmd, " ", data, NULL);
+  silc_parse_command_line(tmp, &argv, &argv_lens,
+                         &argv_types, &argc, 3);
+  g_free(tmp);
+
+  if (argc < 3)
+    cmd_return_error(CMDERR_NOT_ENOUGH_PARAMS);
+
+  chanrec = silc_channel_find(server, argv[1]);
+  if (chanrec == NULL) 
+    cmd_return_error(CMDERR_CHAN_NOT_FOUND);
+
+  /* Send the action message */
+  silc_client_send_channel_message(silc_client, server->conn, 
+                                  chanrec->entry, NULL,
+                                  SILC_MESSAGE_FLAG_ACTION, 
+                                  argv[2], argv_lens[2], TRUE);
+
+  printformat_module("fe-common/silc", server, chanrec->entry->channel_name,
+                    MSGLEVEL_ACTIONS, SILCTXT_CHANNEL_OWNACTION, argv[2]);
+
+  for (i = 0; i < argc; i++)
+    silc_free(argv[i]);
+  silc_free(argv_lens);
+  silc_free(argv_types);
+}
+
 /* NOTICE local command. */
 
 static void command_notice(const char *data, SILC_SERVER_REC *server,
@@ -548,12 +595,20 @@ static void command_away(const char *data, SILC_SERVER_REC *server,
     /* Remove any possible away message */
     silc_client_set_away_message(silc_client, server->conn, NULL);
     set = FALSE;
+
+    printformat_module("fe-common/silc", server, NULL, MSGLEVEL_CRAP, 
+                      SILCTXT_UNSET_AWAY);
   } else {
     /* Set the away message */
     silc_client_set_away_message(silc_client, server->conn, (char *)data);
     set = TRUE;
+
+    printformat_module("fe-common/silc", server, NULL, MSGLEVEL_CRAP, 
+                      SILCTXT_SET_AWAY, data);
   }
 
+  signal_emit("away mode changed", 1, server);
+
   silc_command_exec(server, "UMODE", set ? "+g" : "-g");
 }
 
@@ -1050,6 +1105,7 @@ void silc_channels_init(void)
   
   command_bind("part", MODULE_NAME, (SIGNAL_FUNC) command_part);
   command_bind("me", MODULE_NAME, (SIGNAL_FUNC) command_me);
+  command_bind("action", MODULE_NAME, (SIGNAL_FUNC) command_action);
   command_bind("notice", MODULE_NAME, (SIGNAL_FUNC) command_notice);
   command_bind("away", MODULE_NAME, (SIGNAL_FUNC) command_away);
   command_bind("key", MODULE_NAME, (SIGNAL_FUNC) command_key);
@@ -1082,6 +1138,7 @@ void silc_channels_deinit(void)
   
   command_unbind("part", (SIGNAL_FUNC) command_part);
   command_unbind("me", (SIGNAL_FUNC) command_me);
+  command_unbind("action", (SIGNAL_FUNC) command_action);
   command_unbind("notice", (SIGNAL_FUNC) command_notice);
   command_unbind("away", (SIGNAL_FUNC) command_away);
   command_unbind("key", (SIGNAL_FUNC) command_key);
index b2986eacae22aa64180ec79ab45530c1b2ccbab7..55bc0255bd13e681f5a9055b1c41f52634e9e9f6 100644 (file)
@@ -287,6 +287,8 @@ void silc_command_exec(SILC_SERVER_REC *server,
   (*cmd->cb)(ctx);
 }
 
+/* Generic command function to call any SILC command directly. */
+
 static void command_self(const char *data, SILC_SERVER_REC *server)
 {
   if (!IS_SILC_SERVER(server) || !server->connected) {
@@ -298,6 +300,20 @@ static void command_self(const char *data, SILC_SERVER_REC *server)
   signal_stop();
 }
 
+/* SCONNECT command.  Calls actually SILC's CONNECT command since Irssi
+   has CONNECT command for other purposes. */
+
+static void command_sconnect(const char *data, SILC_SERVER_REC *server)
+{
+  if (!IS_SILC_SERVER(server) || !server->connected) {
+    printtext(NULL, NULL, MSGLEVEL_CLIENTERROR, "Not connected to server");
+    return;
+  }
+
+  silc_command_exec(server, "CONNECT", data);
+  signal_stop();
+}
+
 static void event_text(const char *line, SILC_SERVER_REC *server,
                       WI_ITEM_REC *item)
 {
@@ -338,12 +354,12 @@ void silc_server_init(void)
   command_bind("kill", MODULE_NAME, (SIGNAL_FUNC) command_self);
   command_bind("kick", MODULE_NAME, (SIGNAL_FUNC) command_self);
   command_bind("info", MODULE_NAME, (SIGNAL_FUNC) command_self);
-  command_bind("connect", MODULE_NAME, (SIGNAL_FUNC) command_self);
   command_bind("ping", MODULE_NAME, (SIGNAL_FUNC) command_self);
   command_bind("motd", MODULE_NAME, (SIGNAL_FUNC) command_self);
   command_bind("close", MODULE_NAME, (SIGNAL_FUNC) command_self);
   command_bind("shutdown", MODULE_NAME, (SIGNAL_FUNC) command_self);
   command_bind("getkey", MODULE_NAME, (SIGNAL_FUNC) command_self);
+  command_bind("sconnect", MODULE_NAME, (SIGNAL_FUNC) command_sconnect);
 
   command_set_options("connect", "+silcnet");
 }
@@ -370,11 +386,11 @@ void silc_server_deinit(void)
   command_unbind("kill", (SIGNAL_FUNC) command_self);
   command_unbind("kick", (SIGNAL_FUNC) command_self);
   command_unbind("info", (SIGNAL_FUNC) command_self);
-  command_unbind("connect", (SIGNAL_FUNC) command_self);
   command_unbind("ping", (SIGNAL_FUNC) command_self);
   command_unbind("motd", (SIGNAL_FUNC) command_self);
   command_unbind("ban", (SIGNAL_FUNC) command_self);
   command_unbind("close", (SIGNAL_FUNC) command_self);
   command_unbind("shutdown", (SIGNAL_FUNC) command_self);
   command_unbind("getkey", (SIGNAL_FUNC) command_self);
+  command_unbind("sconnect", (SIGNAL_FUNC) command_sconnect);
 }
index 5d052d203af2eb2132af695299dc3853ada19488..ca9346b922ede1bac1dd7912449883c394769c38 100644 (file)
@@ -1,11 +1,4 @@
-#
-# Configured ciphers.
-#
-# Format: <name>:<module path>:<key length>:<block length>
-#
-# If the cipher is builtin the <module path> maybe omitted.
-#
-[cipher]
+[Cipher]
 aes-256-cbc:../lib/silcsim/modules/aes.sim.so:32:16
 aes-192-cbc:../lib/silcsim/modules/aes.sim.so:24:16
 aes-128-cbc:../lib/silcsim/modules/aes.sim.so:16:16
@@ -17,53 +10,57 @@ mars-192-cbc:../lib/silcsim/modules/mars.sim.so:24:16
 mars-128-cbc:../lib/silcsim/modules/mars.sim.so:16:16
 none:../lib/silcsim/modules/none.sim.so:0:0
 
-#
-# Configured hash functions.
-#
-# Format: <name>:<module path>:<block length>:<digest length>
-#
-# If the hash function is builtin the <module path> maybe omitted.
-#
-[hash]
+[Hash]
 md5::64:16
 sha1::64:20
 
-#
-# Configured HMAC functions. The hash function used in the HMAC must
-# configured to the [hash] section.
-#
-# Format: <name>:<hash name>:<mac length>
-#
 [hmac]
 hmac-sha1-96:sha1:12
 hmac-md5-96:md5:12
-hmac-sha1:sha1:20
+hmac-sha1:sha1:20   
 hmac-md5:md5:16
 
-#
-# Configured PKCS.
-#
-# Format: <name>:<module path>:<key length>
-#
-# NOTE: <module path> must be omitted as PKCS cannot be modules currently.
-#
-[pkcs]
+[PKCS]
 rsa
 
-#
-# Configured connections to servers.
-#
-# Format: <remote host>:<auth type>:<auth data>:<port>
-#
-# <auth type> maybe `passwd' or `pubkey'.
-#
-[connection]
-#lassi.kuo.fi.ssh.com:passwd::706
+[ServerKeys]
+./silcd.pub:./silcd.prv
 
-#
-# Commands.  These are executed when SILC client is run.  Normal
-# SILC commands may be executed here.
-#
-# Format: <command>
-#
-[commands]
+[Identity]
+nobody:nobody
+
+[AdminInfo]
+Mun huone:Mun servo:Pekka Riikonen:priikone@poseidon.pspt.fi
+
+[ServerInfo]
+lassi.kuo.fi.ssh.com:212.146.42.253:Kuopio, Finland:1333
+
+[ListenPort]
+212.146.42.253:212.146.42.253:1333
+
+[Logging]
+infologfile:silcd2.log:10000
+#warninglogfile:/var/log/silcd_warning.log:10000
+errorlogfile:silcd2.log:10000
+#fatallogfile:/var/log/silcd_error.log:
+
+[ConnectionClass]
+1:100:100:100
+2:200:300:400
+
+[ClientConnection]
+:::1333:1
+:::1334:1
+:::1335:1
+:::1336:1
+
+[AdminConnection]
+*:priikone:*:passwd:testi
+
+[ServerConnection]
+#212.146.42.253:passwd:priikone:1335:1:1
+
+[RouterConnection]
+212.146.42.253:passwd:priikone:1334:1:1:1
+
+[DenyConnection]
index b6935b7f4e20fb1113ce13929aee532ebd121ce9..1d549c5b774aee3eba3d3e47c13de4aaa9f1c957 100644 (file)
@@ -1,27 +1,66 @@
-[cipher]
-twofish:/home/silc/silc/lib/silcsim/modules/twofish.sim.so:16:16
-rc6:/home/silc/silc/lib/silcsim/modules/rc6.sim.so:16:16
-mars:/home/silc/silc/lib/silcsim/modules/mars.sim.so:16:16
-none:/home/silc/silc/lib/silcsim/modules/none.sim.so:0:0
+[Cipher]
+aes-256-cbc:../lib/silcsim/modules/aes.sim.so:32:16
+aes-192-cbc:../lib/silcsim/modules/aes.sim.so:24:16
+aes-128-cbc:../lib/silcsim/modules/aes.sim.so:16:16
+twofish-256-cbc:../lib/silcsim/modules/twofish.sim.so:32:16
+twofish-192-cbc:../lib/silcsim/modules/twofish.sim.so:24:16
+twofish-128-cbc:../lib/silcsim/modules/twofish.sim.so:16:16
+mars-256-cbc:../lib/silcsim/modules/mars.sim.so:32:16
+mars-192-cbc:../lib/silcsim/modules/mars.sim.so:24:16
+mars-128-cbc:../lib/silcsim/modules/mars.sim.so:16:16
+none:../lib/silcsim/modules/none.sim.so:0:0
 
-[hash]
+[Hash]
 md5::64:16
 sha1::64:20
 
 [hmac]
 hmac-sha1-96:sha1:12
 hmac-md5-96:md5:12
-hmac-sha1:sha1:20
+hmac-sha1:sha1:20   
 hmac-md5:md5:16
 
-#[pkcs]
-#rsa::1024
-#dss::1024
+[PKCS]
+rsa
 
-[connection]
-#lassi.kuo.fi.ssh.com:passwd::1333
+[serverkeys]
+./silcd.pub:./silcd.prv
 
-[commands]
-#/server lassi:1333
-#/server lassi:1334
-#/server leevi:1333
+[Identity]
+nobody:nobody
+
+[AdminInfo]
+Mun huone:Mun servo:Pekka Riikonen:priikone@poseidon.pspt.fi
+
+[ServerInfo]
+lassi.kuo.fi.ssh.com:212.146.42.253:Kuopio, Finland:1334
+
+[ListenPort]
+212.146.42.253:212.146.42.253:1334
+
+[Logging]
+infologfile:silcd2.log:10000
+#warninglogfile:/var/log/silcd_warning.log:10000
+errorlogfile:silcd2.log:10000
+#fatallogfile:/var/log/silcd_error.log:
+
+[ConnectionClass]
+1:100:100:100
+2:200:300:400
+
+[ClientConnection]
+:::1333:1
+:::1334:1
+:::1335:1
+:::1336:1
+
+[AdminConnection]
+*:priikone:*:passwd:testi
+
+[ServerConnection]
+212.146.42.253:passwd:priikone:1334:1:1
+
+[RouterConnection]
+212.146.42.253:passwd:priikone:1335:1:1:0
+
+[DenyConnection]