/* ipmip_log.h - ipmip_log.h */ /* ****************************************************************************** * HEADER FILE * * Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmip_log.h,v $ $Revision: 1.7 $ * $Source: /home/interpeak/CVSRoot/ipmip/include/private/ipmip_log.h,v $ * $Author: jhorteli $ $Date: 2011-01-21 15:31:28 $ * $State: Exp $ $Locker: $ * * INTERPEAK_COPYRIGHT_STRING * Design and implementation by Joel Hortelius ****************************************************************************** */ #ifndef IPMIP_LOG_H #define IPMIP_LOG_H /* **************************************************************************** * 1 DESCRIPTION **************************************************************************** */ /* DESCRIPTION Utility library for handling the log/event system. Provides mechanisms for deleting, retrieving, adding and configuring the logging system. */ /* **************************************************************************** * 2 CONFIGURATION **************************************************************************** */ /* **************************************************************************** * 3 INCLUDE FILES **************************************************************************** */ #ifdef __cplusplus extern "C" { #endif /* **************************************************************************** * 4 DEFINES **************************************************************************** */ /* **************************************************************************** * 5 TYPES **************************************************************************** */ struct Ipmip_context; struct Ipmip_proc; struct Ipmip_cli_message; typedef struct Ipmip_log_event { Ipcom_list next; /* Stored information; to identify and explain */ Ip_time_t when; Ip_u32 level; char *event; } Ipmip_log_event_t; /* **************************************************************************** * 6 FUNCTIONS **************************************************************************** */ /******************************************************************************* * * ipmip_log_event_delete - ipmip_log_event_delete * * Delete the oldest event stored in the global log * * Parameters: * \is * \i ctx * The generic mobility singleton context for IPMIP. For each started mobility * entity, there exists a mobility context which tracks configuration, system * events, available features and started processes. The mobility context is * created using ipmip_context_create(). See ipmip_context.h for more information * regarding the mobility entity context singleton. * \i proc * The process context associated with the currently executing thread. Each * thread and/or process in MIP must have its own unique process context. * If a process is started using ipmip_proc_start, the process context will * be allocated automatically by the IPMIP framework. Otherwise it must * be allocated using ipmip_proc_alloc(). * \ie * * RETURNS: No return value * * ERRNO: * * NOMANUAL */ IP_GLOBAL void ipmip_log_event_delete ( struct Ipmip_context *ctx, struct Ipmip_proc *proc ); /******************************************************************************* * * ipmip_log_event_flush - ipmip_log_event_flush * * Delete all events stored in the global log * * Parameters: * \is * \i ctx * The generic mobility singleton context for IPMIP. For each started mobility * entity, there exists a mobility context which tracks configuration, system * events, available features and started processes. The mobility context is * created using ipmip_context_create(). See ipmip_context.h for more information * regarding the mobility entity context singleton. * \i proc * The process context associated with the currently executing thread. Each * thread and/or process in MIP must have its own unique process context. * If a process is started using ipmip_proc_start, the process context will * be allocated automatically by the IPMIP framework. Otherwise it must * be allocated using ipmip_proc_alloc(). * \ie * * RETURNS: No return value * * ERRNO: * * NOMANUAL */ IP_GLOBAL void ipmip_log_event_flush ( struct Ipmip_context *ctx, struct Ipmip_proc *proc ); /******************************************************************************* * * ipmip_log_attr_request_events - ipmip_log_attr_request_events * * Dump all stored events to the request. * * Parameters: * \is * \i ctx * The generic mobility singleton context for IPMIP. For each started mobility * entity, there exists a mobility context which tracks configuration, system * events, available features and started processes. The mobility context is * created using ipmip_context_create(). See ipmip_context.h for more information * regarding the mobility entity context singleton. * \i proc * The process context associated with the currently executing thread. Each * thread and/or process in MIP must have its own unique process context. * If a process is started using ipmip_proc_start, the process context will * be allocated automatically by the IPMIP framework. Otherwise it must * be allocated using ipmip_proc_alloc(). * \i request * The request * \ie * * RETURNS: The offset to the reply header * * ERRNO: * * NOMANUAL */ IP_GLOBAL Ip_size_t ipmip_log_attr_request_events ( struct Ipmip_context *ctx, struct Ipmip_proc *proc, struct Ipmip_cli_message *request ); /******************************************************************************* * * ipmip_log_attr_request_history - ipmip_log_attr_request_history * * Dump the current configured event history size * * Parameters: * \is * \i ctx * The generic mobility singleton context for IPMIP. For each started mobility * entity, there exists a mobility context which tracks configuration, system * events, available features and started processes. The mobility context is * created using ipmip_context_create(). See ipmip_context.h for more information * regarding the mobility entity context singleton. * \i proc * The process context associated with the currently executing thread. Each * thread and/or process in MIP must have its own unique process context. * If a process is started using ipmip_proc_start, the process context will * be allocated automatically by the IPMIP framework. Otherwise it must * be allocated using ipmip_proc_alloc(). * \i request * The request * \ie * * RETURNS: The offset to the reply header * * ERRNO: * * NOMANUAL */ IP_GLOBAL Ip_size_t ipmip_log_attr_request_history ( struct Ipmip_context *ctx, struct Ipmip_proc *proc, struct Ipmip_cli_message *request ); /******************************************************************************* * * ipmip_log_attr_request_loglevel - ipmip_log_attr_request_loglevel * * Dump the current configured log level value * * Parameters: * \is * \i ctx * The generic mobility singleton context for IPMIP. For each started mobility * entity, there exists a mobility context which tracks configuration, system * events, available features and started processes. The mobility context is * created using ipmip_context_create(). See ipmip_context.h for more information * regarding the mobility entity context singleton. * \i proc * The process context associated with the currently executing thread. Each * thread and/or process in MIP must have its own unique process context. * If a process is started using ipmip_proc_start, the process context will * be allocated automatically by the IPMIP framework. Otherwise it must * be allocated using ipmip_proc_alloc(). * \i request * The request * \ie * * RETURNS: The offset to the reply header * * ERRNO: * * NOMANUAL */ IP_GLOBAL Ip_size_t ipmip_log_attr_request_loglevel ( struct Ipmip_context *ctx, struct Ipmip_proc *proc, struct Ipmip_cli_message *request ); /******************************************************************************* * * ipmip_log_event_add - ipmip_log_event_add * * Add an event * * Parameters: * \is * \i ctx * The generic mobility singleton context for IPMIP. For each started mobility * entity, there exists a mobility context which tracks configuration, system * events, available features and started processes. The mobility context is * created using ipmip_context_create(). See ipmip_context.h for more information * regarding the mobility entity context singleton. * \i proc * The process context associated with the currently executing thread. Each * thread and/or process in MIP must have its own unique process context. * If a process is started using ipmip_proc_start, the process context will * be allocated automatically by the IPMIP framework. Otherwise it must * be allocated using ipmip_proc_alloc(). * \i format * The format string * \i ... * Variable number of arguments for format string * \ie * * RETURNS: No return value * * ERRNO: * */ IP_GLOBAL void ipmip_log_event_add ( struct Ipmip_context *ctx, struct Ipmip_proc *proc, const char *format, ... ); /******************************************************************************* * * ipmip_log_event_vadd - ipmip_log_event_vadd * * Add an event * * Parameters: * \is * \i ctx * The generic mobility singleton context for IPMIP. For each started mobility * entity, there exists a mobility context which tracks configuration, system * events, available features and started processes. The mobility context is * created using ipmip_context_create(). See ipmip_context.h for more information * regarding the mobility entity context singleton. * \i proc * The process context associated with the currently executing thread. Each * thread and/or process in MIP must have its own unique process context. * If a process is started using ipmip_proc_start, the process context will * be allocated automatically by the IPMIP framework. Otherwise it must * be allocated using ipmip_proc_alloc(). * \i format * The format string * \i ap * The VA arguments for format * \ie * * RETURNS: No return value * * ERRNO: * */ IP_GLOBAL void ipmip_log_event_vadd ( struct Ipmip_context *ctx, struct Ipmip_proc *proc, const char *format, va_list ap ); /******************************************************************************* * * ipmip_log_event_backlog - ipmip_log_event_backlog * * Set the current event backlog history * * Parameters: * \is * \i ctx * The generic mobility singleton context for IPMIP. For each started mobility * entity, there exists a mobility context which tracks configuration, system * events, available features and started processes. The mobility context is * created using ipmip_context_create(). See ipmip_context.h for more information * regarding the mobility entity context singleton. * \i proc * The process context associated with the currently executing thread. Each * thread and/or process in MIP must have its own unique process context. * If a process is started using ipmip_proc_start, the process context will * be allocated automatically by the IPMIP framework. Otherwise it must * be allocated using ipmip_proc_alloc(). * \i backlog * The size of the backlog * \ie * * RETURNS: No return value * * ERRNO: * * NOMANUAL */ IP_GLOBAL void ipmip_log_event_backlog ( struct Ipmip_context *ctx, struct Ipmip_proc *proc, Ip_u32 backlog ); /******************************************************************************* * * ipmip_log_loglevel - ipmip_log_loglevel * * Set the current loglevel * * Parameters: * \is * \i ctx * The generic mobility singleton context for IPMIP. For each started mobility * entity, there exists a mobility context which tracks configuration, system * events, available features and started processes. The mobility context is * created using ipmip_context_create(). See ipmip_context.h for more information * regarding the mobility entity context singleton. * \i proc * The process context associated with the currently executing thread. Each * thread and/or process in MIP must have its own unique process context. * If a process is started using ipmip_proc_start, the process context will * be allocated automatically by the IPMIP framework. Otherwise it must * be allocated using ipmip_proc_alloc(). * \i loglevel * The loglevel to set * \ie * * RETURNS: No return value * * ERRNO: * * NOMANUAL */ IP_GLOBAL void ipmip_log_loglevel ( struct Ipmip_context *ctx, struct Ipmip_proc *proc, Ip_u32 loglevel ); #ifdef __cplusplus } #endif #endif /* **************************************************************************** * END OF FILE **************************************************************************** */