GNUnet 0.29.1-12-g57a93edc3
 
Loading...
Searching...
No Matches
gnunet_hashmap_lib.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2001-2026 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
73#include "gnunet_common.h"
74#if ! defined (__GNUNET_UTIL_LIB_H_INSIDE__)
75#error "Only <gnunet_util_lib.h> can be included directly."
76#endif
77
78#ifndef GNUNET_HASHMAP_LIB_H
79#define GNUNET_HASHMAP_LIB_H
80
81#ifdef __cplusplus
82extern "C" {
83#if 0 /* keep Emacsens' auto-indent happy */
84}
85#endif
86#endif
87
88#include <string.h>
89#include "gnunet_crypto_lib.h"
90
91
130
131
132/* ********************* untyped implementation ********************* */
133
138#define GNUNET_CONTAINER_MULTIMAP_MAX_KEY_SIZE 1024
139
140
174
175
181
182
188
189
201typedef enum GNUNET_GenericReturnValue
203 void *cls,
204 const void *key,
205 void *value);
206
207
219GNUNET_CONTAINER_multimap_create_ (unsigned int len,
220 size_t key_size,
222
223
231void
233
234
242unsigned int
244
245
255void *
257 const void *key);
258
259
270 const struct GNUNET_CONTAINER_MultiMap *map,
271 const void *key);
272
273
285 const struct GNUNET_CONTAINER_MultiMap *map,
286 const void *key,
287 const void *value);
288
289
306 const void *key,
307 void *value,
309
310
323 const void *key,
324 const void *value);
325
326
335int
337 const void *key);
338
339
347unsigned int
349
350
362int
366 void *it_cls);
367
368
382int
385 const void *key,
387 void *it_cls);
388
389
402 const struct GNUNET_CONTAINER_MultiMap *map);
403
404
418 void *key,
419 const void **value);
420
421
428void
431
432
433/* ************************* typed wrappers ************************* */
434
441#define GNUNET_CONTAINER_MULTIMAP_CHECK_(cond) \
442 ((void) sizeof (char[(cond) ? 1 : -1]))
443
444
445/* The function definitions in the following macros are formatted by
446 hand: uncrustify cannot tell that they are function definitions. */
447/* *INDENT-OFF* */
448
454#define GNUNET_CONTAINER_MULTIMAP_DEFINE_COMMON_(prefix, MapType, IterType, \
455 ValueType) \
456 struct MapType; \
457 struct IterType; \
458 \
459 static inline GNUNET_UNUSED void \
460 prefix ## _destroy (struct MapType *map) \
461 { \
462 GNUNET_CONTAINER_multimap_destroy_ ( \
463 (struct GNUNET_CONTAINER_MultiMap *) map); \
464 } \
465 \
466 static inline GNUNET_UNUSED unsigned int \
467 prefix ## _size (const struct MapType *map) \
468 { \
469 return GNUNET_CONTAINER_multimap_size_ ( \
470 (const struct GNUNET_CONTAINER_MultiMap *) map); \
471 } \
472 \
473 static inline GNUNET_UNUSED unsigned int \
474 prefix ## _clear (struct MapType *map) \
475 { \
476 return GNUNET_CONTAINER_multimap_clear_ ( \
477 (struct GNUNET_CONTAINER_MultiMap *) map); \
478 } \
479 \
480 static inline GNUNET_UNUSED struct IterType * \
481 prefix ## _iterator_create (const struct MapType *map) \
482 { \
483 return (struct IterType *) \
484 GNUNET_CONTAINER_multimap_iterator_create_ ( \
485 (const struct GNUNET_CONTAINER_MultiMap *) map); \
486 } \
487 \
488 static inline GNUNET_UNUSED void \
489 prefix ## _iterator_destroy (struct IterType *iter) \
490 { \
491 GNUNET_CONTAINER_multimap_iterator_destroy_ ( \
492 (struct GNUNET_CONTAINER_MultiMapIterator *) iter); \
493 } \
494 \
495 static inline GNUNET_UNUSED enum GNUNET_GenericReturnValue \
496 prefix ## _iterator_next_value_ (struct IterType *iter, \
497 void *key, \
498 const ValueType **value) \
499 { \
500 const void *v; \
501 enum GNUNET_GenericReturnValue ret; \
502 \
503 ret = GNUNET_CONTAINER_multimap_iterator_next_ ( \
504 (struct GNUNET_CONTAINER_MultiMapIterator *) iter, \
505 key, \
506 &v); \
507 if ((GNUNET_YES == ret) && (NULL != value)) \
508 { \
509 *value = (const ValueType *) v; \
510 } \
511 return ret; \
512 }
513
514
589#define GNUNET_CONTAINER_MULTIMAP_DEFINE_PTRKEY(prefix, MapType, IterType, \
590 CbType, KeyType, ValueType) \
591 GNUNET_CONTAINER_MULTIMAP_DEFINE_COMMON_ (prefix, MapType, IterType, \
592 ValueType) \
593 \
594 typedef enum GNUNET_GenericReturnValue \
595 (*CbType)(void *cls, \
596 const KeyType *key, \
597 ValueType *value); \
598 \
599 struct prefix ## _Trampoline_ \
600 { \
601 CbType cb; \
602 void *cb_cls; \
603 }; \
604 \
605 static inline GNUNET_UNUSED enum GNUNET_GenericReturnValue \
606 prefix ## _trampoline_ (void *cls, \
607 const void *key, \
608 void *value) \
609 { \
610 const struct prefix ## _Trampoline_ *t = \
611 (const struct prefix ## _Trampoline_ *) cls; \
612 \
613 return t->cb (t->cb_cls, \
614 (const KeyType *) key, \
615 (ValueType *) value); \
616 } \
617 \
618 static inline GNUNET_UNUSED struct MapType * \
619 prefix ## _create (unsigned int len, \
620 int do_not_copy_keys) \
621 { \
622 GNUNET_CONTAINER_MULTIMAP_CHECK_ ( \
623 sizeof (KeyType) <= GNUNET_CONTAINER_MULTIMAP_MAX_KEY_SIZE); \
624 GNUNET_CONTAINER_MULTIMAP_CHECK_ (__alignof__ (KeyType) <= 8); \
625 return (struct MapType *) GNUNET_CONTAINER_multimap_create_ ( \
626 len, \
627 sizeof (KeyType), \
628 do_not_copy_keys \
629 ? GNUNET_CONTAINER_MULTIMAP_FLAG_DO_NOT_COPY_KEYS \
630 : GNUNET_CONTAINER_MULTIMAP_FLAG_NONE); \
631 } \
632 \
633 static inline GNUNET_UNUSED struct MapType * \
634 prefix ## _create_unprotected (unsigned int len, \
635 int do_not_copy_keys) \
636 { \
637 GNUNET_CONTAINER_MULTIMAP_CHECK_ ( \
638 sizeof (KeyType) <= GNUNET_CONTAINER_MULTIMAP_MAX_KEY_SIZE); \
639 GNUNET_CONTAINER_MULTIMAP_CHECK_ (__alignof__ (KeyType) <= 8); \
640 return (struct MapType *) GNUNET_CONTAINER_multimap_create_ ( \
641 len, \
642 sizeof (KeyType), \
643 (enum GNUNET_CONTAINER_MultiMapFlags) \
644 (GNUNET_CONTAINER_MULTIMAP_FLAG_UNPROTECTED \
645 | (do_not_copy_keys \
646 ? GNUNET_CONTAINER_MULTIMAP_FLAG_DO_NOT_COPY_KEYS \
647 : GNUNET_CONTAINER_MULTIMAP_FLAG_NONE))); \
648 } \
649 \
650 static inline GNUNET_UNUSED ValueType * \
651 prefix ## _get (const struct MapType *map, \
652 const KeyType *key) \
653 { \
654 return (ValueType *) GNUNET_CONTAINER_multimap_get_ ( \
655 (const struct GNUNET_CONTAINER_MultiMap *) map, \
656 key); \
657 } \
658 \
659 static inline GNUNET_UNUSED enum GNUNET_GenericReturnValue \
660 prefix ## _contains (const struct MapType *map, \
661 const KeyType *key) \
662 { \
663 return GNUNET_CONTAINER_multimap_contains_ ( \
664 (const struct GNUNET_CONTAINER_MultiMap *) map, \
665 key); \
666 } \
667 \
668 static inline GNUNET_UNUSED enum GNUNET_GenericReturnValue \
669 prefix ## _contains_value (const struct MapType *map, \
670 const KeyType *key, \
671 const ValueType *value) \
672 { \
673 return GNUNET_CONTAINER_multimap_contains_value_ ( \
674 (const struct GNUNET_CONTAINER_MultiMap *) map, \
675 key, \
676 value); \
677 } \
678 \
679 static inline GNUNET_UNUSED enum GNUNET_GenericReturnValue \
680 prefix ## _put (struct MapType *map, \
681 const KeyType *key, \
682 ValueType *value, \
683 enum GNUNET_CONTAINER_MultiHashMapOption opt) \
684 { \
685 return GNUNET_CONTAINER_multimap_put_ ( \
686 (struct GNUNET_CONTAINER_MultiMap *) map, \
687 key, \
688 (void *) value, \
689 opt); \
690 } \
691 \
692 static inline GNUNET_UNUSED enum GNUNET_GenericReturnValue \
693 prefix ## _remove (struct MapType *map, \
694 const KeyType *key, \
695 const ValueType *value) \
696 { \
697 return GNUNET_CONTAINER_multimap_remove_ ( \
698 (struct GNUNET_CONTAINER_MultiMap *) map, \
699 key, \
700 value); \
701 } \
702 \
703 static inline GNUNET_UNUSED int \
704 prefix ## _remove_all (struct MapType *map, \
705 const KeyType *key) \
706 { \
707 return GNUNET_CONTAINER_multimap_remove_all_ ( \
708 (struct GNUNET_CONTAINER_MultiMap *) map, \
709 key); \
710 } \
711 \
712 static inline GNUNET_UNUSED int \
713 prefix ## _iterate (struct MapType *map, \
714 CbType it, \
715 void *it_cls) \
716 { \
717 struct prefix ## _Trampoline_ t; \
718 \
719 t.cb = it; \
720 t.cb_cls = it_cls; \
721 return GNUNET_CONTAINER_multimap_iterate_ ( \
722 (struct GNUNET_CONTAINER_MultiMap *) map, \
723 (NULL == it) ? NULL : &prefix ## _trampoline_, \
724 &t); \
725 } \
726 \
727 static inline GNUNET_UNUSED int \
728 prefix ## _get_multiple (struct MapType *map, \
729 const KeyType *key, \
730 CbType it, \
731 void *it_cls) \
732 { \
733 struct prefix ## _Trampoline_ t; \
734 \
735 t.cb = it; \
736 t.cb_cls = it_cls; \
737 return GNUNET_CONTAINER_multimap_get_multiple_ ( \
738 (struct GNUNET_CONTAINER_MultiMap *) map, \
739 key, \
740 (NULL == it) ? NULL : &prefix ## _trampoline_, \
741 &t); \
742 } \
743 \
744 static inline GNUNET_UNUSED enum GNUNET_GenericReturnValue \
745 prefix ## _iterator_next (struct IterType *iter, \
746 KeyType *key, \
747 const ValueType **value) \
748 { \
749 return prefix ## _iterator_next_value_ (iter, \
750 key, \
751 value); \
752 }
753
754
784#define GNUNET_CONTAINER_MULTIMAP_DEFINE_VALKEY(prefix, MapType, IterType, \
785 CbType, KeyType, ValueType) \
786 GNUNET_CONTAINER_MULTIMAP_DEFINE_COMMON_ (prefix, MapType, IterType, \
787 ValueType) \
788 \
789 typedef enum GNUNET_GenericReturnValue \
790 (*CbType)(void *cls, \
791 KeyType key, \
792 ValueType *value); \
793 \
794 struct prefix ## _Trampoline_ \
795 { \
796 CbType cb; \
797 void *cb_cls; \
798 }; \
799 \
800 static inline GNUNET_UNUSED enum GNUNET_GenericReturnValue \
801 prefix ## _trampoline_ (void *cls, \
802 const void *key, \
803 void *value) \
804 { \
805 const struct prefix ## _Trampoline_ *t = \
806 (const struct prefix ## _Trampoline_ *) cls; \
807 KeyType k; \
808 \
809 memcpy (&k, key, sizeof (k)); \
810 return t->cb (t->cb_cls, \
811 k, \
812 (ValueType *) value); \
813 } \
814 \
815 static inline GNUNET_UNUSED struct MapType * \
816 prefix ## _create (unsigned int len) \
817 { \
818 GNUNET_CONTAINER_MULTIMAP_CHECK_ (sizeof (KeyType) <= 8); \
819 return (struct MapType *) GNUNET_CONTAINER_multimap_create_ ( \
820 len, \
821 sizeof (KeyType), \
822 GNUNET_CONTAINER_MULTIMAP_FLAG_NONE); \
823 } \
824 \
825 static inline GNUNET_UNUSED struct MapType * \
826 prefix ## _create_unprotected (unsigned int len) \
827 { \
828 GNUNET_CONTAINER_MULTIMAP_CHECK_ (sizeof (KeyType) <= 8); \
829 return (struct MapType *) GNUNET_CONTAINER_multimap_create_ ( \
830 len, \
831 sizeof (KeyType), \
832 GNUNET_CONTAINER_MULTIMAP_FLAG_UNPROTECTED); \
833 } \
834 \
835 static inline GNUNET_UNUSED ValueType * \
836 prefix ## _get (const struct MapType *map, \
837 KeyType key) \
838 { \
839 return (ValueType *) GNUNET_CONTAINER_multimap_get_ ( \
840 (const struct GNUNET_CONTAINER_MultiMap *) map, \
841 &key); \
842 } \
843 \
844 static inline GNUNET_UNUSED enum GNUNET_GenericReturnValue \
845 prefix ## _contains (const struct MapType *map, \
846 KeyType key) \
847 { \
848 return GNUNET_CONTAINER_multimap_contains_ ( \
849 (const struct GNUNET_CONTAINER_MultiMap *) map, \
850 &key); \
851 } \
852 \
853 static inline GNUNET_UNUSED enum GNUNET_GenericReturnValue \
854 prefix ## _contains_value (const struct MapType *map, \
855 KeyType key, \
856 const ValueType *value) \
857 { \
858 return GNUNET_CONTAINER_multimap_contains_value_ ( \
859 (const struct GNUNET_CONTAINER_MultiMap *) map, \
860 &key, \
861 value); \
862 } \
863 \
864 static inline GNUNET_UNUSED enum GNUNET_GenericReturnValue \
865 prefix ## _put (struct MapType *map, \
866 KeyType key, \
867 ValueType *value, \
868 enum GNUNET_CONTAINER_MultiHashMapOption opt) \
869 { \
870 return GNUNET_CONTAINER_multimap_put_ ( \
871 (struct GNUNET_CONTAINER_MultiMap *) map, \
872 &key, \
873 (void *) value, \
874 opt); \
875 } \
876 \
877 static inline GNUNET_UNUSED enum GNUNET_GenericReturnValue \
878 prefix ## _remove (struct MapType *map, \
879 KeyType key, \
880 const ValueType *value) \
881 { \
882 return GNUNET_CONTAINER_multimap_remove_ ( \
883 (struct GNUNET_CONTAINER_MultiMap *) map, \
884 &key, \
885 value); \
886 } \
887 \
888 static inline GNUNET_UNUSED int \
889 prefix ## _remove_all (struct MapType *map, \
890 KeyType key) \
891 { \
892 return GNUNET_CONTAINER_multimap_remove_all_ ( \
893 (struct GNUNET_CONTAINER_MultiMap *) map, \
894 &key); \
895 } \
896 \
897 static inline GNUNET_UNUSED int \
898 prefix ## _iterate (struct MapType *map, \
899 CbType it, \
900 void *it_cls) \
901 { \
902 struct prefix ## _Trampoline_ t; \
903 \
904 t.cb = it; \
905 t.cb_cls = it_cls; \
906 return GNUNET_CONTAINER_multimap_iterate_ ( \
907 (struct GNUNET_CONTAINER_MultiMap *) map, \
908 (NULL == it) ? NULL : &prefix ## _trampoline_, \
909 &t); \
910 } \
911 \
912 static inline GNUNET_UNUSED int \
913 prefix ## _get_multiple (struct MapType *map, \
914 KeyType key, \
915 CbType it, \
916 void *it_cls) \
917 { \
918 struct prefix ## _Trampoline_ t; \
919 \
920 t.cb = it; \
921 t.cb_cls = it_cls; \
922 return GNUNET_CONTAINER_multimap_get_multiple_ ( \
923 (struct GNUNET_CONTAINER_MultiMap *) map, \
924 &key, \
925 (NULL == it) ? NULL : &prefix ## _trampoline_, \
926 &t); \
927 } \
928 \
929 static inline GNUNET_UNUSED enum GNUNET_GenericReturnValue \
930 prefix ## _iterator_next (struct IterType *iter, \
931 KeyType *key, \
932 const ValueType **value) \
933 { \
934 return prefix ## _iterator_next_value_ (iter, \
935 key, \
936 value); \
937 }
938
939
940/* *INDENT-ON* */
941
942
943/* *************************** the classics ************************* */
944
954 GNUNET_CONTAINER_multihashmap,
955 GNUNET_CONTAINER_MultiHashMap,
956 GNUNET_CONTAINER_MultiHashMapIterator,
958 struct GNUNET_HashCode,
959 void)
960
961
970 GNUNET_CONTAINER_multipeermap,
971 GNUNET_CONTAINER_MultiPeerMap,
972 GNUNET_CONTAINER_MultiPeerMapIterator,
974 struct GNUNET_PeerIdentity,
975 void)
976
977
986 GNUNET_CONTAINER_multishortmap,
987 GNUNET_CONTAINER_MultiShortmap,
988 GNUNET_CONTAINER_MultiShortmapIterator,
991 void)
992
993
1002 GNUNET_CONTAINER_multiuuidmap,
1003 GNUNET_CONTAINER_MultiUuidmap,
1004 GNUNET_CONTAINER_MultiUuidmapIterator,
1006 struct GNUNET_Uuid,
1007 void)
1008
1009
1018 GNUNET_CONTAINER_multihashmap32,
1019 GNUNET_CONTAINER_MultiHashMap32,
1020 GNUNET_CONTAINER_MultiHashMap32Iterator,
1022 uint32_t,
1023 void)
1024
1025
1026#if 0 /* keep Emacsens' auto-indent happy */
1027{
1028#endif
1029#ifdef __cplusplus
1030}
1031#endif
1032
1033
1034/* ifndef GNUNET_HASHMAP_LIB_H */
1035#endif
1036
/* end of group hashmap */
1038
/* end of group addition to libgnunetutil */
1040
1041/* end of gnunet_hashmap_lib.h */
struct GNUNET_HashCode key
The key used in the DHT.
static char * value
Value of the record to add/remove.
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
cryptographic primitives for GNUnet
int GNUNET_CONTAINER_multimap_iterate_(struct GNUNET_CONTAINER_MultiMap *map, GNUNET_CONTAINER_MultiMapIteratorCallback it, void *it_cls)
Call a function on every key-value pair of a map.
unsigned int GNUNET_CONTAINER_multimap_clear_(struct GNUNET_CONTAINER_MultiMap *map)
Remove all key-value pairs from a map.
struct GNUNET_CONTAINER_MultiMapIterator * GNUNET_CONTAINER_multimap_iterator_create_(const struct GNUNET_CONTAINER_MultiMap *map)
Create an iterator over a map.
#define GNUNET_CONTAINER_MULTIMAP_DEFINE_VALKEY(prefix, MapType, IterType, CbType, KeyType, ValueType)
Define a hash map type whose keys are passed by value, for keys of up to 8 bytes such as integers.
enum GNUNET_GenericReturnValue(* GNUNET_CONTAINER_ShortmapIterator)(void *cls, const struct GNUNET_ShortHashCode *key, void *value)
enum GNUNET_GenericReturnValue(* GNUNET_CONTAINER_PeerMapIterator)(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
void GNUNET_CONTAINER_multimap_iterator_destroy_(struct GNUNET_CONTAINER_MultiMapIterator *iter)
Destroy an iterator.
enum GNUNET_GenericReturnValue(* GNUNET_CONTAINER_MultiHashMapIterator32Callback)(void *cls, uint32_t key, void *value)
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multimap_contains_(const struct GNUNET_CONTAINER_MultiMap *map, const void *key)
Check if the map has any value stored under a key.
enum GNUNET_GenericReturnValue(* GNUNET_CONTAINER_MultiMapIteratorCallback)(void *cls, const void *key, void *value)
Iterator over the entries of a map with untyped keys and values.
GNUNET_CONTAINER_MultiHashMapOption
Options for storing values in the HashMap.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multimap_remove_(struct GNUNET_CONTAINER_MultiMap *map, const void *key, const void *value)
Remove a key-value pair from a map.
void GNUNET_CONTAINER_multimap_destroy_(struct GNUNET_CONTAINER_MultiMap *map)
Destroy a map.
#define GNUNET_CONTAINER_MULTIMAP_DEFINE_PTRKEY(prefix, MapType, IterType, CbType, KeyType, ValueType)
Define a hash map type whose keys are passed by pointer.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multimap_put_(struct GNUNET_CONTAINER_MultiMap *map, const void *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in a map.
unsigned int GNUNET_CONTAINER_multimap_size_(const struct GNUNET_CONTAINER_MultiMap *map)
Get the number of key-value pairs in a map.
void * GNUNET_CONTAINER_multimap_get_(const struct GNUNET_CONTAINER_MultiMap *map, const void *key)
Get a value stored under a key.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multimap_iterator_next_(struct GNUNET_CONTAINER_MultiMapIterator *iter, void *key, const void **value)
Get the next key-value pair from an iterator.
struct GNUNET_CONTAINER_MultiMap * GNUNET_CONTAINER_multimap_create_(unsigned int len, size_t key_size, enum GNUNET_CONTAINER_MultiMapFlags flags)
Create a map.
enum GNUNET_GenericReturnValue(* GNUNET_CONTAINER_MultiUuidmapIteratorCallback)(void *cls, const struct GNUNET_Uuid *key, void *value)
int GNUNET_CONTAINER_multimap_remove_all_(struct GNUNET_CONTAINER_MultiMap *map, const void *key)
Remove all values stored under a key from a map.
int GNUNET_CONTAINER_multimap_get_multiple_(struct GNUNET_CONTAINER_MultiMap *map, const void *key, GNUNET_CONTAINER_MultiMapIteratorCallback it, void *it_cls)
Call a function on every value stored under a key.
GNUNET_CONTAINER_MultiMapFlags
Flags for GNUNET_CONTAINER_multimap_create_().
enum GNUNET_GenericReturnValue(* GNUNET_CONTAINER_MultiHashMapIteratorCallback)(void *cls, const struct GNUNET_HashCode *key, void *value)
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multimap_contains_value_(const struct GNUNET_CONTAINER_MultiMap *map, const void *key, const void *value)
Check if the map has a particular key-value pair.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST
, ' bother checking if a value already exists (faster than GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE...
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE
Allow multiple values with the same key.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY
There must only be one value per key; storing a value should fail if a value under the same key alrea...
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE
If a value with the given key exists, replace it.
@ GNUNET_CONTAINER_MULTIMAP_FLAG_NONE
Copy keys longer than 8 bytes into the map.
@ GNUNET_CONTAINER_MULTIMAP_FLAG_UNPROTECTED
Do not protect the map against hash flooding.
@ GNUNET_CONTAINER_MULTIMAP_FLAG_DO_NOT_COPY_KEYS
Do not copy keys longer than 8 bytes into the map, only keep a pointer to them.
GNUNET_GenericReturnValue
Named constants for return values.
static struct GNUNET_CONTAINER_MultiPeerMap * map
Peermap of PeerIdentities to "struct PeerEntry" (for fast lookup).
Definition peer.c:63
Internal representation of a map.
size_t key_size
Size of the keys in bytes.
A 512-bit hashcode.
The identity of the host (wraps the signing key of the peer).
A 256-bit hashcode.
A UUID, a 128 bit "random" value.