aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/utils/identification.h
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2015-06-11 17:38:46 +0200
committerTobias Brunner <tobias@strongswan.org>2015-08-06 17:22:32 +0200
commit520fba489934e5a30cd3a51192c6586785c069b0 (patch)
tree76a6b621425632190dde7181767f90bb57de1d1e /src/libstrongswan/utils/identification.h
parentb2efc6181848b679a186f00963bfe02816f79d05 (diff)
downloadstrongswan-520fba489934e5a30cd3a51192c6586785c069b0.tar.bz2
strongswan-520fba489934e5a30cd3a51192c6586785c069b0.tar.xz
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.
Diffstat (limited to 'src/libstrongswan/utils/identification.h')
-rw-r--r--src/libstrongswan/utils/identification.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libstrongswan/utils/identification.h b/src/libstrongswan/utils/identification.h
index e6a9fe1c6..a172f64e9 100644
--- a/src/libstrongswan/utils/identification.h
+++ b/src/libstrongswan/utils/identification.h
@@ -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
@@ -219,6 +219,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.
*
* @param other other identification_t object