1/* 2 * Copyright (c) 2001-2014 Apple Inc. All rights reserved. 3 * 4 * @APPLE_LICENSE_HEADER_START@ 5 * 6 * This file contains Original Code and/or Modifications of Original Code 7 * as defined in and that are subject to the Apple Public Source License 8 * Version 2.0 (the 'License'). You may not use this file except in 9 * compliance with the License. Please obtain a copy of the License at 10 * http://www.opensource.apple.com/apsl/ and read it before using this 11 * file. 12 * 13 * The Original Code and all software distributed under the License are 14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 * Please see the License for the specific language governing rights and 19 * limitations under the License. 20 * 21 * @APPLE_LICENSE_HEADER_END@ 22 */ 23 24/* 25 * Modification History 26 * 27 * October 26, 2001 Dieter Siegmund (dieter@apple.com) 28 * - created 29 */ 30 31#ifndef _S_EAPOLSOCKET_H 32#define _S_EAPOLSOCKET_H 33 34 35#include "EAPOL.h" 36#include "EAPOLControlTypes.h" 37#include "wireless.h" 38#include "ClientControlInterface.h" 39 40typedef struct EAPOLSocket_s EAPOLSocket, * EAPOLSocketRef; 41 42typedef struct { 43 EAPOLPacket * eapol_p; 44 unsigned int length; 45} EAPOLSocketReceiveData, *EAPOLSocketReceiveDataRef; 46 47typedef void (EAPOLSocketReceiveCallback)(void * arg1, void * arg2, 48 EAPOLSocketReceiveDataRef data); 49typedef EAPOLSocketReceiveCallback * EAPOLSocketReceiveCallbackRef; 50 51void 52EAPOLSocketSetDebug(boolean_t debug); 53 54bool 55EAPOLSocketIsLinkActive(EAPOLSocketRef sock); 56 57int 58EAPOLSocketMTU(EAPOLSocketRef sock); 59 60const struct ether_addr * 61EAPOLSocketGetAuthenticatorMACAddress(EAPOLSocketRef sock); 62 63boolean_t 64EAPOLSocketIsWireless(EAPOLSocketRef sock); 65 66boolean_t 67EAPOLSocketSetKey(EAPOLSocketRef sock, wirelessKeyType type, 68 int index, const uint8_t * key, int key_length); 69 70boolean_t 71EAPOLSocketSetWPAKey(EAPOLSocketRef sock, 72 const uint8_t * msk, int msk_length); 73 74void 75EAPOLSocketClearPMKCache(EAPOLSocketRef sock); 76 77boolean_t 78EAPOLSocketHasPMK(EAPOLSocketRef sock); 79 80CFStringRef 81EAPOLSocketGetSSID(EAPOLSocketRef sock); 82 83void 84EAPOLSocketDisableReceive(EAPOLSocketRef eapol_socket); 85 86void 87EAPOLSocketEnableReceive(EAPOLSocketRef eapol_socket, 88 EAPOLSocketReceiveCallback * func, 89 void * arg1, void * arg2); 90 91int 92EAPOLSocketTransmit(EAPOLSocketRef sock, 93 EAPOLPacketType packet_type, 94 void * body, unsigned int body_length); 95 96const char * 97EAPOLSocketIfName(EAPOLSocketRef sock, uint32_t * length); 98 99const char * 100EAPOLSocketName(EAPOLSocketRef sock); 101 102void 103EAPOLSocketReportStatus(EAPOLSocketRef sock, CFDictionaryRef status_dict); 104 105EAPOLControlMode 106EAPOLSocketGetMode(EAPOLSocketRef sock); 107 108void 109EAPOLSocketStopClient(EAPOLSocketRef sock); 110 111boolean_t 112EAPOLSocketReassociate(EAPOLSocketRef sock); 113 114int 115get_plist_int(CFDictionaryRef plist, CFStringRef key, int def); 116 117#endif /* _S_EAPOLSOCKET_H */ 118 119