X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Fsilcd%2Froute.h;h=0e78e739a4b66f91f57aaaa16a4a3bea2cdf462b;hb=c257b555225193e54d85daf541d29578b3c93882;hp=aec76e69ff7201e0de735fa3d2bb74312d971a6b;hpb=62f89b2886bbe9df82d9b2fdabfe707509d9e0fc;p=silc.git diff --git a/apps/silcd/route.h b/apps/silcd/route.h index aec76e69..0e78e739 100644 --- a/apps/silcd/route.h +++ b/apps/silcd/route.h @@ -2,9 +2,9 @@ route.h - Author: Pekka Riikonen + Author: Pekka Riikonen - Copyright (C) 2000 Pekka Riikonen + Copyright (C) 2000 - 2002 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 @@ -31,19 +31,19 @@ Following short description of the fields. - unsigned int dest + SilcUInt32 dest Destination IPv4 address. Can be used to quickly check whether the found route entry is what the caller wanted. - SilcServerList *router + SilcServerEntry router Pointer to the router specific data. */ typedef struct { - unsigned int dest; - SilcServerList *router; + SilcUInt32 dest; + SilcServerEntry router; } SilcServerRouteTable; /* Route cache hash table */ @@ -54,11 +54,11 @@ extern SilcServerRouteTable silc_route_cache[SILC_SERVER_ROUTE_SIZE]; /* Returns route cache hash table entry index. This is IPv4 specific. `port' argument may be zero (0) if it doesn't exist. This has been taken from Linux kernel's route cache code. */ -extern inline -unsigned int silc_server_route_hash(unsigned int addr, - unsigned short port) +static inline +SilcUInt32 silc_server_route_hash(unsigned int addr, + SilcUInt16 port) { - unsigned int hash; + SilcUInt32 hash; hash = ((addr & 0xf0f0f0f0) >> 4) | ((addr & 0x0f0f0f0f) << 4); hash ^= port; @@ -69,9 +69,11 @@ unsigned int silc_server_route_hash(unsigned int addr, } /* Prototypes */ -void silc_server_route_add(unsigned int index, unsigned int dest, - SilcServerList *router); -SilcServerList *silc_server_route_check(unsigned int dest, - unsigned short port); +void silc_server_route_add(SilcUInt32 index, unsigned int dest, + SilcServerEntry router); +SilcServerEntry silc_server_route_check(SilcUInt32 dest, + SilcUInt16 port); +SilcSocketConnection silc_server_route_get(SilcServer server, void *id, + SilcIdType id_type); #endif