]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove "hash" from RADIUS_PACKET
authorAlan T. DeKok <aland@freeradius.org>
Wed, 25 Jan 2012 10:53:29 +0000 (11:53 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 25 Jan 2012 10:53:29 +0000 (11:53 +0100)
It's no longer needed.  Various support functions are
also removed.

src/include/libradius.h
src/include/packet.h
src/lib/packet.c

index ea1411134cb263c4f00c4d754179d797b731d092..4b5618b6c9cb468b92d6776613eee62c437a6edf 100644 (file)
@@ -231,7 +231,6 @@ typedef struct radius_packet {
        uint16_t                dst_port;
        int                     id;
        unsigned int            code;
-       uint32_t                hash;
        uint8_t                 vector[AUTH_VECTOR_LEN];
        struct timeval          timestamp;
        uint8_t                 *data;
index 74e2a33e9636fe6cd573ddc5bafdc1d620865b3f..e7b5bae37148be1f86316535f4391031aa05fdff 100644 (file)
@@ -31,8 +31,6 @@ RCSIDH(packet_h, "$Id$")
 extern "C" {
 #endif
 
-uint32_t fr_request_packet_hash(const RADIUS_PACKET *packet);
-uint32_t fr_reply_packet_hash(const RADIUS_PACKET *packet);
 int fr_packet_cmp(const RADIUS_PACKET *a, const RADIUS_PACKET *b);
 int fr_inaddr_any(fr_ipaddr_t *ipaddr);
 void fr_request_from_reply(RADIUS_PACKET *request,
index ad68ce2eabca3585cb15c6d382b5761107f314f2..813360b252b424ddcd022f696f98c100b08d32a4 100644 (file)
@@ -31,102 +31,6 @@ RCSID("$Id$")
 
 #include <fcntl.h>
 
-/*
- *     Take the key fields of a request packet, and convert it to a
- *     hash.
- */
-uint32_t fr_request_packet_hash(const RADIUS_PACKET *packet)
-{
-       uint32_t hash;
-
-       if (packet->hash) return packet->hash;
-
-       hash = fr_hash(&packet->sockfd, sizeof(packet->sockfd));
-       hash = fr_hash_update(&packet->src_port, sizeof(packet->src_port),
-                               hash);
-       hash = fr_hash_update(&packet->dst_port,
-                               sizeof(packet->dst_port), hash);
-       hash = fr_hash_update(&packet->src_ipaddr.af,
-                               sizeof(packet->src_ipaddr.af), hash);
-
-       /*
-        *      The caller ensures that src & dst AF are the same.
-        */
-       switch (packet->src_ipaddr.af) {
-       case AF_INET:
-               hash = fr_hash_update(&packet->src_ipaddr.ipaddr.ip4addr,
-                                       sizeof(packet->src_ipaddr.ipaddr.ip4addr),
-                                       hash);
-               hash = fr_hash_update(&packet->dst_ipaddr.ipaddr.ip4addr,
-                                       sizeof(packet->dst_ipaddr.ipaddr.ip4addr),
-                                       hash);
-               break;
-       case AF_INET6:
-               hash = fr_hash_update(&packet->src_ipaddr.ipaddr.ip6addr,
-                                       sizeof(packet->src_ipaddr.ipaddr.ip6addr),
-                                       hash);
-               hash = fr_hash_update(&packet->dst_ipaddr.ipaddr.ip6addr,
-                                       sizeof(packet->dst_ipaddr.ipaddr.ip6addr),
-                                       hash);
-               break;
-       default:
-               break;
-       }
-
-       return fr_hash_update(&packet->id, sizeof(packet->id), hash);
-}
-
-
-/*
- *     Take the key fields of a reply packet, and convert it to a
- *     hash.
- *
- *     i.e. take a reply packet, and find the hash of the request packet
- *     that asked for the reply.  To do this, we hash the reverse fields
- *     of the request.  e.g. where the request does (src, dst), we do
- *     (dst, src)
- */
-uint32_t fr_reply_packet_hash(const RADIUS_PACKET *packet)
-{
-       uint32_t hash;
-
-       hash = fr_hash(&packet->sockfd, sizeof(packet->sockfd));
-       hash = fr_hash_update(&packet->id, sizeof(packet->id), hash);
-       hash = fr_hash_update(&packet->src_port, sizeof(packet->src_port),
-                               hash);
-       hash = fr_hash_update(&packet->dst_port,
-                               sizeof(packet->dst_port), hash);
-       hash = fr_hash_update(&packet->src_ipaddr.af,
-                               sizeof(packet->src_ipaddr.af), hash);
-
-       /*
-        *      The caller ensures that src & dst AF are the same.
-        */
-       switch (packet->src_ipaddr.af) {
-       case AF_INET:
-               hash = fr_hash_update(&packet->dst_ipaddr.ipaddr.ip4addr,
-                                       sizeof(packet->dst_ipaddr.ipaddr.ip4addr),
-                                       hash);
-               hash = fr_hash_update(&packet->src_ipaddr.ipaddr.ip4addr,
-                                       sizeof(packet->src_ipaddr.ipaddr.ip4addr),
-                                       hash);
-               break;
-       case AF_INET6:
-               hash = fr_hash_update(&packet->dst_ipaddr.ipaddr.ip6addr,
-                                       sizeof(packet->dst_ipaddr.ipaddr.ip6addr),
-                                       hash);
-               hash = fr_hash_update(&packet->src_ipaddr.ipaddr.ip6addr,
-                                       sizeof(packet->src_ipaddr.ipaddr.ip6addr),
-                                       hash);
-               break;
-       default:
-               break;
-       }
-
-       return fr_hash_update(&packet->id, sizeof(packet->id), hash);
-}
-
-
 /*
  *     See if two packets are identical.
  *