-
Notifications
You must be signed in to change notification settings - Fork 9
/
firewall.go
39 lines (34 loc) · 1.5 KB
/
firewall.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
package upcloud
// Constants
const (
FirewallRuleActionAccept = "accept"
FirewallRuleActionReject = "reject"
FirewallRuleActionDrop = "drop"
FirewallRuleDirectionIn = "in"
FirewallRuleDirectionOut = "out"
FirewallRuleProtocolTCP = "tcp"
FirewallRuleProtocolUDP = "udp"
FirewallRuleProtocolICMP = "icmp"
)
// FirewallRules represents a list of firewall rules
type FirewallRules struct {
FirewallRules []FirewallRule `xml:"firewall_rule"`
}
// FirewallRule represents a single firewall rule. Note that most integer values are represented as strings
type FirewallRule struct {
Action string `xml:"action"`
Comment string `xml:"comment,omitempty"`
DestinationAddressStart string `xml:"destination_address_start,omitempty"`
DestinationAddressEnd string `xml:"destination_address_end,omitempty"`
DestinationPortStart string `xml:"destination_port_start,omitempty"`
DestinationPortEnd string `xml:"destination_port_end,omitempty"`
Direction string `xml:"direction"`
Family string `xml:"family"`
ICMPType string `xml:"icmp_type,omitempty"`
Position int `xml:"position"`
Protocol string `xml:"protocol,omitempty"`
SourceAddressStart string `xml:"source_address_start,omitempty"`
SourceAddressEnd string `xml:"source_address_end,omitempty"`
SourcePortStart string `xml:"source_port_start,omitempty"`
SourcePortEnd string `xml:"source_port_end,omitempty"`
}