X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilccore%2Fsilccommand.h;h=8c1094ff861d41248ccde10ba37c04038d24a913;hb=40f8443d8d3a6577336ee66d18e04d9ac4d956bb;hp=691d96eee68c6a62dfaa2a6d5fafd7d53cdfb055;hpb=48df45ce74e38c47a8a05a5dcb3b57a61eeb0b5d;p=silc.git diff --git a/lib/silccore/silccommand.h b/lib/silccore/silccommand.h index 691d96ee..8c1094ff 100644 --- a/lib/silccore/silccommand.h +++ b/lib/silccore/silccommand.h @@ -1,16 +1,15 @@ /* - + silccommand.h - + Author: Pekka Riikonen - - Copyright (C) 1997 - 2001 Pekka Riikonen - + + Copyright (C) 1997 - 2005 Pekka Riikonen + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - + the Free Software Foundation; version 2 of the License. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -51,7 +50,7 @@ typedef void (*SilcCommandCb)(void *context, void *context2); /****s* silccore/SilcCommandAPI/SilcCommandPayload * * NAME - * + * * typedef struct SilcCommandPayloadStruct *SilcCommandPayload; * * DESCRIPTION @@ -67,7 +66,7 @@ typedef struct SilcCommandPayloadStruct *SilcCommandPayload; /****d* silccore/SilcCommandAPI/SilcCommandFlags * * NAME - * + * * typedef enum { ... } SilcCommandFlags; * * DESCRIPTION @@ -98,7 +97,7 @@ typedef enum { /* Command is available only for server operators */ SILC_CF_OPER = (1L << 4), - /* Command is available only for SILC (router) operators. If this + /* Command is available only for SILC (router) operators. If this is set SILC_CF_OPER is not necessary to be set. */ SILC_CF_SILC_OPER = (1L << 5), @@ -108,8 +107,8 @@ typedef enum { /****d* silccore/SilcCommandAPI/SilcCommand * * NAME - * - * typedef unsigned char SilcCommand; + * + * typedef SilcUInt8 SilcCommand; * * DESCRIPTION * @@ -119,7 +118,7 @@ typedef enum { * * SOURCE */ -typedef unsigned char SilcCommand; +typedef SilcUInt8 SilcCommand; /* All SILC commands. These are commands that have client and server counterparts. */ @@ -145,12 +144,15 @@ typedef unsigned char SilcCommand; #define SILC_COMMAND_KICK 19 #define SILC_COMMAND_BAN 20 #define SILC_COMMAND_DETACH 21 +#define SILC_COMMAND_WATCH 22 #define SILC_COMMAND_SILCOPER 23 #define SILC_COMMAND_LEAVE 24 #define SILC_COMMAND_USERS 25 #define SILC_COMMAND_GETKEY 26 +#define SILC_COMMAND_SERVICE 27 /* Private range start */ +#define SILC_COMMAND_PRIVATE 200 #define SILC_COMMAND_PRIV_CONNECT 200 #define SILC_COMMAND_PRIV_CLOSE 201 #define SILC_COMMAND_PRIV_SHUTDOWN 202 @@ -165,7 +167,7 @@ typedef unsigned char SilcCommand; * * SYNOPSIS * - * SilcCommandPayload + * SilcCommandPayload * silc_command_payload_parse(const unsigned char *payload, * SilcUInt32 payload_len); * @@ -205,7 +207,7 @@ SilcBuffer silc_command_payload_encode(SilcCommand cmd, * * SYNOPSIS * - * SilcBuffer + * SilcBuffer * silc_command_payload_encode_payload(SilcCommandPayload payload); * * DESCRIPTION @@ -220,31 +222,31 @@ SilcBuffer silc_command_payload_encode_payload(SilcCommandPayload payload); * * SYNOPSIS * - * SilcBuffer silc_command_payload_encode_va(SilcCommand cmd, - * SilcUInt16 ident, + * SilcBuffer silc_command_payload_encode_va(SilcCommand cmd, + * SilcUInt16 ident, * SilcUInt32 argc, ...); * * DESCRIPTION * * Encodes Command payload with variable argument list. The arguments - * must be: SilcUInt32, unsigned char *, unsigned int, ... One - * {SilcUInt32, unsigned char * and unsigned int} forms one argument, - * thus `argc' in case when sending one {SilcUInt32, unsigned char * + * must be: SilcUInt32, unsigned char *, unsigned int, ... One + * {SilcUInt32, unsigned char * and unsigned int} forms one argument, + * thus `argc' in case when sending one {SilcUInt32, unsigned char * * and SilcUInt32} equals one (1) and when sending two of those it * equals two (2), and so on. This has to be preserved or bad things * will happen. The variable arguments is: {type, data, data_len}. * ***/ -SilcBuffer silc_command_payload_encode_va(SilcCommand cmd, - SilcUInt16 ident, +SilcBuffer silc_command_payload_encode_va(SilcCommand cmd, + SilcUInt16 ident, SilcUInt32 argc, ...); /****f* silccore/SilcCommandAPI/silc_command_payload_encode_vap * * SYNOPSIS * - * SilcBuffer silc_command_payload_encode_vap(SilcCommand cmd, - * SilcUInt16 ident, + * SilcBuffer silc_command_payload_encode_vap(SilcCommand cmd, + * SilcUInt16 ident, * SilcUInt32 argc, va_list ap); * * DESCRIPTION @@ -253,16 +255,16 @@ SilcBuffer silc_command_payload_encode_va(SilcCommand cmd, * takes the va_list as argument. * ***/ -SilcBuffer silc_command_payload_encode_vap(SilcCommand cmd, - SilcUInt16 ident, +SilcBuffer silc_command_payload_encode_vap(SilcCommand cmd, + SilcUInt16 ident, SilcUInt32 argc, va_list ap); /****f* silccore/SilcCommandAPI/silc_command_reply_payload_encode_va * * SYNOPSIS * - * SilcBuffer - * silc_command_reply_payload_encode_va(SilcCommand cmd, + * SilcBuffer + * silc_command_reply_payload_encode_va(SilcCommand cmd, * SilcStatus status, * SilcStatus error, * SilcUInt16 ident, @@ -270,8 +272,8 @@ SilcBuffer silc_command_payload_encode_vap(SilcCommand cmd, * * DESCRIPTION * - * Same as silc_command_payload_encode_va except that this is used to - * encode strictly command reply packets. The `argc' must not count + * Same as silc_command_payload_encode_va except that this is used to + * encode strictly command reply packets. The `argc' must not count * `status' and `error' as arguments. The `status' includes the * command reply status. If single reply will be sent then it includes * SILC_STATUS_OK if error did not occur. It includes an error value @@ -289,8 +291,8 @@ SilcBuffer silc_command_payload_encode_vap(SilcCommand cmd, * replies are sent after the successful replies. * ***/ -SilcBuffer -silc_command_reply_payload_encode_va(SilcCommand cmd, +SilcBuffer +silc_command_reply_payload_encode_va(SilcCommand cmd, SilcStatus status, SilcStatus error, SilcUInt16 ident, @@ -300,8 +302,8 @@ silc_command_reply_payload_encode_va(SilcCommand cmd, * * SYNOPSIS * - * SilcBuffer - * silc_command_reply_payload_encode_vap(SilcCommand cmd, + * SilcBuffer + * silc_command_reply_payload_encode_vap(SilcCommand cmd, * SilcStatus status, * SilcStatus error, * SilcUInt16 ident, SilcUInt32 argc, @@ -313,11 +315,11 @@ silc_command_reply_payload_encode_va(SilcCommand cmd, * takes the va_list as argument. * ***/ -SilcBuffer -silc_command_reply_payload_encode_vap(SilcCommand cmd, +SilcBuffer +silc_command_reply_payload_encode_vap(SilcCommand cmd, SilcStatus status, SilcStatus error, - SilcUInt16 ident, SilcUInt32 argc, + SilcUInt16 ident, SilcUInt32 argc, va_list ap); /****f* silccore/SilcCommandAPI/silc_command_free @@ -380,7 +382,7 @@ SilcUInt16 silc_command_get_ident(SilcCommandPayload payload); * * SYNOPSIS * - * bool silc_command_get_status(SilcCommandPayload payload, + * SilcBool silc_command_get_status(SilcCommandPayload payload, * SilcStatus *status, * SilcStatus *error); * @@ -394,7 +396,7 @@ SilcUInt16 silc_command_get_ident(SilcCommandPayload payload); * which indicates that there will be list of errors. * ***/ -bool silc_command_get_status(SilcCommandPayload payload, +SilcBool silc_command_get_status(SilcCommandPayload payload, SilcStatus *status, SilcStatus *error); @@ -402,14 +404,14 @@ bool silc_command_get_status(SilcCommandPayload payload, * * SYNOPSIS * - * void silc_command_set_ident(SilcCommandPayload payload, + * void silc_command_set_ident(SilcCommandPayload payload, * SilcUInt16 ident); * * DESCRIPTION * * Function to set identifier to already allocated Command Payload. Command * payloads are frequentlly resent in SILC and thusly this makes it easy - * to set the identifier without encoding new Command Payload. + * to set the identifier without encoding new Command Payload. * ***/ void silc_command_set_ident(SilcCommandPayload payload, SilcUInt16 ident); @@ -418,7 +420,7 @@ void silc_command_set_ident(SilcCommandPayload payload, SilcUInt16 ident); * * SYNOPSIS * - * void silc_command_set_command(SilcCommandPayload payload, + * void silc_command_set_command(SilcCommandPayload payload, * SilcCommand command); * * DESCRIPTION