]> git.saurik.com Git - apple/security.git/blob - SecureTransport/privateInc/sslDebug.h
Security-54.1.3.tar.gz
[apple/security.git] / SecureTransport / privateInc / sslDebug.h
1 /*
2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
3 *
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
8 * using this file.
9 *
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
16 */
17
18
19 /*
20 File: sslDebug.h
21
22 Contains: Debugging macros.
23
24 Written by: Doug Mitchell
25
26 Copyright: (c) 1998, 1999 by Apple Computer, Inc., all rights reserved.
27 */
28
29 #ifndef _SSL_DEBUG_H_
30 #define _SSL_DEBUG_H_
31
32 #include "sslContext.h"
33 #include <Security/debugging.h>
34 #include <assert.h>
35
36 /* log changes in handshake state */
37 #define sslHdskStateDebug(args...) debug("sslHdskState", ## args)
38
39 /* log handshake and alert messages */
40 #define sslHdskMsgDebug(args...) debug("sslHdskMsg", ## args)
41
42 /* log negotiated handshake parameters */
43 #define sslLogNegotiateDebug(args...) debug("sslLogNegotiate", ## args)
44
45 /* log received protocol messsages */
46 #define sslLogRxProtocolDebug(msgType) debug("sslLogRxProtocol", \
47 "---received protoMsg %s", msgType)
48
49 /* log resumable session info */
50 #define sslLogResumSessDebug(args...) debug("sslResumSession", ## args)
51
52 /* log low-level session info in appleSession.cpp */
53 #define sslLogSessCacheDebug(args...) debug("sslSessionCache", ## args)
54
55 /* log record-level I/O (SSLRead, SSLWrite) */
56 #define sslLogRecordIo(args...) debug("sslRecordIo", ## args)
57
58 #ifdef NDEBUG
59
60 #define SSLChangeHdskState(ctx, newState) { ctx->state=newState; }
61 #define SSLLogHdskMsg(msg, sent)
62
63 /* all errors logged to stdout for DEBUG config only */
64 #define sslErrorLog(args...)
65
66 #else
67
68 #include "sslAlertMessage.h"
69
70 extern void SSLLogHdskMsg(SSLHandshakeType msg, char sent);
71 extern char *hdskStateToStr(SSLHandshakeState state);
72 extern void SSLChangeHdskState(SSLContext *ctx, SSLHandshakeState newState);
73
74 /* all errors logged to stdout for DEBUG config only */
75 #define sslErrorLog(args...) printf(args)
76
77 #endif /* NDEBUG */
78
79 #endif /* _SSL_DEBUG_H_ */