PadicoTM

Documentation

« back to PM2 home.

Internal structures for NS-basic. More...

#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <Padico/Puk.h>
#include <Padico/Module.h>
#include <Padico/PadicoTM.h>
#include <Padico/Topology.h>
#include <Padico/NetSelector.h>
Include dependency graph for Ns-basic-internals.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ns_node_s
 
struct  ns_host_s
 
struct  ns_group_s
 
struct  ns_entity_s
 
struct  ns_target_s
 
struct  ns_rule_bucket_s
 
struct  ns_rulebucket_hash_entry_s
 stores an entry in the hashtable More...
 
struct  ns_rulebucket_hash_entry_block_lfstack_cell_s
 
struct  ns_rulebucket_hash_entry_block_lfstack_s
 
struct  ns_rulebucket_hash_entry_slice_lfstack_cell_s
 
struct  ns_rulebucket_hash_entry_slice_lfstack_s
 
struct  ns_rulebucket_hash_entry_allocator_s
 
struct  ns_rulebucket_hashtable_s
 
struct  ns_rulebucket_hashtable_enumerator_s
 
struct  ns_entity_byname_hash_entry_s
 stores an entry in the hashtable More...
 
struct  ns_entity_byname_hash_entry_block_lfstack_cell_s
 
struct  ns_entity_byname_hash_entry_block_lfstack_s
 
struct  ns_entity_byname_hash_entry_slice_lfstack_cell_s
 
struct  ns_entity_byname_hash_entry_slice_lfstack_s
 
struct  ns_entity_byname_hash_entry_allocator_s
 
struct  ns_entity_byname_hashtable_s
 
struct  ns_entity_byname_hashtable_enumerator_s
 
struct  padico_ns_database_s
 

Macros

#define PADICO_NS_DEFAULT_PROFILE   "default"
 

Typedefs

typedef struct ns_entity_s * ns_entity_t
 
typedef uint32_t(* ns_rulebucket_hash_hfunc_t) (const struct ns_rule_bucket_s *key)
 
typedef int(* ns_rulebucket_hash_eqfunc_t) (const struct ns_rule_bucket_s *key1, const struct ns_rule_bucket_s *key2)
 
typedef void(* ns_rulebucket_hash_destructor_t) (const struct ns_rule_bucket_s *key, ns_rule_list_t data)
 
typedef struct ns_rulebucket_hash_entry_block_lfstack_s ns_rulebucket_hash_entry_block_lfstack_t
 
typedef struct ns_rulebucket_hash_entry_slice_lfstack_s ns_rulebucket_hash_entry_slice_lfstack_t
 
typedef struct ns_rulebucket_hash_entry_allocator_s * ns_rulebucket_hash_entry_allocator_t
 
typedef struct ns_rulebucket_hashtable_s * ns_rulebucket_hashtable_t
 
typedef struct ns_rulebucket_hashtable_enumerator_s * ns_rulebucket_hashtable_enumerator_t
 
typedef uint32_t(* ns_entity_byname_hash_hfunc_t) (const char *key)
 
typedef int(* ns_entity_byname_hash_eqfunc_t) (const char *key1, const char *key2)
 
typedef void(* ns_entity_byname_hash_destructor_t) (const char *key, ns_entity_t data)
 
typedef struct ns_entity_byname_hash_entry_block_lfstack_s ns_entity_byname_hash_entry_block_lfstack_t
 
typedef struct ns_entity_byname_hash_entry_slice_lfstack_s ns_entity_byname_hash_entry_slice_lfstack_t
 
typedef struct ns_entity_byname_hash_entry_allocator_s * ns_entity_byname_hash_entry_allocator_t
 
typedef struct ns_entity_byname_hashtable_s * ns_entity_byname_hashtable_t
 
typedef struct ns_entity_byname_hashtable_enumerator_s * ns_entity_byname_hashtable_enumerator_t
 

Functions

static uint32_t ns_rulebucket_hash (const struct ns_rule_bucket_s *r)
 
static int ns_rulebucket_eq (const struct ns_rule_bucket_s *r1, const struct ns_rule_bucket_s *r2)
 
struct ns_rulebucket_hash_entry_block_lfstack_cell_s __attribute__ ((aligned(16)))
 
 __attribute__ ((unused)) static inline void ns_rulebucket_hash_entry_allocator_init_thread(struct ns_rulebucket_hash_entry_allocator_s *a
 explicit thread level
 
 if (!single) pthread_spin_unlock(&_stack -> _lock)
 
 if (_cell !=NULL)
 
 assert (slab_size > 0)
 
 ns_rulebucket_hash_entry_allocator_init_thread (a, slab_size,(1))
 
 if (block !=NULL) rblocks++
 
 while (block !=NULL)
 
 if (slice !=NULL)
 
 padico_free_func (slice, puk_mod_binary_get_profile(), padico_module_self_name(), __func__, __FILE__, __LINE__))
 
 while (slice !=NULL)
 
 if (check &&(rblocks !=allocated_blocks)) do
 
 while (0)
 
 __attribute__ ((unused, nonnull)) static inline void ns_rulebucket_hashtable_init(ns_rulebucket_hashtable_t h)
 initialize a new hashtable
 
 assert (cell !=NULL)
 
puk_allocator_cell_clear & cell (struct ns_rulebucket_hash_entry_s)
 
static struct ns_rulebucket_hash_entry_s * ns_rulebucket_hash_entry_lookup (ns_rulebucket_hashtable_t h, const const struct ns_rule_bucket_s *key)
 
static void ns_rulebucket_hash_entry_insert (ns_rulebucket_hashtable_t h, const struct ns_rule_bucket_s *key, ns_rule_list_t data)
 
static int ns_rulebucket_hash_entry_oldprobe (ns_rulebucket_hashtable_t h, const const struct ns_rule_bucket_s *key)
 
static void ns_rulebucket_hash_entry_rehash_row (ns_rulebucket_hashtable_t h, ssize_t z)
 
static void ns_rulebucket_hash_entry_rehash_n (ns_rulebucket_hashtable_t h, ssize_t n)
 
