200 lines
7.5 KiB
C
200 lines
7.5 KiB
C
/*
|
|
******************************************************************************
|
|
* HEADER FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipike_exchange_transaction_mode.h,v $ $Revision: 1.3.16.1 $
|
|
* $Source: /home/interpeak/CVSRoot/ipike/src/ipike_exchange_transaction_mode.h,v $
|
|
* $Author: ulf $ $Date: 2011-11-16 10:33:33 $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Kenneth Jonsson <kenneth@interpeak.se>
|
|
******************************************************************************
|
|
*/
|
|
#ifndef IPIKE_TRANSACTION_MODE_H
|
|
#define IPIKE_TRANSACTION_MODE_H
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/* IKE transaction mode exchange (to get dynamic ip address)
|
|
* for more information see draft-ietf-ipsec-isakmp-mode-cfg-05.txt */
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#include "ipike_config.h"
|
|
#include "ipike.h"
|
|
#include "ipike_isakmp.h"
|
|
#include "ipike_payload.h"
|
|
#include "ipike_ipsec_sadb.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipike_transaction_mode_on_new_exchange_initiator
|
|
*===========================================================================
|
|
* Description:
|
|
* Parameters: ie - the state of this exchange (this pointer).
|
|
* ike_sa - The IKE SA to be used to protect the communication.
|
|
* option1 - Exchange specific option1
|
|
* option2 - Exchange specific option2
|
|
*
|
|
* Returns: Ipike standard error code.
|
|
*/
|
|
IP_PUBLIC Ipike_error
|
|
ipike_transaction_mode_on_new_exchange_initiator(
|
|
Ipike_isakmp_exchange* ie,
|
|
struct Ipike_sadb_entry_struct* ike_sa,
|
|
const void* option1,
|
|
const void* option2);
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipike_transaction_mode_on_new_exchange_responder
|
|
*===========================================================================
|
|
* Description: Gets the IKE SA that matches the cookies in the message.
|
|
* Parameters: ie - the state of this exchange (this pointer).
|
|
* first_isakmp - the first message (and only) that was/will be sent
|
|
* in this exchange.
|
|
* local_addr - The local address the peer communicates with.
|
|
* peer_addr - The address of the peer IKE daemon.
|
|
* Returns: Ipike standard error code.
|
|
*/
|
|
IP_PUBLIC Ipike_error
|
|
ipike_transaction_mode_on_new_exchange_responder(
|
|
Ipike_isakmp_exchange* ie,
|
|
Ipike_isakmp_header* first_isakmp,
|
|
union Ip_sockaddr_union* local_addr,
|
|
union Ip_sockaddr_union* peer_addr);
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipike_transaction_mode_on_delete_exchange
|
|
*===========================================================================
|
|
* Description: Does nothing.
|
|
* Parameters: ie - the state of this exchange (this pointer).
|
|
* Returns:
|
|
*/
|
|
IP_PUBLIC void
|
|
ipike_transaction_mode_on_delete_exchange(Ipike_isakmp_exchange* ie);
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipike_transaction_mode_get_payload_order
|
|
*===========================================================================
|
|
* Description: Returns a IPIKE_PAYLOAD_NONE terminated array of payload
|
|
* id:s that the main mode exchange message must contain.
|
|
* Parameters: ie - the state of this exchange.
|
|
* Returns: An array containing the payload IDs in the low byte and
|
|
* flags in the high byte.
|
|
*/
|
|
IP_PUBLIC const Ip_u16*
|
|
ipike_transaction_mode_get_payload_order(Ipike_isakmp_exchange* ie);
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipike_transaction_mode_process_payloads
|
|
*===========================================================================
|
|
* Description: Logs the content of the notify payload to the system log
|
|
* or remove the SA in the delete payload.
|
|
* Parameters: ie - the state of this exchange.
|
|
* isakmp - the ISAKMP message.
|
|
* Returns: IPIKE_SUCCESS
|
|
* IPIKE_SA_NOT_FOUND
|
|
*/
|
|
IP_PUBLIC Ipike_error
|
|
ipike_transaction_mode_process_payloads(
|
|
Ipike_isakmp_exchange* ie,
|
|
Ipike_isakmp_header* isakmp);
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipike_transaction_mode_add_reply_payloads
|
|
*===========================================================================
|
|
* Description: Adds all payloads that should part of the response.
|
|
* Parameters: ie - the state of this exchange (this pointer).
|
|
* reply_payloads - pointer to an array of payload pointers.
|
|
* The array will be allocated by this function.
|
|
* Returns: IPIKE_SUCCESS
|
|
* IPIKE_OUT_OF_MEMORY
|
|
* IPIKE_ISAKMP_UNSUPPORTED_PAYLOAD
|
|
*
|
|
*/
|
|
IP_PUBLIC Ipike_error
|
|
ipike_transaction_mode_add_reply_payloads(
|
|
Ipike_isakmp_exchange* ie,
|
|
Ipike_payload_header*** reply_payloads);
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipike_transaction_mode_cleartext_outgoing_message
|
|
*===========================================================================
|
|
* Description: Adds the authentication hash if a IKE SA has been established
|
|
* with the recipient of the message.
|
|
* Parameters: ie - the state of this exchange.
|
|
* outgoing_isakmp - the outgoing ISAKMP message.
|
|
* Returns: IPIKE_SUCCESS
|
|
*/
|
|
IP_PUBLIC Ipike_error
|
|
ipike_transaction_mode_cleartext_outgoing_message(
|
|
Ipike_isakmp_exchange* ie,
|
|
Ipike_isakmp_header** outgoing_isakmp);
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipike_transaction_mode_exchange_done
|
|
*===========================================================================
|
|
* Description: Does nothing.
|
|
* Parameters: ie - the paramtes for the finnished exchange.
|
|
* Returns: IPIKE_SUCCESS
|
|
* OUT_OF_MEMORY
|
|
*/
|
|
IP_PUBLIC Ipike_error
|
|
ipike_transaction_mode_exchange_done(Ipike_isakmp_exchange* ie);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|