NewMadeleine

Documentation

nm_tags.h File Reference

Private definitions for managing tags and structures indexed by tags. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  nm_matching_wildcard_s
 struct to store matching info for wildcard requests, one per session More...
 
struct  nm_matching_wildcard_entry_s
 
struct  nm_matching_wildcard_table_s
 
struct  nm_matching_tag_s
 struct to store matching info for any-source requests of a given tag More...
 
struct  nm_matching_tag_entry_s
 
struct  nm_matching_tag_table_s
 

Macros

#define NM_TAGS_PREALLOC   255
 
#define NM_TAG_TABLE_TYPE(NAME, ENTRY_TYPE)
 macro to generate tables indexed by tags More...
 

Functions

static int nm_core_tag_eq (const nm_core_tag_t tag1, const nm_core_tag_t tag2)
 checks whether tags are equal. More...
 
static int nm_core_tag_match (nm_core_tag_t recv_tag, nm_core_tag_t lookup_tag, nm_core_tag_t mask)
 checks whether matching applies on tags- (recv_tag & mask) == lookup_tag More...
 
static uint32_t nm_core_tag_hash (const nm_core_tag_t *p_tag)
 
static int nm_core_tag_heq (const nm_core_tag_t *p_tag1, const nm_core_tag_t *p_tag2)
 checks whether tags are equal, for hashtables. More...
 
 PUK_VECT_TYPE (nm_core_tag, nm_core_tag_t)
 vector of tags, for *_get_tags() functions More...
 
__PUK_SYM_INTERNAL void nm_unexpected_wildcard_clean (struct nm_unexpected_wildcard_list_s *p_unexpected)
 
static void nm_matching_wildcard_ctor (struct nm_matching_wildcard_s *p_wildcard, nm_core_tag_t tag __attribute__((unused)))
 
static void nm_matching_wildcard_dtor (struct nm_matching_wildcard_s *p_wildcard)
 
 NM_ALLOCATOR_TYPE (nm_matching_wildcard_entry, struct nm_matching_wildcard_entry_s)
 
 PUK_HASHTABLE_TYPE (nm_matching_wildcard, nm_core_tag_t *, struct nm_matching_wildcard_entry_s *, &nm_core_tag_hash, &nm_core_tag_heq, NULL)
 
static void nm_matching_wildcard_table_init (struct nm_matching_wildcard_table_s *t)
 
static void nm_matching_wildcard_table_destroy (struct nm_matching_wildcard_table_s *t)
 
static struct nm_matching_wildcard_snm_matching_wildcard_get (struct nm_matching_wildcard_table_s *t, nm_core_tag_t tag)
 
static void nm_matching_wildcard_delete (struct nm_matching_wildcard_table_s *t, struct nm_matching_wildcard_s *_e)
 
static nm_core_tag_vect_t nm_matching_wildcard_get_tags (struct nm_matching_wildcard_table_s *t)
 
static struct nm_matching_wildcard_snm_matching_wildcard_bytag (struct nm_core *p_core, nm_core_tag_t core_tag)
 get the wildcard structure from a full tag, using only its hashcode More...
 
static void nm_matching_tag_ctor (struct nm_matching_tag_s *p_matching_tag, nm_core_tag_t tag __attribute__((unused)))
 
static void nm_matching_tag_dtor (struct nm_matching_tag_s *p_matching_tag __attribute__((unused)))
 
 NM_ALLOCATOR_TYPE (nm_matching_tag_entry, struct nm_matching_tag_entry_s)
 
 PUK_HASHTABLE_TYPE (nm_matching_tag, nm_core_tag_t *, struct nm_matching_tag_entry_s *, &nm_core_tag_hash, &nm_core_tag_heq, NULL)
 
static void nm_matching_tag_table_init (struct nm_matching_tag_table_s *t)
 
static void nm_matching_tag_table_destroy (struct nm_matching_tag_table_s *t)
 
static struct nm_matching_tag_snm_matching_tag_get (struct nm_matching_tag_table_s *t, nm_core_tag_t tag)
 
static void nm_matching_tag_delete (struct nm_matching_tag_table_s *t, struct nm_matching_tag_s *_e)
 
static nm_core_tag_vect_t nm_matching_tag_get_tags (struct nm_matching_tag_table_s *t)
 

Detailed Description

Private definitions for managing tags and structures indexed by tags.

Definition in file nm_tags.h.

Macro Definition Documentation

◆ NM_TAG_TABLE_TYPE

#define NM_TAG_TABLE_TYPE (   NAME,
  ENTRY_TYPE 
)

macro to generate tables indexed by tags

Definition at line 57 of file nm_tags.h.

◆ NM_TAGS_PREALLOC

#define NM_TAGS_PREALLOC   255

Definition at line 24 of file nm_tags.h.

Function Documentation

◆ NM_ALLOCATOR_TYPE() [1/2]

NM_ALLOCATOR_TYPE ( nm_matching_tag_entry  ,
struct nm_matching_tag_entry_s   
)

◆ NM_ALLOCATOR_TYPE() [2/2]

NM_ALLOCATOR_TYPE ( nm_matching_wildcard_entry  ,
struct nm_matching_wildcard_entry_s   
)

◆ nm_core_tag_eq()

static int nm_core_tag_eq ( const nm_core_tag_t  tag1,
const nm_core_tag_t  tag2 
)
inlinestatic

checks whether tags are equal.

Definition at line 30 of file nm_tags.h.

References nm_core_tag_s::hashcode, and nm_core_tag_s::tag.

◆ nm_core_tag_hash()

static uint32_t nm_core_tag_hash ( const nm_core_tag_t p_tag)
inlinestatic

Definition at line 42 of file nm_tags.h.

