eapol/eapol_framework/wapi_common/include/abs_wapi_ethernet_core.h
changeset 17 8840d3e38314
equal deleted inserted replaced
2:1c7bc153c08e 17:8840d3e38314
       
     1 /*
       
     2 * ============================================================================
       
     3 *  Name        : ./accesssec/eapol/eapol_framework/wapi_common/include/abs_wapi_ethernet_core.h
       
     4 *  Part of     : WAPI / WAPI       *** Info from the SWAD
       
     5 *  Description : WAPI authentication
       
     6 *  Version     : %version: 4.1.1 % << Don't touch! Updated by Synergy at check-out.
       
     7 *
       
     8 *  Copyright © 2001-2009 Nokia.  All rights reserved.
       
     9 *  This material, including documentation and any related computer
       
    10 *  programs, is protected by copyright controlled by Nokia.  All
       
    11 *  rights are reserved.  Copying, including reproducing, storing,
       
    12 *  adapting or translating, any or all of this material requires the
       
    13 *  prior written consent of Nokia.  This material also contains
       
    14 *  confidential information which may not be disclosed to others
       
    15 *  without the prior written consent of Nokia.
       
    16 * ============================================================================
       
    17 * Template version: 4.2
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #if !defined(_ABS_WAPI_ETHERNET_CORE_H_)
       
    23 #define _ABS_WAPI_ETHERNET_CORE_H_
       
    24 
       
    25 #include "eap_header.h"
       
    26 #include "eap_array.h"
       
    27 
       
    28 
       
    29 class abs_wapi_core_c;
       
    30 class eap_am_network_id_c;
       
    31 class eap_buf_chain_wr_c;
       
    32 class eapol_session_key_c;
       
    33 class abs_eap_state_notification_c;
       
    34 
       
    35 /// The abs_wapi_ethernet_core_c class defines the interface the wapi_ethernet_core_c class
       
    36 /// will use with the partner class.
       
    37 class EAP_EXPORT abs_wapi_ethernet_core_c
       
    38 {
       
    39 private:
       
    40 	//--------------------------------------------------
       
    41 
       
    42 	//--------------------------------------------------
       
    43 protected:
       
    44 	//--------------------------------------------------
       
    45 
       
    46 	//--------------------------------------------------
       
    47 public:
       
    48 	//--------------------------------------------------
       
    49 
       
    50 	// 
       
    51 	virtual ~abs_wapi_ethernet_core_c()
       
    52 	{
       
    53 	}
       
    54 
       
    55 	// 
       
    56 	abs_wapi_ethernet_core_c()
       
    57 	{
       
    58 	}
       
    59 
       
    60 	// 
       
    61 	virtual eap_status_e packet_send(
       
    62 		const eap_am_network_id_c * const network_id,
       
    63 		eap_buf_chain_wr_c * const sent_packet,
       
    64 		const u32_t header_offset,
       
    65 		const u32_t data_length,
       
    66 		const u32_t buffer_length) = 0;
       
    67 
       
    68 	//
       
    69 	virtual u32_t get_header_offset(
       
    70 		u32_t * const MTU,
       
    71 		u32_t * const trailer_length) = 0;
       
    72 
       
    73 	/**
       
    74 	 * The packet_data_session_key() function passes one traffic encryption key to 
       
    75 	 * the lower layers. Ultimately the key can end up to the WLAN hardware.
       
    76 	 * @see abs_eapol_core_c::packet_data_session_key(). 
       
    77 	 */
       
    78 	virtual eap_status_e packet_data_session_key(
       
    79 		const eap_am_network_id_c * const send_network_id,
       
    80 		const eapol_session_key_c * const key
       
    81 		) = 0;
       
    82 
       
    83 	virtual eap_status_e read_configure(
       
    84 		const eap_configuration_field_c * const field,
       
    85 		eap_variable_data_c * const data) = 0;
       
    86 
       
    87 	virtual eap_status_e write_configure(
       
    88 		const eap_configuration_field_c * const field,
       
    89 		eap_variable_data_c * const data) = 0;
       
    90 
       
    91 	/**
       
    92 	 * This is notification of internal state transition.
       
    93 	 * This is used for notifications, debugging and protocol testing.
       
    94 	 * The primal notifications are eap_state_variable_e::eap_state_authentication_finished_successfully
       
    95 	 * and eap_state_variable_e::eap_state_authentication_terminated_unsuccessfully.
       
    96 	 * These two notifications are sent from WAPI layer (eap_protocol_layer_e::eap_protocol_layer_wapi).
       
    97 	 */
       
    98 	virtual void state_notification(
       
    99 		const abs_eap_state_notification_c * const state) = 0;
       
   100 
       
   101 	virtual bool get_is_client() = 0;
       
   102 
       
   103 	/**
       
   104 	 * The set_timer() function initializes timer to be elapsed after p_time_ms milliseconds.
       
   105 	 * @param initializer is pointer to object which timer_expired() function will
       
   106 	 * be called after timer elapses.
       
   107 	 * @param id is identifier which will be returned in timer_expired() function.
       
   108 	 * The user selects and interprets the id for this timer.
       
   109 	 * @param data is pointer to any user selected data which will be returned in timer_expired() function.
       
   110 	 *
       
   111 	 * Adaptation module internally implements the timer.
       
   112 	 */
       
   113 	virtual eap_status_e set_timer(
       
   114 		abs_eap_base_timer_c * const initializer, 
       
   115 		const u32_t id, 
       
   116 		void * const data,
       
   117 		const u32_t p_time_ms) = 0;
       
   118 
       
   119 	/**
       
   120 	 * The cancel_timer() function cancels the timer id initiated by initializer.
       
   121 	 *
       
   122 	 * Adaptation module internally implements the timer.
       
   123 	 */
       
   124 	virtual eap_status_e cancel_timer(
       
   125 		abs_eap_base_timer_c * const initializer, 
       
   126 		const u32_t id) = 0;
       
   127 
       
   128 	/**
       
   129 	 * The cancel_all_timers() function cancels all timers.
       
   130 	 * User should use this in termination of the stack before
       
   131 	 * the adaptation module of tools is deleted.
       
   132 	 * Preferred mode is to cancel each timer directly
       
   133 	 * using cancel_timer() function.
       
   134 	 *
       
   135 	 * Adaptation module internally implements the timer.
       
   136 	 */
       
   137 	virtual eap_status_e cancel_all_timers() = 0;
       
   138 
       
   139 	//--------------------------------------------------
       
   140 }; // class abs_wapi_ethernet_core_c
       
   141 
       
   142 #endif //#if !defined(_ABS_WAPI_ETHERNET_CORE_H_)
       
   143 
       
   144 //--------------------------------------------------
       
   145 
       
   146 
       
   147 
       
   148 // End.