/* ****************************************************************************** * HEADER FILE * * Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipike_exchange_aggressive_mode.h,v $ $Revision: 1.3.16.1 $ * $Source: /home/interpeak/CVSRoot/ipike/src/ipike_exchange_aggressive_mode.h,v $ * $Author: ulf $ $Date: 2011-11-16 10:33:33 $ * $State: Exp $ $Locker: $ * * Copyright Interpeak AB . All rights reserved. * Design and implementation by Kenneth Jonsson ****************************************************************************** */ #ifndef IPIKE_AGGRESSIVE_MODE_H #define IPIKE_AGGRESSIVE_MODE_H /* **************************************************************************** * 1 DESCRIPTION **************************************************************************** */ /* IKE aggressive mode exchange */ /* **************************************************************************** * 2 CONFIGURATION **************************************************************************** */ /* **************************************************************************** * 3 INCLUDE FILES **************************************************************************** */ #include "ipike_config.h" #include "ipike.h" #include "ipike_isakmp.h" #include "ipike_payload.h" #include "ipike_sadb.h" #ifdef __cplusplus extern "C" { #endif /* **************************************************************************** * 4 DEFINES **************************************************************************** */ /* **************************************************************************** * 5 TYPES **************************************************************************** */ /* **************************************************************************** * 6 FUNCTIONS **************************************************************************** */ /* *=========================================================================== * ipike_aggressive_mode_on_new_exchange_initiator *=========================================================================== * Description: Creates a new IKE SA and creates a initiator cookie. * Parameters: ie - the state of this exchange (this pointer). * ike_sa - IKE SA (optional) * conf_section - The name of the configuration section that * contatins information about how to initialize this exchange. * Returns: Ipike standard error code. */ IP_PUBLIC Ipike_error ipike_aggressive_mode_on_new_exchange_initiator( Ipike_isakmp_exchange* ie, Ipike_sadb_entry* ike_sa, const void* option1, const void* flow_option); /* *=========================================================================== * ipike_aggressive_mode_on_new_exchange_responder *=========================================================================== * Description: Creates a new IKE SA. * 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 send messages to. * peer_addr - The address of the peer IKE daemon. * Returns: Ipike standard error code. */ IP_PUBLIC Ipike_error ipike_aggressive_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_aggressive_mode_on_delete_exchange *=========================================================================== * Description: Updates the base initialization vector if the exchange * was compleated successfully. * Parameters: ie - the state of this exchange (this pointer). * Returns: */ IP_PUBLIC void ipike_aggressive_mode_on_delete_exchange(Ipike_isakmp_exchange* ie); /* *=========================================================================== * ipike_aggressive_mode_get_payload_order *=========================================================================== * Description: Returns a IPIKE_PAYLOAD_NONE terminated array of payload * id:s that the aggressive 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_aggressive_mode_get_payload_order(Ipike_isakmp_exchange* ie); /* *=========================================================================== * ipike_aggressive_mode_process_payloads *=========================================================================== * Description: Updates the SA structure bound to this exchange. * Parameters: ie - the state of this exchange. * isakmp - the ISAKMP message. * Returns: IPIKE_SUCCESS * IPIKE_OUT_OF_MEMORY * IPIKE_SA_NO_ACCEPTED_TRANSFORM * IPIKE_DOI_UNSUPPORTED * IPIKE_SITUATION_UNSUPPORTED */ IP_PUBLIC Ipike_error ipike_aggressive_mode_process_payloads( Ipike_isakmp_exchange* ie, Ipike_isakmp_header *isakmp); /* *=========================================================================== * ipike_aggressive_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_aggressive_mode_add_reply_payloads( Ipike_isakmp_exchange* ie, Ipike_payload_header*** reply_payloads); /* *=========================================================================== * ipike_aggressive_mode_cleartext_outgoing_message *=========================================================================== * Description: Does nothing (not needed in aggressive mode) * Parameters: ie - the state of this exchange. * outgoing_isakmp - the outgoing ISAKMP message. * Returns: IPIKE_SUCCESS */ IP_PUBLIC Ipike_error ipike_aggressive_mode_cleartext_outgoing_message( Ipike_isakmp_exchange* ie, Ipike_isakmp_header** outgoing_isakmp); /* *=========================================================================== * ipike_aggressive_mode_exchange_done *=========================================================================== * Description: Stores the final IV. * Parameters: ie - the paramtes for the finnished exchange. * Returns: IPIKE_SUCCESS * OUT_OF_MEMORY */ IP_PUBLIC Ipike_error ipike_aggressive_mode_exchange_done(Ipike_isakmp_exchange* ie); #ifdef __cplusplus } #endif #endif /* **************************************************************************** * END OF FILE **************************************************************************** */