Crinit -- Configurable Rootfs Init
|
Implementation file related to elos connection. More...
#include <pthread.h>
#include <safu/common.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include "logio.h"
#include "thrpool.h"
Go to the source code of this file.
Data Structures | |
struct | crinitElosSession |
struct | crinitElosEventSource |
struct | crinitElosEvent |
struct | crinitElosEventVector |
struct | crinitElosVirtualTable |
Macros | |
#define | LIBELOS_SO_FILENAME "libelos.so.1" |
Elos shared library filename for dlopen() | |
#define | CRINIT_ELOS_CONNECTION_RETRIES 10uL |
#define | CRINIT_ELOS_CONNECTION_RETRY_INTERVAL_US 500000 |
#define | ELOS_ID_INVALID 0 |
Invalid elos event queue ID constant. | |
#define | ELOS_CLASSIFICATION_ELOS_MASK 0x00000000FFFFFFFFuLL |
#define | ELOS_CLASSIFICATION_USER_MASK 0x000000FF00000000uLL |
#define | ELOS_CLASSIFICATION_RESERVED_MASK 0xFFFFFF0000000000uLL |
#define | ELOS_CLASSIFICATION_UNDEFINED 0x0000000000000000uLL |
#define | ELOS_CLASSIFICATION_KERNEL 0x0000000000000001uLL |
#define | ELOS_CLASSIFICATION_NETWORK 0x0000000000000002uLL |
#define | ELOS_CLASSIFICATION_SECURITY 0x0000000000000004uLL |
#define | ELOS_CLASSIFICATION_POWER 0x0000000000000008uLL |
#define | ELOS_CLASSIFICATION_STORAGE 0x0000000000000010uLL |
#define | ELOS_CLASSIFICATION_PROCESS 0x0000000000000020uLL |
#define | ELOS_CLASSIFICATION_IPC 0x0000000000000040uLL |
#define | ELOS_CLASSIFICATION_HARDWARE 0x0000000000000080uLL |
#define | ELOS_CLASSIFICATION_ELOS 0x0000000000000100uLL |
#define | ELOS_CLASSIFICATION_PROCESS_ERRORS 0x0000000000000200uLL |
#define | ELOS_CLASSIFICATION_USER_0 0x0000000100000000uLL |
#define | ELOS_CLASSIFICATION_USER_1 0x0000000200000000uLL |
#define | ELOS_CLASSIFICATION_USER_2 0x0000000400000000uLL |
#define | ELOS_CLASSIFICATION_USER_3 0x0000000800000000uLL |
#define | ELOS_CLASSIFICATION_USER_4 0x0000001000000000uLL |
#define | ELOS_CLASSIFICATION_USER_5 0x0000002000000000uLL |
#define | ELOS_CLASSIFICATION_USER_6 0x0000004000000000uLL |
#define | ELOS_CLASSIFICATION_USER_7 0x0000008000000000uLL |
#define | crinitElosTryExec(session, sessionLock, func, err_msg, ...) |
Typedefs | |
typedef uint32_t | crinitElosEventQueueId_t |
typedef struct crinitElosSession | crinitElosSession_t |
typedef struct crinitElosEventSource | crinitElosEventSource_t |
typedef enum crinitElosSeverityE_t | crinitElosSeverityE_t |
typedef enum crinitElosEventMessageCodeE_t | crinitElosEventMessageCodeE_t |
typedef struct crinitElosEvent | crinitElosEvent_t |
typedef struct crinitElosEventVector | crinitElosEventVector_t |
typedef struct crinitElosVirtualTable | crinitElosVirtualTable_t |
Enumerations | |
enum | crinitElosSeverityE_t { ELOS_SEVERITY_OFF = 0 , ELOS_SEVERITY_FATAL , ELOS_SEVERITY_ERROR , ELOS_SEVERITY_WARN , ELOS_SEVERITY_INFO , ELOS_SEVERITY_DEBUG , ELOS_SEVERITY_VERBOSE } |
enum | crinitElosEventMessageCodeE_t { ELOS_MSG_CODE_INFO_LOG = 1102 , ELOS_MSG_CODE_PROCESS_CREATED = 2001 , ELOS_MSG_CODE_PROCESS_EXITED = 2002 , ELOS_MSG_CODE_FILE_OPENED = 2003 , ELOS_MSG_CODE_IPC_NOT_AUTHORIZED = 4001 , ELOS_MSG_CODE_EXIT_FAILURE = 5006 } |
Functions | |
int | crinitElosInit (void) |
crinitElosVirtualTable_t * | crinitElosGetVTable (void) |
int | crinitElosDisconnect (crinitElosSession_t *session, pthread_mutex_t *sessionLock) |
Implementation file related to elos connection.
Header related to elos connection.
#define CRINIT_ELOS_CONNECTION_RETRIES 10uL |
#define CRINIT_ELOS_CONNECTION_RETRY_INTERVAL_US 500000 |
#define crinitElosTryExec | ( | session, | |
sessionLock, | |||
func, | |||
err_msg, | |||
... | |||
) |
Macro to simplify checking for a valid elos session.
Will print an error message and return from the calling function with an error code if the session pointer is either null or the conn.
HINT: This uses a GNU extension of gcc to define a compound statement enclosed in parentheses.
session | Elos session to be used. |
sessionLock | The session lock. |
func | Elos function to be called. |
err_msg | Error message to be returned on error. |
#define ELOS_CLASSIFICATION_ELOS 0x0000000000000100uLL |
#define ELOS_CLASSIFICATION_ELOS_MASK 0x00000000FFFFFFFFuLL |
#define ELOS_CLASSIFICATION_HARDWARE 0x0000000000000080uLL |
#define ELOS_CLASSIFICATION_IPC 0x0000000000000040uLL |
#define ELOS_CLASSIFICATION_KERNEL 0x0000000000000001uLL |
#define ELOS_CLASSIFICATION_NETWORK 0x0000000000000002uLL |
#define ELOS_CLASSIFICATION_POWER 0x0000000000000008uLL |
#define ELOS_CLASSIFICATION_PROCESS 0x0000000000000020uLL |
#define ELOS_CLASSIFICATION_PROCESS_ERRORS 0x0000000000000200uLL |
#define ELOS_CLASSIFICATION_RESERVED_MASK 0xFFFFFF0000000000uLL |
#define ELOS_CLASSIFICATION_SECURITY 0x0000000000000004uLL |
#define ELOS_CLASSIFICATION_STORAGE 0x0000000000000010uLL |
#define ELOS_CLASSIFICATION_UNDEFINED 0x0000000000000000uLL |
#define ELOS_CLASSIFICATION_USER_0 0x0000000100000000uLL |
#define ELOS_CLASSIFICATION_USER_1 0x0000000200000000uLL |
#define ELOS_CLASSIFICATION_USER_2 0x0000000400000000uLL |
#define ELOS_CLASSIFICATION_USER_3 0x0000000800000000uLL |
#define ELOS_CLASSIFICATION_USER_4 0x0000001000000000uLL |
#define ELOS_CLASSIFICATION_USER_5 0x0000002000000000uLL |
#define ELOS_CLASSIFICATION_USER_6 0x0000004000000000uLL |
#define ELOS_CLASSIFICATION_USER_7 0x0000008000000000uLL |
#define ELOS_CLASSIFICATION_USER_MASK 0x000000FF00000000uLL |
#define ELOS_ID_INVALID 0 |
Invalid elos event queue ID constant.
#define LIBELOS_SO_FILENAME "libelos.so.1" |
Elos shared library filename for dlopen()
typedef struct crinitElosEvent crinitElosEvent_t |
Event send to elos.
Relevant elos message codes for crinit.
typedef uint32_t crinitElosEventQueueId_t |
Type defition for elos event queue IDs.
typedef struct crinitElosEventSource crinitElosEventSource_t |
Information of the sender sending an event to elos.
typedef struct crinitElosEventVector crinitElosEventVector_t |
Elos event vector type.
typedef struct crinitElosSession crinitElosSession_t |
Elos session type.
typedef enum crinitElosSeverityE_t crinitElosSeverityE_t |
Possible severities an elos event can have.
typedef struct crinitElosVirtualTable crinitElosVirtualTable_t |
Elos virtual table and connection data.
Relevant elos message codes for crinit.
int crinitElosDisconnect | ( | crinitElosSession_t * | session, |
pthread_mutex_t * | sessionLock | ||
) |
Disconnect from elos daemon.
session | Session to disconnect. |
sessionLock | The session lock. |
crinitElosVirtualTable_t * crinitElosGetVTable | ( | void | ) |
Returns the internal elos virtual table.
int crinitElosInit | ( | void | ) |
Initializes the elos vtable.