1package hcsshim 2 3// Type of Request Support in ModifySystem 4type PolicyType string 5 6// RequestType const 7const ( 8 Nat PolicyType = "NAT" 9 ACL PolicyType = "ACL" 10 PA PolicyType = "PA" 11 VLAN PolicyType = "VLAN" 12 VSID PolicyType = "VSID" 13 VNet PolicyType = "VNET" 14 L2Driver PolicyType = "L2Driver" 15 Isolation PolicyType = "Isolation" 16 QOS PolicyType = "QOS" 17 OutboundNat PolicyType = "OutBoundNAT" 18 ExternalLoadBalancer PolicyType = "ELB" 19 Route PolicyType = "ROUTE" 20) 21 22type NatPolicy struct { 23 Type PolicyType `json:"Type"` 24 Protocol string 25 InternalPort uint16 26 ExternalPort uint16 27} 28 29type QosPolicy struct { 30 Type PolicyType `json:"Type"` 31 MaximumOutgoingBandwidthInBytes uint64 32} 33 34type IsolationPolicy struct { 35 Type PolicyType `json:"Type"` 36 VLAN uint 37 VSID uint 38 InDefaultIsolation bool 39} 40 41type VlanPolicy struct { 42 Type PolicyType `json:"Type"` 43 VLAN uint 44} 45 46type VsidPolicy struct { 47 Type PolicyType `json:"Type"` 48 VSID uint 49} 50 51type PaPolicy struct { 52 Type PolicyType `json:"Type"` 53 PA string `json:"PA"` 54} 55 56type OutboundNatPolicy struct { 57 Policy 58 VIP string `json:"VIP,omitempty"` 59 Exceptions []string `json:"ExceptionList,omitempty"` 60} 61 62type ActionType string 63type DirectionType string 64type RuleType string 65 66const ( 67 Allow ActionType = "Allow" 68 Block ActionType = "Block" 69 70 In DirectionType = "In" 71 Out DirectionType = "Out" 72 73 Host RuleType = "Host" 74 Switch RuleType = "Switch" 75) 76 77type ACLPolicy struct { 78 Type PolicyType `json:"Type"` 79 Protocol uint16 80 InternalPort uint16 81 Action ActionType 82 Direction DirectionType 83 LocalAddresses string 84 RemoteAddresses string 85 LocalPort uint16 86 RemotePort uint16 87 RuleType RuleType `json:"RuleType,omitempty"` 88 Priority uint16 89 ServiceName string 90} 91 92type Policy struct { 93 Type PolicyType `json:"Type"` 94} 95