Files
2026-07-30 11:19:44 +05:30

140 lines
3.6 KiB
C

/*
******************************************************************************
* HEADER FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipike_event_receiver.h,v $ $Revision: 1.4.2.2 $
* $Source: /home/interpeak/CVSRoot/ipike/include/ipike_event_receiver.h,v $
* $Author: ulf $ $Date: 2011-11-16 10:33:30 $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
* Design and implementation by Erik Dahlberg <erik.dahlberg@windriver.com>
******************************************************************************
*/
#ifndef IPIKE_EVENT_RECEIVER_H_
#define IPIKE_EVENT_RECEIVER_H_
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
#include <ipike_config.h>
#ifdef IPIKE_USE_EVENT_LOG
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
#include <ipike.h>
#include <ipike_event.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
/* Event Receiver callback */
typedef int (*Ipike_event_receiver_cb)(Ipike_event * event);
/*
****************************************************************************
* 6 FUNCTIONS
****************************************************************************
*/
/*******************************************************************************
*
* ipike_event_receiver_init - initializes IKE and IPsec event receiver
* This routine initializes the event receiver library.
*
* Parameters:
* \is
* \i <event_cb>
* A user callback function which is called upon reception of an event.
*
*
* EXAMPLE
* \cs
* int event_cb(Ipike_event *event)
* {
* printf("Got event\n");
* printf(" type: %s\n", ipike_event_type_str(event->type));
* printf(" reason: %s\n", ipike_event_reason_str(event->reason));
* return 0;
* }
*
* void example_start(void)
* {
* /@ Initialize event receiver library @/
* ipike_event_receiver_init(event_cb);
* }
*
*
* void example_stop(void)
* {
* /@ Stop and destroy event receiver @/
* ipike_event_receiver_destroy();
* }
* \ce
*
* RETURNS: 0 on success, -1 on failure
*
* ERRNO:
*/
IP_PUBLIC int
ipike_event_receiver_init(
Ipike_event_receiver_cb event_cb);
/*******************************************************************************
*
* ipike_event_receiver_destroy - destroys and stops the IKE and IPsec event
* receiver
* This routine stops the event receiver task and returns allocated memory.
*
* Parameters:
*
* RETURNS:
*
* ERRNO:
*/
IP_PUBLIC void
ipike_event_receiver_destroy(void);
#ifdef __cplusplus
}
#endif
#endif /* IPIKE_USE_EVENT_LOG */
#endif /* IPIKE_EVENT_RECEIVER_H_ */
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/