~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to extra/yassl/include/yassl_error.hpp

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
   Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
 
3
 
 
4
   This program is free software; you can redistribute it and/or modify
 
5
   it under the terms of the GNU General Public License as published by
 
6
   the Free Software Foundation; version 2 of the License.
 
7
 
 
8
   This program is distributed in the hope that it will be useful,
 
9
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
   GNU General Public License for more details.
 
12
 
 
13
   You should have received a copy of the GNU General Public License
 
14
   along with this program; see the file COPYING. If not, write to the
 
15
   Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
 
16
   MA  02110-1301  USA.
 
17
*/
 
18
 
 
19
 
 
20
/* yaSSL error header defines error codes and an exception class
 
21
 */
 
22
 
 
23
#ifndef yaSSL_ERROR_HPP
 
24
#define yaSSL_ERROR_HPP
 
25
 
 
26
 
 
27
 
 
28
namespace yaSSL {
 
29
 
 
30
 
 
31
enum YasslError {
 
32
    no_error            = 0,
 
33
 
 
34
    // 10 - 47 from AlertDescription, 0 also close_notify
 
35
 
 
36
    range_error         = 101,
 
37
    realloc_error       = 102,
 
38
    factory_error       = 103,
 
39
    unknown_cipher      = 104,
 
40
    prefix_error        = 105,
 
41
    record_layer        = 106,
 
42
    handshake_layer     = 107,
 
43
    out_of_order        = 108,
 
44
    bad_input           = 109,
 
45
    match_error         = 110,
 
46
    no_key_file         = 111,
 
47
    verify_error        = 112,
 
48
    send_error          = 113,
 
49
    receive_error       = 114,
 
50
    certificate_error   = 115,
 
51
    privateKey_error    = 116,
 
52
    badVersion_error    = 117,
 
53
    compress_error      = 118,
 
54
    decompress_error    = 119,
 
55
    pms_version_error   = 120,
 
56
    sanityCipher_error  = 121
 
57
 
 
58
    // !!!! add error message to .cpp !!!!
 
59
 
 
60
    // 1000+ from TaoCrypt error.hpp
 
61
 
 
62
};
 
63
 
 
64
 
 
65
enum Library { yaSSL_Lib = 0, CryptoLib, SocketLib };
 
66
enum { MAX_ERROR_SZ = 80 };
 
67
 
 
68
void SetErrorString(YasslError, char*);
 
69
 
 
70
/* remove for now, if go back to exceptions use this wrapper
 
71
// Base class for all yaSSL exceptions
 
72
class Error : public mySTL::runtime_error {
 
73
    YasslError  error_;
 
74
    Library     lib_;
 
75
public:
 
76
    explicit Error(const char* s = "", YasslError e = no_error,
 
77
                   Library l = yaSSL_Lib);
 
78
 
 
79
    YasslError  get_number() const;
 
80
    Library     get_lib()    const;
 
81
};
 
82
*/
 
83
 
 
84
 
 
85
} // naemspace
 
86
 
 
87
#endif // yaSSL_ERROR_HPP