aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuardKit/Sources/WireGuardKit/PeerConfiguration.swift
diff options
context:
space:
mode:
Diffstat (limited to 'WireGuardKit/Sources/WireGuardKit/PeerConfiguration.swift')
-rw-r--r--WireGuardKit/Sources/WireGuardKit/PeerConfiguration.swift24
1 files changed, 12 insertions, 12 deletions
diff --git a/WireGuardKit/Sources/WireGuardKit/PeerConfiguration.swift b/WireGuardKit/Sources/WireGuardKit/PeerConfiguration.swift
index 7fd3f87..4d92dc6 100644
--- a/WireGuardKit/Sources/WireGuardKit/PeerConfiguration.swift
+++ b/WireGuardKit/Sources/WireGuardKit/PeerConfiguration.swift
@@ -3,9 +3,9 @@
import Foundation
-struct PeerConfiguration {
- var publicKey: Data
- var preSharedKey: Data? {
+public struct PeerConfiguration {
+ public var publicKey: Data
+ public var preSharedKey: Data? {
didSet(value) {
if let value = value {
if value.count != TunnelConfiguration.keyLength {
@@ -14,14 +14,14 @@ struct PeerConfiguration {
}
}
}
- var allowedIPs = [IPAddressRange]()
- var endpoint: Endpoint?
- var persistentKeepAlive: UInt16?
- var rxBytes: UInt64?
- var txBytes: UInt64?
- var lastHandshakeTime: Date?
+ public var allowedIPs = [IPAddressRange]()
+ public var endpoint: Endpoint?
+ public var persistentKeepAlive: UInt16?
+ public var rxBytes: UInt64?
+ public var txBytes: UInt64?
+ public var lastHandshakeTime: Date?
- init(publicKey: Data) {
+ public init(publicKey: Data) {
self.publicKey = publicKey
if publicKey.count != TunnelConfiguration.keyLength {
fatalError("Invalid public key")
@@ -30,7 +30,7 @@ struct PeerConfiguration {
}
extension PeerConfiguration: Equatable {
- static func == (lhs: PeerConfiguration, rhs: PeerConfiguration) -> Bool {
+ public static func == (lhs: PeerConfiguration, rhs: PeerConfiguration) -> Bool {
return lhs.publicKey == rhs.publicKey &&
lhs.preSharedKey == rhs.preSharedKey &&
Set(lhs.allowedIPs) == Set(rhs.allowedIPs) &&
@@ -40,7 +40,7 @@ extension PeerConfiguration: Equatable {
}
extension PeerConfiguration: Hashable {
- func hash(into hasher: inout Hasher) {
+ public func hash(into hasher: inout Hasher) {
hasher.combine(publicKey)
hasher.combine(preSharedKey)
hasher.combine(Set(allowedIPs))