the SKE functions anymore, but this function is used to
set the callbacks.
+ * Fixed the WIN32 DLL generation in lib/Makefile.am.pre.
+
+ * Added `silc_version' argument to the silc_client_alloc
+ to define the version of the application for the library.
+ The library will use the version string to compare it
+ against the remote host's (usually a server) version
+ string. Affected file lib/silcclient/silcapi.h
+
Mon Jun 25 21:42:51 EEST 2001 Pekka Riikonen <priikone@silcnet.org>
* Do not add regex.h for WIN32. The affected file
silc_init_userinfo();
/* Allocate SILC client */
- silc_client = silc_client_alloc(&ops, NULL);
+ silc_client = silc_client_alloc(&ops, NULL, silc_version_string);
/* Load local config file */
silc_config = silc_client_config_alloc(SILC_CLIENT_HOME_CONFIG_FILE);
app = silc_calloc(1, sizeof(*app));
/* Allocate new client */
- app->client = silc = silc_client_alloc(&ops, app);
+ app->client = silc = silc_client_alloc(&ops, app, silc_version_string);
if (!silc)
goto fail;
# WIN32 DLL generation
silc.dll: libsilc.a
dllwrap --export-all --output-def silc.def \
- --implib libsilc.a --driver-name $(CC) --target i386-mingw32 \
- --mno-cygwin -o silc.dll libsilc.a -lwsock32
+ --implib silc.a --driver-name $(CC) --target i386-mingw32 \
+ -mno-cygwin -o silc.dll libsilc.a -lwsock32
silcclient.dll: libsilcclient.a
dllwrap --export-all --output-def silcclient.def \
- --implib libsilcclient.a --driver-name $(CC) --target i386-mingw32 \
- --mno-cygwin -o silcclient.dll libsilcclient.a
+ --implib silcclient.a --driver-name $(CC) --target i386-mingw32 \
+ -mno-cygwin -o silcclient.dll libsilcclient.a -L. -lsilc -lwsock32
endif
libsilc.a:
The client object is SilcClient which is usually allocated in following
manner:
- SilcClient client = silc_client_alloc(&ops, context);
+ SilcClient client = silc_client_alloc(&ops, context, version);
`ops' is the static structure of client operations that library will call.
`context' can be some application specific context that will be saved into
the client. The `application' is application specific user data pointer
and caller must free it. */
-SilcClient silc_client_alloc(SilcClientOperations *ops, void *application)
+SilcClient silc_client_alloc(SilcClientOperations *ops, void *application,
+ const char *silc_version)
{
SilcClient new_client;
new_client = silc_calloc(1, sizeof(*new_client));
new_client->application = application;
new_client->ops = ops;
+ new_client->silc_client_version = strdup(silc_version);
return new_client;
}
/* Random Number Generator. Application should use this as its primary
random number generator. */
SilcRng rng;
+
+ /* Client version. Used to compare to remote host's version strings. */
+ char *silc_client_version;
};
/* Macros */
SILC_TASK_CALLBACK(silc_client_protocol_key_exchange);
SILC_TASK_CALLBACK(silc_client_protocol_rekey);
-extern char *silc_version_string;
-
/*
* Key Exhange protocol functions
*/
if (cp)
build = atoi(cp + 1);
- cp = silc_version_string + 9;
+ cp = client->silc_client_version + 9;
if (!cp)
status = SILC_SKE_STATUS_BAD_VERSION;
/* Start the key exchange by processing the received security
properties packet from initiator. */
status = silc_ske_responder_start(ske, ctx->rng, ctx->sock,
- silc_version_string,
+ client->silc_client_version,
ctx->packet->buffer, TRUE);
} else {
SilcSKEStartPayload *start_payload;
/* Assemble security properties. */
silc_ske_assemble_security_properties(ske, SILC_SKE_SP_FLAG_NONE,
- silc_version_string,
+ client->silc_client_version,
&start_payload);
/* Start the key exchange by sending our security properties
* Allocates new client object. This has to be done before client may
* work. After calling this one must call silc_client_init to initialize
* the client. The `application' is application specific user data pointer
- * and caller must free it.
+ * and caller must free it. The `silc_version' is the application version
+ * that will be used to compare against remote host's (usually a server)
+ * version string.
*
***/
-SilcClient silc_client_alloc(SilcClientOperations *ops, void *application);
+SilcClient silc_client_alloc(SilcClientOperations *ops, void *application,
+ const char *silc_version);
/****f* silcclient/SilcClientAPI/silc_client_free
*