171 lines
5.2 KiB
C
171 lines
5.2 KiB
C
/*
|
|
******************************************************************************
|
|
* HEADER FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipike_event.h,v $ $Revision: 1.2.2.3 $
|
|
* $Source: /home/interpeak/CVSRoot/ipike/include/ipike_event.h,v $
|
|
* $Author: jwang9 $ $Date: 2014-12-04 08:32:19 $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Erik Dahlberg <erik.dahlberg@windriver.com>
|
|
******************************************************************************
|
|
*/
|
|
|
|
#ifndef IPIKE_EVENT_H_
|
|
#define IPIKE_EVENT_H_
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
#include "ipike_config.h"
|
|
|
|
#ifdef IPIKE_USE_EVENT_LOG
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
/* Needed for the Ipike_event_msg definition */
|
|
#include "../src/ipike_channel.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/* Event Types */
|
|
typedef enum Ipike_event_type_enum
|
|
{
|
|
IPIKE_EVENT_SOFT_LIFE_SIZE_EXPIRED = 0,
|
|
IPIKE_EVENT_SOFT_LIFE_TIME_EXPIRED,
|
|
IPIKE_EVENT_HARD_LIFE_SIZE_EXPIRED,
|
|
IPIKE_EVENT_HARD_LIFE_TIME_EXPIRED,
|
|
IPIKE_EVENT_IKE_PACKET_DISCARD,
|
|
IPIKE_EVENT_IKE_PHASE_I_FAIL,
|
|
IPIKE_EVENT_IKE_PHASE_I_SUCCESS,
|
|
IPIKE_EVENT_IKE_PHASE_II_FAIL,
|
|
IPIKE_EVENT_IKE_PHASE_II_SUCCESS,
|
|
IPIKE_EVENT_IPSEC_PACKET_DISCARD,
|
|
IPIKE_EVENT_SEQUENCE_NUM_OVERFLOW,
|
|
IPIKE_EVENT_SPD_PACKET_DISCARD,
|
|
IPIKE_EVENT_MAX,
|
|
} Ipike_event_type;
|
|
|
|
/* Event reasons */
|
|
typedef enum Ipike_event_reason_enum
|
|
{
|
|
IPIKE_REASON_UNDEFINED = 0,
|
|
IPIKE_REASON_AUTHENTICATION_ERROR,
|
|
IPIKE_REASON_DECRYPTION_ERROR,
|
|
IPIKE_REASON_ENCRYPTION_ERROR,
|
|
IPIKE_REASON_EXPLICIT_DISCARD_POLICY,
|
|
IPIKE_REASON_INVALID_SPI_ERROR,
|
|
IPIKE_REASON_NEGOTIATION_TIMEOUT,
|
|
IPIKE_REASON_NO_POLICY,
|
|
IPIKE_REASON_NO_PROTECTION_SUITE,
|
|
IPIKE_REASON_POLICY_ERROR,
|
|
IPIKE_REASON_REPLAY_ERROR,
|
|
IPIKE_REASON_IPSEC_INTERNAL_ERROR,
|
|
IPIKE_REASON_ISAKMP_PACKET_ERROR,
|
|
IPIKE_REASON_PROPOSAL_MISMATCH,
|
|
IPIKE_REASON_PSK_MISMATCH,
|
|
IPIKE_REASON_FLOW_MISMATCH,
|
|
IPIKE_REASON_IKE_INTERNAL_ERROR,
|
|
IPIKE_REASON_IKE_SA_OVERFLOW,
|
|
IPIKE_REASON_IPSEC_SA_OVERFLOW,
|
|
IPIKE_REASON_MAX,
|
|
} Ipike_event_reason;
|
|
|
|
|
|
/* Event structure */
|
|
typedef struct Ipike_event_struct
|
|
{
|
|
Ip_u16 type;
|
|
Ip_u16 reason;
|
|
Ip_u8 protocol;
|
|
Ip_u8 sa_family;
|
|
Ip_u16 src_port;
|
|
Ip_u16 dst_port;
|
|
Ip_u32 spi;
|
|
union Ip_sockaddr_union src_ip;
|
|
union Ip_sockaddr_union dst_ip;
|
|
} Ipike_event;
|
|
|
|
|
|
/* Event message definition, needs to be exposed so the IPsec module can
|
|
* generate complete event messages which can be relayed by IPIKE daemon */
|
|
typedef struct Ipike_event_msg_struct
|
|
{
|
|
Ipike_channel_msg hdr;
|
|
Ipike_event event;
|
|
} Ipike_event_msg;
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipike_event_type_str
|
|
*===========================================================================
|
|
* Description: Returns the string representation of an event type.
|
|
*
|
|
* Parameters: type - Event type
|
|
* Returns: Event string or
|
|
* "TYPE_UNKNOWN" if the event type is unrecognizable
|
|
*/
|
|
IP_PUBLIC const char *
|
|
ipike_event_type_str(Ip_u16 type);
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipike_event_reason_str
|
|
*===========================================================================
|
|
* Description: Returns the string representation of an event reason.
|
|
*
|
|
* Parameters: type - Event reason
|
|
* Returns: Event reason string or
|
|
* "REASON_UNKNOWN" if the event reason type is unrecognizable
|
|
*/
|
|
IP_PUBLIC const char *
|
|
ipike_event_reason_str(Ip_u16 reason);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* IPIKE_USE_EVENT_LOG */
|
|
|
|
#endif /* IPIKE_EVENT_H_ */
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|