From 4e39a93821bda4a61ee5be9daf05fa0c0ef93345 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Fri, 18 May 2001 09:38:30 +0000 Subject: [PATCH] updates. --- CHANGES | 8 ++++ TODO | 4 ++ apps/silcd/command.c | 7 ++- apps/silcd/command_reply.c | 54 ++++++++++------------ apps/silcd/idlist.c | 92 ++++++++++++++++++------------------- apps/silcd/packet_receive.c | 40 +++++----------- apps/silcd/server.c | 27 +++++------ lib/silccore/idcache.c | 12 +++++ lib/silccore/idcache.h | 1 + 9 files changed, 121 insertions(+), 124 deletions(-) diff --git a/CHANGES b/CHANGES index c70abe0d..0c7bd932 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,11 @@ +Fri May 18 11:18:45 EEST 2001 Pekka Riikonen + + * Added new function silc_idcache_del_by_context into the + lib/silccore/idcache.[ch]. + + * Changed the server's ID list routines to use the new ID Cache + interface. Changes around the source tree. + Fri May 18 08:35:31 EEST 2001 Pekka Riikonen * Added silc_hash_table_del[_by_context]_ext functions in to the diff --git a/TODO b/TODO index 2e7dd511..b695701e 100644 --- a/TODO +++ b/TODO @@ -19,6 +19,10 @@ TODO/bugs In SILC Client Library TODO/bugs In SILC Server ======================== + o Save channel names in the ID Cache always as lowered characters, + though allow mixed case characters in the channel entry but the ID + cache does not handle loose data searching anymore. + o When server quits and all clients of that server are removed from all channels the channel keys are re-generated for all clients. This is a bug and should be done only once per channel after all clients of diff --git a/apps/silcd/command.c b/apps/silcd/command.c index a961f6c9..b260c141 100644 --- a/apps/silcd/command.c +++ b/apps/silcd/command.c @@ -1764,8 +1764,7 @@ SILC_SERVER_CMD_FUNC(nick) new_id); /* Remove old cache entry */ - silc_idcache_del_by_id(server->local_list->clients, SILC_ID_CLIENT, - client->id); + silc_idcache_del_by_id(server->local_list->clients, client->id); oidp = silc_id_payload_encode(client->id, SILC_ID_CLIENT); @@ -1782,8 +1781,8 @@ SILC_SERVER_CMD_FUNC(nick) /* Update client cache */ silc_idcache_add(server->local_list->clients, client->nickname, - strlen(client->nickname), SILC_ID_CLIENT, client->id, - (void *)client, TRUE, FALSE); + strlen(client->nickname), client->id, + (void *)client, FALSE); nidp = silc_id_payload_encode(client->id, SILC_ID_CLIENT); diff --git a/apps/silcd/command_reply.c b/apps/silcd/command_reply.c index eec80289..fa0e2be2 100644 --- a/apps/silcd/command_reply.c +++ b/apps/silcd/command_reply.c @@ -132,7 +132,6 @@ silc_server_command_reply_whois_save(SilcServerCommandReplyContext cmd) char *nickname, *username, *realname, *servername = NULL; SilcClientID *client_id; SilcClientEntry client; - SilcIDCacheEntry cache = NULL; char global = FALSE; char *nick; uint32 mode = 0, len, id_len; @@ -159,11 +158,10 @@ silc_server_command_reply_whois_save(SilcServerCommandReplyContext cmd) /* Check if we have this client cached already. */ - client = silc_idlist_find_client_by_id(server->local_list, client_id, - &cache); + client = silc_idlist_find_client_by_id(server->local_list, client_id, NULL); if (!client) { - client = silc_idlist_find_client_by_id(server->global_list, - client_id, &cache); + client = silc_idlist_find_client_by_id(server->global_list, client_id, + NULL); global = TRUE; } @@ -226,13 +224,12 @@ silc_server_command_reply_whois_save(SilcServerCommandReplyContext cmd) client->mode = mode; client->servername = servername; - if (cache) { - cache->data = nick; - cache->data_len = strlen(nick); - silc_idcache_sort_by_data(global ? server->global_list->clients : - server->local_list->clients); - } - + /* Remove the old cache entry and create a new one */ + silc_idcache_del_by_context(global ? server->global_list->clients : + server->local_list->clients, client); + silc_idcache_add(global ? server->global_list->clients : + server->local_list->clients, nick, strlen(nick), + client->id, client, FALSE); silc_free(client_id); } @@ -360,12 +357,12 @@ silc_server_command_reply_whowas_save(SilcServerCommandReplyContext cmd) client->username = strdup(username); client->servername = servername; - if (cache) { - cache->data = nick; - cache->data_len = strlen(nick); - silc_idcache_sort_by_data(global ? server->global_list->clients : - server->local_list->clients); - } + /* Remove the old cache entry and create a new one */ + silc_idcache_del_by_context(global ? server->global_list->clients : + server->local_list->clients, client); + silc_idcache_add(global ? server->global_list->clients : + server->local_list->clients, nick, strlen(nick), + client->id, client, FALSE); } silc_free(client_id); @@ -410,7 +407,6 @@ silc_server_command_reply_identify_save(SilcServerCommandReplyContext cmd) char *nickname, *username; SilcClientID *client_id; SilcClientEntry client; - SilcIDCacheEntry cache = NULL; char global = FALSE; char *nick = NULL; @@ -426,11 +422,10 @@ silc_server_command_reply_identify_save(SilcServerCommandReplyContext cmd) /* Check if we have this client cached already. */ - client = silc_idlist_find_client_by_id(server->local_list, client_id, - &cache); + client = silc_idlist_find_client_by_id(server->local_list, client_id, NULL); if (!client) { - client = silc_idlist_find_client_by_id(server->global_list, - client_id, &cache); + client = silc_idlist_find_client_by_id(server->global_list, client_id, + NULL); global = TRUE; } @@ -485,13 +480,14 @@ silc_server_command_reply_identify_save(SilcServerCommandReplyContext cmd) client->username = strdup(username); } - if (nickname && cache) { - cache->data = nick; - cache->data_len = strlen(nick); - silc_idcache_sort_by_data(global ? server->global_list->clients : - server->local_list->clients); + /* Remove the old cache entry and create a new one */ + if (nickname) { + silc_idcache_del_by_context(global ? server->global_list->clients : + server->local_list->clients, client); + silc_idcache_add(global ? server->global_list->clients : + server->local_list->clients, nick, strlen(nick), + client->id, client, FALSE); } - silc_free(client_id); } diff --git a/apps/silcd/idlist.c b/apps/silcd/idlist.c index ae733745..d3d0b200 100644 --- a/apps/silcd/idlist.c +++ b/apps/silcd/idlist.c @@ -113,8 +113,7 @@ silc_idlist_add_server(SilcIDList id_list, if (!silc_idcache_add(id_list->servers, server->server_name, server->server_name ? strlen(server->server_name) : 0, - SILC_ID_SERVER, (void *)server->id, - (void *)server, TRUE, FALSE)) { + (void *)server->id, (void *)server, FALSE)) { silc_free(server); return NULL; } @@ -137,8 +136,8 @@ silc_idlist_find_server_by_id(SilcIDList id_list, SilcServerID *id, SILC_LOG_DEBUG(("Server ID (%s)", silc_id_render(id, SILC_ID_SERVER))); - if (!silc_idcache_find_by_id_one(id_list->servers, (void *)id, - SILC_ID_SERVER, &id_cache)) + if (!silc_idcache_find_by_id(id_list->servers, (void *)id, + &id_cache)) return NULL; server = (SilcServerEntry)id_cache->context; @@ -160,7 +159,8 @@ silc_idlist_find_server_by_name(SilcIDList id_list, char *name, SILC_LOG_DEBUG(("Server by name `%s'", name)); - if (!silc_idcache_find_by_data_one(id_list->servers, name, &id_cache)) + if (!silc_idcache_find_by_data_one(id_list->servers, name, strlen(name), + &id_cache)) return NULL; server = (SilcServerEntry)id_cache->context; @@ -186,8 +186,7 @@ silc_idlist_find_server_by_conn(SilcIDList id_list, char *hostname, SILC_LOG_DEBUG(("Server by hostname %s and port %d", hostname, port)); - if (!silc_idcache_find_by_id(id_list->servers, SILC_ID_CACHE_ANY, - SILC_ID_SERVER, &list)) + if (!silc_idcache_get_all(id_list->servers, &list)) return NULL; if (!silc_idcache_list_first(list, &id_cache)) { @@ -235,8 +234,7 @@ silc_idlist_replace_server_id(SilcIDList id_list, SilcServerID *old_id, SILC_LOG_DEBUG(("Replacing Server ID")); - if (!silc_idcache_find_by_id_one(id_list->servers, (void *)old_id, - SILC_ID_SERVER, &id_cache)) + if (!silc_idcache_find_by_id(id_list->servers, (void *)old_id, &id_cache)) return NULL; server = (SilcServerEntry)id_cache->context; @@ -258,8 +256,7 @@ int silc_idlist_del_server(SilcIDList id_list, SilcServerEntry entry) if (entry) { /* Remove from cache */ if (entry->id) - if (!silc_idcache_del_by_id(id_list->servers, SILC_ID_SERVER, - (void *)entry->id)) + if (!silc_idcache_del_by_id(id_list->servers, (void *)entry->id)) return FALSE; /* Free data */ @@ -312,8 +309,7 @@ silc_idlist_add_client(SilcIDList id_list, unsigned char *nickname, client_list); if (!silc_idcache_add(id_list->clients, nickname, nickname_len, - SILC_ID_CLIENT, (void *)client->id, - (void *)client, TRUE, FALSE)) { + (void *)client->id, (void *)client, FALSE)) { silc_free(client); return NULL; } @@ -331,8 +327,7 @@ int silc_idlist_del_client(SilcIDList id_list, SilcClientEntry entry) if (entry) { /* Remove from cache */ if (entry->id) - if (!silc_idcache_del_by_id(id_list->clients, SILC_ID_CLIENT, - (void *)entry->id)) + if (!silc_idcache_del_by_id(id_list->clients, (void *)entry->id)) return FALSE; /* Free data */ @@ -368,7 +363,8 @@ int silc_idlist_get_clients_by_nickname(SilcIDList id_list, char *nickname, SILC_LOG_DEBUG(("Start")); - if (!silc_idcache_find_by_data(id_list->clients, nickname, &list)) + if (!silc_idcache_find_by_data(id_list->clients, nickname, strlen(nickname), + &list)) return FALSE; *clients = silc_realloc(*clients, @@ -410,7 +406,8 @@ int silc_idlist_get_clients_by_hash(SilcIDList id_list, char *nickname, silc_hash_make(md5hash, nickname, strlen(nickname), hash); - if (!silc_idcache_find_by_data(id_list->clients, hash, &list)) + if (!silc_idcache_find_by_data(id_list->clients, hash, + md5hash->hash->hash_len, &list)) return FALSE; *clients = silc_realloc(*clients, @@ -446,8 +443,7 @@ silc_idlist_find_client_by_id(SilcIDList id_list, SilcClientID *id, SILC_LOG_DEBUG(("Client ID (%s)", silc_id_render(id, SILC_ID_CLIENT))); - if (!silc_idcache_find_by_id_one(id_list->clients, (void *)id, - SILC_ID_CLIENT, &id_cache)) + if (!silc_idcache_find_by_id(id_list->clients, (void *)id, &id_cache)) return NULL; client = (SilcClientEntry)id_cache->context; @@ -474,8 +470,7 @@ silc_idlist_replace_client_id(SilcIDList id_list, SilcClientID *old_id, SILC_LOG_DEBUG(("Replacing Client ID")); - if (!silc_idcache_find_by_id_one(id_list->clients, (void *)old_id, - SILC_ID_CLIENT, &id_cache)) + if (!silc_idcache_find_by_id(id_list->clients, (void *)old_id, &id_cache)) return NULL; client = (SilcClientEntry)id_cache->context; @@ -483,13 +478,14 @@ silc_idlist_replace_client_id(SilcIDList id_list, SilcClientID *old_id, client->id = new_id; id_cache->id = (void *)new_id; + /* XXX does not work correctly with the new ID Cache */ + /* If the old ID Cache data was the hash value of the old Client ID replace it with the hash of new Client ID */ if (id_cache->data && SILC_ID_COMPARE_HASH(old_id, id_cache->data)) { silc_free(id_cache->data); id_cache->data = silc_calloc(sizeof(new_id->hash), sizeof(unsigned char)); memcpy(id_cache->data, new_id->hash, sizeof(new_id->hash)); - silc_idcache_sort_by_data(id_list->clients); } SILC_LOG_DEBUG(("Replaced")); @@ -555,9 +551,8 @@ silc_idlist_add_channel(SilcIDList id_list, char *channel_name, int mode, channel_list); if (!silc_idcache_add(id_list->channels, channel->channel_name, - channel->channel_name ? strlen(channel->channel_name) : - 0, SILC_ID_CHANNEL, - (void *)channel->id, (void *)channel, TRUE, FALSE)) { + strlen(channel->channel_name), + (void *)channel->id, (void *)channel, FALSE)) { silc_free(channel); return NULL; } @@ -576,8 +571,7 @@ int silc_idlist_del_channel(SilcIDList id_list, SilcChannelEntry entry) /* Remove from cache */ if (entry->id) - if (!silc_idcache_del_by_id(id_list->channels, SILC_ID_CHANNEL, - (void *)entry->id)) + if (!silc_idcache_del_by_id(id_list->channels, (void *)entry->id)) return FALSE; /* Free data */ @@ -630,7 +624,7 @@ silc_idlist_find_channel_by_name(SilcIDList id_list, char *name, SILC_LOG_DEBUG(("Channel by name")); - if (!silc_idcache_find_by_data_loose(id_list->channels, name, &list)) + if (!silc_idcache_find_by_data(id_list->channels, name, strlen(name), &list)) return NULL; if (!silc_idcache_list_first(list, &id_cache)) { @@ -665,8 +659,7 @@ silc_idlist_find_channel_by_id(SilcIDList id_list, SilcChannelID *id, SILC_LOG_DEBUG(("Channel ID (%s)", silc_id_render(id, SILC_ID_CHANNEL))); - if (!silc_idcache_find_by_id_one(id_list->channels, (void *)id, - SILC_ID_CHANNEL, &id_cache)) + if (!silc_idcache_find_by_id(id_list->channels, (void *)id, &id_cache)) return NULL; channel = (SilcChannelEntry)id_cache->context; @@ -694,8 +687,7 @@ silc_idlist_replace_channel_id(SilcIDList id_list, SilcChannelID *old_id, SILC_LOG_DEBUG(("Replacing Channel ID")); - if (!silc_idcache_find_by_id_one(id_list->channels, (void *)old_id, - SILC_ID_CHANNEL, &id_cache)) + if (!silc_idcache_find_by_id(id_list->channels, (void *)old_id, &id_cache)) return NULL; channel = (SilcChannelEntry)id_cache->context; @@ -717,26 +709,34 @@ silc_idlist_get_channels(SilcIDList id_list, SilcChannelID *channel_id, { SilcIDCacheList list = NULL; SilcIDCacheEntry id_cache = NULL; - SilcChannelEntry *channels; - int i; + SilcChannelEntry *channels = NULL; + int i = 0; SILC_LOG_DEBUG(("Start")); - if (!silc_idcache_find_by_id(id_list->channels, channel_id ? channel_id : - SILC_ID_CACHE_ANY, SILC_ID_CHANNEL, &list)) - return NULL; + if (!channel_id) { + if (!silc_idcache_get_all(id_list->channels, &list)) + return NULL; - channels = silc_calloc(silc_idcache_list_count(list), sizeof(*channels)); + channels = silc_calloc(silc_idcache_list_count(list), sizeof(*channels)); + + i = 0; + silc_idcache_list_first(list, &id_cache); + channels[i++] = (SilcChannelEntry)id_cache->context; + + while (silc_idcache_list_next(list, &id_cache)) + channels[i++] = (SilcChannelEntry)id_cache->context; + + silc_idcache_list_free(list); + } else { + if (!silc_idcache_find_by_id(id_list->channels, channel_id, &id_cache)) + return NULL; - i = 0; - silc_idcache_list_first(list, &id_cache); - channels[i++] = (SilcChannelEntry)id_cache->context; + i = 1; + channels = silc_calloc(1, sizeof(*channels)); + channels[0] = (SilcChannelEntry)id_cache->context; + } - while (silc_idcache_list_next(list, &id_cache)) - channels[i++] = (SilcChannelEntry)id_cache->context; - - silc_idcache_list_free(list); - if (channels_count) *channels_count = i; diff --git a/apps/silcd/packet_receive.c b/apps/silcd/packet_receive.c index b325fd6a..5091da02 100644 --- a/apps/silcd/packet_receive.c +++ b/apps/silcd/packet_receive.c @@ -1274,7 +1274,6 @@ SilcClientEntry silc_server_new_client(SilcServer server, { SilcBuffer buffer = packet->buffer; SilcClientEntry client; - SilcIDCacheEntry cache; SilcClientID *client_id; SilcBuffer reply; SilcIDListData idata; @@ -1291,14 +1290,8 @@ SilcClientEntry silc_server_new_client(SilcServer server, client = (SilcClientEntry)sock->user_data; idata = (SilcIDListData)client; - /* Fetch the old client cache entry so that we can update it. */ - if (!silc_idcache_find_by_context(server->local_list->clients, - sock->user_data, &cache)) { - SILC_LOG_ERROR(("Lost client's cache entry - bad thing")); - silc_server_disconnect_remote(server, sock, "Server closed connection: " - "Unknown client"); - return NULL; - } + /* Remove the old cache entry */ + silc_idcache_del_by_context(server->local_list->clients, client); /* Parse incoming packet */ ret = silc_buffer_unformat(buffer, @@ -1339,12 +1332,9 @@ SilcClientEntry silc_server_new_client(SilcServer server, client->id = client_id; id_len = silc_id_get_len(client_id, SILC_ID_CLIENT); - /* Update the cache entry */ - cache->id = (void *)client_id; - cache->type = SILC_ID_CLIENT; - cache->data = username; - cache->data_len = strlen(username); - silc_idcache_sort_by_data(server->local_list->clients); + /* Add the client again to the ID cache */ + silc_idcache_add(server->local_list->clients, client->nickname, + strlen(client->nickname), client_id, client, FALSE); /* Notify our router about new client on the SILC network */ if (!server->standalone) @@ -1434,7 +1424,6 @@ SilcServerEntry silc_server_new_server(SilcServer server, { SilcBuffer buffer = packet->buffer; SilcServerEntry new_server; - SilcIDCacheEntry cache; SilcServerID *server_id; SilcIDListData idata; unsigned char *server_name, *id_string; @@ -1451,12 +1440,8 @@ SilcServerEntry silc_server_new_server(SilcServer server, new_server = (SilcServerEntry)sock->user_data; idata = (SilcIDListData)new_server; - /* Fetch the old server cache entry so that we can update it. */ - if (!silc_idcache_find_by_context(server->local_list->servers, - sock->user_data, &cache)) { - SILC_LOG_ERROR(("Lost server's cache entry - bad thing")); - return NULL; - } + /* Remove the old cache entry */ + silc_idcache_del_by_context(server->local_list->servers, new_server); /* Parse the incoming packet */ ret = silc_buffer_unformat(buffer, @@ -1490,17 +1475,14 @@ SilcServerEntry silc_server_new_server(SilcServer server, } silc_free(id_string); - /* Update client entry */ + /* Update server entry */ idata->registered = TRUE; new_server->server_name = server_name; new_server->id = server_id; - /* Update the cache entry */ - cache->id = (void *)server_id; - cache->type = SILC_ID_SERVER; - cache->data = server_name; - cache->data_len = strlen(server_name); - silc_idcache_sort_by_data(server->local_list->servers); + /* Add again the entry to the ID cache. */ + silc_idcache_add(server->local_list->servers, server_name, + strlen(server_name), server_id, server, FALSE); /* Distribute the information about new server in the SILC network to our router. If we are normal server we won't send anything diff --git a/apps/silcd/server.c b/apps/silcd/server.c index 455a8c33..8435e02a 100644 --- a/apps/silcd/server.c +++ b/apps/silcd/server.c @@ -182,17 +182,17 @@ int silc_server_init(SilcServer server) /* Initialize ID caches */ server->local_list->clients = - silc_idcache_alloc(0, silc_idlist_client_destructor); - server->local_list->servers = silc_idcache_alloc(0, NULL); - server->local_list->channels = silc_idcache_alloc(0, NULL); + silc_idcache_alloc(0, SILC_ID_CLIENT, silc_idlist_client_destructor); + server->local_list->servers = silc_idcache_alloc(0, SILC_ID_SERVER, NULL); + server->local_list->channels = silc_idcache_alloc(0, SILC_ID_CHANNEL, NULL); /* These are allocated for normal server as well as these hold some global information that the server has fetched from its router. For router these are used as they are supposed to be used on router. */ server->global_list->clients = - silc_idcache_alloc(0, silc_idlist_client_destructor); - server->global_list->servers = silc_idcache_alloc(0, NULL); - server->global_list->channels = silc_idcache_alloc(0, NULL); + silc_idcache_alloc(0, SILC_ID_CLIENT, silc_idlist_client_destructor); + server->global_list->servers = silc_idcache_alloc(0, SILC_ID_SERVER, NULL); + server->global_list->channels = silc_idcache_alloc(0, SILC_ID_CHANNEL, NULL); /* Allocate the entire socket list that is used in server. Eventually all connections will have entry in this table (it is a table of @@ -2297,8 +2297,7 @@ int silc_server_remove_clients_by_server(SilcServer server, silc_buffer_free(idp); } - if (silc_idcache_find_by_id(server->local_list->clients, - SILC_ID_CACHE_ANY, SILC_ID_CLIENT, &list)) { + if (silc_idcache_get_all(server->local_list->clients, &list)) { if (silc_idcache_list_first(list, &id_cache)) { while (id_cache) { @@ -2351,8 +2350,7 @@ int silc_server_remove_clients_by_server(SilcServer server, silc_idcache_list_free(list); } - if (silc_idcache_find_by_id(server->global_list->clients, - SILC_ID_CACHE_ANY, SILC_ID_CLIENT, &list)) { + if (silc_idcache_get_all(server->global_list->clients, &list)) { if (silc_idcache_list_first(list, &id_cache)) { while (id_cache) { @@ -3105,8 +3103,7 @@ static void silc_server_announce_get_servers(SilcServer server, SilcBuffer idp; /* Go through all clients in the list */ - if (silc_idcache_find_by_id(id_list->servers, SILC_ID_CACHE_ANY, - SILC_ID_SERVER, &list)) { + if (silc_idcache_get_all(id_list->servers, &list)) { if (silc_idcache_list_first(list, &id_cache)) { while (id_cache) { entry = (SilcServerEntry)id_cache->context; @@ -3172,8 +3169,7 @@ static void silc_server_announce_get_clients(SilcServer server, SilcBuffer idp; /* Go through all clients in the list */ - if (silc_idcache_find_by_id(id_list->clients, SILC_ID_CACHE_ANY, - SILC_ID_CLIENT, &list)) { + if (silc_idcache_get_all(id_list->clients, &list)) { if (silc_idcache_list_first(list, &id_cache)) { while (id_cache) { client = (SilcClientEntry)id_cache->context; @@ -3321,8 +3317,7 @@ void silc_server_announce_get_channels(SilcServer server, SILC_LOG_DEBUG(("Start")); /* Go through all channels in the list */ - if (silc_idcache_find_by_id(id_list->channels, SILC_ID_CACHE_ANY, - SILC_ID_CHANNEL, &list)) { + if (silc_idcache_get_all(id_list->channels, &list)) { if (silc_idcache_list_first(list, &id_cache)) { while (id_cache) { channel = (SilcChannelEntry)id_cache->context; diff --git a/lib/silccore/idcache.c b/lib/silccore/idcache.c index 9842a7d7..6c307d2a 100644 --- a/lib/silccore/idcache.c +++ b/lib/silccore/idcache.c @@ -212,6 +212,18 @@ bool silc_idcache_del_by_id(SilcIDCache cache, void *id) return silc_idcache_del(cache, c); } +/* Deletes ID cache entry by context. */ + +bool silc_idcache_del_by_context(SilcIDCache cache, void *context) +{ + SilcIDCacheEntry c; + + if (!silc_hash_table_find(cache->context_table, context, NULL, (void *)&c)) + return FALSE; + + return silc_idcache_del(cache, c); +} + /* Deletes all ID entries from cache. Free's memory as well. */ bool silc_idcache_del_all(SilcIDCache cache) diff --git a/lib/silccore/idcache.h b/lib/silccore/idcache.h index 98f01014..032bad70 100644 --- a/lib/silccore/idcache.h +++ b/lib/silccore/idcache.h @@ -88,6 +88,7 @@ bool silc_idcache_add(SilcIDCache cache, unsigned char *data, uint32 data_len, void *id, void *context, int expire); bool silc_idcache_del(SilcIDCache cache, SilcIDCacheEntry old); bool silc_idcache_del_by_id(SilcIDCache cache, void *id); +bool silc_idcache_del_by_context(SilcIDCache cache, void *context); bool silc_idcache_del_all(SilcIDCache cache); bool silc_idcache_purge(SilcIDCache cache); bool silc_idcache_purge_by_context(SilcIDCache cache, void *context); -- 2.24.0