|
OpenVAS Scanner 23.23.1
|
#include "ipc.h"#include "ipc_pipe.h"#include <errno.h>#include <fcntl.h>#include <glib.h>#include <gvm/base/logging.h>#include <json-glib/json-glib.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/types.h>#include <sys/wait.h>#include <unistd.h>Macros | |
| #define | G_LOG_DOMAIN "lib misc" |
| GLib logging domain. | |
| #define | IPC_CONTEXTS_CAP_STEP 10 |
Functions | |
| int | ipc_send (struct ipc_context *context, enum ipc_relation to, const char *msg, size_t len) |
| sends given msg to the target based on the given context | |
| int | ipc_destroy (struct ipc_context *context) |
| destroys given context | |
| char * | ipc_retrieve (struct ipc_context *context, enum ipc_relation from) |
| retrieves data for the relation based on the context | |
| int | ipc_close (struct ipc_context *context) |
| closes given context | |
| struct ipc_context * | ipc_init (enum ipc_protocol type, enum ipc_relation relation) |
| initializes a new context. | |
| struct ipc_context * | ipc_exec_as_process (enum ipc_protocol type, struct ipc_exec_context exec_ctx) |
| runs given functions with the given protocol type. | |
| struct ipc_contexts * | ipc_contexts_init (int cap) |
| initializes ipc_contexts with a given preallocated capacity. | |
| struct ipc_contexts * | ipc_add_context (struct ipc_contexts *ctxs, struct ipc_context *ctx) |
| adds a given context to contexts | |
| int | ipc_destroy_contexts (struct ipc_contexts *ctxs) |
| destroys given contexts | |
| #define G_LOG_DOMAIN "lib misc" |
GLib logging domain.
| #define IPC_CONTEXTS_CAP_STEP 10 |
| struct ipc_contexts * ipc_add_context | ( | struct ipc_contexts * | ctxs, |
| struct ipc_context * | ctx ) |
adds a given context to contexts
| ctxs | the context holder array to be used to add a new ctx |
| ctx | the context to be added to ctxs |
| int ipc_close | ( | struct ipc_context * | context | ) |
closes given context
| context | the ipc_context to be closed |
| struct ipc_contexts * ipc_contexts_init | ( | int | cap | ) |
initializes ipc_contexts with a given preallocated capacity.
| cap | to size to be preallocated, if 0 it will not preallocate but allocate on each enw entry. |
| int ipc_destroy | ( | struct ipc_context * | context | ) |
destroys given context
| context | the ipc_context to be destroyed. |
| int ipc_destroy_contexts | ( | struct ipc_contexts * | ctxs | ) |
destroys given contexts
| ctxs | the context holder array to be destroyed. |
| struct ipc_context * ipc_exec_as_process | ( | enum ipc_protocol | type, |
| struct ipc_exec_context | exec_ctx ) |
runs given functions with the given protocol type.
| type | the protocol type to be initialized |
| exec_ctx | the execution context to be executed. |
| struct ipc_context * ipc_init | ( | enum ipc_protocol | type, |
| enum ipc_relation | relation ) |
initializes a new context.
| type | the protocol type to be initialized |
| relation | the relation of the context to be initialized when supported by the type. |
| char * ipc_retrieve | ( | struct ipc_context * | context, |
| enum ipc_relation | from ) |
retrieves data for the relation based on the context
| context | the ipc_context to be used; must be previously initialized via ipc_init. |
| to | the recieving direction of the message when it is supported by the given ipc_context. |
| int ipc_send | ( | struct ipc_context * | context, |
| enum ipc_relation | to, | ||
| const char * | msg, | ||
| size_t | len ) |
sends given msg to the target based on the given context
| context | the ipc_context to be used; must be previously initialized via ipc_init. |
| to | the target direction of the message when it is supported by the given ipc_context. |
| msg | the message to send |
| len | the length of msg |