3 * Copyright (C) 2012 Sawtooth Consulting Ltd.
5 * This file is part of CyaSSL.
7 * CyaSSL is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * CyaSSL is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
23 #ifndef CYASSL_CALLBACKS_H
24 #define CYASSL_CALLBACKS_H
33 enum { /* CALLBACK CONTSTANTS */
34 MAX_PACKETNAME_SZ = 24,
35 MAX_CIPHERNAME_SZ = 24,
36 MAX_TIMEOUT_NAME_SZ = 24,
37 MAX_PACKETS_HANDSHAKE = 14, /* 12 for client auth plus 2 alerts */
38 MAX_VALUE_SZ = 128, /* all handshake packets but Cert should
43 typedef struct handShakeInfo_st {
44 char cipherName[MAX_CIPHERNAME_SZ + 1]; /* negotiated cipher */
45 char packetNames[MAX_PACKETS_HANDSHAKE][MAX_PACKETNAME_SZ + 1];
46 /* SSL packet names */
47 int numberPackets; /* actual # of packets */
48 int negotiationError; /* cipher/parameter err */
52 typedef struct timeval Timeval;
55 typedef struct packetInfo_st {
56 char packetName[MAX_PACKETNAME_SZ + 1]; /* SSL packet name */
57 Timeval timestamp; /* when it occured */
58 unsigned char value[MAX_VALUE_SZ]; /* if fits, it's here */
59 unsigned char* bufferValue; /* otherwise here (non 0) */
60 int valueSz; /* sz of value or buffer */
64 typedef struct timeoutInfo_st {
65 char timeoutName[MAX_TIMEOUT_NAME_SZ + 1]; /* timeout Name */
66 int flags; /* for future use */
67 int numberPackets; /* actual # of packets */
68 PacketInfo packets[MAX_PACKETS_HANDSHAKE]; /* list of all packets */
69 Timeval timeoutValue; /* timer that caused it */
79 #endif /* CyaSSL_CALLBACKS_H */