Documentation

Documentation

Includes

libcoap.h

#include "libcoap.h"
#include "libcoap.h"

uthash.h

#include "uthash.h"
#include "uthash.h"

str.h

#include "str.h"
#include "str.h"

Macros

Marco COAP_HASHKEY_H_

#define COAP_HASHKEY_H_


      

Marco coap_hash(String,Length,Result)

#define coap_hash(String,Length,Result) \
 coap_hash_impl((String),(Length),(Result))


      

Marco COAP_DEFAULT_HASH

#define COAP_DEFAULT_HASH
/* This is used to control the pre-set hash-keys for resources. */

Marco coap_str_hash(Str,H)

#define coap_str_hash(Str,H) {              \
   assert(Str);                            \
   memset((H), 0, sizeof(coap_key_t));     \
   coap_hash((Str)->s, (Str)->length, (H)); \
 }
/**
 * Calls coap_hash() with given @c coap_string_t object as parameter.
 *
 * @param Str Must contain a pointer to a coap string object.
 * @param H   A coap_key_t object to store the result.
 *
 * @hideinitializer
 */

Functions

Func coap_hash_impl

void coap_hash_impl(const unsigned char *s, unsigned int len, coap_key_t h);
/**
 * Calculates a fast hash over the given string @p s of length @p len and stores
 * the result into @p h. Depending on the exact implementation, this function
 * cannot be used as one-way function to check message integrity or simlar.
 *
 * @param s   The string used for hash calculation.
 * @param len The length of @p s.
 * @param h   The result buffer to store the calculated hash key.
 */

Vars

Consts

Types

Typedefs

Typedef coap_key_t[4]

typedef unsigned char coap_key_t[4];