References nm_core_tag_s::hashcode, and nm_core_tag_s::tag.

◆ nm_core_tag_heq()

static int nm_core_tag_heq ( const nm_core_tag_t p_tag1,
const nm_core_tag_t p_tag2 
)
inlinestatic

checks whether tags are equal, for hashtables.

Definition at line 48 of file nm_tags.h.

References nm_core_tag_s::hashcode, and nm_core_tag_s::tag.

◆ nm_core_tag_match()

static int nm_core_tag_match ( nm_core_tag_t  recv_tag,
nm_core_tag_t  lookup_tag,
nm_core_tag_t  mask 
)
inlinestatic

checks whether matching applies on tags- (recv_tag & mask) == lookup_tag

Definition at line 35 of file nm_tags.h.

References nm_core_tag_s::hashcode, and nm_core_tag_s::tag.

◆ nm_matching_tag_ctor()

static void nm_matching_tag_ctor ( struct nm_matching_tag_s p_matching_tag,
nm_core_tag_t tag   __attribute__(unused) 
)
inlinestatic

Definition at line 150 of file nm_tags.h.

References nm_matching_tag_s::unexpected, and nm_matching_tag_s::unpacks.

◆ nm_matching_tag_delete()

static void nm_matching_tag_delete ( struct nm_matching_tag_table_s t,
struct nm_matching_tag_s _e 
)
inlinestatic

Definition at line 158 of file nm_tags.h.

◆ nm_matching_tag_dtor()

static void nm_matching_tag_dtor ( struct nm_matching_tag_s *p_matching_tag   __attribute__(unused))
inlinestatic

Definition at line 155 of file nm_tags.h.

◆ nm_matching_tag_get()

static struct nm_matching_tag_s * nm_matching_tag_get ( struct nm_matching_tag_table_s t,
nm_core_tag_t  tag 
)
inlinestatic

Definition at line 158 of file nm_tags.h.

◆ nm_matching_tag_get_tags()

static nm_core_tag_vect_t nm_matching_tag_get_tags ( struct nm_matching_tag_table_s t)
inlinestatic

Definition at line 158 of file nm_tags.h.

◆ nm_matching_tag_table_destroy()

static void nm_matching_tag_table_destroy ( struct nm_matching_tag_table_s t)
inlinestatic

Definition at line 158 of file nm_tags.h.

◆ nm_matching_tag_table_init()

static void nm_matching_tag_table_init ( struct nm_matching_tag_table_s t)
inlinestatic

Definition at line 158 of file nm_tags.h.

◆ nm_matching_wildcard_bytag()

static struct nm_matching_wildcard_s * nm_matching_wildcard_bytag ( struct nm_core p_core,
nm_core_tag_t  core_tag 
)
inlinestatic

get the wildcard structure from a full tag, using only its hashcode

◆ nm_matching_wildcard_ctor()

static void nm_matching_wildcard_ctor ( struct nm_matching_wildcard_s p_wildcard,
nm_core_tag_t tag   __attribute__(unused) 
)
inlinestatic

◆ nm_matching_wildcard_delete()

static void nm_matching_wildcard_delete ( struct nm_matching_wildcard_table_s t,
struct nm_matching_wildcard_s _e 
)
inlinestatic

Definition at line 140 of file nm_tags.h.

◆ nm_matching_wildcard_dtor()

static void nm_matching_wildcard_dtor ( struct nm_matching_wildcard_s p_wildcard)
inlinestatic

Definition at line 136 of file nm_tags.h.

References nm_unexpected_wildcard_clean(), and nm_matching_wildcard_s::unexpected.

Here is the call graph for this function:

◆ nm_matching_wildcard_get()

static struct nm_matching_wildcard_s * nm_matching_wildcard_get ( struct nm_matching_wildcard_table_s t,
nm_core_tag_t  tag 
)
inlinestatic

Definition at line 140 of file nm_tags.h.

Referenced by nm_matching_wildcard_bytag().

Here is the caller graph for this function:

◆ nm_matching_wildcard_get_tags()

static nm_core_tag_vect_t nm_matching_wildcard_get_tags ( struct nm_matching_wildcard_table_s t)
inlinestatic

Definition at line 140 of file nm_tags.h.

◆ nm_matching_wildcard_table_destroy()

static void nm_matching_wildcard_table_destroy ( struct nm_matching_wildcard_table_s t)
inlinestatic

Definition at line 140 of file nm_tags.h.

◆ nm_matching_wildcard_table_init()

static void nm_matching_wildcard_table_init ( struct nm_matching_wildcard_table_s t)
inlinestatic

Definition at line 140 of file nm_tags.h.

◆ nm_unexpected_wildcard_clean()

__PUK_SYM_INTERNAL void nm_unexpected_wildcard_clean ( struct nm_unexpected_wildcard_list_s *  p_unexpected)

Referenced by nm_matching_wildcard_dtor().

Here is the caller graph for this function:

◆ PUK_HASHTABLE_TYPE() [1/2]

PUK_HASHTABLE_TYPE ( nm_matching_tag  ,
nm_core_tag_t ,
struct nm_matching_tag_entry_s ,
nm_core_tag_hash,
nm_core_tag_heq,
NULL   
)

◆ PUK_HASHTABLE_TYPE() [2/2]

PUK_HASHTABLE_TYPE ( nm_matching_wildcard  ,
nm_core_tag_t ,
struct nm_matching_wildcard_entry_s ,
nm_core_tag_hash,
nm_core_tag_heq,
NULL   
)

◆ PUK_VECT_TYPE()

PUK_VECT_TYPE ( nm_core_tag  ,
nm_core_tag_t   
)

vector of tags, for *_get_tags() functions