libtins
4.5
Toggle main menu visibility
Loading...
Searching...
No Matches
include
tins
exceptions.h
1
/*
2
* Copyright (c) 2017, Matias Fontanini
3
* All rights reserved.
4
*
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions are
7
* met:
8
*
9
* * Redistributions of source code must retain the above copyright
10
* notice, this list of conditions and the following disclaimer.
11
* * Redistributions in binary form must reproduce the above
12
* copyright notice, this list of conditions and the following disclaimer
13
* in the documentation and/or other materials provided with the
14
* distribution.
15
*
16
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
*
28
*/
29
30
#ifndef TINS_EXCEPTIONS_H
31
#define TINS_EXCEPTIONS_H
32
33
#include <string>
34
#include <stdexcept>
35
36
namespace
Tins
{
37
41
class
exception_base :
public
std::runtime_error {
42
public
:
43
exception_base()
44
: std::runtime_error(std::string()) { }
45
46
exception_base(
const
std::string& message)
47
: std::runtime_error(message) { }
48
49
exception_base(
const
char
* message)
50
: std::runtime_error(message) { }
51
};
52
56
class
option_not_found :
public
exception_base {
57
public
:
58
option_not_found() : exception_base(
"Option not found"
) { }
59
};
60
64
class
malformed_packet :
public
exception_base {
65
public
:
66
malformed_packet() : exception_base(
"Malformed packet"
) { }
67
malformed_packet(
const
std::string& message) : exception_base(message) { }
68
};
69
73
class
dns_decompression_pointer_out_of_bounds :
public
malformed_packet {
74
public
:
75
dns_decompression_pointer_out_of_bounds() : malformed_packet(
"DNS decompression: pointer out of bounds"
) { }
76
};
77
81
class
dns_decompression_pointer_loops :
public
malformed_packet {
82
public
:
83
dns_decompression_pointer_loops() : malformed_packet(
"DNS decompression: pointer loops"
) { }
84
};
85
86
90
class
serialization_error :
public
exception_base {
91
public
:
92
serialization_error() : exception_base(
"Serialization error"
) { }
93
};
94
98
class
pdu_not_found :
public
exception_base {
99
public
:
100
pdu_not_found() : exception_base(
"PDU not found"
) { }
101
};
102
107
class
invalid_interface :
public
exception_base {
108
public
:
109
invalid_interface() : exception_base(
"Invalid interface"
) { }
110
};
111
116
class
invalid_address :
public
exception_base {
117
public
:
118
invalid_address() : exception_base(
"Invalid address"
) { }
119
};
120
124
class
invalid_option_value :
public
exception_base {
125
public
:
126
invalid_option_value() : exception_base(
"Invalid option value"
) { }
127
};
128
132
class
field_not_present :
public
exception_base {
133
public
:
134
field_not_present() : exception_base(
"Field not present"
) { }
135
};
136
140
class
socket_open_error :
public
exception_base {
141
public
:
142
socket_open_error(
const
std::string& msg)
143
: exception_base(msg) { }
144
};
145
149
class
socket_close_error :
public
exception_base {
150
public
:
151
socket_close_error(
const
std::string& msg)
152
: exception_base(msg) { }
153
};
154
158
class
socket_write_error :
public
exception_base {
159
public
:
160
socket_write_error(
const
std::string& msg)
161
: exception_base(msg) { }
162
};
163
168
class
invalid_socket_type :
public
exception_base {
169
public
:
170
invalid_socket_type() : exception_base(
"The provided socket type is invalid"
) { }
171
};
172
177
class
unknown_link_type :
public
exception_base {
178
public
:
179
unknown_link_type() : exception_base(
"The sniffed link layer PDU type is unknown"
) { }
180
};
181
185
class
malformed_option :
public
exception_base {
186
public
:
187
malformed_option() : exception_base(
"Malformed option"
) { }
188
};
189
193
class
bad_tins_cast :
public
exception_base {
194
public
:
195
bad_tins_cast() : exception_base(
"Bad Tins cast"
) { }
196
};
197
202
class
protocol_disabled :
public
exception_base {
203
public
:
204
protocol_disabled() : exception_base(
"Protocol disabled"
) { }
205
};
206
211
class
feature_disabled :
public
exception_base {
212
public
:
213
feature_disabled() : exception_base(
"Feature disabled"
) { }
214
};
215
220
class
option_payload_too_large :
public
exception_base {
221
public
:
222
option_payload_too_large() : exception_base(
"Option payload too large"
) { }
223
};
224
229
class
invalid_ipv6_extension_header :
public
exception_base {
230
public
:
231
invalid_ipv6_extension_header() : exception_base(
"Invalid IPv6 extension header"
) { }
232
};
233
237
class
pcap_error :
public
exception_base {
238
public
:
239
pcap_error(
const
char
* message) : exception_base(message) {
240
241
}
242
243
pcap_error(
const
std::string& message) : exception_base(message) {
244
245
}
246
};
247
251
class
invalid_pcap_filter :
public
exception_base {
252
public
:
253
invalid_pcap_filter(
const
char
* message) : exception_base(message) {
254
255
}
256
};
257
262
class
pdu_not_serializable :
public
exception_base {
263
public
:
264
pdu_not_serializable() : exception_base(
"PDU not serializable"
) { }
265
};
266
270
class
pcap_open_failed :
public
exception_base {
271
public
:
272
pcap_open_failed() : exception_base(
"Failed to create pcap handle"
) { }
273
};
274
279
class
unsupported_function :
public
exception_base {
280
public
:
281
unsupported_function() : exception_base(
"Function is not supported on this OS"
) { }
282
};
283
287
class
invalid_domain_name :
public
exception_base {
288
public
:
289
invalid_domain_name() : exception_base(
"Invalid domain name"
) { }
290
};
291
295
class
stream_not_found :
public
exception_base {
296
public
:
297
stream_not_found() : exception_base(
"Stream not found"
) { }
298
};
299
303
class
callback_not_set :
public
exception_base {
304
public
:
305
callback_not_set() : exception_base(
"Callback not set"
) { }
306
};
307
311
class
invalid_packet :
public
exception_base {
312
public
:
313
invalid_packet() : exception_base(
"Invalid packet"
) { }
314
};
315
316
namespace
Crypto {
317
namespace
WPA2 {
321
class
invalid_handshake :
public
exception_base {
322
public
:
323
invalid_handshake() : exception_base(
"Invalid WPA2 handshake"
) { }
324
};
325
}
// WPA2
326
}
// Crypto
327
328
}
// Tins
329
330
#endif
// TINS_EXCEPTIONS_H
Tins
The Tins namespace.
Definition
address_range.h:38
Generated on
for libtins by
1.17.0