15 #ifndef SRC_VNET_SESSION_SEGMENT_MANAGER_H_ 16 #define SRC_VNET_SESSION_SEGMENT_MANAGER_H_ 25 typedef struct _segment_manager_properties
32 u32 preallocated_fifo_pairs;
41 u8 use_private_segment;
44 typedef struct _segment_manager
67 memset (sm, 0,
sizeof (*sm));
105 u32 * fifo_segment_index);
int segment_manager_alloc_session_fifos(segment_manager_t *sm, svm_fifo_t **server_rx_fifo, svm_fifo_t **server_tx_fifo, u32 *fifo_segment_index)
static segment_manager_t * segment_manager_new()
void segment_manager_get_segment_info(u32 index, u8 **name, u32 *size)
static segment_manager_t * segment_manager_get_if_valid(u32 index)
struct _segment_manager_properties segment_manager_properties_t
void segment_manager_dealloc_queue(segment_manager_t *sm, unix_shared_memory_queue_t *q)
Frees shm queue allocated in the first segment.
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
struct _svm_fifo svm_fifo_t
int session_manager_add_segment(segment_manager_t *sm)
int segment_manager_init(segment_manager_t *sm, segment_manager_properties_t *properties, u32 seg_size)
Initializes segment manager based on options provided.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
static u32 segment_manager_index(segment_manager_t *sm)
void segment_manager_del(segment_manager_t *sm)
Removes segment manager.
unix_shared_memory_queue_t * segment_manager_alloc_queue(segment_manager_t *sm, u32 queue_size)
Allocates shm queue in the first segment.
struct _segment_manager segment_manager_t
int session_manager_add_first_segment(segment_manager_t *sm, u32 segment_size)
segment_manager_t * segment_managers
Pool of segment managers.
void segment_manager_dealloc_fifos(u32 svm_segment_index, svm_fifo_t *rx_fifo, svm_fifo_t *tx_fifo)
static segment_manager_t * segment_manager_get(u32 index)
struct _unix_shared_memory_queue unix_shared_memory_queue_t