updates.
authorPekka Riikonen <priikone@silcnet.org>
Fri, 2 Feb 2001 09:44:52 +0000 (09:44 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 2 Feb 2001 09:44:52 +0000 (09:44 +0000)
CHANGES
lib/silcclient/client.c
lib/silcclient/command.c
lib/silcclient/command.h
lib/silcclient/idlist.c
lib/silcclient/idlist.h

diff --git a/CHANGES b/CHANGES
index bb850d84952e1ec6fa730db1eeaf80ee5a05e244..81bf961af69c3b6be747a2bb8454db9e4c7bd02b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,16 @@
+Fri Feb  2 11:42:56 EET 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
+
+       * Added extra parameter, command identifier, to the
+         silc_client_send_command so that explicit command identifier
+         can be defined.
+
+         Changed that ID list routines uses specific command identifier
+         when sending WHOIS/IDENTIFY requests to the server so that they
+         can be identified when the reply comes back.
+
+         Affected files lib/silcclient/command.[ch],
+         lib/silcclient/client.c and lib/silcclient/idlist.[ch].
+
 Thu Feb  1 23:31:21 EET 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
 
        * Fixed channel ID decoding in server's JOIN command reply in
index 9b3bba3eb486b1f1054a85994e6f5696cd356287..d3a15dd86f4a1a32c0b7f2f1bab6adb716384a21 100644 (file)
@@ -1326,7 +1326,7 @@ void silc_client_notify_by_server(SilcClient client,
       SilcPacketContext *p = silc_packet_context_dup(packet);
       p->context = (void *)client;
       p->sock = sock;
-      silc_client_command_pending(conn, SILC_COMMAND_WHOIS, 0,
+      silc_client_command_pending(conn, SILC_COMMAND_WHOIS, SILC_IDLIST_IDENT,
                                  silc_client_notify_by_server_pending, p);
       goto out;
     }
@@ -1372,7 +1372,7 @@ void silc_client_notify_by_server(SilcClient client,
       SilcPacketContext *p = silc_packet_context_dup(packet);
       p->context = (void *)client;
       p->sock = sock;
-      silc_client_command_pending(conn, SILC_COMMAND_WHOIS, 0
+      silc_client_command_pending(conn, SILC_COMMAND_WHOIS, SILC_IDLIST_IDENT
                                  silc_client_notify_by_server_pending, p);
       goto out;
     }
@@ -1546,7 +1546,7 @@ void silc_client_notify_by_server(SilcClient client,
       SilcPacketContext *p = silc_packet_context_dup(packet);
       p->context = (void *)client;
       p->sock = sock;
-      silc_client_command_pending(conn, SILC_COMMAND_WHOIS, 0, 
+      silc_client_command_pending(conn, SILC_COMMAND_WHOIS, SILC_IDLIST_IDENT,
                                  silc_client_notify_by_server_pending, p);
       goto out;
     }
index bed9099548068f9ae7e1c5be52f4c4c29b74e572..afb042071bd0cf8aa5d41908d101028136bdbb41 100644 (file)
@@ -78,14 +78,15 @@ SilcClientCommand silc_command_list[] =
    encoded into correct form in correct order. */
 
 void silc_client_send_command(SilcClient client, SilcClientConnection conn,
-                             SilcCommand command, unsigned int argc, ...)
+                             SilcCommand command, unsigned short ident,
+                             unsigned int argc, ...)
 {
   SilcBuffer packet;
   va_list ap;
 
   va_start(ap, argc);
 
-  packet = silc_command_payload_encode_vap(command, 0, argc, ap);
+  packet = silc_command_payload_encode_vap(command, ident, argc, ap);
   silc_client_packet_send(client, conn->sock, SILC_PACKET_COMMAND, 
                          NULL, 0, NULL, NULL, packet->data, 
                          packet->len, TRUE);
index a9cb241a77fd77371ed43c335e19ae80ba15ec8c..632f957afca39864c5e3fc566f39a64c66871bea 100644 (file)
@@ -109,7 +109,8 @@ do {                                                                        \
 /* Prototypes */
 void silc_client_command_free(SilcClientCommandContext cmd);
 void silc_client_send_command(SilcClient client, SilcClientConnection conn,
-                             SilcCommand command, unsigned int argc, ...);
+                             SilcCommand command, unsigned short ident,
+                             unsigned int argc, ...);
 SilcClientCommand *silc_client_command_find(const char *name);
 void silc_client_command_pending(SilcClientConnection conn,
                                 SilcCommand reply_cmd,
index 9638ee1226ff02c25f80a7de95729e0edb0f24b0..3adc43eb3ae20cc49a17381a3734222b6f1ed804 100644 (file)
@@ -122,7 +122,8 @@ SilcClientEntry silc_idlist_get_client_by_id(SilcClient client,
       return NULL;
     } else {
       SilcBuffer idp = silc_id_payload_encode(client_id, SILC_ID_CLIENT);
-      silc_client_send_command(client, conn, SILC_COMMAND_WHOIS, 1,
+      silc_client_send_command(client, conn, SILC_COMMAND_WHOIS, 
+                              SILC_IDLIST_IDENT, 1, 
                               3, idp->data, idp->len);
       return NULL;
     }
index 4d1c8b1ba36d8c50148001519d60aec7c6540f5c..9f1e4c37a417a96d547732022583cb6d5f36e809 100644 (file)
@@ -66,6 +66,10 @@ typedef struct SilcChannelEntryStruct {
   unsigned char iv[SILC_CIPHER_MAX_IV_SIZE];
 } *SilcChannelEntry;
 
+/* Command identifier used by ID list routines when sending WHOIS/IDENTIFY
+   commands to routers. */
+#define SILC_IDILIST_IDENT 3333
+
 /* Prototypes */
 
 SilcClientEntry silc_idlist_get_client(SilcClient client,