void auth_authenticating(auth_t* auth_1x) { #ifdef DEBUG_STATS g_debug_stats.auth_stats.aing++; #endif /* DEBUG_STATS */ auth_1x->auth_pae.eapolStart = BFALSE; auth_1x->global.authSuccess = BFALSE; auth_1x->global.authFail = BFALSE; auth_1x->global.authTimeout = BFALSE; /* Indicate to authentication backend state machine about the start of */ /* authentication process. NOTE: Authentication backend state machine is */ /* run after Authentication sate machine. */ auth_1x->global.authStart = BTRUE; auth_1x->global.keyRun = BFALSE; auth_1x->global.keyDone = BFALSE; /* Reset the RespID Flag */ auth_1x->auth_pae.rxRespId = BFALSE; if(get_eap_type(auth_1x->eapolEap) == EAP_TYPE_IDENTITY) { update_identity(auth_1x, get_eap_identity(auth_1x->eapolEap), get_eap_identity_len(auth_1x->eapolEap)); } /* Set authentication state */ auth_1x->auth_pae.state = AS_AUTHENTICATING; }
/* * === FUNCTION ====================================================================== * Name: get_packet * Description: pcap的回呼函数,当收到EAPOL报文时自动被调用 * ===================================================================================== */ void get_packet(uint8_t *args, const struct pcap_pkthdr *header, const uint8_t *packet) { /* declare pointers to packet headers */ const struct ether_header *ethernet; /* The ethernet header [1] */ const struct eap_header *eap_header; ethernet = (struct ether_header*)(packet); eap_header = (struct eap_header *)(packet + SIZE_ETHERNET); enum EAPType p_type = get_eap_type(eap_header); action_by_eap_type(p_type, eap_header, header, packet); return; }
i32_t eap_loaded_type_c::compare(const eap_loaded_type_c * const right) { if (get_index_type() != right->get_index_type()) { return static_cast<i32_t>(get_index_type()) - static_cast<i32_t>(right->get_index_type()); } else if (get_index() != right->get_index()) { return static_cast<i32_t>(get_index()) - static_cast<i32_t>(right->get_index()); } else { // Compares the EAP-type. return get_eap_type().compare(&(right->get_eap_type())); } }