Renamed "connect" and "disconnect" client operations to
"connected" and "disconnected".
* If version string in silc_clinet_alloc is NULL the library
puts it automatically. Affected file lib/silcclient/client.c.
* If version string in silc_clinet_alloc is NULL the library
puts it automatically. Affected file lib/silcclient/client.c.
+ * Changed the version strings from variables to #define's
+ in includes/silcversion.h.
+
Wed Oct 30 16:17:30 CET 2002 Pekka Riikonen <priikone@silcnet.org>
* Added shared library complation support.
Wed Oct 30 16:17:30 CET 2002 Pekka Riikonen <priikone@silcnet.org>
* Added shared library complation support.
#include "silc-channels.h"
#include "silc-queries.h"
#include "silc-nicklist.h"
#include "silc-channels.h"
#include "silc-queries.h"
#include "silc-nicklist.h"
-#include "silcversion.h"
#include "signals.h"
#include "levels.h"
#include "signals.h"
#include "levels.h"
SILC_TASK_CALLBACK(silc_server_protocol_key_exchange);
SILC_TASK_CALLBACK(silc_server_protocol_rekey);
SILC_TASK_CALLBACK(silc_server_protocol_key_exchange);
SILC_TASK_CALLBACK(silc_server_protocol_rekey);
-extern char *silc_version_string;
-
/*
* Key Exhange protocol functions
*/
/*
* Key Exhange protocol functions
*/
/* Include generic SILC type definitions */
#include "silctypes.h"
/* Include generic SILC type definitions */
#include "silctypes.h"
+#include "silcversion.h"
/* Math library includes */
#include "silcmp.h"
/* Math library includes */
#include "silcmp.h"
#include "version_internal.h"
#include "version_internal.h"
-/* Version type definition */
-typedef unsigned char SilcVersion;
-
/* SILC Protocol version number */
#define SILC_PROTOCOL_VERSION_CURRENT 11
/* SILC version string */
/* SILC Protocol version number */
#define SILC_PROTOCOL_VERSION_CURRENT 11
/* SILC version string */
-const char *silc_version = SILC_VERSION_STRING;
-const char *silc_dist_version = SILC_DIST_VERSION_STRING;
-const char *silc_version_string = SILC_PROTOCOL_VERSION_STRING;
-const char *silc_name = SILC_NAME;
-const char *silc_fullname = "Secure Internet Live Conferencing";
+#define silc_version SILC_VERSION_STRING
+#define silc_dist_version SILC_DIST_VERSION_STRING
+#define silc_version_string SILC_PROTOCOL_VERSION_STRING
+#define silc_name SILC_NAME
+#define silc_fullname "Secure Internet Live Conferencing"
in includes/version.h file. */
client = silc_client_alloc(&ops, NULL, NULL, silc_version_string);
in includes/version.h file. */
client = silc_client_alloc(&ops, NULL, NULL, silc_version_string);
- /* Register default ciphers, pkcs, hash funtions and hmacs. */
- silc_cipher_register_default();
- silc_pkcs_register_default();
- silc_hash_register_default();
- silc_hmac_register_default();
-
/* Set the mandatory pointers, read public and private key from
files (or somewhere) and return pointers and PKCS context. */
client->username = silc_get_username();
/* Set the mandatory pointers, read public and private key from
files (or somewhere) and return pointers and PKCS context. */
client->username = silc_get_username();
#include "silcincludes.h"
#include "silcclient.h"
#include "client_internal.h"
#include "silcincludes.h"
#include "silcclient.h"
#include "client_internal.h"
-#include "silcversion.h"
/* Static task callback prototypes */
SILC_TASK_CALLBACK(silc_client_connect_to_server_start);
/* Static task callback prototypes */
SILC_TASK_CALLBACK(silc_client_connect_to_server_start);
SilcClient silc_client_alloc(SilcClientOperations *ops,
SilcClientParams *params,
void *application,
SilcClient silc_client_alloc(SilcClientOperations *ops,
SilcClientParams *params,
void *application,
- const char *silc_version)
+ const char *version_string)
new_client->internal->ops = ops;
new_client->internal->params =
silc_calloc(1, sizeof(*new_client->internal->params));
new_client->internal->ops = ops;
new_client->internal->params =
silc_calloc(1, sizeof(*new_client->internal->params));
- if (!silc_version)
- silc_version = silc_version_string;
- new_client->internal->silc_client_version = strdup(silc_version);
+ if (!version_string)
+ version_string = silc_version_string;
+ new_client->internal->silc_client_version = strdup(version_string);
if (params)
memcpy(new_client->internal->params, params, sizeof(*params));
if (params)
memcpy(new_client->internal->params, params, sizeof(*params));
client->internal->ops->say(client, conn, SILC_CLIENT_MESSAGE_ERROR,
"Error: Could not start key exchange protocol");
silc_net_close_connection(conn->sock->sock);
client->internal->ops->say(client, conn, SILC_CLIENT_MESSAGE_ERROR,
"Error: Could not start key exchange protocol");
silc_net_close_connection(conn->sock->sock);
- client->internal->ops->connect(client, conn, SILC_CLIENT_CONN_ERROR);
+ client->internal->ops->connected(client, conn, SILC_CLIENT_CONN_ERROR);
return;
}
conn->sock->protocol = protocol;
return;
}
conn->sock->protocol = protocol;
(SilcClientKEInternalContext *)context;
SilcClient client = (SilcClient)ctx->client;
(SilcClientKEInternalContext *)context;
SilcClient client = (SilcClient)ctx->client;
- client->internal->ops->connect(client, ctx->sock->user_data,
- SILC_CLIENT_CONN_ERROR);
+ client->internal->ops->connected(client, ctx->sock->user_data,
+ SILC_CLIENT_CONN_ERROR);
if (ctx->packet)
silc_packet_context_free(ctx->packet);
silc_free(ctx);
if (ctx->packet)
silc_packet_context_free(ctx->packet);
silc_free(ctx);
(SilcClientConnAuthInternalContext *)context;
SilcClient client = (SilcClient)ctx->client;
(SilcClientConnAuthInternalContext *)context;
SilcClient client = (SilcClient)ctx->client;
- client->internal->ops->connect(client, ctx->sock->user_data,
- SILC_CLIENT_CONN_ERROR);
+ client->internal->ops->connected(client, ctx->sock->user_data,
+ SILC_CLIENT_CONN_ERROR);
silc_free(ctx);
/* Notify application of failure */
silc_free(ctx);
/* Notify application of failure */
- client->internal->ops->connect(client, conn, SILC_CLIENT_CONN_ERROR);
+ client->internal->ops->connected(client, conn, SILC_CLIENT_CONN_ERROR);
silc_client_del_connection(client, conn);
}
return;
silc_client_del_connection(client, conn);
}
return;
close the connection */
if (SILC_IS_DISCONNECTING(sock)) {
if (sock == conn->sock && sock->type != SILC_SOCKET_TYPE_CLIENT)
close the connection */
if (SILC_IS_DISCONNECTING(sock)) {
if (sock == conn->sock && sock->type != SILC_SOCKET_TYPE_CLIENT)
- client->internal->ops->disconnect(client, conn, 0, NULL);
+ client->internal->ops->disconnected(client, conn, 0, NULL);
silc_client_close_connection_real(client, sock, conn);
return;
}
SILC_LOG_DEBUG(("EOF from connection %d", sock->sock));
if (sock == conn->sock && sock->type != SILC_SOCKET_TYPE_CLIENT)
silc_client_close_connection_real(client, sock, conn);
return;
}
SILC_LOG_DEBUG(("EOF from connection %d", sock->sock));
if (sock == conn->sock && sock->type != SILC_SOCKET_TYPE_CLIENT)
- client->internal->ops->disconnect(client, conn, 0, NULL);
+ client->internal->ops->disconnected(client, conn, 0, NULL);
silc_client_close_connection_real(client, sock, conn);
return;
}
silc_client_close_connection_real(client, sock, conn);
return;
}
sock->protocol->state = SILC_PROTOCOL_STATE_ERROR;
silc_protocol_execute_final(sock->protocol, client->schedule);
/* The application will recall this function with these protocols
sock->protocol->state = SILC_PROTOCOL_STATE_ERROR;
silc_protocol_execute_final(sock->protocol, client->schedule);
/* The application will recall this function with these protocols
- (the ops->connect client operation). */
+ (the ops->connected client operation). */
return;
} else {
sock->protocol->state = SILC_PROTOCOL_STATE_ERROR;
return;
} else {
sock->protocol->state = SILC_PROTOCOL_STATE_ERROR;
conn = (SilcClientConnection)sock->user_data;
if (sock == conn->sock && sock->type != SILC_SOCKET_TYPE_CLIENT)
conn = (SilcClientConnection)sock->user_data;
if (sock == conn->sock && sock->type != SILC_SOCKET_TYPE_CLIENT)
- client->internal->ops->disconnect(client, conn, status, message);
+ client->internal->ops->disconnected(client, conn, status, message);
SilcBuffer sidp;
/* Notify application that connection is created to server */
SilcBuffer sidp;
/* Notify application that connection is created to server */
- client->internal->ops->connect(client, conn, success ?
- SILC_CLIENT_CONN_SUCCESS_RESUME :
- SILC_CLIENT_CONN_ERROR);
+ client->internal->ops->connected(client, conn, success ?
+ SILC_CLIENT_CONN_SUCCESS_RESUME :
+ SILC_CLIENT_CONN_ERROR);
if (success) {
/* Issue INFO command to fetch the real server name and server
if (success) {
/* Issue INFO command to fetch the real server name and server
/* Notify application of successful connection. We do it here now that
we've received the Client ID and are allowed to send traffic. */
/* Notify application of successful connection. We do it here now that
we've received the Client ID and are allowed to send traffic. */
- client->internal->ops->connect(client, conn, SILC_CLIENT_CONN_SUCCESS);
+ client->internal->ops->connected(client, conn, SILC_CLIENT_CONN_SUCCESS);
/* Issue INFO command to fetch the real server name and server
information and other stuff. */
/* Issue INFO command to fetch the real server name and server
information and other stuff. */
silc_client_close_connection. */
static void
silc_client_close_connection. */
static void
-silc_connect(SilcClient client, SilcClientConnection conn,
- SilcClientConnectionStatus status)
+silc_connected(SilcClient client, SilcClientConnection conn,
+ SilcClientConnectionStatus status)
received from server. */
static void
received from server. */
static void
-silc_disconnect(SilcClient client, SilcClientConnection conn,
- SilcStatus status, const char *message)
+silc_disconnected(SilcClient client, SilcClientConnection conn,
+ SilcStatus status, const char *message)
silc_notify,
silc_command,
silc_command_reply,
silc_notify,
silc_command,
silc_command_reply,
- silc_connect,
- silc_disconnect,
+ silc_connected,
+ silc_disconnected,
silc_get_auth_method,
silc_verify_public_key,
silc_ask_passphrase,
silc_get_auth_method,
silc_verify_public_key,
silc_ask_passphrase,
QuitInternal q = (QuitInternal)context;
/* Close connection */
QuitInternal q = (QuitInternal)context;
/* Close connection */
- q->client->internal->ops->disconnect(q->client, q->conn, 0, NULL);
+ q->client->internal->ops->disconnected(q->client, q->conn, 0, NULL);
silc_client_close_connection(q->client, q->conn->sock->user_data);
silc_free(q);
silc_client_close_connection(q->client, q->conn->sock->user_data);
silc_free(q);
The `status' indicated whether the connection were successful. If it
is error value the application must always call the function
silc_client_close_connection. */
The `status' indicated whether the connection were successful. If it
is error value the application must always call the function
silc_client_close_connection. */
- void (*connect)(SilcClient client, SilcClientConnection conn,
- SilcClientConnectionStatus status);
+ void (*connected)(SilcClient client, SilcClientConnection conn,
+ SilcClientConnectionStatus status);
/* Called to indicate that connection was disconnected to the server.
The `status' may tell the reason of the disconnection, and if the
`message' is non-NULL it may include the disconnection message
received from server. */
/* Called to indicate that connection was disconnected to the server.
The `status' may tell the reason of the disconnection, and if the
`message' is non-NULL it may include the disconnection message
received from server. */
- void (*disconnect)(SilcClient client, SilcClientConnection conn,
- SilcStatus status, const char *message);
+ void (*disconnected)(SilcClient client, SilcClientConnection conn,
+ SilcStatus status, const char *message);
/* Find authentication method and authentication data by hostname and
port. The hostname may be IP address as well. When the authentication
/* Find authentication method and authentication data by hostname and
port. The hostname may be IP address as well. When the authentication
SilcClient silc_client_alloc(SilcClientOperations *ops,
SilcClientParams *params,
void *application,
SilcClient silc_client_alloc(SilcClientOperations *ops,
SilcClientParams *params,
void *application,
- const char *silc_version);
+ const char *version_string);
/****f* silcclient/SilcClientAPI/silc_client_free
*
/****f* silcclient/SilcClientAPI/silc_client_free
*
* directly to the server using this function. If application is using
* the silc_client_command_call, this function is usually not used.
*
* directly to the server using this function. If application is using
* the silc_client_command_call, this function is usually not used.
*
+ * The variable arguments are a pair of { type, data, data_length },
+ * and the `argc' is the number of these pairs.
+ *
+ * EXAMPLE
+ *
+ * silc_client_command_send(client, conn, SILC_COMMAND_WHOIS, 0, 1,
+ * 1, nickname, strlen(nickname));
+ *
***/
void silc_client_command_send(SilcClient client, SilcClientConnection conn,
SilcCommand command, SilcUInt16 ident,
***/
void silc_client_command_send(SilcClient client, SilcClientConnection conn,
SilcCommand command, SilcUInt16 ident,