static void ns_rulebucket_hash_entry_rehash_flush (ns_rulebucket_hashtable_t h)
 
 if (source->key !=((const struct ns_rule_bucket_s *) 0))
 
 __attribute__ ((unused, nonnull(1))) static inline void ns_rulebucket_hashtable_insert(ns_rulebucket_hashtable_t h
 insert an entry into a hashtable
 
 assert (key !=((const struct ns_rule_bucket_s *) 0))
 
 if (e)
 
 return (e !=NULL)
 
 if (e !=NULL)
 
 if (data) *data = ( ns_rule_list_t )0
 
 if (h->table==NULL) return
 
 while (e &&(e->key !=((const struct ns_rule_bucket_s *) 0)))
 
 while (ns_rulebucket_hash_entry_oldprobe(h, key))
 
 ns_rulebucket_hash_entry_rehash_flush (h)
 
 assert (e->h !=NULL)
 
 assert (e->h->oldtable==NULL)
 
 if (e->current &&e->current->next)
 
 if (e->i< e->h->size)
 
 ns_rulebucket_hashtable_remove (h, *key)
 
 ns_entity_byname_hash_entry_allocator_init_thread (a, slab_size,(1))
 
puk_allocator_cell_clear & cell (struct ns_entity_byname_hash_entry_s)
 
static struct ns_entity_byname_hash_entry_s * ns_entity_byname_hash_entry_lookup (ns_entity_byname_hashtable_t h, const const char *key)
 
static void ns_entity_byname_hash_entry_insert (ns_entity_byname_hashtable_t h, const char *key, ns_entity_t data)
 
static int ns_entity_byname_hash_entry_oldprobe (ns_entity_byname_hashtable_t h, const const char *key)
 
static void ns_entity_byname_hash_entry_rehash_row (ns_entity_byname_hashtable_t h, ssize_t z)
 
static void ns_entity_byname_hash_entry_rehash_n (ns_entity_byname_hashtable_t h, ssize_t n)
 
static void ns_entity_byname_hash_entry_rehash_flush (ns_entity_byname_hashtable_t h)
 
 while (e &&(e->key !=((const char *) 0)))
 
 while (ns_entity_byname_hash_entry_oldprobe(h, key))
 
 ns_entity_byname_hash_entry_rehash_flush (h)
 
 ns_entity_byname_hashtable_remove (h, *key)
 
 __attribute__ ((visibility("internal"))) int ns_basic_parse_init(void)
 Init the parser.
 

Variables

typdef struct ns_group_vect_s * ns_group_vect_t
 
typdef struct ns_entity_vect_s * ns_entity_vect_t
 
typdef struct ns_target_vect_s * ns_target_vect_t
 
 ns_rule
 
puk_component_t assembly
 Serial assembly used.
 
struct ns_target_vect_s targets
 
struct ns_rulebucket_hash_entry_block_lfstack_cell_s * _next = _stack->_head
 
struct ns_rulebucket_hash_entry_block_lfstack_s __attribute__
 
struct ns_rulebucket_hash_entry_block_lfstack_cell_s * _cell { ns_rulebucket_hash_entry_block_lfstack_push_ext(_stack, _cell, 0)
 
struct ns_rulebucket_hash_entry_block_lfstack_cell_s int single { if(!single) pthread_spin_lock(&_stack->_lock)
 
_stack _head = _cell
 
struct ns_rulebucket_hash_entry_block_lfstack_cell_s block [] = NULL
 
ssize_t slab_size = slab_size
 
ns_rulebucket_hash_entry_slice_lfstack_init & a
 
a new_slab = 0
 
 void
 
int check { int rblocks = 0
 
 do { block = ns_rulebucket_hash_entry_block_lfstack_pop_ext(&a->blocks, a->single)
 
int allocated_blocks = 0
 
struct ns_rulebucket_hash_entry_slice_lfstack_cell_s * slice = NULL
 
struct ns_rulebucket_hash_entry_s * b { struct ns_rulebucket_hash_entry_block_lfstack_cell_s*cell = (( struct ns_rulebucket_hash_entry_block_lfstack_cell_s *)((char*)(__typeof__ (&(( struct ns_rulebucket_hash_entry_block_lfstack_cell_s *)0)-> block ))( b )- ((size_t) &(( struct ns_rulebucket_hash_entry_block_lfstack_cell_s *)0)-> block )))
 
const const struct ns_rule_bucket_s * key { if(h->oldtable) { const uint32_t z = (*( &ns_rulebucket_hash ))(key); const ssize_t index = puk_hash_to_index(z, h->oldsize); struct ns_rulebucket_hash_entry_s*e = h->oldtable + index; while(e && (e->key != (( const struct ns_rule_bucket_s* )0) )) { if((*( &ns_rulebucket_eq ))(key, e->key)) { ns_rulebucket_hash_entry_rehash_row(h, index); ns_rulebucket_hash_entry_rehash_n(h, 16 ); return 1; } e = e->next; } } return 0
 
ssize_t z { assert(h->oldtable != NULL)
 
struct ns_rulebucket_hash_entry_s * source = h->oldtable + z
 
ssize_t n { if(h->oldtable) { ssize_t k; for(k = 0; k < n; k++) { ns_rulebucket_hash_entry_rehash_row(h, h->rehashed + k); if(h->rehashed + k == h->oldsize - 1) { (padico_free_func( h->oldtable , puk_mod_binary_get_profile(), padico_module_self_name(), __func__, __FILE__, __LINE__)); h->oldtable = NULL; h->rehashed = 0; return; } } h->rehashed += k; } } __attribute__((unused)) static inline void ns_rulebucket_hash_entry_insert( ns_rulebucket_hashtable_t h, const struct ns_rule_bucket_s* key, ns_rule_list_t data) { const uint32_t z = (*( &ns_rulebucket_hash ))(key); assert(h->table != NULL); struct ns_rulebucket_hash_entry_s*e = h->table + puk_hash_to_index(z, h->size); if(e->key != (( const struct ns_rule_bucket_s* )0) ) { while(e->next) { e = e->next; } e->next = ns_rulebucket_hash_entry_malloc(&h->entry_allocator); assert(e->next != NULL); e = e->next; } e->key = key; e->data = data; e->next = NULL; } __attribute__((unused)) static inline struct ns_rulebucket_hash_entry_s* ns_rulebucket_hash_entry_lookup( ns_rulebucket_hashtable_t h, const const struct ns_rule_bucket_s* key) { if(h->table == NULL) return NULL; const uint32_t z = (*( &ns_rulebucket_hash ))(key); struct ns_rulebucket_hash_entry_s*e = NULL; do { e = h->table + puk_hash_to_index(z, h->size); while(e && (e->key != (( const struct ns_rule_bucket_s* )0) )) { if((*( &ns_rulebucket_eq ))(key, e->key)) { return e; } e = e->next; } } while( ns_rulebucket_hash_entry_oldprobe(h, key)); return NULL; } __attribute__((unused)) static inline void ns_rulebucket_hash_entry_rehash_flush( ns_rulebucket_hashtable_t h) { if(h->oldtable) { ns_rulebucket_hash_entry_rehash_n(h, h->oldsize); } assert(h->oldtable == NULL); } __attribute__((unused)) static void ns_rulebucket_hash_rehash_trigger( ns_rulebucket_hashtable_t h) { static const ssize_t hash_primes[] = { 11, 23, 53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593, 49157, 98317, 196613, 393241, 786433, 1572869, 3145739, 6291469, 12582917, 25165843, 50331653, 100663319, 201326611, 402653189, 805306457, -1 }; assert(hash_primes[0] == 11 ); assert(h->oldtable == NULL); h->oldtable = h->table; h->oldsize = h->size; h->rehashed = 0; int i = 0; while(h->size >= hash_primes[i]) { i++; } h->size = hash_primes[i]; assert(h->size > 0); assert(h->size > h->oldsize); h->table = (struct ns_rulebucket_hash_entry_s*)(padico_malloc_func( h->size * sizeof(struct ns_rulebucket_hash_entry_s) , puk_mod_binary_get_profile(), padico_module_self_name(), __func__, __FILE__, __LINE__)); for(i = 0; i < h->size; i++) { h->table[i].key = (( const struct ns_rule_bucket_s* )0) ; h->table[i].data = ( ns_rule_list_t )0; h->table[i].next = NULL; } ns_rulebucket_hash_entry_rehash_n(h, 16 ); }
 
const struct ns_rule_bucket_s ns_rule_list_t data { ns_rulebucket_hash_entry_rehash_n(h, 16 )
 
struct ns_rulebucket_hash_entry_s * e = ns_rulebucket_hash_entry_lookup(h, key)
 
 else { if(h->load >= h->size * 3 / 4) { ns_rulebucket_hash_rehash_trigger(h); } ns_rulebucket_hash_entry_insert(h, key, data)
 
h load
 
const const struct ns_rule_bucket_s const struct ns_rule_bucket_s ** outkey
 
struct ns_rulebucket_hash_entry_s * prev = NULL
 
ns_rulebucket_hashtable_t h { assert(h != NULL)
 
e i = -1
 
e current = NULL
 
struct padico_ns_database_s nsdb
 the internal database of rules and nodes/hosts/groups
 
padico_topo_node_t node2
 
padico_topo_node_t const char * profile
 
padico_topo_node_t const char puk_iface_t iface
 

Detailed Description

Internal structures for NS-basic.

Definition in file Ns-basic-internals.h.

Macro Definition Documentation

◆ PADICO_NS_DEFAULT_PROFILE

#define PADICO_NS_DEFAULT_PROFILE   "default"

Definition at line 154 of file Ns-basic-internals.h.

Typedef Documentation

◆ ns_entity_byname_hash_destructor_t

typedef void(* ns_entity_byname_hash_destructor_t) (const char *key, ns_entity_t data)

Definition at line 137 of file Ns-basic-internals.h.

◆ ns_entity_byname_hash_entry_allocator_t

◆ ns_entity_byname_hash_entry_block_lfstack_t

◆ ns_entity_byname_hash_entry_slice_lfstack_t

◆ ns_entity_byname_hash_eqfunc_t

typedef int(* ns_entity_byname_hash_eqfunc_t) (const char *key1, const char *key2)

Definition at line 137 of file Ns-basic-internals.h.

◆ ns_entity_byname_hash_hfunc_t

typedef uint32_t(* ns_entity_byname_hash_hfunc_t) (const char *key)

Definition at line 137 of file Ns-basic-internals.h.

◆ ns_entity_byname_hashtable_enumerator_t

◆ ns_entity_byname_hashtable_t

◆ ns_entity_t

◆ ns_rulebucket_hash_destructor_t

typedef void(* ns_rulebucket_hash_destructor_t) (const struct ns_rule_bucket_s *key, ns_rule_list_t data)

Definition at line 134 of file Ns-basic-internals.h.

◆ ns_rulebucket_hash_entry_allocator_t

◆ ns_rulebucket_hash_entry_block_lfstack_t

◆ ns_rulebucket_hash_entry_slice_lfstack_t

◆ ns_rulebucket_hash_eqfunc_t

Definition at line 134 of file Ns-basic-internals.h.

◆ ns_rulebucket_hash_hfunc_t

typedef uint32_t(* ns_rulebucket_hash_hfunc_t) (const struct ns_rule_bucket_s *key)

Definition at line 134 of file Ns-basic-internals.h.

◆ ns_rulebucket_hashtable_enumerator_t

◆ ns_rulebucket_hashtable_t

Function Documentation

◆ __attribute__() [1/5]

◆ __attribute__() [2/5]

__attribute__ ( (unused)  )

explicit thread level

get the seq part of a tagged ptr

pop key & data of any element in the table

remove entry with given key from hashtable; does nothing if key not found

allocate a new hashtable

make progress on rehash for n rows

force rehashing of given row

lookup in the oldtable; if found, migrate row and return cell in regular table

default compile-time thread level

Definition at line 134 of file Ns-basic-internals.h.

◆ __attribute__() [3/5]

__attribute__ ( (unused, nonnull(1))  )

insert an entry into a hashtable

returns <key,value> associated with given key, outkey is set to NULL if key not found

probes whether an entry with given key exists in the hashtable

returns value associated with key, NULL if not found

◆ __attribute__() [4/5]

__attribute__ ( (unused, nonnull)  )

initialize a new hashtable

deallocate a hashtable

destroy a hashtable

Definition at line 134 of file Ns-basic-internals.h.

◆ __attribute__() [5/5]

__attribute__ ( (visibility("internal"))  )

◆ assert() [1/5]

assert ( cell !  = NULL)

◆ assert() [2/5]

assert ( e->h !  = NULL)

◆ assert() [3/5]

assert ( e->h->  oldtable = =NULL)

◆ assert() [4/5]

assert ( key !  = ((const struct ns_rule_bucket_s *) 0))

◆ assert() [5/5]

assert ( slab_size  ,
0   
)

Referenced by __lzo_align_gap(), begin_comm_thread(), bench_control_packet_handler(), bench_lfqueue_init(), bench_newmad_init(), bench_psp_handler(), bench_psp_handler(), bench_psp_init(), bz2pf_destroy(), bz2pf_instantiate(), control_packet_handler(), control_router_event_listener(), control_twostep_new_node(), css_event_listener(), data_check_in(), data_check_out(), disappear_end_handler(), g5k_get_netmask(), group_barrier_stage2_end_handler(), gw_status_new(), idpf_decode(), jxta_rdvclient_listener_run(), jxta_rdvserver_run(), killgroup_end_handler(), lz4pf_destroy(), lzo1x_1_compress(), lzo1x_1_compress_core(), lzo1x_decompress(), lzo1x_decompress_safe(), lzopf_destroy(), main(), na_bindings_serialize(), na_control_request_handler(), na_sysio_lock(), na_sysio_unlock(), na_unit_multi_start(), nm_examples_init_topo(), ns_basic_group_end_handler(), ns_basic_group_start_handler(), ns_basic_rule_end_handler(), ns_besteffort_selector_2networks(), ns_besteffort_selector_dijkstra(), ns_besteffort_selector_host(), nsbe_dijkstra_vertex_add(), padico_addrdb_dynget(), padico_addrdb_get(), padico_addrdb_insert(), padico_connector_connect_handler(), padico_control_deliver_message(), padico_control_msg_get_iovec_size(), padico_control_msg_get_size(), padico_control_send_msg(), padico_group_topology(), padico_ibv_create_port(), padico_ibv_sp_send(), padico_io_register(), padico_io_unregister(), padico_lib_init(), padico_mem_monitor_worker(), padico_ns_selector_register(), padico_ns_selector_unregister(), padico_ns_serial_selector(), padico_nsbe_rule_resolve(), padico_pmi2_kvs_lookup(), padico_psp_slot_insert(), padico_shm_block_assert(), padico_shm_block_from_num(), padico_shm_block_from_ptr(), padico_shm_block_from_short_ptr(), padico_shm_block_get_ptr(), padico_shm_close(), padico_shm_directory_register_self(), padico_shm_directory_unregister_self(), padico_shm_init(), padico_shm_large_send(), padico_shm_queue_from_num(), padico_shm_queue_get_lfqueue(), padico_shm_short_get_ptr(), padico_shm_short_recv_poll(), padico_sockaddr_init(), padico_sysio_read(), padico_sysio_write(), padico_tasklet_acquire(), padico_tasklet_destroy(), padico_tasklet_dispatch(), padico_tasklet_release(), padico_tasklet_schedule(), padico_tasklet_subscribe(), padico_tasklet_unsubscribe(), padico_tasklet_worker(), padico_tm_init(), padico_tm_mod_action(), padico_tm_mod_process(), padico_tm_req_wait(), padico_topo_binding_add_filter(), padico_topo_hwaddr_create(), padico_topo_network_create(), padico_topo_network_getnodebyaddr(), padico_topo_network_set_perf(), padico_vio_connect(), padico_vio_open(), padico_vio_poll(), padico_vio_read(), padico_vnode_get_self_instance(), padico_vnode_read_post(), pfzstd_destroy(), pfzstd_instantiate(), psp_control_new_message(), psp_control_pump(), psp_mx_connect(), psp_mx_init(), psp_shm_init(), psp_shm_new_message(), rdvclient_peerview_listener(), rdvserver_peerview_listener(), remote_control_control_callback(), remote_control_node_callback(), resolver_request_end_handler(), router_control_send_common(), router_message_end_handler(), router_new_node(), router_update_end_handler(), run_end_handler(), sflibss2_start_thread(), sflibssh2_callback_connector(), sfplain_callback_connector(), sfrfw_gateway_connect_server_end_handler(), sfsnc_callback_connector(), sfsplice_bind(), sfsplice_callback_connector(), sfsplice_connect(), sfsplice_listen(), sfsplice_request_handler(), sfsrtun_callback_connector(), sfsrtun_connect_server_end_handler(), sfsrtun_create(), sfssh2_callback_connector(), sfstun_callback_connector(), sfstun_create(), socks4client_create(), sr_bench_init(), ssh2_control_outv(), ssh2_control_read_callback(), ssh2_control_send_common(), ssh2_control_start(), sysio_control_connector_connect(), sysio_control_read_callback(), sysio_control_send_common(), sysio_control_socket_close(), sysio_control_socket_create(), sysio_control_start(), tm_puk_acquire_lock(), tm_puk_release_lock(), topo_binding_bind_host(), topo_binding_bind_node(), topo_binding_merge(), topo_binding_serialize(), topo_host_from_hostent(), topo_node_create(), vio_store_desc(), vlink_fwd_connect(), vlink_fwd_connect_handler(), vlink_fwd_gw_notifier(), vlink_fwd_gwlisten_handler(), vlink_fwd_listen_handler(), vlink_id_bind(), vlink_id_notifier(), vlink_ps_callback_acceptor(), vlink_ps_send_post(), vlink_sf_bind(), vlink_sf_close(), vlink_sf_connect(), vlink_sf_connect_finalizer(), vlink_sf_fullshutdown(), vlink_sf_listen(), vlink_sysio_reader_worker(), vnode_destroy(), vnode_hfd_callback_reader(), vnode_hfd_callback_writer(), vnode_lock(), vnode_trylock(), vnode_unlock(), vobs_secondary_init(), vobs_set_commit(), vobs_signal(), vobs_subscribe(), vobs_wait(), vopw_data_process(), vopw_data_send(), vopw_deferred_req_worker(), vopw_psp_callback_OKTOSEND(), vopw_psp_callback_PACKET(), vopw_psp_handler(), vopw_vnode_lookup(), vpf_bind(), vpf_commit(), vpf_notifier(), vrp_hdr_pack_tag(), vrp_in_frame_construct(), vrp_incoming_deliver_frame(), vrp_incoming_process_data(), vrp_incoming_process_hdr(), vrp_incoming_read_callback(), vrp_out_frame_construct(), vrp_out_frame_send_hdr(), vrp_outgoing_process_fragment(), vrp_outgoing_send_frame(), vsock_madio_recvfrom(), vsock_madio_sendto(), vsock_vopw_bind(), vsock_vopw_genaddr(), vsock_vopw_listen(), vsock_vopw_recv_post(), vsock_vopw_send_post(), zpf_destroy(), and zpf_instantiate().

◆ cell() [1/2]

◆ cell() [2/2]

◆ if() [1/12]

if ( !  single) & -> _lock)

◆ if() [2/12]

if ( _cell !  = NULL)

Definition at line 134 of file Ns-basic-internals.h.

◆ if() [3/12]

if ( block !  = NULL)

◆ if() [4/12]

if ( check &&  rblocks !=allocated_blocks)

Definition at line 134 of file Ns-basic-internals.h.

◆ if() [5/12]

if ( data  ) = ( ns_rule_list_t )0

◆ if() [6/12]

if ( e !  = NULL)

Definition at line 134 of file Ns-basic-internals.h.

◆ if() [7/12]

if ( e  )

Definition at line 134 of file Ns-basic-internals.h.

◆ if() [8/12]

if ( e->current &&e->current->  next)

Definition at line 134 of file Ns-basic-internals.h.

◆ if() [9/12]

if ( e->i< e->h->  size)

Definition at line 134 of file Ns-basic-internals.h.

◆ if() [10/12]

if ( h->  table = =NULL)

◆ if() [11/12]

if ( slice !  = NULL)

Definition at line 134 of file Ns-basic-internals.h.

◆ if() [12/12]

if ( source->key !  = (( const struct ns_rule_bucket_s* )0))

Definition at line 134 of file Ns-basic-internals.h.

◆ ns_entity_byname_hash_entry_allocator_init_thread()

ns_entity_byname_hash_entry_allocator_init_thread ( a  ,
slab_size  ,
(1)   
)

◆ ns_entity_byname_hash_entry_insert()

static void ns_entity_byname_hash_entry_insert ( ns_entity_byname_hashtable_t  h,
const char *  key,
ns_entity_t  data 
)
inlinestatic

◆ ns_entity_byname_hash_entry_lookup()

static struct ns_entity_byname_hash_entry_s * ns_entity_byname_hash_entry_lookup ( ns_entity_byname_hashtable_t  h,
const const char *  key 
)
inlinestatic

◆ ns_entity_byname_hash_entry_oldprobe()

static int ns_entity_byname_hash_entry_oldprobe ( ns_entity_byname_hashtable_t  h,
const const char *  key 
)
inlinestatic

◆ ns_entity_byname_hash_entry_rehash_flush() [1/2]

ns_entity_byname_hash_entry_rehash_flush ( h  )

◆ ns_entity_byname_hash_entry_rehash_flush() [2/2]

static void ns_entity_byname_hash_entry_rehash_flush ( ns_entity_byname_hashtable_t  h)
inlinestatic

◆ ns_entity_byname_hash_entry_rehash_n()

static void ns_entity_byname_hash_entry_rehash_n ( ns_entity_byname_hashtable_t  h,
ssize_t  n 
)
inlinestatic

◆ ns_entity_byname_hash_entry_rehash_row()

static void ns_entity_byname_hash_entry_rehash_row ( ns_entity_byname_hashtable_t  h,
ssize_t  z 
)
inlinestatic

◆ ns_entity_byname_hashtable_remove()

ns_entity_byname_hashtable_remove ( h  ,
*  key 
)

◆ ns_rulebucket_eq()

static int ns_rulebucket_eq ( const struct ns_rule_bucket_s *  r1,
const struct ns_rule_bucket_s *  r2 
)
inlinestatic

Definition at line 128 of file Ns-basic-internals.h.

References done.

◆ ns_rulebucket_hash()

static uint32_t ns_rulebucket_hash ( const struct ns_rule_bucket_s *  r)
inlinestatic

Definition at line 122 of file Ns-basic-internals.h.

References done, r, and z.

◆ ns_rulebucket_hash_entry_allocator_init_thread()

ns_rulebucket_hash_entry_allocator_init_thread ( a  ,
slab_size  ,
(1)   
)

◆ ns_rulebucket_hash_entry_insert()

static void ns_rulebucket_hash_entry_insert ( ns_rulebucket_hashtable_t  h,
const struct ns_rule_bucket_s *  key,
ns_rule_list_t  data 
)
inlinestatic

◆ ns_rulebucket_hash_entry_lookup()

static struct ns_rulebucket_hash_entry_s * ns_rulebucket_hash_entry_lookup ( ns_rulebucket_hashtable_t  h,
const const struct ns_rule_bucket_s *  key 
)
inlinestatic

◆ ns_rulebucket_hash_entry_oldprobe()

static int ns_rulebucket_hash_entry_oldprobe ( ns_rulebucket_hashtable_t  h,
const const struct ns_rule_bucket_s *  key 
)
inlinestatic

◆ ns_rulebucket_hash_entry_rehash_flush() [1/2]

ns_rulebucket_hash_entry_rehash_flush ( h  )

◆ ns_rulebucket_hash_entry_rehash_flush() [2/2]

static void ns_rulebucket_hash_entry_rehash_flush ( ns_rulebucket_hashtable_t  h)
inlinestatic

◆ ns_rulebucket_hash_entry_rehash_n()

static void ns_rulebucket_hash_entry_rehash_n ( ns_rulebucket_hashtable_t  h,
ssize_t  n 
)
inlinestatic

◆ ns_rulebucket_hash_entry_rehash_row()

static void ns_rulebucket_hash_entry_rehash_row ( ns_rulebucket_hashtable_t  h,
ssize_t  z 
)
inlinestatic

◆ ns_rulebucket_hashtable_remove()

ns_rulebucket_hashtable_remove ( h  ,
*  key 
)

◆ padico_free_func()

padico_free_func ( slice  ,
puk_mod_binary_get_profile()  ,
padico_module_self_name()  ,
__func__  ,
__FILE__  ,
__LINE__   
)

◆ return()

return ( e !  = NULL)

◆ while() [1/7]

while ( 0  )

◆ while() [2/7]

while ( block !  = NULL)

◆ while() [3/7]

while ( e &&  e->key !=((const char *) 0))

Definition at line 137 of file Ns-basic-internals.h.

◆ while() [4/7]

while ( e &&  e->key !=((const struct ns_rule_bucket_s *) 0))

Definition at line 134 of file Ns-basic-internals.h.

◆ while() [5/7]

◆ while() [6/7]

◆ while() [7/7]

while ( slice !  = NULL)

Variable Documentation

◆ __attribute__

◆ _cell

◆ _head

_stack _head = _cell

Definition at line 134 of file Ns-basic-internals.h.

◆ _next

_cell _next = _stack->_head

Definition at line 134 of file Ns-basic-internals.h.

◆ a

◆ allocated_blocks

int allocated_blocks = 0

Definition at line 134 of file Ns-basic-internals.h.

◆ assembly

◆ b

◆ block

◆ check

int check { int rblocks = 0

Definition at line 134 of file Ns-basic-internals.h.

Referenced by vsock_vopw_connect(), and vsock_vopw_listen().

◆ current

e current = NULL

Definition at line 134 of file Ns-basic-internals.h.

Referenced by padico_vio_readv(), padico_vio_recvmsg(), and padico_vio_writev().

◆ data

◆ do

Definition at line 134 of file Ns-basic-internals.h.

◆ e

Definition at line 134 of file Ns-basic-internals.h.

Referenced by __attribute__(), arg_end_handler(), assembly_request_end_handler(), bench_control_packet_handler(), bench_list_server(), cascade_delete_end_handler(), control_bootstrap_pmi2_component_init(), control_packet_handler(), control_router_broadcast(), control_router_event_listener(), control_router_table_print(), control_twostep_connector_new_handler(), css_event_listener(), defgroup_end_handler(), disappear_end_handler(), getenv_start_handler(), group_barrier_stage1_end_handler(), group_barrier_stage2_end_handler(), kill_end_handler(), killgroup_end_handler(), load_end_handler(), na_control_ping_handler(), na_control_rc_handler(), na_control_request_handler(), na_network_getentity_byaddr(), na_sysiogetparams_end_handler(), na_sysiotune_start_handler(), ns_basic_config_init(), ns_basic_debug_init(), ns_basic_group_end_handler(), ns_basic_group_start_handler(), ns_basic_host_start_handler(), ns_basic_node_start_handler(), ns_basic_rule_end_handler(), ns_basic_target_end_handler(), ns_basic_target_start_handler(), ns_selector_insert(), nsbe_dijkstra_init(), nsdb_group_flatten(), padico_addrdb_dynget(), padico_addrdb_entry_destructor(), padico_addrdb_free_entry(), padico_addrdb_get(), padico_addrdb_insert(), padico_addrdb_new_entry(), padico_addrdb_publish_handler(), padico_connector_connect_handler(), padico_connector_new_handler(), padico_control_gen_init_events(), padico_group_topology(), padico_ibv_connect_start_handler(), padico_na_topology_serialize(), padico_nsbe_rule_resolve(), padico_shm_directory_register_self(), padico_sockaddr_check(), padico_sysio_stat_handler(), padico_topo_gethosts(), padico_topo_host_can_input(), padico_topo_host_can_output(), padico_topo_network_can_input(), padico_topo_network_can_output(), padico_topo_network_gethosts(), puk_abi_real_seterrno(), puk_abi_seterrno(), remotecontrol_getranks_handler(), resolver_request_end_handler(), router_announce_end_handler(), router_message_end_handler(), router_update_end_handler(), run_end_handler(), setenv_start_handler(), sfrfw_gateway_close_end_handler(), sfrfw_gateway_connect_server_end_handler(), sfrfw_gateway_set_error(), sfsplice_request_handler(), sfsrtun_close_end_handler(), sfsrtun_connect_server_end_handler(), sfsrtun_server_set_error(), sr_bench_url_handler(), ssh2_control_start(), sysio_control_start(), topo_binding_end_handler(), topo_host_end_handler(), topo_host_start_handler(), topo_hostname_end_handler(), topo_hwaddr_end_handler(), topo_lstopo_end_handler(), topo_network_end_handler(), topo_node_end_handler(), topo_node_start_handler(), topo_performance_end_handler(), topo_property_end_handler(), unload_end_handler(), vaddr_end_handler(), viodump_vfd_end_handler(), viostat_end_handler(), vlink_fwd_connect_handler(), vlink_fwd_gwlisten_handler(), vlink_fwd_listen_handler(), vopw_dynres_lookup(), vopw_dynres_register(), vopw_dynres_resolve(), vrp_incoming_process_hdr(), and vrp_out_frame_hdr_construct().

◆ else

Definition at line 134 of file Ns-basic-internals.h.

◆ h

◆ i

e i = -1
Examples
Tests/VIO/vio-test.c.

Definition at line 134 of file Ns-basic-internals.h.

Referenced by _lzo_config_check(), addarray(), answer_cmd(), assembly_request_end_handler(), bench_common_init(), bench_lfqueue1_init(), bench_lfqueue_init(), cascade_delete_end_handler(), check_buffer(), client(), client_loop(), client_loop(), control_bootstrap_pmi2_init(), control_router_broadcast(), control_router_event_listener(), control_twostep_selector_event_listener(), creer_fenetres(), css_event_listener(), defgroup_end_handler(), fdsets_from_vobs_secondary(), fill_buffer(), fill_buffer(), fill_buffer(), fill_buffer(), fill_buffer(), fusion(), g5k_compute_nodes(), g5k_describe_topology(), get_href_by_title(), init_contextes_graphiques(), isfull(), isused(), mac_address(), main(), main(), main_file(), my_memcpy(), my_thread_process(), na_bindings_serialize(), na_sysio_update_status(), na_unit_multi_start(), ns_basic_assembly(), ns_basic_group_end_handler(), ns_basic_host_assembly(), ns_basic_print_rules(), ns_basic_rule_end_handler(), ns_basic_rule_print_entity(), ns_basic_target_end_handler(), ns_besteffort_selector_2networks(), ns_besteffort_selector_dijkstra(), ns_selector_insert(), nsbe_binding_select(), nsbe_dijkstra_getmin(), nsdb_group_flatten(), padico_control_msg_destroy(), padico_control_msg_get_iovec(), padico_control_new_node_vect(), padico_gatekeeper__CreateGroup(), padico_gatekeeper__RunModule(), padico_gatekeeper__StartJob(), padico_group_barrier(), padico_group_dup(), padico_group_kill(), padico_group_rank(), padico_group_send_to_all(), padico_group_topology(), padico_group_wait_all(), padico_ibv_connection_init(), padico_ibv_finalize(), padico_ibv_lz_recover_credits(), padico_ibv_lz_send(), padico_ibv_poll_lz_all(), padico_launch_execve(), padico_mem_monitor_worker(), padico_ns_host_selector(), padico_ns_selector_unregister(), padico_ns_serial_selector(), padico_nsbe_delete_profile(), padico_pmi2_kvs_lookup(), padico_pmi2_kvs_publish(), padico_psm2_discover(), padico_shm_close(), padico_shm_directory_clean(), padico_shm_directory_dump(), padico_shm_directory_node_lookup(), padico_shm_directory_register_self(), padico_shm_seg_init(), padico_tasklet_schedule(), padico_tasklet_unsubscribe(), padico_timing_init(), padico_timing_profile_flush(), padico_topo_host_add_name(), padico_topo_host_getaddr(), padico_topo_host_getaddr2(), padico_topo_host_getbindings(), padico_topo_host_getbyin6addr(), padico_topo_host_getbyinaddr(), padico_topo_host_getname2(), padico_topo_network_getbyid(), padico_topo_networks_getbyfamily(), padico_topo_node_getaddress(), padico_vaddr_marshall(), padico_vaddr_unmarshall(), padico_vio_init(), padico_vio_readv(), padico_vio_recvmsg(), padico_vio_select(), padico_vio_sendmsg(), padico_vio_writev(), padico_vlink_packet_init(), print_pollfd(), psp_control_event_listener(), psp_control_getpacket(), psp_control_getstream(), psp_control_module_finalize(), psp_ibv_worker(), rafraichir_ecran(), razarray(), redessiner_touches(), remote_control_event_listener(), router_announce_end_handler(), router_update_end_handler(), run_end_handler(), send_msg(), servant_loop(), servant_loop(), server(), sflibss2_start_thread(), sh_unit_start(), ssh2_control_bootstrap_connect(), ssh2_control_outv(), ssh2_control_send_common(), ssh2_openssh_config(), sysio_control_send_common(), test1(), test2(), the_bench(), topo_binding_end_handler(), topo_host_destroy(), topo_host_end_handler(), topo_inet_addr_detect_getifaddrs(), topo_inet_addr_detect_siocgifconf(), topo_network_end_handler(), topo_node_destroy(), topo_node_end_handler(), topology_populate(), touche_correspondant_a(), udp_client(), udp_server(), unit_legacy_start(), vio_alloc_desc(), vio_ring_init(), vio_ring_run(), vlink_ps_callback_acceptor(), vlink_ps_close(), vlink_ps_connect(), vlink_ps_fullshutdown(), vlink_registry_lookup(), vlink_registry_unregister(), vlink_selector_close(), vlink_selector_connect(), vlink_selector_fullshutdown(), vnode_pollfd_from_observer(), vobs_secondary_destroy(), vobs_secondary_from_fdsets(), vobs_secondary_from_pollfd(), vobs_secondary_update(), vopw_control_event_listener(), vopw_dynres_lookup(), vopw_unregister_vnode(), vopw_vnode_lookup(), vrp_incoming_deliver_frame(), vrp_incoming_process_data(), vrp_incoming_process_hdr(), vrp_init(), vrp_out_cell_translate(), vrp_out_frame_construct(), vrp_outgoing_process_fragment(), vrp_outgoing_send_routine(), vrp_shutdown(), vrp_test_incoming_handler(), vrp_test_run(), vsock_client(), vsock_server(), vsock_vopw_dumpstat(), and vsock_vopw_gentag().

◆ iface

◆ key

const char ** key { if(h->oldtable) { const uint32_t z = (*( &ns_rulebucket_hash ))(key); const ssize_t index = puk_hash_to_index(z, h->oldsize); struct ns_rulebucket_hash_entry_s*e = h->oldtable + index; while(e && (e->key != (( const struct ns_rule_bucket_s* )0) )) { if((*( &ns_rulebucket_eq ))(key, e->key)) { ns_rulebucket_hash_entry_rehash_row(h, index); ns_rulebucket_hash_entry_rehash_n(h, 16 ); return 1; } e = e->next; } } return 0

Definition at line 134 of file Ns-basic-internals.h.

Referenced by na_multi_notify(), nsbe_rule_resolved_hash(), padico_control_send_async(), padico_io_register(), padico_nsbe_rule_resolve(), padico_pmi2_kvs_lookup(), padico_pmi2_kvs_lookup_single(), padico_pmi2_kvs_publish(), padico_pmi2_kvs_publish_single(), padico_pmix_kvs_lookup(), padico_pmix_kvs_publish(), padico_psp_slot_insert(), padico_tm_req_new(), psp_control_init(), psp_ibv_init(), psp_mx_init(), psp_sf_init(), psp_shm_init(), remote_control_node_callback(), sflibssh2_callback_connector(), sflibssh2_connect(), sfplain_callback_acceptor(), sfplain_callback_connector(), sfplain_connect(), sfplain_listen(), sfrfw_client_acceptor(), sfrfw_gateway_client_callback_connector(), sfrfw_gateway_client_read_callback(), sfrfw_gateway_server_callback_connector(), sfrfw_gateway_server_read_callback(), sfsnc_callback_connector(), sfsnc_connect(), sfsplice_connect(), sfsplice_listen(), sfsrtun_callback_connector(), sfsrtun_connect(), sfssh2_callback_connector(), sfssh2_connect(), sfstun_callback_connector(), sfstun_connect(), socks4client_connect(), socks4client_proxy_connect_notifier(), socks4client_proxy_reply_notifier(), ssh2_control_read_callback(), sysio_control_bootstrap_acceptor(), sysio_control_bootstrap_connector(), sysio_control_read_callback(), vlink_fwd_gw_notifier(), vlink_fwd_notifier(), vlink_hash(), vlink_id_notifier(), vlink_ps_callback_acceptor(), vlink_selector_client_notifier(), vlink_selector_server_notifier(), vnode_hfd_callback_reader(), vnode_hfd_callback_writer(), vobs_subscribe(), and vpf_notifier().

◆ load

h load

Definition at line 134 of file Ns-basic-internals.h.

◆ n

ssize_t n { if(h->oldtable) { ssize_t k; for(k = 0; k < n; k++) { ns_rulebucket_hash_entry_rehash_row(h, h->rehashed + k); if(h->rehashed + k == h->oldsize - 1) { (padico_free_func( h->oldtable , puk_mod_binary_get_profile(), padico_module_self_name(), __func__, __FILE__, __LINE__)); h->oldtable = NULL; h->rehashed = 0; return; } } h->rehashed += k; } } __attribute__((unused)) static inline void ns_rulebucket_hash_entry_insert( ns_rulebucket_hashtable_t h, const struct ns_rule_bucket_s* key, ns_rule_list_t data) { const uint32_t z = (*( &ns_rulebucket_hash ))(key); assert(h->table != NULL); struct ns_rulebucket_hash_entry_s*e = h->table + puk_hash_to_index(z, h->size); if(e->key != (( const struct ns_rule_bucket_s* )0) ) { while(e->next) { e = e->next; } e->next = ns_rulebucket_hash_entry_malloc(&h->entry_allocator); assert(e->next != NULL); e = e->next; } e->key = key; e->data = data; e->next = NULL; } __attribute__((unused)) static inline struct ns_rulebucket_hash_entry_s* ns_rulebucket_hash_entry_lookup( ns_rulebucket_hashtable_t h, const const struct ns_rule_bucket_s* key) { if(h->table == NULL) return NULL; const uint32_t z = (*( &ns_rulebucket_hash ))(key); struct ns_rulebucket_hash_entry_s*e = NULL; do { e = h->table + puk_hash_to_index(z, h->size); while(e && (e->key != (( const struct ns_rule_bucket_s* )0) )) { if((*( &ns_rulebucket_eq ))(key, e->key)) { return e; } e = e->next; } } while( ns_rulebucket_hash_entry_oldprobe(h, key)); return NULL; } __attribute__((unused)) static inline void ns_rulebucket_hash_entry_rehash_flush( ns_rulebucket_hashtable_t h) { if(h->oldtable) { ns_rulebucket_hash_entry_rehash_n(h, h->oldsize); } assert(h->oldtable == NULL); } __attribute__((unused)) static void ns_rulebucket_hash_rehash_trigger( ns_rulebucket_hashtable_t h) { static const ssize_t hash_primes[] = { 11, 23, 53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593, 49157, 98317, 196613, 393241, 786433, 1572869, 3145739, 6291469, 12582917, 25165843, 50331653, 100663319, 201326611, 402653189, 805306457, -1 }; assert(hash_primes[0] == 11 ); assert(h->oldtable == NULL); h->oldtable = h->table; h->oldsize = h->size; h->rehashed = 0; int i = 0; while(h->size >= hash_primes[i]) { i++; } h->size = hash_primes[i]; assert(h->size > 0); assert(h->size > h->oldsize); h->table = (struct ns_rulebucket_hash_entry_s*)(padico_malloc_func( h->size * sizeof(struct ns_rulebucket_hash_entry_s) , puk_mod_binary_get_profile(), padico_module_self_name(), __func__, __FILE__, __LINE__)); for(i = 0; i < h->size; i++) { h->table[i].key = (( const struct ns_rule_bucket_s* )0) ; h->table[i].data = ( ns_rule_list_t )0; h->table[i].next = NULL; } ns_rulebucket_hash_entry_rehash_n(h, 16 ); }

◆ new_slab

a new_slab = 0

Definition at line 134 of file Ns-basic-internals.h.

◆ node2

Definition at line 167 of file Ns-basic-internals.h.

Referenced by ns_basic_assembly_serial().

◆ ns_entity_vect_t

typdef struct ns_entity_vect_s* ns_entity_vect_t

Definition at line 49 of file Ns-basic-internals.h.

◆ ns_group_vect_t

typdef struct ns_group_vect_s* ns_group_vect_t

Definition at line 48 of file Ns-basic-internals.h.

◆ ns_rule

ns_rule

◆ ns_target_vect_t

typdef struct ns_target_vect_s* ns_target_vect_t

Definition at line 109 of file Ns-basic-internals.h.

◆ nsdb

◆ outkey

const const char const char ** outkey

Definition at line 134 of file Ns-basic-internals.h.

◆ prev

◆ profile

◆ single

a single { if(!single) pthread_spin_lock(&_stack->_lock)

Definition at line 134 of file Ns-basic-internals.h.

◆ slab_size

a slab_size = slab_size

Definition at line 134 of file Ns-basic-internals.h.

◆ slice

◆ source

struct topo_host_by_name_hash_entry_s * source = h->oldtable + z

Definition at line 134 of file Ns-basic-internals.h.

Referenced by my_memcpy(), padico_vaddr_unmarshall(), and server().

◆ targets

Definition at line 113 of file Ns-basic-internals.h.

◆ void

void

Definition at line 134 of file Ns-basic-internals.h.

Referenced by lzo_bitops_ctlz32_func(), lzo_bitops_cttz32_func(), test1(), and test2().

◆ z

const uint32_t z { assert(h->oldtable != NULL)

Definition at line 134 of file Ns-basic-internals.h.

Referenced by ns_rulebucket_hash(), and padico_addrkey_hash().