172 lines
5.8 KiB
C
172 lines
5.8 KiB
C
/*
|
|
******************************************************************************
|
|
* HEADER FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipike_event_server.h,v $ $Revision: 1.2.2.2 $
|
|
* $Source: /home/interpeak/CVSRoot/ipike/src/ipike_event_server.h,v $
|
|
* $Author: ulf $ $Date: 2011-11-16 10:33:32 $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Erik Dahlberg <erik.dahlberg@windriver.com>
|
|
******************************************************************************
|
|
*/
|
|
|
|
#ifndef IPIKE_EVENT_SERVER_H_
|
|
#define IPIKE_EVENT_SERVER_H_
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
#include "ipike_config.h"
|
|
|
|
#ifdef IPIKE_USE_EVENT_LOG
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
#include "ipike_h.h"
|
|
#include "ipike_event.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipike_event_server_log
|
|
*===========================================================================
|
|
* Description: Creates an event message and sends it to all registered
|
|
* event receivers. This function is used to send event messages
|
|
* from the IKE daemon.
|
|
*
|
|
* Parameters: type - Event type
|
|
* reason - Event reason
|
|
* src_ip - Source IP Address
|
|
* dst_ip - Destination IP Address
|
|
* sa_proto - SA Protocol (AH or ESP)
|
|
spi - IPsec SA SPI
|
|
* Returns:
|
|
*/
|
|
IP_GLOBAL void
|
|
ipike_event_server_log(int type, int reason,
|
|
union Ip_sockaddr_union * src_ip,
|
|
union Ip_sockaddr_union * dst_ip,
|
|
int sa_proto,
|
|
Ip_u8 spi[4]);
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipike_event_server_relay
|
|
*===========================================================================
|
|
* Description: Relays the event message to all registered receivers.
|
|
*
|
|
* Parameters: emsg - Event message
|
|
* Returns:
|
|
*/
|
|
IP_GLOBAL void
|
|
ipike_event_server_relay(Ipike_event_msg *emsg);
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipike_event_server_shutdown
|
|
*===========================================================================
|
|
* Description: Shutdowns the event server and closes all channels to
|
|
* registered receivers.
|
|
* Parameters:
|
|
* Returns:
|
|
*/
|
|
IP_GLOBAL void
|
|
ipike_event_server_shutdown(void);
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipike_event_server_add_fds
|
|
*===========================================================================
|
|
* Description: Adds internal sockets held be the event server into the
|
|
* file descriptor set.
|
|
*
|
|
* Parameters: read_fds - Read file descriptor set.
|
|
* write_fds - Write file descriptor set.
|
|
* Returns: The largest file descriptor that was added, or
|
|
* -1 if no file descriptor was added.
|
|
*/
|
|
IP_GLOBAL Ipike_error
|
|
ipike_event_server_startup(void);
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipike_event_server_add_fds
|
|
*===========================================================================
|
|
* Description: Adds internal sockets held be the event server into the
|
|
* file descriptor set.
|
|
*
|
|
* Parameters: read_fds - Read file descriptor set.
|
|
* write_fds - Write file descriptor set.
|
|
* Returns: The largest file descriptor that was added, or
|
|
* -1 if no file descriptor was added.
|
|
*/
|
|
IP_GLOBAL int
|
|
ipike_event_server_add_fds(
|
|
Ip_fd_set * read_fds,
|
|
Ip_fd_set * write_fds);
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipike_channel_server_process
|
|
*===========================================================================
|
|
* Description: Process internal sockets inside the event server which has
|
|
* been added with ipike_event_server_add_fds.
|
|
*
|
|
* Parameters: read_fds - Read file descriptor set.
|
|
* write_fds - Write file descriptor set.
|
|
* Returns: The number of processed file descriptors, 0 if no file
|
|
* descriptors were processed.
|
|
*/
|
|
IP_GLOBAL int
|
|
ipike_event_server_process(
|
|
Ip_fd_set * read_fds,
|
|
Ip_fd_set * write_fds);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* IPIKE_USE_EVENT_LOG */
|
|
|
|
#endif /* IPIKE_EVENT_SERVER_H_ */
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|