aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/Shared/Model/InterfaceConfiguration.swift
blob: ef33907aab286512f1aaf5178f5348f5a6b86004 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// SPDX-License-Identifier: MIT
// Copyright © 2018 WireGuard LLC. All Rights Reserved.

import Foundation

struct InterfaceConfiguration {
    var privateKey: Data
    var addresses = [IPAddressRange]()
    var listenPort: UInt16?
    var mtu: UInt16?
    var dns = [DNSServer]()

    init(privateKey: Data) {
        if privateKey.count != TunnelConfiguration.keyLength {
            fatalError("Invalid private key")
        }
        self.privateKey = privateKey
    }
}