-
Notifications
You must be signed in to change notification settings - Fork 46
/
configuration.go
76 lines (57 loc) · 1.9 KB
/
configuration.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package types
import (
"net"
"regexp"
)
type Configuration struct {
// Print packets on stderr
Debug bool
// Record all packets coming in and out in a file that can be read by Wireshark (pcap)
CaptureFile string
// Length of packet
// Larger packets means less packets to exchange for the same amount of data (and less protocol overhead)
MTU int
// Network reserved for the virtual network
Subnet string
// IP address of the virtual gateway
GatewayIP string
// MAC address of the virtual gateway
GatewayMacAddress string
// Built-in DNS records that will be served by the DNS server embedded in the gateway
DNS []Zone
// List of search domains that will be added in all DHCP replies
DNSSearchDomains []string
// Port forwarding between the machine running the gateway and the virtual network.
Forwards map[string]string
// Address translation of incoming traffic.
// Useful for reaching the host itself (localhost) from the virtual network.
NAT map[string]string
// IPs assigned to the gateway that can answer to ARP requests
GatewayVirtualIPs []string
// DHCP static leases. Allow to assign pre-defined IP to virtual machine based on the MAC address
DHCPStaticLeases map[string]string
// Only for Hyperkit
// Allow to assign a pre-defined MAC address to an Hyperkit VM
VpnKitUUIDMacAddresses map[string]string
// Qemu or Hyperkit protocol
// Qemu protocol is 32bits big endian size of the packet, then the packet.
// Hyperkit protocol is handshake, then 16bits little endian size of packet, then the packet.
// Bess protocol transfers bare L2 packets as SOCK_SEQPACKET.
Protocol Protocol
}
type Protocol string
const (
HyperKitProtocol Protocol = "hyperkit"
QemuProtocol Protocol = "qemu"
BessProtocol Protocol = "bess"
)
type Zone struct {
Name string
Records []Record
DefaultIP net.IP
}
type Record struct {
Name string
IP net.IP
Regexp *regexp.Regexp
}