go.mod: github.com/Microsoft/hcsshim v0.8.16
full diff: https://github.com/microsoft/hcsshim/compare/v0.8.15...v0.8.16 also updating github.com/Microsoft/hcsshim/test to current master Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
32
vendor/github.com/Microsoft/hcsshim/hcn/hcn.go
generated
vendored
32
vendor/github.com/Microsoft/hcsshim/hcn/hcn.go
generated
vendored
@@ -3,7 +3,6 @@
|
||||
package hcn
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"syscall"
|
||||
|
||||
@@ -64,12 +63,6 @@ import (
|
||||
//sys hcnDeleteRoute(id *_guid, result **uint16) (hr error) = computenetwork.HcnDeleteSdnRoute?
|
||||
//sys hcnCloseRoute(route hcnRoute) (hr error) = computenetwork.HcnCloseSdnRoute?
|
||||
|
||||
// Service
|
||||
//sys hcnOpenService(service *hcnService, result **uint16) (hr error) = computenetwork.HcnOpenService?
|
||||
//sys hcnRegisterServiceCallback(service hcnService, callback int32, context int32, callbackHandle *hcnCallbackHandle) (hr error) = computenetwork.HcnRegisterServiceCallback?
|
||||
//sys hcnUnregisterServiceCallback(callbackHandle hcnCallbackHandle) (hr error) = computenetwork.HcnUnregisterServiceCallback?
|
||||
//sys hcnCloseService(service hcnService) (hr error) = computenetwork.HcnCloseService?
|
||||
|
||||
type _guid = guid.GUID
|
||||
|
||||
type hcnNetwork syscall.Handle
|
||||
@@ -77,8 +70,6 @@ type hcnEndpoint syscall.Handle
|
||||
type hcnNamespace syscall.Handle
|
||||
type hcnLoadBalancer syscall.Handle
|
||||
type hcnRoute syscall.Handle
|
||||
type hcnService syscall.Handle
|
||||
type hcnCallbackHandle syscall.Handle
|
||||
|
||||
// SchemaVersion for HCN Objects/Queries.
|
||||
type SchemaVersion = Version // hcnglobals.go
|
||||
@@ -101,6 +92,20 @@ type HostComputeQuery struct {
|
||||
Filter string `json:",omitempty"`
|
||||
}
|
||||
|
||||
type ExtraParams struct {
|
||||
Resources interface{} `json:",omitempty"`
|
||||
SharedContainers interface{} `json:",omitempty"`
|
||||
LayeredOn string `json:",omitempty"`
|
||||
SwitchGuid string `json:",omitempty"`
|
||||
UtilityVM string `json:",omitempty"`
|
||||
VirtualMachine string `json:",omitempty"`
|
||||
}
|
||||
|
||||
type Health struct {
|
||||
Data interface{} `json:",omitempty"`
|
||||
Extra ExtraParams `json:",omitempty"`
|
||||
}
|
||||
|
||||
// defaultQuery generates HCN Query.
|
||||
// Passed into get/enumerate calls to filter results.
|
||||
func defaultQuery() HostComputeQuery {
|
||||
@@ -114,15 +119,6 @@ func defaultQuery() HostComputeQuery {
|
||||
return query
|
||||
}
|
||||
|
||||
func defaultQueryJson() string {
|
||||
query := defaultQuery()
|
||||
queryJson, err := json.Marshal(query)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return string(queryJson)
|
||||
}
|
||||
|
||||
// PlatformDoesNotSupportError happens when users are attempting to use a newer shim on an older OS
|
||||
func platformDoesNotSupportError(featureName string) error {
|
||||
return fmt.Errorf("Platform does not support feature %s", featureName)
|
||||
|
||||
44
vendor/github.com/Microsoft/hcsshim/hcn/hcnloadbalancer.go
generated
vendored
44
vendor/github.com/Microsoft/hcsshim/hcn/hcnloadbalancer.go
generated
vendored
@@ -160,50 +160,6 @@ func createLoadBalancer(settings string) (*HostComputeLoadBalancer, error) {
|
||||
return &outputLoadBalancer, nil
|
||||
}
|
||||
|
||||
func modifyLoadBalancer(loadBalancerId string, settings string) (*HostComputeLoadBalancer, error) {
|
||||
loadBalancerGuid, err := guid.FromString(loadBalancerId)
|
||||
if err != nil {
|
||||
return nil, errInvalidLoadBalancerID
|
||||
}
|
||||
// Open loadBalancer.
|
||||
var (
|
||||
loadBalancerHandle hcnLoadBalancer
|
||||
resultBuffer *uint16
|
||||
propertiesBuffer *uint16
|
||||
)
|
||||
hr := hcnOpenLoadBalancer(&loadBalancerGuid, &loadBalancerHandle, &resultBuffer)
|
||||
if err := checkForErrors("hcnOpenLoadBalancer", hr, resultBuffer); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Modify loadBalancer.
|
||||
hr = hcnModifyLoadBalancer(loadBalancerHandle, settings, &resultBuffer)
|
||||
if err := checkForErrors("hcnModifyLoadBalancer", hr, resultBuffer); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Query loadBalancer.
|
||||
hcnQuery := defaultQuery()
|
||||
query, err := json.Marshal(hcnQuery)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
hr = hcnQueryLoadBalancerProperties(loadBalancerHandle, string(query), &propertiesBuffer, &resultBuffer)
|
||||
if err := checkForErrors("hcnQueryLoadBalancerProperties", hr, resultBuffer); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
properties := interop.ConvertAndFreeCoTaskMemString(propertiesBuffer)
|
||||
// Close loadBalancer.
|
||||
hr = hcnCloseLoadBalancer(loadBalancerHandle)
|
||||
if err := checkForErrors("hcnCloseLoadBalancer", hr, nil); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Convert output to LoadBalancer
|
||||
var outputLoadBalancer HostComputeLoadBalancer
|
||||
if err := json.Unmarshal([]byte(properties), &outputLoadBalancer); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &outputLoadBalancer, nil
|
||||
}
|
||||
|
||||
func deleteLoadBalancer(loadBalancerId string) error {
|
||||
loadBalancerGuid, err := guid.FromString(loadBalancerId)
|
||||
if err != nil {
|
||||
|
||||
2
vendor/github.com/Microsoft/hcsshim/hcn/hcnnamespace.go
generated
vendored
2
vendor/github.com/Microsoft/hcsshim/hcn/hcnnamespace.go
generated
vendored
@@ -378,7 +378,7 @@ func (namespace *HostComputeNamespace) Sync() error {
|
||||
// The shim is likey gone. Simply ignore the sync as if it didn't exist.
|
||||
if perr, ok := err.(*os.PathError); ok && perr.Err == syscall.ERROR_FILE_NOT_FOUND {
|
||||
// Remove the reg key there is no point to try again
|
||||
cfg.Remove()
|
||||
_ = cfg.Remove()
|
||||
return nil
|
||||
}
|
||||
f := map[string]interface{}{
|
||||
|
||||
11
vendor/github.com/Microsoft/hcsshim/hcn/hcnnetwork.go
generated
vendored
11
vendor/github.com/Microsoft/hcsshim/hcn/hcnnetwork.go
generated
vendored
@@ -9,21 +9,21 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// Route is assoicated with a subnet.
|
||||
// Route is associated with a subnet.
|
||||
type Route struct {
|
||||
NextHop string `json:",omitempty"`
|
||||
DestinationPrefix string `json:",omitempty"`
|
||||
Metric uint16 `json:",omitempty"`
|
||||
}
|
||||
|
||||
// Subnet is assoicated with a Ipam.
|
||||
// Subnet is associated with a Ipam.
|
||||
type Subnet struct {
|
||||
IpAddressPrefix string `json:",omitempty"`
|
||||
Policies []json.RawMessage `json:",omitempty"`
|
||||
Routes []Route `json:",omitempty"`
|
||||
}
|
||||
|
||||
// Ipam (Internet Protocol Addres Management) is assoicated with a network
|
||||
// Ipam (Internet Protocol Address Management) is associated with a network
|
||||
// and represents the address space(s) of a network.
|
||||
type Ipam struct {
|
||||
Type string `json:",omitempty"` // Ex: Static, DHCP
|
||||
@@ -36,12 +36,12 @@ type MacRange struct {
|
||||
EndMacAddress string `json:",omitempty"`
|
||||
}
|
||||
|
||||
// MacPool is assoicated with a network and represents pool of MacRanges.
|
||||
// MacPool is associated with a network and represents pool of MacRanges.
|
||||
type MacPool struct {
|
||||
Ranges []MacRange `json:",omitempty"`
|
||||
}
|
||||
|
||||
// Dns (Domain Name System is associated with a network.
|
||||
// Dns (Domain Name System is associated with a network).
|
||||
type Dns struct {
|
||||
Domain string `json:",omitempty"`
|
||||
Search []string `json:",omitempty"`
|
||||
@@ -82,6 +82,7 @@ type HostComputeNetwork struct {
|
||||
Dns Dns `json:",omitempty"`
|
||||
Ipams []Ipam `json:",omitempty"`
|
||||
Flags NetworkFlags `json:",omitempty"` // 0: None
|
||||
Health Health `json:",omitempty"`
|
||||
SchemaVersion SchemaVersion `json:",omitempty"`
|
||||
}
|
||||
|
||||
|
||||
13
vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go
generated
vendored
13
vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go
generated
vendored
@@ -19,6 +19,7 @@ const (
|
||||
L4WFPPROXY EndpointPolicyType = "L4WFPPROXY"
|
||||
PortName EndpointPolicyType = "PortName"
|
||||
EncapOverhead EndpointPolicyType = "EncapOverhead"
|
||||
IOV EndpointPolicyType = "Iov"
|
||||
// Endpoint and Network have InterfaceConstraint and ProviderAddress
|
||||
NetworkProviderAddress EndpointPolicyType = "ProviderAddress"
|
||||
NetworkInterfaceConstraint EndpointPolicyType = "InterfaceConstraint"
|
||||
@@ -47,6 +48,7 @@ const (
|
||||
HostRoute NetworkPolicyType = "HostRoute"
|
||||
SetPolicy NetworkPolicyType = "SetPolicy"
|
||||
NetworkL4Proxy NetworkPolicyType = "L4Proxy"
|
||||
LayerConstraint NetworkPolicyType = "LayerConstraint"
|
||||
)
|
||||
|
||||
// NetworkPolicy is a collection of Policy settings for a Network.
|
||||
@@ -170,6 +172,13 @@ type EncapOverheadEndpointPolicySetting struct {
|
||||
Overhead uint16 `json:",omitempty"`
|
||||
}
|
||||
|
||||
// IovPolicySetting sets the Iov settings for an endpoint.
|
||||
type IovPolicySetting struct {
|
||||
IovOffloadWeight uint32 `json:",omitempty"`
|
||||
QueuePairsRequested uint32 `json:",omitempty"`
|
||||
InterruptModeration uint32 `json:",omitempty"`
|
||||
}
|
||||
|
||||
/// Endpoint and Network Policy objects
|
||||
|
||||
// ProviderAddressEndpointPolicySetting sets the PA for an endpoint.
|
||||
@@ -215,6 +224,10 @@ type AutomaticDNSNetworkPolicySetting struct {
|
||||
Enable bool `json:",omitempty"`
|
||||
}
|
||||
|
||||
type LayerConstraintNetworkPolicySetting struct {
|
||||
LayerId string `json:",omitempty"`
|
||||
}
|
||||
|
||||
/// Subnet Policy objects
|
||||
|
||||
// VlanPolicySetting isolates a subnet with VLAN tagging.
|
||||
|
||||
60
vendor/github.com/Microsoft/hcsshim/hcn/zsyscall_windows.go
generated
vendored
60
vendor/github.com/Microsoft/hcsshim/hcn/zsyscall_windows.go
generated
vendored
@@ -78,10 +78,6 @@ var (
|
||||
procHcnQuerySdnRouteProperties = modcomputenetwork.NewProc("HcnQuerySdnRouteProperties")
|
||||
procHcnDeleteSdnRoute = modcomputenetwork.NewProc("HcnDeleteSdnRoute")
|
||||
procHcnCloseSdnRoute = modcomputenetwork.NewProc("HcnCloseSdnRoute")
|
||||
procHcnOpenService = modcomputenetwork.NewProc("HcnOpenService")
|
||||
procHcnRegisterServiceCallback = modcomputenetwork.NewProc("HcnRegisterServiceCallback")
|
||||
procHcnUnregisterServiceCallback = modcomputenetwork.NewProc("HcnUnregisterServiceCallback")
|
||||
procHcnCloseService = modcomputenetwork.NewProc("HcnCloseService")
|
||||
)
|
||||
|
||||
func SetCurrentThreadCompartmentId(compartmentId uint32) (hr error) {
|
||||
@@ -797,59 +793,3 @@ func hcnCloseRoute(route hcnRoute) (hr error) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func hcnOpenService(service *hcnService, result **uint16) (hr error) {
|
||||
if hr = procHcnOpenService.Find(); hr != nil {
|
||||
return
|
||||
}
|
||||
r0, _, _ := syscall.Syscall(procHcnOpenService.Addr(), 2, uintptr(unsafe.Pointer(service)), uintptr(unsafe.Pointer(result)), 0)
|
||||
if int32(r0) < 0 {
|
||||
if r0&0x1fff0000 == 0x00070000 {
|
||||
r0 &= 0xffff
|
||||
}
|
||||
hr = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func hcnRegisterServiceCallback(service hcnService, callback int32, context int32, callbackHandle *hcnCallbackHandle) (hr error) {
|
||||
if hr = procHcnRegisterServiceCallback.Find(); hr != nil {
|
||||
return
|
||||
}
|
||||
r0, _, _ := syscall.Syscall6(procHcnRegisterServiceCallback.Addr(), 4, uintptr(service), uintptr(callback), uintptr(context), uintptr(unsafe.Pointer(callbackHandle)), 0, 0)
|
||||
if int32(r0) < 0 {
|
||||
if r0&0x1fff0000 == 0x00070000 {
|
||||
r0 &= 0xffff
|
||||
}
|
||||
hr = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func hcnUnregisterServiceCallback(callbackHandle hcnCallbackHandle) (hr error) {
|
||||
if hr = procHcnUnregisterServiceCallback.Find(); hr != nil {
|
||||
return
|
||||
}
|
||||
r0, _, _ := syscall.Syscall(procHcnUnregisterServiceCallback.Addr(), 1, uintptr(callbackHandle), 0, 0)
|
||||
if int32(r0) < 0 {
|
||||
if r0&0x1fff0000 == 0x00070000 {
|
||||
r0 &= 0xffff
|
||||
}
|
||||
hr = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func hcnCloseService(service hcnService) (hr error) {
|
||||
if hr = procHcnCloseService.Find(); hr != nil {
|
||||
return
|
||||
}
|
||||
r0, _, _ := syscall.Syscall(procHcnCloseService.Addr(), 1, uintptr(service), 0, 0)
|
||||
if int32(r0) < 0 {
|
||||
if r0&0x1fff0000 == 0x00070000 {
|
||||
r0 &= 0xffff
|
||||
}
|
||||
hr = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user