mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-05-13 00:04:14 +08:00
Define OpenVPNPacket class
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// OpenVPNPacket.h
|
||||
// OpenVPN Adapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 15.01.2018.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface OpenVPNPacket : NSObject
|
||||
|
||||
@property (readonly, nonatomic) NSData *data;
|
||||
@property (readonly, nonatomic) NSNumber *protocolFamily;
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
- (instancetype)initWithData:(NSData *)data protocolFamily:(NSNumber *)protocolFamily NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// OpenVPNPacket.m
|
||||
// OpenVPN Adapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 15.01.2018.
|
||||
//
|
||||
|
||||
#import "OpenVPNPacket.h"
|
||||
|
||||
@implementation OpenVPNPacket
|
||||
|
||||
- (instancetype)initWithData:(NSData *)data protocolFamily:(NSNumber *)protocolFamily {
|
||||
if ((self = [super init])) {
|
||||
_data = data;
|
||||
_protocolFamily = protocolFamily;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user