libosmocore 1.10.0
Osmocom core library
Loading...
Searching...
No Matches
jhash.h File Reference

Go to the source code of this file.

Data Structures

struct  osmo_unaligned_cpu32
 

Macros

#define OSMO_JHASH_MIX(a, b, c)
 
#define OSMO_JHASH_FINAL(a, b, c)
 
#define JHASH_INITVAL   0xdeadbeef
 

Functions

static uint32_t osmo_rol32 (uint32_t word, unsigned int shift)
 rol32 - rotate a 32-bit value left @word: value to rotate @shift: bits to roll
 
struct osmo_unaligned_cpu32 __attribute__ ((__packed__))
 
static uint32_t osmo_get_unaligned_cpu32 (const void *p)
 
static uint32_t osmo_jhash (const void *key, uint32_t length, uint32_t initval)
 
static uint32_t osmo_jhash2 (const uint32_t *k, uint32_t length, uint32_t initval)
 

Variables

uint32_t x
 

Macro Definition Documentation

◆ JHASH_INITVAL

#define JHASH_INITVAL   0xdeadbeef

Referenced by osmo_jhash(), and osmo_jhash2().

◆ OSMO_JHASH_FINAL

#define OSMO_JHASH_FINAL ( a,
b,
c )
Value:
{ \
c ^= b; c -= osmo_rol32(b, 14); \
a ^= c; a -= osmo_rol32(c, 11); \
b ^= a; b -= osmo_rol32(a, 25); \
c ^= b; c -= osmo_rol32(b, 16); \
a ^= c; a -= osmo_rol32(c, 4); \
b ^= a; b -= osmo_rol32(a, 14); \
c ^= b; c -= osmo_rol32(b, 24); \
}
struct abis_rsl_common_hdr c
static uint32_t osmo_rol32(uint32_t word, unsigned int shift)
rol32 - rotate a 32-bit value left @word: value to rotate @shift: bits to roll
Definition jhash.h:14

Referenced by osmo_jhash(), and osmo_jhash2().

◆ OSMO_JHASH_MIX

#define OSMO_JHASH_MIX ( a,
b,
c )
Value:
{ \
a -= c; a ^= osmo_rol32(c, 4); c += b; \
b -= a; b ^= osmo_rol32(a, 6); a += c; \
c -= b; c ^= osmo_rol32(b, 8); b += a; \
a -= c; a ^= osmo_rol32(c, 16); c += b; \
b -= a; b ^= osmo_rol32(a, 19); a += c; \
c -= b; c ^= osmo_rol32(b, 4); b += a; \
}

Referenced by osmo_jhash(), and osmo_jhash2().

Function Documentation

◆ __attribute__()

struct osmo_unaligned_cpu32 __attribute__ ( (__packed__) )

◆ osmo_get_unaligned_cpu32()

static uint32_t osmo_get_unaligned_cpu32 ( const void * p)
inlinestatic

References osmo_unaligned_cpu32::x.

Referenced by osmo_jhash().

◆ osmo_jhash()

static uint32_t osmo_jhash ( const void * key,
uint32_t length,
uint32_t initval )
inlinestatic

◆ osmo_jhash2()

static uint32_t osmo_jhash2 ( const uint32_t * k,
uint32_t length,
uint32_t initval )
inlinestatic

◆ osmo_rol32()

static uint32_t osmo_rol32 ( uint32_t word,
unsigned int shift )
inlinestatic

rol32 - rotate a 32-bit value left @word: value to rotate @shift: bits to roll

Variable Documentation

◆ x