📄 ipsec_logger.h
字号:
/* ipsec_logger.h - WindNet IPsec: IPsec logger private header *//* * Copyright (c) 2000-2005 Wind River Systems, Inc. * * The right to copy, distribute, modify or otherwise make use * of this software may be licensed only pursuant to the terms * of an applicable Wind River license agreement. *//*modification history-------------------------------------01b,13oct05,??? Added macros to clean up source files that use logger01a,15apr05,djp added validity flag for IP address fields*//*DESCRIPTIONPrivate version of IPsec logger header file. */#if !defined (__IPSEC_LOGGER_P_H__)#define __IPSEC_LOGGER_P_H__#include <semLib.h>#include <wrn/ipsec/ipsecLogger.h>typedef enum IPSEC_LOGGER_MSG_TYPE{ IPSEC_LOGGER_EVENT_MSG = 0, IPSEC_LOGGER_SHUTDOWN_MSG, IPSEC_LOGGER_MSG_LAST_TYPE = IPSEC_LOGGER_SHUTDOWN_MSG}IPSEC_LOGGER_MSG_TYPE;/* IPSEC_LOGGER_MSG_DATA defines a structure containing the callback * data. This is used to serialize and deserialize logger message contents */#define IPSEC_LOGGER_MAX_EVENT_SIZE (400)typedef struct IPSEC_LOGGER_MSG{ IPSEC_LOGGER_MSG_TYPE msgType; unsigned char saFamily; UCHAR srcIPAddr [16]; UCHAR dstIPAddr [16]; BOOL srcAddrValid; BOOL dstAddrValid; unsigned int srcPort; unsigned int dstPort; int protocol; int spi; int eventDataSize; IPSEC_LOG_EVENT_ID eventId; IPSEC_LOG_REASON reasonId; UCHAR eventData[IPSEC_LOGGER_MAX_EVENT_SIZE]; /* event data gets copied here */}IPSEC_LOGGER_MSG;/* IPSEC_LOGGER_INFO defines the callback functions and mutexes for an * IKE Callback "context". Each RTP plus the IKE task maintains this * information. */typedef struct IPSEC_LOGGER_INFO{ FP_IPSEC_LOGGER_GLOBAL_CALLBACK fpIpsecLogger; SEM_ID callbackInfoMutex; BOOL initialized; BOOL isLoggerEnabled;}IPSEC_LOGGER_INFO;/* Callback queue and task definitions */#define IPSEC_LOGGER_MSG_LEN (sizeof(IPSEC_LOGGER_MSG))#define IPSEC_LOGGER_QUEUE_MAX_MSGS (16)#define IPSEC_LOGGER_QUEUE_NAME ("/ipsecLoggerCallbackQueue")#define IPSEC_LOGGER_TASK_NAME ("tIPsecLoggerCallback")#define IPSEC_LOGGER_TASK_PRIORITY (150)#define IPSEC_LOGGER_TASK_STACK_SIZE (10000)/* private prototypes */STATUS ipsecLoggerInfoInit(IPSEC_LOGGER_INFO* callbackInfo);void ipsecLoggerInfoClear(IPSEC_LOGGER_INFO* callbackInfo);STATUS ipsecLoggerInfoCallbackSet(IPSEC_LOGGER_INFO* callbackInfo, FP_IPSEC_LOGGER_GLOBAL_CALLBACK fpIpsecLogger);STATUS ipsecLoggerInfoCallbackClear(IPSEC_LOGGER_INFO* callbackInfo);BOOL ipsecLoggerInfoIsEnabled(IPSEC_LOGGER_INFO* callbackInfo);STATUS ipsecLoggerInfoEnabledSet(IPSEC_LOGGER_INFO* callbackInfo, BOOL enable);STATUS ipsecLoggerInfoEventEnabledSet(IPSEC_LOGGER_INFO* callbackInfo, IPSEC_LOG_EVENT_ID eventId, BOOL enable);BOOL ipsecLoggerInfoEventEnabledGet(IPSEC_LOGGER_INFO* callbackInfo, IPSEC_LOG_EVENT_ID eventId);FP_IPSEC_LOGGER_GLOBAL_CALLBACK ipsecLoggerInfoCallbackGet(IPSEC_LOGGER_INFO* callbackInfo);STATUS ipsecLoggerHandlerTaskSpawn(IPSEC_LOGGER_INFO* callbackInfo);void ipsecLoggerQueueCallback(IPSEC_LOGGER_MSG* callbackMsg);void ipsecLoggerInvokeCallback(u_char saFamily, UCHAR* srcIPAddr, UCHAR* dstIPAddr, unsigned int srcPort, unsigned int dstPort, int protocol, int spi, void* eventData, IPSEC_LOG_EVENT_ID eventId, IPSEC_LOG_REASON reasonId);void ipsecLoggerEventSerialize(IPSEC_LOGGER_MSG* callbackMsg, u_char saFamily, UCHAR* srcIPAddr, UCHAR* dstIPAddr, unsigned int srcPort, unsigned int dstPort, int protocol, int spi, void* eventData, IPSEC_LOG_EVENT_ID eventId, IPSEC_LOG_REASON reasonId);STATUS ipsecLoggerInit (void);void ipsecLoggerShutdown (void);void ipsecLoggerTaskShutdown (void);IPSEC_LOGGER_INFO* ipsecLoggerInfoGet();#endif /* __IPSEC_LOGGER_P_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -