2018-08-23 08:19:25 +00:00
|
|
|
//
|
|
|
|
// Errors.h
|
2018-08-23 10:07:55 +00:00
|
|
|
// TunnelKit
|
2018-08-23 08:19:25 +00:00
|
|
|
//
|
|
|
|
// Created by Davide De Rosa on 10/10/17.
|
|
|
|
// Copyright © 2018 London Trust Media. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
2018-08-23 10:07:55 +00:00
|
|
|
extern NSString *const TunnelKitErrorDomain;
|
2018-08-23 08:19:25 +00:00
|
|
|
|
2018-08-23 10:07:55 +00:00
|
|
|
typedef NS_ENUM(NSInteger, TunnelKitErrorCode) {
|
|
|
|
TunnelKitErrorCodeCryptoBoxRandomGenerator = 101,
|
|
|
|
TunnelKitErrorCodeCryptoBoxHMAC,
|
|
|
|
TunnelKitErrorCodeCryptoBoxEncryption,
|
|
|
|
TunnelKitErrorCodeCryptoBoxAlgorithm,
|
|
|
|
TunnelKitErrorCodeTLSBoxCA = 201,
|
|
|
|
TunnelKitErrorCodeTLSBoxHandshake,
|
|
|
|
TunnelKitErrorCodeTLSBoxGeneric,
|
|
|
|
TunnelKitErrorCodeDataPathOverflow = 301,
|
|
|
|
TunnelKitErrorCodeDataPathPeerIdMismatch
|
2018-08-23 08:19:25 +00:00
|
|
|
};
|
|
|
|
|
2018-08-23 10:07:55 +00:00
|
|
|
static inline NSError *TunnelKitErrorWithCode(TunnelKitErrorCode code) {
|
|
|
|
return [NSError errorWithDomain:TunnelKitErrorDomain code:code userInfo:nil];
|
2018-08-23 08:19:25 +00:00
|
|
|
}
|