universal_address.h File Reference

Types and functions for operating universal addresses. More...

Detailed Description

Types and functions for operating universal addresses.

Author
Martin Landsmann

Definition in file universal_address.h.

#include <stdint.h>
#include <stdlib.h>
#include "net/ipv6/addr.h"
+ Include dependency graph for universal_address.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  universal_address_container_t
 The container descriptor used to identify a universal address entry. More...
 

Macros

#define UNIVERSAL_ADDRESS_SIZE
 size of the used addresses in bytes More...
 
#define UNIVERSAL_ADDRESS_EQUAL   (0)
 return value indicating the compared addresses are equal
 
#define UNIVERSAL_ADDRESS_MATCHING_PREFIX   (1)
 return value indicating the compared addresses match up to a certain prefix
 
#define UNIVERSAL_ADDRESS_IS_ALL_ZERO_ADDRESS   (2)
 return value indicating all address bits of the entry are 0. More...
 

Functions

void universal_address_init (void)
 Initialize the data structure for the entries.
 
void universal_address_reset (void)
 Resets the universal_address_container_t::use_count for all entries.
 
universal_address_container_tuniversal_address_add (uint8_t *addr, size_t addr_size)
 Add a given address to the universal address entries. More...
 
void universal_address_rem (universal_address_container_t *entry)
 Add a given container from the universal address entries. More...
 
uint8_t * universal_address_get_address (universal_address_container_t *entry, uint8_t *addr, size_t *addr_size)
 Copy the address from the given container to the provided pointer. More...
 
int universal_address_compare (universal_address_container_t *entry, uint8_t *addr, size_t *addr_size_in_bits)
 Determine if the entry equals the provided address This function requires to be provided with the full size of the used address type behind addr to be comparable with the address stored in entry. More...
 
int universal_address_compare_prefix (universal_address_container_t *entry, uint8_t *prefix, size_t prefix_size_in_bits)
 Determine if the entry equals the provided prefix This function requires to be provided with the full size of the used address type behind prefix to be comparable with the address stored in entry. More...
 
void universal_address_print_entry (universal_address_container_t *entry)
 Print the content of the given entry. More...
 
int universal_address_get_num_used_entries (void)
 Return the number of used entries.
 
void universal_address_print_table (void)
 Print the content of the generic address table up to the used element.