wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/inc/core_wlan_eapol_if_message.h
changeset 0 c40eb8fe8501
child 24 e717b8f55620
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Class for parsing and generating messages for Engine-EAPOL interface.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CORE_WLAN_EAPOL_IF_MESSAGE_H
       
    20 #define CORE_WLAN_EAPOL_IF_MESSAGE_H
       
    21 
       
    22 #include "am_platform_libraries.h"
       
    23 #include "core_type_list.h"
       
    24 #include "core_types.h"
       
    25 #include "core_tools.h"
       
    26 
       
    27 // Compile time assert. Used to make sure that generated datatypes are correct size.
       
    28 #define COMPILE_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1]
       
    29 
       
    30 
       
    31 /**
       
    32  * Class for parsing and generating WLAN EAPOL Plugin interface messages.
       
    33  *
       
    34  * @since S60 v3.2
       
    35  */
       
    36 
       
    37 
       
    38 enum wlan_eapol_if_message_type_e
       
    39     {
       
    40     wlan_eapol_if_message_type_none                                 = 0,
       
    41     wlan_eapol_if_message_type_array                                = 1,
       
    42     wlan_eapol_if_message_type_boolean                              = 2,
       
    43     wlan_eapol_if_message_type_eap_protocol_layer                   = 3,
       
    44     wlan_eapol_if_message_type_eap_state_notification               = 4,
       
    45     wlan_eapol_if_message_type_eap_status                           = 5,
       
    46     wlan_eapol_if_message_type_eap_type                             = 6,
       
    47     wlan_eapol_if_message_type_eapol_key_802_11_authentication_mode = 7,
       
    48     wlan_eapol_if_message_type_eapol_key_authentication_type        = 8,
       
    49     wlan_eapol_if_message_type_eapol_key_type                       = 9,
       
    50     wlan_eapol_if_message_type_eapol_tkip_mic_failure_type          = 10,
       
    51     wlan_eapol_if_message_type_eapol_wlan_authentication_state      = 11,
       
    52     wlan_eapol_if_message_type_error                                = 12,
       
    53     wlan_eapol_if_message_type_function                             = 13,
       
    54     wlan_eapol_if_message_type_network_id                           = 14,
       
    55     wlan_eapol_if_message_type_network_key                          = 15,
       
    56     wlan_eapol_if_message_type_protected_setup_credential           = 16,
       
    57     wlan_eapol_if_message_type_RSNA_cipher                          = 17,
       
    58     wlan_eapol_if_message_type_session_key                          = 18,
       
    59     wlan_eapol_if_message_type_u8_t                                 = 19,
       
    60     wlan_eapol_if_message_type_u16_t                                = 20,
       
    61     wlan_eapol_if_message_type_u32_t                                = 21,
       
    62     wlan_eapol_if_message_type_u64_t                                = 22,
       
    63     wlan_eapol_if_message_type_variable_data                        = 23,
       
    64     };
       
    65 
       
    66 
       
    67 enum wlan_eapol_if_message_type_function_e
       
    68     {
       
    69     wlan_eapol_if_message_type_function_none                                        = 0,
       
    70     wlan_eapol_if_message_type_function_check_pmksa_cache                           = 1,
       
    71     wlan_eapol_if_message_type_function_start_authentication                        = 2,
       
    72     wlan_eapol_if_message_type_function_complete_association                        = 3,
       
    73     wlan_eapol_if_message_type_function_disassociation                              = 4,
       
    74     wlan_eapol_if_message_type_function_start_preauthentication                     = 5,
       
    75     wlan_eapol_if_message_type_function_start_reassociation                         = 6,
       
    76     wlan_eapol_if_message_type_function_complete_reassociation                      = 7,
       
    77     wlan_eapol_if_message_type_function_start_wpx_fast_roam_reassociation           = 8,
       
    78     wlan_eapol_if_message_type_function_complete_wpx_fast_roam_reassociation        = 9,
       
    79     wlan_eapol_if_message_type_function_packet_process                              = 10,
       
    80     wlan_eapol_if_message_type_function_tkip_mic_failure                            = 11,
       
    81     wlan_eapol_if_message_type_function_eap_acknowledge                             = 12,
       
    82     wlan_eapol_if_message_type_function_update_header_offset                        = 13,
       
    83     wlan_eapol_if_message_type_function_complete_check_pmksa_cache                  = 14,
       
    84     wlan_eapol_if_message_type_function_packet_send                                 = 15,
       
    85     wlan_eapol_if_message_type_function_associate                                   = 16,
       
    86     wlan_eapol_if_message_type_function_disassociate                                = 17,
       
    87     wlan_eapol_if_message_type_function_packet_data_session_key                     = 18,
       
    88     wlan_eapol_if_message_type_function_state_notification                          = 19,
       
    89     wlan_eapol_if_message_type_function_reassociate                                 = 20,
       
    90     wlan_eapol_if_message_type_function_update_wlan_database_reference_values       = 21,
       
    91     wlan_eapol_if_message_type_function_complete_start_wpx_fast_roam_reassociation  = 22,
       
    92     wlan_eapol_if_message_type_function_new_protected_setup_credentials             = 23,
       
    93     };
       
    94 
       
    95 
       
    96 
       
    97 static const u32_t WLAN_EAPOL_MESSAGE_IF_TYPE_OFFSET   = 0;
       
    98 static const u32_t WLAN_EAPOL_MESSAGE_IF_LENGTH_OFFSET = 4;
       
    99 static const u32_t WLAN_EAPOL_MESSAGE_IF_DATA_OFFSET   = 8;
       
   100 
       
   101 
       
   102 
       
   103 class network_id_c
       
   104     {
       
   105 public:
       
   106     
       
   107     /**
       
   108      * Constructor
       
   109      */
       
   110     network_id_c(
       
   111         u8_t * source, u32_t source_length,
       
   112         u8_t * destination, u32_t destination_length,
       
   113         u16_t packet_type ) 
       
   114         : source_ptr( source )
       
   115         , source_length( source_length )
       
   116         , destination_ptr( destination )
       
   117         , destination_length( destination_length )
       
   118         , packet_type( packet_type )
       
   119         , source_m( ZERO_MAC_ADDR )
       
   120         , destination_m( ZERO_MAC_ADDR )
       
   121         {
       
   122         }
       
   123 
       
   124     /** 
       
   125      * Destructor.
       
   126      */
       
   127     ~network_id_c()
       
   128         {
       
   129         source_ptr = NULL;
       
   130         destination_ptr = NULL;
       
   131         }
       
   132 
       
   133     const core_mac_address_s& source()
       
   134         {
       
   135         if( source_ptr )
       
   136             {
       
   137             core_tools_c::copy(
       
   138                 &source_m.addr[0],
       
   139                 source_ptr,
       
   140                 MAC_ADDR_LEN );
       
   141             }
       
   142 
       
   143         return source_m;
       
   144         }
       
   145 
       
   146     const core_mac_address_s& destination()
       
   147         {
       
   148         if( destination_ptr )
       
   149             {
       
   150             core_tools_c::copy(
       
   151                 &destination_m.addr[0],
       
   152                 destination_ptr,
       
   153                 MAC_ADDR_LEN );
       
   154             }
       
   155 
       
   156         return destination_m;
       
   157         }
       
   158 
       
   159 public: // data
       
   160 
       
   161     u8_t * source_ptr;
       
   162     u32_t source_length;
       
   163     u8_t * destination_ptr;
       
   164     u32_t destination_length;
       
   165     u16_t packet_type;
       
   166     core_mac_address_s source_m;
       
   167     core_mac_address_s destination_m;
       
   168     };
       
   169 
       
   170 
       
   171 
       
   172 
       
   173 
       
   174 class session_key_c
       
   175     {
       
   176 public:
       
   177     
       
   178     /**
       
   179      * Constructor
       
   180      */
       
   181     session_key_c(
       
   182         u8_t * key, u32_t key_length,
       
   183         u8_t * sequence_number, u32_t sequence_number_length,
       
   184         wlan_eapol_if_eapol_key_type_e eapol_key_type,
       
   185         u32_t key_index,
       
   186         bool_t key_tx_bit )
       
   187         : key( key )
       
   188         , key_length( key_length )
       
   189         , sequence_number( sequence_number )
       
   190         , sequence_number_length( sequence_number_length )
       
   191         , eapol_key_type( eapol_key_type )
       
   192         , key_index( key_index )
       
   193         , key_tx_bit( key_tx_bit )
       
   194         { }
       
   195     
       
   196     /** 
       
   197      * Destructor.
       
   198      */
       
   199     ~session_key_c()
       
   200         {
       
   201         key = NULL;
       
   202         sequence_number = NULL;
       
   203         }
       
   204 
       
   205 public: // data
       
   206 
       
   207     u8_t * key;
       
   208     u32_t key_length;
       
   209     
       
   210     u8_t * sequence_number;
       
   211     u32_t sequence_number_length;
       
   212     
       
   213     wlan_eapol_if_eapol_key_type_e eapol_key_type;
       
   214     u32_t key_index;
       
   215     bool_t key_tx_bit;
       
   216     };
       
   217 
       
   218 
       
   219 
       
   220 
       
   221 
       
   222 class state_notification_c
       
   223     {
       
   224 public:
       
   225 
       
   226     /**
       
   227      * Constructor
       
   228      */
       
   229     state_notification_c(
       
   230         const network_id_c * network_id,
       
   231         wlan_eapol_if_eap_protocol_layer_e protocol_layer,
       
   232         u32_t protocol,
       
   233         u32_t eap_type_vendor_id,
       
   234         u32_t eap_type_vendor_type,
       
   235         u32_t current_state,
       
   236         bool_t is_client,
       
   237         wlan_eapol_if_eap_status_e authentication_error )
       
   238         : network_id( *network_id )
       
   239         , protocol_layer( protocol_layer )
       
   240         , protocol( protocol )
       
   241         , eap_type_vendor_id( eap_type_vendor_id )
       
   242         , eap_type_vendor_type( eap_type_vendor_type )
       
   243         , current_state( current_state )
       
   244         , is_client( is_client )
       
   245         , authentication_error( authentication_error )
       
   246         { }
       
   247     
       
   248     /** 
       
   249      * Destructor.
       
   250      */
       
   251     ~state_notification_c()
       
   252         { }
       
   253 
       
   254 public: // data
       
   255 
       
   256     network_id_c network_id;
       
   257     wlan_eapol_if_eap_protocol_layer_e protocol_layer;
       
   258     u32_t protocol;
       
   259     u32_t eap_type_vendor_id;
       
   260     u32_t eap_type_vendor_type;
       
   261     u32_t current_state;
       
   262     bool_t is_client;
       
   263     wlan_eapol_if_eap_status_e authentication_error;
       
   264     
       
   265     };
       
   266 
       
   267 
       
   268 class network_key_c
       
   269     {
       
   270 public:
       
   271     
       
   272     /**
       
   273      * Constructor
       
   274      */
       
   275     network_key_c(
       
   276         u8_t network_key_index,
       
   277         u8_t * network_key,
       
   278         u32_t network_key_length )
       
   279         : network_key_index( network_key_index )
       
   280         , network_key( network_key )
       
   281         , network_key_length( network_key_length )
       
   282         { }
       
   283     
       
   284     /** 
       
   285      * Destructor.
       
   286      */
       
   287     ~network_key_c()
       
   288         {
       
   289         network_key = NULL;
       
   290         }
       
   291 
       
   292 public: // data
       
   293 
       
   294     u8_t network_key_index;
       
   295     u8_t * network_key;
       
   296     u32_t network_key_length;
       
   297     
       
   298     };
       
   299 
       
   300 
       
   301 class protected_setup_credential_c
       
   302     {
       
   303 public:
       
   304     
       
   305     /**
       
   306      * Constructor
       
   307      */
       
   308     protected_setup_credential_c(
       
   309         u8_t network_index,
       
   310         u8_t * ssid,
       
   311         u32_t ssid_length,
       
   312         u16_t authentication_type,
       
   313         u16_t encryption_type,
       
   314         u8_t * mac_address,
       
   315         u32_t mac_address_length )
       
   316         : network_index( network_index )
       
   317         , ssid( ssid )
       
   318         , ssid_length( ssid_length )
       
   319         , authentication_type( authentication_type )
       
   320         , encryption_type( encryption_type )
       
   321         , network_key_list( )
       
   322         , mac_address( mac_address )
       
   323         , mac_address_length( mac_address_length )
       
   324         { }
       
   325     
       
   326     /** 
       
   327      * Destructor.
       
   328      */
       
   329     ~protected_setup_credential_c()
       
   330         {
       
   331         ssid = NULL;
       
   332         mac_address = NULL;
       
   333         }
       
   334 
       
   335 public: // data
       
   336 
       
   337     u8_t network_index;
       
   338     u8_t * ssid;
       
   339     u32_t ssid_length;
       
   340     u16_t authentication_type;
       
   341     u16_t encryption_type;
       
   342     core_type_list_c<network_key_c> network_key_list;
       
   343     u8_t * mac_address;
       
   344     u32_t mac_address_length;
       
   345     
       
   346     };
       
   347 
       
   348 
       
   349 
       
   350 
       
   351 
       
   352 
       
   353 
       
   354 
       
   355 //NONSHARABLE_CLASS( core_wlan_eapol_if_parameter_c )
       
   356 
       
   357 class core_wlan_eapol_if_parameter_c
       
   358     {
       
   359 public:
       
   360 
       
   361     /**
       
   362      * Constructor
       
   363      */
       
   364     core_wlan_eapol_if_parameter_c();
       
   365     
       
   366     /**
       
   367      * Constructor
       
   368      *
       
   369      * @param data Pointer to the TLV encoded data.
       
   370      * @param data_length Length of the TLV encoded data.
       
   371      */
       
   372     core_wlan_eapol_if_parameter_c(
       
   373         u8_t *data, u32_t data_length );
       
   374     
       
   375     /** 
       
   376      * Destructor.
       
   377      */
       
   378     ~core_wlan_eapol_if_parameter_c();
       
   379     
       
   380     /**
       
   381      * Update content of parameter
       
   382      *
       
   383      * @param data Pointer to the TLV encoded data.
       
   384      * @param data_length Length of the TLV encoded data.
       
   385      */
       
   386     void update(
       
   387         u8_t *data, u32_t data_length );
       
   388 
       
   389     
       
   390     // ============================================================================
       
   391     // General methods to handle parameters
       
   392     
       
   393     u32_t size() const;
       
   394 
       
   395     wlan_eapol_if_message_type_e get_parameter_type() const;
       
   396 
       
   397     u32_t get_parameter_length() const;
       
   398 
       
   399     u8_t* get_data() const;
       
   400     
       
   401 
       
   402     // ============================================================================
       
   403     // Parameter specific methods
       
   404     
       
   405     // All 32 bit base types
       
   406     core_error_e set_parameter_data( 
       
   407         wlan_eapol_if_message_type_e type, 
       
   408         u32_t value );
       
   409 
       
   410     // All already generated structures, arrays and variable data
       
   411     core_error_e set_parameter_data( 
       
   412         wlan_eapol_if_message_type_e type, 
       
   413         const u8_t* data, u32_t length );
       
   414 
       
   415     // EAP type
       
   416     core_error_e set_parameter_data( 
       
   417         wlan_eapol_if_message_type_e type, 
       
   418         u32_t vendor_id, 
       
   419         u32_t vendor_type );
       
   420 
       
   421     core_error_e set_parameter_data_boolean( 
       
   422         wlan_eapol_if_message_type_e type, 
       
   423         bool_t boolean );
       
   424 
       
   425     core_error_e set_parameter_data_u16_t( 
       
   426         wlan_eapol_if_message_type_e type, 
       
   427         u16_t value );
       
   428 
       
   429     core_error_e set_parameter_data_u8_t( 
       
   430         wlan_eapol_if_message_type_e type, 
       
   431         u8_t value );
       
   432 
       
   433     core_error_e set_parameter_data_u64_t(
       
   434         u64_t data );
       
   435 
       
   436     // ============================================================================
       
   437 
       
   438     // All 32 bit values
       
   439     core_error_e get_parameter_data(
       
   440         u32_t * value ) const;
       
   441     
       
   442     // 
       
   443     core_error_e get_parameter_data(
       
   444         u64_t * value ) const;
       
   445 
       
   446     // 
       
   447     core_error_e get_parameter_data(
       
   448         bool_t * value ) const;
       
   449 
       
   450     core_error_e get_parameter_data(
       
   451         u16_t * value ) const;
       
   452 
       
   453     core_error_e get_parameter_data(
       
   454         u8_t * value ) const;
       
   455 
       
   456     core_error_e get_parameter_data(
       
   457         u8_t ** const data, u32_t * data_length ) const;
       
   458 
       
   459     core_error_e get_parameter_data(
       
   460         u32_t * vendor_id, 
       
   461         u32_t * vendor_type ) const;
       
   462 
       
   463 
       
   464 // ============================================================================
       
   465 
       
   466 private:
       
   467 
       
   468     core_error_e reserve_buffer(
       
   469         u32_t needed_buffer_length  );
       
   470 
       
   471     void add_header(
       
   472         wlan_eapol_if_message_type_e type, 
       
   473         u32_t length );
       
   474 
       
   475     u64_t get_parameter_u64_t() const;
       
   476 
       
   477     void add_parameter_u32_t(
       
   478         u32_t data );
       
   479 
       
   480     u32_t get_parameter_u32_t() const;
       
   481 
       
   482     void add_parameter_u16_t(
       
   483         u16_t data );
       
   484 
       
   485     u16_t get_parameter_u16_t() const;
       
   486 
       
   487     void add_parameter_u8_t(
       
   488         u8_t data );
       
   489 
       
   490     u8_t get_parameter_u8_t() const;
       
   491 
       
   492 private: // Data
       
   493 
       
   494     u8_t * data_m;           // This is pointer to current buffer
       
   495     u32_t buffer_length_m;
       
   496     bool_t delete_buffer_m;
       
   497     
       
   498     };
       
   499 
       
   500 
       
   501 
       
   502 
       
   503 
       
   504 
       
   505 
       
   506 
       
   507 
       
   508 
       
   509 class core_wlan_eapol_if_function_c
       
   510     {
       
   511 public:
       
   512 
       
   513     /**
       
   514      * Constructor
       
   515      */
       
   516     core_wlan_eapol_if_function_c();
       
   517 
       
   518     /**
       
   519      * Constructor
       
   520      *
       
   521      * @param data Pointer to the IE data.
       
   522      * @param data_length Length of the IE data.
       
   523      */
       
   524     core_wlan_eapol_if_function_c(
       
   525         u8_t * data,
       
   526         const u32_t length );
       
   527     
       
   528     /** 
       
   529      * Destructor.
       
   530      */
       
   531     ~core_wlan_eapol_if_function_c();
       
   532     
       
   533     
       
   534     wlan_eapol_if_message_type_e get_type();
       
   535 
       
   536     wlan_eapol_if_message_type_function_e get_function();
       
   537     
       
   538     core_error_e append(
       
   539         const core_wlan_eapol_if_parameter_c * const param );
       
   540 
       
   541     u32_t size() const;
       
   542 
       
   543     u8_t* get_data();
       
   544 
       
   545     void clear();
       
   546     
       
   547     // ============================================================================
       
   548     
       
   549     // Iterators
       
   550     void first();
       
   551     
       
   552     void next();
       
   553 
       
   554     const core_wlan_eapol_if_parameter_c* current();
       
   555     
       
   556     bool_t is_done() const;
       
   557 
       
   558     // ============================================================================
       
   559     // Methods to generate and parse structured datatypes
       
   560     
       
   561     core_error_e reserve_buffer(
       
   562         u32_t needed_buffer_length );
       
   563 
       
   564     // Higher level methods to handle structured parameters and functions
       
   565     
       
   566     core_error_e generate_network_id(
       
   567         const network_id_c * const network_id );
       
   568     
       
   569     core_error_e parse_network_id(
       
   570         network_id_c * network_id );
       
   571 
       
   572     core_error_e generate_network_key(
       
   573         network_key_c * network_key );
       
   574     
       
   575     core_error_e parse_network_key(
       
   576         network_key_c * network_key );
       
   577 
       
   578     core_error_e generate_protected_setup_credential(
       
   579         protected_setup_credential_c * credential );
       
   580     
       
   581     core_error_e parse_protected_setup_credential(
       
   582         protected_setup_credential_c * credential );
       
   583 
       
   584     core_error_e generate_session_key(
       
   585         session_key_c * session_key );
       
   586 
       
   587     core_error_e parse_session_key(
       
   588         session_key_c * session_key );
       
   589 
       
   590     core_error_e generate_eap_state_notification(
       
   591         state_notification_c * state_notification );
       
   592 
       
   593     core_error_e parse_eap_state_notification(
       
   594         state_notification_c * state_notification );
       
   595 
       
   596 
       
   597     // ============================================================================
       
   598     // Methods to generate and parse functions
       
   599 
       
   600     core_error_e check_pmksa_cache(
       
   601         core_type_list_c<network_id_c> & network_id_list,
       
   602         const wlan_eapol_if_eapol_key_authentication_type_e selected_eapol_key_authentication_type,
       
   603         const wlan_eapol_if_rsna_cipher_e pairwise_key_cipher_suite,
       
   604         const wlan_eapol_if_rsna_cipher_e group_key_cipher_suite );
       
   605 
       
   606     core_error_e start_authentication(
       
   607         u8_t * ssid, const u32_t ssid_length, 
       
   608         const wlan_eapol_if_eapol_key_authentication_type_e selected_eapol_key_authentication_type,
       
   609         u8_t * wpa_psk, const u32_t wpa_psk_length, 
       
   610         const bool_t wpa_override_enabled,
       
   611         const network_id_c * receive_network_id );
       
   612 
       
   613     core_error_e complete_association(
       
   614         const wlan_eapol_if_eapol_wlan_authentication_state_e association_result,
       
   615         const network_id_c * network_id,
       
   616         u8_t * received_wpa_ie, const u32_t received_wpa_ie_length,
       
   617         u8_t * sent_wpa_ie, const u32_t sent_wpa_ie_length,
       
   618         const wlan_eapol_if_rsna_cipher_e pairwise_key_cipher_suite,
       
   619         const wlan_eapol_if_rsna_cipher_e group_key_cipher_suite );
       
   620     
       
   621     core_error_e disassociation(
       
   622         const network_id_c * network_id );
       
   623 
       
   624     core_error_e start_preauthentication(
       
   625         const network_id_c * network_id );
       
   626 
       
   627     core_error_e start_reassociation(
       
   628         const network_id_c * old_network_id,
       
   629         const network_id_c * new_network_id,
       
   630         const wlan_eapol_if_eapol_key_authentication_type_e selected_eapol_key_authentication_type );
       
   631         
       
   632     core_error_e complete_reassociation(
       
   633         const wlan_eapol_if_eapol_wlan_authentication_state_e association_result,
       
   634         const network_id_c * network_id,
       
   635         u8_t * received_wpa_ie, const u32_t received_wpa_ie_length,
       
   636         u8_t * sent_wpa_ie, const u32_t sent_wpa_ie_length,
       
   637         const wlan_eapol_if_rsna_cipher_e pairwise_key_cipher_suite,
       
   638         const wlan_eapol_if_rsna_cipher_e group_key_cipher_suite );
       
   639     
       
   640     core_error_e start_wpx_fast_roam_reassociation(
       
   641         const network_id_c * old_network_id,
       
   642         const network_id_c * new_network_id,
       
   643         u8_t * reassociation_request_ie,
       
   644         const u32_t reassociation_request_ie_length,
       
   645         const u8_t* received_wpa_ie,
       
   646         u32_t received_wpa_ie_length,
       
   647         const u8_t* sent_wpa_ie,
       
   648         u32_t sent_wpa_ie_length );
       
   649 
       
   650     core_error_e complete_wpx_fast_roam_reassociation(
       
   651         const wlan_eapol_if_eapol_wlan_authentication_state_e reassociation_result,
       
   652         const network_id_c * network_id,
       
   653         u8_t * received_reassociation_ie, const u32_t received_reassociation_ie_length );
       
   654 
       
   655     core_error_e packet_process(
       
   656         const network_id_c * network_id,
       
   657         const u8_t * packet_data, const u32_t packet_data_length );
       
   658 
       
   659     core_error_e tkip_mic_failure(
       
   660         const network_id_c * network_id,
       
   661         const bool_t is_fatal_failure, 
       
   662         const wlan_eapol_if_eapol_tkip_mic_failure_type_e tkip_mic_failure_type );
       
   663 
       
   664     core_error_e eap_acknowledge(
       
   665         const network_id_c * network_id );
       
   666 
       
   667     core_error_e update_header_offset(
       
   668         const u32_t header_offset,
       
   669         const u32_t MTU,
       
   670         const u32_t trailer_length );
       
   671 
       
   672 
       
   673     
       
   674     core_error_e generate_complete_check_pmksa_cache(
       
   675         core_type_list_c<network_id_c> & network_id_list );
       
   676     
       
   677     core_error_e parse_complete_check_pmksa_cache(
       
   678         core_type_list_c<network_id_c> & network_id_list );
       
   679     
       
   680     core_error_e generate_packet_send(
       
   681         network_id_c * send_network_id,
       
   682         u8_t * packet_data, const u32_t packet_data_length );
       
   683 
       
   684     core_error_e parse_packet_send(
       
   685         network_id_c * send_network_id,
       
   686         u8_t ** packet_data, u32_t * packet_data_length );
       
   687 
       
   688     core_error_e generate_associate(
       
   689         const wlan_eapol_if_eapol_key_authentication_mode_e authentication_mode );
       
   690 
       
   691     core_error_e parse_associate(
       
   692         wlan_eapol_if_eapol_key_authentication_mode_e * authentication_mode );
       
   693     
       
   694     core_error_e generate_disassociate(
       
   695         network_id_c * receive_network_id,
       
   696         const bool_t self_disassociation );
       
   697 
       
   698     core_error_e parse_disassociate(
       
   699         network_id_c * receive_network_id,
       
   700         bool_t * self_disassociation );
       
   701 
       
   702     core_error_e generate_packet_data_session_key(
       
   703         network_id_c * send_network_id,
       
   704         session_key_c * session_key );
       
   705 
       
   706     core_error_e parse_packet_data_session_key(
       
   707         network_id_c * send_network_id,
       
   708         session_key_c * session_key );
       
   709 
       
   710     core_error_e generate_state_notification(
       
   711         state_notification_c * state_notification );
       
   712 
       
   713     core_error_e parse_state_notification(
       
   714         state_notification_c * state_notification );
       
   715 
       
   716     core_error_e generate_reassociate(
       
   717         network_id_c * send_network_id,
       
   718         wlan_eapol_if_eapol_key_authentication_type_e authentication_type,
       
   719         u8_t * pmkid,
       
   720         u32_t pmkid_length );
       
   721 
       
   722     core_error_e parse_reassociate(
       
   723         network_id_c * send_network_id,
       
   724         wlan_eapol_if_eapol_key_authentication_type_e * authentication_type,
       
   725         u8_t ** pmkid,
       
   726         u32_t * pmkid_length );
       
   727 
       
   728     core_error_e update_wlan_database_reference_values(
       
   729         u8_t * database_reference_value, const u32_t database_reference_value_length );
       
   730 
       
   731     core_error_e generate_complete_start_wpx_fast_roam_reassociation(
       
   732         network_id_c * receive_network_id,
       
   733         u8_t * reassociation_request_ie,
       
   734         u32_t reassociation_request_ie_length );
       
   735 
       
   736     core_error_e parse_complete_start_wpx_fast_roam_reassociation(
       
   737         network_id_c * receive_network_id,
       
   738         u8_t ** reassociation_request_ie,
       
   739         u32_t * reassociation_request_ie_length );
       
   740 
       
   741     core_error_e generate_error(
       
   742         wlan_eapol_if_error_e errorcode,
       
   743         wlan_eapol_if_message_type_function_e function );
       
   744 
       
   745     core_error_e parse_error(
       
   746         wlan_eapol_if_error_e * errorcode,
       
   747         wlan_eapol_if_message_type_function_e * function );
       
   748 
       
   749     core_error_e generate_new_protected_setup_credentials(
       
   750         core_type_list_c< protected_setup_credential_c > & credential_list );
       
   751 
       
   752     core_error_e parse_new_protected_setup_credentials(
       
   753         core_type_list_c< protected_setup_credential_c > & credential_list );
       
   754 
       
   755 
       
   756     void debug_print();
       
   757     
       
   758     void debug_print_type_string(
       
   759         wlan_eapol_if_message_type_e type, 
       
   760         u32_t length );
       
   761 
       
   762     void debug_print_function_string(
       
   763         wlan_eapol_if_message_type_function_e function );
       
   764 
       
   765 private: // Data
       
   766 
       
   767     u8_t * data_m;           // This is pointer to current buffer
       
   768     u32_t data_length_m;
       
   769     u32_t buffer_length_m;
       
   770     bool_t delete_buffer_m;
       
   771 
       
   772     u32_t iter_m;
       
   773     core_wlan_eapol_if_parameter_c current_parameter_m;
       
   774     
       
   775     };
       
   776 
       
   777 
       
   778 #endif // CORE_WLAN_EAPOL_IF_MESSAGE_H