dhcp_socket_t *socket;
};
-/**
- * Hashtable hash function
- */
-static u_int hash(void *key)
-{
- return (uintptr_t)key;
-}
-
-/**
- * Hashtable equals function
- */
-static bool equals(void *a, void *b)
-{
- return a == b;
-}
-
/**
* Hash ID and host to a key
*/
},
.socket = socket,
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
- .transactions = hashtable_create(hash, equals, 8),
+ .transactions = hashtable_create(hashtable_hash_ptr,
+ hashtable_equals_ptr, 8),
);
return &this->public;
*/
static private_eap_radius_forward_t *singleton = NULL;
-/**
- * Hashtable hash function
- */
-static u_int hash(uintptr_t key)
-{
- return key;
-}
-
-/**
- * Hashtable equals function
- */
-static bool equals(uintptr_t a, uintptr_t b)
-{
- return a == b;
-}
-
/**
* Free a queue entry
*/
.to_attr = parse_selector(lib->settings->get_str(lib->settings,
"%s.plugins.eap-radius.forward.radius_to_ike", "",
lib->ns)),
- .from = hashtable_create((hashtable_hash_t)hash,
- (hashtable_equals_t)equals, 8),
- .to = hashtable_create((hashtable_hash_t)hash,
- (hashtable_equals_t)equals, 8),
+ .from = hashtable_create(hashtable_hash_ptr, hashtable_equals_ptr, 8),
+ .to = hashtable_create(hashtable_hash_ptr, hashtable_equals_ptr, 8),
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
);
mutex_t *mutex;
};
-/**
- * Hashtable hash function
- */
-static u_int hash(void *key)
-{
- return (uintptr_t)key;
-}
-
-/**
- * Hashtable equals function
- */
-static bool equals(void *a, void *b)
-{
- return a == b;
-}
-
/**
* Cache entry for an IKE_SA
*/
.count = count,
.kernel = kernel,
.socket = socket,
- .cache = hashtable_create(hash, equals, 8),
+ .cache = hashtable_create(hashtable_hash_ptr, hashtable_equals_ptr, 8),
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
);
return !failed;
}
-/**
- * hashtable hash() function
- */
-static u_int hash(void *key)
-{
- return (uintptr_t)key;
-}
-
-/**
- * hashtable equals() function
- */
-static bool equals(void *key1, void *key2)
-{
- return key1 == key2;
-}
-
METHOD(cred_encoding_t, get_cache, bool,
private_cred_encoding_t *this, cred_encoding_type_t type, void *cache,
chunk_t *encoding)
for (type = 0; type < CRED_ENCODING_MAX; type++)
{
- this->cache[type] = hashtable_create(hash, equals, 8);
+ this->cache[type] = hashtable_create(hashtable_hash_ptr,
+ hashtable_equals_ptr, 8);
}
return &this->public;