Contiki 2.5
hash.h
Go to the documentation of this file.
1 /**
2  * \addtogroup agent
3  * @{
4  */
5 
6 /**
7  * \defgroup hash Hashing modules
8  *
9  * @{
10  */
11 
12 /**
13  * \file
14  * \brief This file defines the interface for Hashing modules
15  * \author Wolf-Bastian Poettner <poettner@ibr.cs.tu-bs.de>
16  */
17 
18 #ifndef HASH_H
19 #define HASH_H
20 
21 #include "contiki.h"
22 
23 /**
24  * Which hash driver are we going to use?
25  */
26 #ifdef CONF_HASH
27 #define HASH CONF_HASH
28 #else
29 #define HASH hash_xxfast
30 #endif
31 
32 /** storage module interface */
33 struct hash_driver {
34  char *name;
35 
36  /** called by agent a startup */
37  void (* init)(void);
38 
39  /** hashes the 4 arguments into 1 32 bit number */
40  uint32_t (* hash_convenience)(uint32_t one, uint32_t two, uint32_t three, uint32_t four, uint32_t five);
41 
42  /** hashes the 4 arguments into 1 32 bit number */
43  uint32_t (* hash_convenience_ptr)(uint32_t * one, uint32_t * two, uint32_t * three, uint32_t * four, uint32_t * five);
44 
45  /** hashes the buffer into 1 32 bit number */
46  uint32_t (* hash_buffer)(uint8_t * buffer, uint16_t length);
47 };
48 
49 extern const struct hash_driver HASH;
50 
51 #endif
52 /** @} */
53 /** @} */