From d0092e78f61aeb83a8b5345dcfc0f9dd287a6c7c Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Mon, 17 Jul 2000 11:45:20 +0000 Subject: [PATCH] updates --- CHANGES | 5 ++ configure.in | 2 +- doc/CodingStyle | 4 +- doc/Makefile.am | 3 ++ doc/draft-riikonen-silc-pp-00.nroff | 38 ++++++++++---- doc/draft-riikonen-silc-spec-00.nroff | 76 ++++++++++++++------------- includes/version.h | 2 +- lib/silccore/silccommand.h | 48 ++++++++--------- lib/silccore/silcsockconn.h | 7 +++ 9 files changed, 110 insertions(+), 75 deletions(-) diff --git a/CHANGES b/CHANGES index f9fcec41..84533b55 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +Sat Jul 15 15:33:48 EEST 2000 Pekka Riikonen + + * Added command lagging support in server. Client may execute + commands now only once in two seconds. + Thu Jul 13 22:10:21 EEST 2000 Pekka Riikonen * Optimized packet reception. MAC computation and checking is now diff --git a/configure.in b/configure.in index 36c386ad..8957dacd 100644 --- a/configure.in +++ b/configure.in @@ -33,7 +33,7 @@ case "$target" in ;; esac -AM_INIT_AUTOMAKE(silc, 10072000) +AM_INIT_AUTOMAKE(silc, 14072000) AC_PREREQ(2.3) AM_CONFIG_HEADER(includes/silcdefs.h) diff --git a/doc/CodingStyle b/doc/CodingStyle index 6d732bab..09aa8407 100644 --- a/doc/CodingStyle +++ b/doc/CodingStyle @@ -1,7 +1,7 @@ Coding Style in SILC source tree ================================ -This documents describes the coding style and coding conventions used +This document describes the coding style and coding conventions used in the SILC source tree. The purpose of the document is to describe the common way to program for SILC and thus should be learned when programming new code. The document describes various conventions regarding variable @@ -420,7 +420,7 @@ by memset() before freeing the memory. Common way to do is, memset(ptr, 'F', sizeof(*ptr)); silc_free(ptr); -Where 'F' indicates free'd memory if you ever check it with debugger. +Where 'F' indicates free'd memory if you'd ever check it with debugger. Other choice is to use 0 instead of 'F'. The pointer after freeing should be set to NULL if appropriate, ptr = NULL. diff --git a/doc/Makefile.am b/doc/Makefile.am index 0d089525..ac405ee0 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -26,6 +26,9 @@ all: dist-hook: -rm -f draft-riikonen*.txt + touch draft-riikonen-silc-spec-00.txt + touch draft-riikonen-silc-pp-00.txt + touch draft-riikonen-silc-ke-auth-00.txt ./makerfc draft-riikonen-silc-spec-00.nroff \ draft-riikonen-silc-spec-00.txt ./makerfc draft-riikonen-silc-pp-00.nroff \ diff --git a/doc/draft-riikonen-silc-pp-00.nroff b/doc/draft-riikonen-silc-pp-00.nroff index 569573e9..1ed4915b 100644 --- a/doc/draft-riikonen-silc-pp-00.nroff +++ b/doc/draft-riikonen-silc-pp-00.nroff @@ -1312,8 +1312,9 @@ o Private Message Key (variable length) - The actual private .ti 0 2.3.12 Command Payload -Command Payload is used to send SILC commands from client to server. -Following diagram represents the Command Payload. +Command Payload is used to send SILC commands from client to server. +Also server may send commands to other servers. Following diagram +represents the Command Payload. .in 5 @@ -1321,8 +1322,10 @@ Following diagram represents the Command Payload. 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -| SILC Command | Arguments Num | Payload Length | +| Payload Length | SILC Command | Arguments Num | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +| Command Unifier | ++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ .in 3 .ce @@ -1330,6 +1333,10 @@ Figure 13: Command Payload .in 6 +o Payload Length (2 bytes) - Length of the entire command + payload including any command argument payloads associated + with this payload. + o SILC Command (1 byte) - SILC Command identifier. This must be set to non-zero value. If zero (0) value is found in this field the packet must be discarded. @@ -1339,9 +1346,14 @@ o Arguments Num (1 byte) - Indicates the number of arguments field is set to zero (0). The arguments must follow the command payload. -o Payload Length (2 bytes) - Length of the entire command - payload including any command argument payloads associated - with this payload. +o Command Unifier (2 bytes) - Unifies this command at the + sender's end. The entity who replies to this command must + set the value found from this field into the Command Payload + used to send the reply to the sender. This way the sender + can identify which command reply belongs to which originally + sent command. What this field includes is implementation + issue but it is recommended that wrapping counter value is + used in the field. .in 3 See [SILC1] for detailed description of different SILC commands, @@ -1405,11 +1417,15 @@ o Argument Data (variable length) - Argument data. .ti 0 2.3.13 Command Reply Payload -Command Reply Payload is used to send replies to the commands sent -by the client. The Command Reply Payload is identical to the -Command Payload hence see the upper sections for Command Payload -and for Command Argument Payload specifications. Command Reply -message uses the Command Argument Payload as well. +Command Reply Payload is used to send replies to the commands. The +Command Reply Payload is identical to the Command Payload thus see the +upper sections for Command Payload and for Command Argument Payload +specifications. Command Reply message uses the Command Argument Payload +as well. + +The entity who sends the reply packet must set the Command Unifier +field in the reply packet's Command Payload to the value it received +in the original command packet. See SILC Commands in [SILC1] for detailed description of different SILC commands, their arguments and their reply messages. diff --git a/doc/draft-riikonen-silc-spec-00.nroff b/doc/draft-riikonen-silc-spec-00.nroff index e3446e08..72897fd0 100644 --- a/doc/draft-riikonen-silc-spec-00.nroff +++ b/doc/draft-riikonen-silc-spec-00.nroff @@ -1651,19 +1651,23 @@ List of all defined commands in SILC follows. None. This is reserved command and must not be sent. - 2 SILC_COMMAND_WHOIS + 1 SILC_COMMAND_WHOIS - Max Arguments: 2 - Arguments: (1) [@] (2) [] + Max Arguments: 3 + Arguments: (1) [@] (2) [] + (3) [] + + Whois command is used to query various information about specific + user. The user maybe requested by their nickname and server name. + The query may find multiple matching users as there are no unique + nicknames in the SILC. The option maybe given to narrow + down the number of accepted results. If this is not defined there + are no limit of accepted results. The query may also be narrowed + down by defining the server name of the nickname. - Whois. Whois command is used to query various information about - specific user. The user maybe requested by their nickname and - server name. The query may find multiple matching users as - there are no unique nicknames in the SILC. The option - maybe given to narrow down the number of accepted results. If - this is not defined there are no limit of accepted results. - The query may also be narrowed down by defining the server name - of the nickname. + It is also possible to search the user by Client ID. If + is provided server must use it as the search value instead of + the . To prevent miss-use of this service wildcards in the nickname or in the servername are not permitted. It is not allowed @@ -1709,7 +1713,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_TOO_MANY_PARAMS - 3 SILC_COMMAND_WHOWAS + 2 SILC_COMMAND_WHOWAS Max Arguments: 2 Arguments: (1) [@] (2) [] @@ -1758,7 +1762,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_TOO_MANY_PARAMS - 4 SILC_COMMAND_IDENTIFY + 3 SILC_COMMAND_IDENTIFY Max Arguments: 2 Arguments: (1) [@] (2) [] @@ -1781,7 +1785,7 @@ List of all defined commands in SILC follows. be based on specific nickname request. Implementations may not want to give interface access to this - commands as it is hardly a command that would be used a end user. + command as it is hardly a command that would be used a end user. However, it must be implemented as it is used with private message sending. @@ -1817,7 +1821,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_TOO_MANY_PARAMS - 5 SILC_COMMAND_NICK + 4 SILC_COMMAND_NICK Max Arguments: 1 Arguments: (1) @@ -1851,7 +1855,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_TOO_MANY_PARAMS - 6 SILC_COMMAND_LIST + 5 SILC_COMMAND_LIST Max Arguments: 2 Arguments: (1) [] [] @@ -1895,7 +1899,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_NO_SUCH_SERVER - 7 SILC_COMMAND_TOPIC + 6 SILC_COMMAND_TOPIC Max Arguments: 2 Arguments: (1) (2) []] @@ -1929,7 +1933,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_NO_CHANNEL_PRIV - 8 SILC_COMMAND_INVITE + 7 SILC_COMMAND_INVITE Max Arguments: 2 Arguments: (1) (2) @@ -1964,7 +1968,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_USER_ON_CHANNEL - 9 SILC_COMMAND_QUIT + 8 SILC_COMMAND_QUIT Max Arguments: 1 Arguments: (1) [] @@ -1979,7 +1983,7 @@ List of all defined commands in SILC follows. This command does not reply anything. - 10 SILC_COMMAND_KILL + 9 SILC_COMMAND_KILL Max Arguments: 2 Arguments: (1) (2) [] @@ -2012,7 +2016,7 @@ List of all defined commands in SILC follows. - 11 SILC_COMMAND_INFO + 10 SILC_COMMAND_INFO Max Arguments: 1 Arguments: (1) [] @@ -2040,7 +2044,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_NO_SUCH_SERVER - 12 SILC_COMMAND_CONNECT + 11 SILC_COMMAND_CONNECT Max Arguments: 2 Arguments: (1) @@ -2073,7 +2077,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_NO_ROUTER_PRIV - 13 SILC_COMMAND_PING + 12 SILC_COMMAND_PING Max Arguments: 1 Arguments: (1) @@ -2101,7 +2105,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_NOT_REGISTERED - 14 SILC_COMMAND_OPER + 13 SILC_COMMAND_OPER Max Arguments: 2 Arguments: (1) (2) @@ -2136,7 +2140,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_AUTH_FAILED - 15 SILC_COMMAND_JOIN + 14 SILC_COMMAND_JOIN Max Arguments: 3 Arguments: (1) (2) [] @@ -2207,7 +2211,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_USER_ON_CHANNEL - 16 SILC_COMMAND_MOTD + 15 SILC_COMMAND_MOTD Max Arguments: 1 Arguments: (1) @@ -2230,7 +2234,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_NO_SUCH_SERVER - 17 SILC_COMMAND_UMODE + 16 SILC_COMMAND_UMODE Max Arguments: 2 Arguments: (1) (2) @@ -2292,7 +2296,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_NO_CLIENT_ID - 18 SILC_COMMAND_CMODE + 17 SILC_COMMAND_CMODE Max Arguments: 8 Arguments: (1) (2) @@ -2512,7 +2516,7 @@ List of all defined commands in SILC follows. - 19 SILC_COMMAND_KICK + 18 SILC_COMMAND_KICK Max Arguments: 3 Arguments: (1) (2) @@ -2543,7 +2547,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_NO_CLIENT_ID - 20 SILC_COMMAND_RESTART + 19 SILC_COMMAND_RESTART Max Arguments: 0 Arguments: None @@ -2567,7 +2571,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_NO_SERVER_PRIV - 21 SILC_COMMAND_CLOSE + 20 SILC_COMMAND_CLOSE Max Arguments: 1 Arguments: (1) @@ -2596,7 +2600,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_NO_SUCH_SERVER_ID - 22 SILC_COMMAND_DIE + 21 SILC_COMMAND_DIE Max Arguments: 0 Arguments: None @@ -2621,7 +2625,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_NO_SERVER_PRIV - 23 SILC_COMMAND_SILCOPER + 22 SILC_COMMAND_SILCOPER Max Arguments: 2 Arguments: (1) (2) @@ -2661,7 +2665,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_AUTH_FAILED - 24 SILC_COMMAND_LEAVE + 23 SILC_COMMAND_LEAVE Max Arguments: 1 Arguments: (1) @@ -2689,7 +2693,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_NO_CHANNEL_ID - 25 SILC_COMMAND_NAMES + 24 SILC_COMMAND_NAMES Max Arguments: 1 Arguments: (1) @@ -2732,7 +2736,7 @@ List of all defined commands in SILC follows. SILC_STATUS_ERR_NOT_ON_CHANNEL - 26 - 254 + 25 - 254 Currently undefined commands. diff --git a/includes/version.h b/includes/version.h index b192a1d5..503a6a28 100644 --- a/includes/version.h +++ b/includes/version.h @@ -33,7 +33,7 @@ typedef unsigned char SilcVersion; #define SILC_VERSION_1 '\1' /* SILC version string */ -const char *silc_version = "10072000"; +const char *silc_version = "14072000"; const char *silc_name = "SILC"; const char *silc_fullname = "Secure Internet Live Conferencing"; diff --git a/lib/silccore/silccommand.h b/lib/silccore/silccommand.h index 39a2e289..155027d6 100644 --- a/lib/silccore/silccommand.h +++ b/lib/silccore/silccommand.h @@ -55,30 +55,30 @@ typedef enum { /* All SILC commands. These are commands that have client and server counterparts. These are pretty much the same as in IRC. */ #define SILC_COMMAND_NONE 0 -#define SILC_COMMAND_WHOIS 2 -#define SILC_COMMAND_WHOWAS 3 -#define SILC_COMMAND_IDENTIFY 4 -#define SILC_COMMAND_NICK 5 -#define SILC_COMMAND_LIST 6 -#define SILC_COMMAND_TOPIC 7 -#define SILC_COMMAND_INVITE 8 -#define SILC_COMMAND_QUIT 9 -#define SILC_COMMAND_KILL 10 -#define SILC_COMMAND_INFO 11 -#define SILC_COMMAND_CONNECT 12 -#define SILC_COMMAND_PING 13 -#define SILC_COMMAND_OPER 14 -#define SILC_COMMAND_JOIN 15 -#define SILC_COMMAND_MOTD 16 -#define SILC_COMMAND_UMODE 17 -#define SILC_COMMAND_CMODE 18 -#define SILC_COMMAND_KICK 19 -#define SILC_COMMAND_RESTART 20 -#define SILC_COMMAND_CLOSE 21 -#define SILC_COMMAND_DIE 22 -#define SILC_COMMAND_SILCOPER 23 -#define SILC_COMMAND_LEAVE 24 -#define SILC_COMMAND_NAMES 25 +#define SILC_COMMAND_WHOIS 1 +#define SILC_COMMAND_WHOWAS 2 +#define SILC_COMMAND_IDENTIFY 3 +#define SILC_COMMAND_NICK 4 +#define SILC_COMMAND_LIST 5 +#define SILC_COMMAND_TOPIC 6 +#define SILC_COMMAND_INVITE 7 +#define SILC_COMMAND_QUIT 8 +#define SILC_COMMAND_KILL 9 +#define SILC_COMMAND_INFO 10 +#define SILC_COMMAND_CONNECT 11 +#define SILC_COMMAND_PING 12 +#define SILC_COMMAND_OPER 13 +#define SILC_COMMAND_JOIN 14 +#define SILC_COMMAND_MOTD 15 +#define SILC_COMMAND_UMODE 16 +#define SILC_COMMAND_CMODE 17 +#define SILC_COMMAND_KICK 18 +#define SILC_COMMAND_RESTART 19 +#define SILC_COMMAND_CLOSE 20 +#define SILC_COMMAND_DIE 21 +#define SILC_COMMAND_SILCOPER 22 +#define SILC_COMMAND_LEAVE 23 +#define SILC_COMMAND_NAMES 24 /* Local commands. Local commands are unofficial commands and are implementation specific commands. These are used only by the diff --git a/lib/silccore/silcsockconn.h b/lib/silccore/silcsockconn.h index 5706b682..291a5a46 100644 --- a/lib/silccore/silcsockconn.h +++ b/lib/silccore/silcsockconn.h @@ -76,6 +76,13 @@ typedef enum { indicate several different status that can affect the use of the socket object. + char *hostname + char *ip + unsigned short port + + Resolved hostname, IP address and port of the connection who owns + this object. + SilcBuffer inbuf SilcBuffer outbuf -- 2.24.0