From: Pekka Riikonen Date: Fri, 2 Feb 2001 09:44:52 +0000 (+0000) Subject: updates. X-Git-Tag: SILC.0.1~276 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=88124edd682e846ef3e6837206d2e0263af985be updates. --- diff --git a/CHANGES b/CHANGES index bb850d84..81bf961a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,16 @@ +Fri Feb 2 11:42:56 EET 2001 Pekka Riikonen + + * 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 * Fixed channel ID decoding in server's JOIN command reply in diff --git a/lib/silcclient/client.c b/lib/silcclient/client.c index 9b3bba3e..d3a15dd8 100644 --- a/lib/silcclient/client.c +++ b/lib/silcclient/client.c @@ -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; } diff --git a/lib/silcclient/command.c b/lib/silcclient/command.c index bed90995..afb04207 100644 --- a/lib/silcclient/command.c +++ b/lib/silcclient/command.c @@ -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); diff --git a/lib/silcclient/command.h b/lib/silcclient/command.h index a9cb241a..632f957a 100644 --- a/lib/silcclient/command.h +++ b/lib/silcclient/command.h @@ -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, diff --git a/lib/silcclient/idlist.c b/lib/silcclient/idlist.c index 9638ee12..3adc43eb 100644 --- a/lib/silcclient/idlist.c +++ b/lib/silcclient/idlist.c @@ -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; } diff --git a/lib/silcclient/idlist.h b/lib/silcclient/idlist.h index 4d1c8b1b..9f1e4c37 100644 --- a/lib/silcclient/idlist.h +++ b/lib/silcclient/idlist.h @@ -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,