]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Source/WolfSSL/cyassl/callbacks.h
Rename the CyaSSL directory to WolfSSL
[freertos] / FreeRTOS-Plus / Source / WolfSSL / cyassl / callbacks.h
1 /* callbacks.h
2  *
3  * Copyright (C) 2013 wolfSSL Inc.
4  *
5  * This file is part of CyaSSL.
6  *
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.
11  *
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.
16  *
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21
22
23 #ifndef CYASSL_CALLBACKS_H
24 #define CYASSL_CALLBACKS_H
25
26 #include <sys/time.h>
27
28 #ifdef __cplusplus
29     extern "C" {
30 #endif
31
32
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
39                                           fit here  */
40 };
41
42
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 */
49 } HandShakeInfo;
50
51
52 typedef struct timeval Timeval;
53
54
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 */
61 } PacketInfo;
62
63
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 */
70 } TimeoutInfo;
71
72
73
74 #ifdef __cplusplus
75     }  /* extern "C" */
76 #endif
77
78
79 #endif /* CYASSL_CALLBACKS_H */
80