Source code for connectionmanager/clientconnection_types.h

// SPDX-License-Identifier: MIT
#pragma once

#include <elos/eventfilter/eventfilter_types.h>
#include <elos/libelosplugin/libelosplugin.h>
#include <netinet/in.h>
#include <safu/flags.h>
#include <safu/vector.h>
#include <samconf/samconf_types.h>
#include <semaphore.h>

#include "connectionmanager/clientconnection_defines.h"

typedef safuVec_t elosEventFilterNodeIdVector_t;
typedef safuVec_t elosEventQueueIdVector_t;
[docs][docs]/******************************************************************* * Data structures used exclusively by the worker thread * * Members: * publisher: exclusiv for the connection * subscriber: exclusiv for the connection ******************************************************************/ typedef struct elosClientConnectionData {
[docs][docs][docs][docs] struct elosPublisher *publisher;
[docs][docs][docs][docs] struct elosSubscriber *subscriber;
} elosClientConnectionData_t;
[docs][docs]/******************************************************************* * Data structures shared between all connections of a ConnectionManager * * Members: * connectionSemaphore: Used for waiting until a connection is available * plugin: reference to the plugin instance ******************************************************************/ typedef struct elosClientConnectionSharedData {
[docs][docs] sem_t connectionSemaphore;
[docs][docs] elosPlugin_t *plugin;
} elosClientConnectionSharedData_t;
[docs][docs]/******************************************************************* * Data structure of a ClientConnection * * Members: * flags: State bits of the component (e.g. initialized, active, e.t.c.) * fd: The socket used for communication * syncFd: eventfd used for synchronization with the worker thread * triggerFd: eventfd used for waking the worker thread (e.g. for a controlled shutdown) * addr: Address information of the currently used socketFd * thread: Worker thread used by pthread_* functions * sharedData: See struct defintion of elosClientConnectionSharedData_t * data: worker thread local data * isTrusted: 'true' if the connection is trusted * blacklist: blacklist filters ******************************************************************/ typedef struct elosClientConnection {
[docs][docs] safuFlags_t flags;
[docs][docs] int fd;
[docs][docs] int syncFd;
[docs][docs] int triggerFd;
[docs][docs] struct sockaddr_in addr;
[docs][docs] pthread_t thread;
[docs][docs] elosClientConnectionSharedData_t *sharedData;
[docs][docs] elosClientConnectionData_t data;
[docs][docs] bool isTrusted;
[docs][docs] elosEventFilter_t blacklist;
} elosClientConnection_t;