identification: Add hash() method

Compared to hashing the encoding we can ignore string types of RDNs when
hashing DNs, making hash() compatible to equals() that does the same.

Fixes #991.
This commit is contained in:
Tobias Brunner
2015-08-06 17:22:32 +02:00
parent b2efc61818
commit 520fba4899
3 changed files with 135 additions and 3 deletions
+9 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009 Tobias Brunner
* Copyright (C) 2009-2015 Tobias Brunner
* Copyright (C) 2005-2009 Martin Willi
* Copyright (C) 2005 Jan Hutter
* Hochschule fuer Technik Rapperswil
@@ -218,6 +218,14 @@ struct identification_t {
*/
id_type_t (*get_type) (identification_t *this);
/**
* Create a hash value for this identification_t object.
*
* @param inc optional value for incremental hashing
* @return hash value
*/
u_int (*hash) (identification_t *this, u_int inc);
/**
* Check if two identification_t objects are equal.
*