1/*
2 * Copyright (c) 2001-2013 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 * November 8, 2001	Dieter Siegmund
28 * - created
29 */
30
31#ifndef _S_MYLOG_H
32#define _S_MYLOG_H
33
34#include <stdio.h>
35#include <sys/types.h>
36#include <stdbool.h>
37#include "EAPLog.h"
38
39/**
40 ** eapolclient logging
41 **/
42enum {
43    kLogFlagBasic 		= 0x00000001,
44    kLogFlagConfig		= 0x00000002,
45    kLogFlagStatus		= 0x00000004,
46    kLogFlagTunables		= 0x00000008,
47    kLogFlagPacketDetails 	= 0x00000010,
48    kLogFlagDisableInnerDetails	= 0x00001000, /* e.g. LogFlags 0xffffefff */
49
50};
51
52uint32_t
53eapolclient_log_flags(void);
54
55void
56eapolclient_log_set_flags(uint32_t log_flags, bool log_it);
57
58bool
59eapolclient_should_log(uint32_t flags);
60
61#define eapolclient_log(__flags, __format, ...)			\
62    if (eapolclient_should_log(__flags))			\
63	EAPLog(LOG_DEBUG, CFSTR(__format), ## __VA_ARGS__)
64
65#endif /* _S_MYLOG_H */
66
67