1/*
2 * Copyright (c) 2001-2012 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 * session_key, int session_key_length,
73		     const uint8_t * server_key, int server_key_length);
74
75void
76EAPOLSocketClearPMKCache(EAPOLSocketRef sock);
77
78CFStringRef
79EAPOLSocketGetSSID(EAPOLSocketRef sock);
80
81void
82EAPOLSocketDisableReceive(EAPOLSocketRef eapol_socket);
83
84void
85EAPOLSocketEnableReceive(EAPOLSocketRef eapol_socket,
86			 EAPOLSocketReceiveCallback * func,
87			 void * arg1, void * arg2);
88
89int
90EAPOLSocketTransmit(EAPOLSocketRef sock,
91		    EAPOLPacketType packet_type,
92		    void * body, unsigned int body_length);
93
94const char *
95EAPOLSocketIfName(EAPOLSocketRef sock, uint32_t * length);
96
97const char *
98EAPOLSocketName(EAPOLSocketRef sock);
99
100void
101EAPOLSocketReportStatus(EAPOLSocketRef sock, CFDictionaryRef status_dict);
102
103EAPOLControlMode
104EAPOLSocketGetMode(EAPOLSocketRef sock);
105
106void
107EAPOLSocketStopClient(EAPOLSocketRef sock);
108
109boolean_t
110EAPOLSocketReassociate(EAPOLSocketRef sock);
111
112int
113get_plist_int(CFDictionaryRef plist, CFStringRef key, int def);
114
115#endif /* _S_EAPOLSOCKET_H */
116
117