diff --git a/cmd/ncproxy/ncproxy_v0_service.go b/cmd/ncproxy/ncproxy_v0_service.go new file mode 100644 index 0000000000..cd953ee625 --- /dev/null +++ b/cmd/ncproxy/ncproxy_v0_service.go @@ -0,0 +1,314 @@ +package main + +import ( + "context" + "errors" + "strconv" + + ncproxygrpcv0 "github.com/Microsoft/hcsshim/pkg/ncproxy/ncproxygrpc/v0" + ncproxygrpc "github.com/Microsoft/hcsshim/pkg/ncproxy/ncproxygrpc/v1" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +var ( + errUnsupportedNetworkType = errors.New("unsupported network type") + errUnsupportedEndpointType = errors.New("unsupported endpoint type") +) + +type v0ServiceWrapper struct { + s *grpcService +} + +func newV0ServiceWrapper(s *grpcService) *v0ServiceWrapper { + return &v0ServiceWrapper{s} +} + +var _ ncproxygrpcv0.NetworkConfigProxyServer = &v0ServiceWrapper{} + +func (w *v0ServiceWrapper) AddNIC(ctx context.Context, req *ncproxygrpcv0.AddNICRequest) (_ *ncproxygrpcv0.AddNICResponse, err error) { + v1Req := &ncproxygrpc.AddNICRequest{ + ContainerID: req.ContainerID, + NicID: req.NicID, + EndpointName: req.EndpointName, + } + _, err = w.s.AddNIC(ctx, v1Req) + if err != nil { + return nil, err + } + return &ncproxygrpcv0.AddNICResponse{}, nil +} + +func (w *v0ServiceWrapper) ModifyNIC(ctx context.Context, req *ncproxygrpcv0.ModifyNICRequest) (_ *ncproxygrpcv0.ModifyNICResponse, err error) { + v1Req := &ncproxygrpc.ModifyNICRequest{ + ContainerID: req.ContainerID, + NicID: req.NicID, + EndpointName: req.EndpointName, + } + if req.IovPolicySettings != nil { + v1Req.EndpointSettings = &ncproxygrpc.EndpointSettings{ + Settings: &ncproxygrpc.EndpointSettings_HcnEndpoint{ + HcnEndpoint: &ncproxygrpc.HcnEndpointSettings{ + Policies: &ncproxygrpc.HcnEndpointPolicies{ + IovPolicySettings: &ncproxygrpc.IovEndpointPolicySetting{ + IovOffloadWeight: req.IovPolicySettings.IovOffloadWeight, + QueuePairsRequested: req.IovPolicySettings.QueuePairsRequested, + InterruptModeration: req.IovPolicySettings.InterruptModeration, + }, + }, + }, + }, + } + } + _, err = w.s.ModifyNIC(ctx, v1Req) + if err != nil { + return nil, err + } + return &ncproxygrpcv0.ModifyNICResponse{}, nil +} + +func (w *v0ServiceWrapper) DeleteNIC(ctx context.Context, req *ncproxygrpcv0.DeleteNICRequest) (_ *ncproxygrpcv0.DeleteNICResponse, err error) { + v1Req := &ncproxygrpc.DeleteNICRequest{ + ContainerID: req.ContainerID, + NicID: req.NicID, + EndpointName: req.EndpointName, + } + _, err = w.s.DeleteNIC(ctx, v1Req) + if err != nil { + return nil, err + } + return &ncproxygrpcv0.DeleteNICResponse{}, nil +} + +func (w *v0ServiceWrapper) CreateNetwork(ctx context.Context, req *ncproxygrpcv0.CreateNetworkRequest) (_ *ncproxygrpcv0.CreateNetworkResponse, err error) { + v1Req := &ncproxygrpc.CreateNetworkRequest{ + Network: &ncproxygrpc.Network{ + Settings: &ncproxygrpc.Network_HcnNetwork{ + HcnNetwork: &ncproxygrpc.HostComputeNetworkSettings{ + Name: req.Name, + Mode: ncproxygrpc.HostComputeNetworkSettings_NetworkMode(req.Mode), + SwitchName: req.SwitchName, + IpamType: ncproxygrpc.HostComputeNetworkSettings_IpamType(req.IpamType), + SubnetIpaddressPrefix: req.SubnetIpaddressPrefix, + DefaultGateway: req.DefaultGateway, + }, + }, + }, + } + resp, err := w.s.CreateNetwork(ctx, v1Req) + if err != nil { + return nil, err + } + return &ncproxygrpcv0.CreateNetworkResponse{ + ID: resp.ID, + }, nil +} + +func (w *v0ServiceWrapper) CreateEndpoint(ctx context.Context, req *ncproxygrpcv0.CreateEndpointRequest) (_ *ncproxygrpcv0.CreateEndpointResponse, err error) { + var v1DnsSettings *ncproxygrpc.DnsSetting + if req.DnsSetting != nil { + v1DnsSettings = &ncproxygrpc.DnsSetting{ + ServerIpAddrs: req.DnsSetting.ServerIpAddrs, + Domain: req.DnsSetting.Domain, + Search: req.DnsSetting.Search, + } + } + var v1PortnamePolicySetting *ncproxygrpc.PortNameEndpointPolicySetting + if req.PortnamePolicySetting != nil { + v1PortnamePolicySetting = &ncproxygrpc.PortNameEndpointPolicySetting{ + PortName: req.PortnamePolicySetting.PortName, + } + } + + var v1IovPolicySettings *ncproxygrpc.IovEndpointPolicySetting + if req.IovPolicySettings != nil { + v1IovPolicySettings = &ncproxygrpc.IovEndpointPolicySetting{ + IovOffloadWeight: req.IovPolicySettings.IovOffloadWeight, + QueuePairsRequested: req.IovPolicySettings.QueuePairsRequested, + InterruptModeration: req.IovPolicySettings.InterruptModeration, + } + } + prefixLen, err := strconv.ParseUint(req.IpaddressPrefixlength, 10, 32) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "received invalid ip address prefix length %+v: %v", req, err) + } + v1Req := &ncproxygrpc.CreateEndpointRequest{ + EndpointSettings: &ncproxygrpc.EndpointSettings{ + Settings: &ncproxygrpc.EndpointSettings_HcnEndpoint{ + HcnEndpoint: &ncproxygrpc.HcnEndpointSettings{ + Name: req.Name, + Macaddress: req.Macaddress, + Ipaddress: req.Ipaddress, + IpaddressPrefixlength: uint32(prefixLen), + NetworkName: req.NetworkName, + DnsSetting: v1DnsSettings, + Policies: &ncproxygrpc.HcnEndpointPolicies{ + PortnamePolicySetting: v1PortnamePolicySetting, + IovPolicySettings: v1IovPolicySettings, + }, + }, + }, + }, + } + resp, err := w.s.CreateEndpoint(ctx, v1Req) + if err != nil { + return nil, err + } + return &ncproxygrpcv0.CreateEndpointResponse{ + ID: resp.ID, + }, nil +} + +func (w *v0ServiceWrapper) AddEndpoint(ctx context.Context, req *ncproxygrpcv0.AddEndpointRequest) (_ *ncproxygrpcv0.AddEndpointResponse, err error) { + v1Req := &ncproxygrpc.AddEndpointRequest{ + Name: req.Name, + NamespaceID: req.NamespaceID, + } + _, err = w.s.AddEndpoint(ctx, v1Req) + if err != nil { + return nil, err + } + return &ncproxygrpcv0.AddEndpointResponse{}, nil +} + +func (w *v0ServiceWrapper) DeleteEndpoint(ctx context.Context, req *ncproxygrpcv0.DeleteEndpointRequest) (_ *ncproxygrpcv0.DeleteEndpointResponse, err error) { + v1Req := &ncproxygrpc.DeleteEndpointRequest{ + Name: req.Name, + } + _, err = w.s.DeleteEndpoint(ctx, v1Req) + if err != nil { + return nil, err + } + return &ncproxygrpcv0.DeleteEndpointResponse{}, nil +} + +func (w *v0ServiceWrapper) DeleteNetwork(ctx context.Context, req *ncproxygrpcv0.DeleteNetworkRequest) (_ *ncproxygrpcv0.DeleteNetworkResponse, err error) { + v1Req := &ncproxygrpc.DeleteNetworkRequest{ + Name: req.Name, + } + _, err = w.s.DeleteNetwork(ctx, v1Req) + if err != nil { + return nil, err + } + return &ncproxygrpcv0.DeleteNetworkResponse{}, nil +} + +func (w *v0ServiceWrapper) GetEndpoint(ctx context.Context, req *ncproxygrpcv0.GetEndpointRequest) (_ *ncproxygrpcv0.GetEndpointResponse, err error) { + v1Req := &ncproxygrpc.GetEndpointRequest{ + Name: req.Name, + } + resp, err := w.s.GetEndpoint(ctx, v1Req) + if err != nil { + return nil, err + } + v0Resp, err := v1EndpointToV0EndpointResp(resp) + if err != nil { + if err == errUnsupportedEndpointType { + return nil, status.Errorf(codes.NotFound, "no endpoint with name `%s` found", req.Name) + } + return nil, err + } + + return v0Resp, nil +} + +func v1EndpointToV0EndpointResp(v1EndpointResp *ncproxygrpc.GetEndpointResponse) (_ *ncproxygrpcv0.GetEndpointResponse, err error) { + if v1EndpointResp.Endpoint != nil { + if v1EndpointResp.Endpoint.GetHcnEndpoint() != nil { + v0Resp := &ncproxygrpcv0.GetEndpointResponse{ + ID: v1EndpointResp.ID, + Namespace: v1EndpointResp.Namespace, + } + v1EndpointSettings := v1EndpointResp.Endpoint.GetHcnEndpoint() + v0Resp.Name = v1EndpointSettings.Name + v0Resp.Network = v1EndpointSettings.NetworkName + + if v1EndpointSettings.DnsSetting != nil { + v0Resp.DnsSetting = &ncproxygrpcv0.DnsSetting{ + ServerIpAddrs: v1EndpointSettings.DnsSetting.ServerIpAddrs, + Domain: v1EndpointSettings.DnsSetting.Domain, + Search: v1EndpointSettings.DnsSetting.Search, + } + } + return v0Resp, nil + } + } + return nil, errUnsupportedEndpointType +} + +func (w *v0ServiceWrapper) GetEndpoints(ctx context.Context, req *ncproxygrpcv0.GetEndpointsRequest) (_ *ncproxygrpcv0.GetEndpointsResponse, err error) { + resp, err := w.s.GetEndpoints(ctx, &ncproxygrpc.GetEndpointsRequest{}) + if err != nil { + return nil, err + } + v0Endpoints := make([]*ncproxygrpcv0.GetEndpointResponse, len(resp.Endpoints)) + for i, e := range resp.Endpoints { + v0Endpoint, err := v1EndpointToV0EndpointResp(e) + if err != nil { + if err == errUnsupportedEndpointType { + // ignore unsupported endpoints + continue + } + return nil, err + } + v0Endpoints[i] = v0Endpoint + } + return &ncproxygrpcv0.GetEndpointsResponse{ + Endpoints: v0Endpoints, + }, nil +} + +func (w *v0ServiceWrapper) GetNetwork(ctx context.Context, req *ncproxygrpcv0.GetNetworkRequest) (_ *ncproxygrpcv0.GetNetworkResponse, err error) { + v1Req := &ncproxygrpc.GetNetworkRequest{ + Name: req.Name, + } + resp, err := w.s.GetNetwork(ctx, v1Req) + if err != nil { + return nil, err + } + + v0Resp, err := v1NetworkToV0NetworkResp(resp) + if err != nil { + if err == errUnsupportedNetworkType { + return nil, status.Errorf(codes.NotFound, "no network with name `%s` found", req.Name) + } + return nil, err + } + + return v0Resp, nil +} + +func v1NetworkToV0NetworkResp(v1NetworkResp *ncproxygrpc.GetNetworkResponse) (_ *ncproxygrpcv0.GetNetworkResponse, err error) { + if v1NetworkResp.Network != nil { + if v1NetworkResp.Network.GetHcnNetwork() != nil { + v0Resp := &ncproxygrpcv0.GetNetworkResponse{ + ID: v1NetworkResp.ID, + Name: v1NetworkResp.Network.GetHcnNetwork().Name, + } + return v0Resp, nil + } + } + return nil, errUnsupportedNetworkType +} + +func (w *v0ServiceWrapper) GetNetworks(ctx context.Context, req *ncproxygrpcv0.GetNetworksRequest) (_ *ncproxygrpcv0.GetNetworksResponse, err error) { + resp, err := w.s.GetNetworks(ctx, &ncproxygrpc.GetNetworksRequest{}) + if err != nil { + return nil, err + } + v0Networks := make([]*ncproxygrpcv0.GetNetworkResponse, len(resp.Networks)) + for i, n := range resp.Networks { + v0Network, err := v1NetworkToV0NetworkResp(n) + if err != nil { + if err == errUnsupportedNetworkType { + // ignore unsupported networks + continue + } + return nil, err + } + v0Networks[i] = v0Network + } + return &ncproxygrpcv0.GetNetworksResponse{ + Networks: v0Networks, + }, nil +} diff --git a/cmd/ncproxy/ncproxy_v0_service_test.go b/cmd/ncproxy/ncproxy_v0_service_test.go new file mode 100644 index 0000000000..136740e6eb --- /dev/null +++ b/cmd/ncproxy/ncproxy_v0_service_test.go @@ -0,0 +1,1314 @@ +package main + +import ( + "context" + "strconv" + "strings" + "testing" + + "github.com/Microsoft/hcsshim/hcn" + "github.com/Microsoft/hcsshim/internal/computeagent" + computeagentMock "github.com/Microsoft/hcsshim/internal/computeagent/mock" + "github.com/Microsoft/hcsshim/osversion" + ncproxygrpcv0 "github.com/Microsoft/hcsshim/pkg/ncproxy/ncproxygrpc/v0" + "github.com/golang/mock/gomock" +) + +func TestAddNIC_V0_HCN(t *testing.T) { + ctx := context.Background() + containerID := t.Name() + "-containerID" + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + // create mocked compute agent service + computeAgentCtrl := gomock.NewController(t) + defer computeAgentCtrl.Finish() + mockedService := computeagentMock.NewMockComputeAgentService(computeAgentCtrl) + mockedAgentClient := &computeAgentClient{nil, mockedService} + + // put mocked compute agent in agent cache for test + if err := agentCache.put(containerID, mockedAgentClient); err != nil { + t.Fatal(err) + } + + // setup expected mocked calls + mockedService.EXPECT().AddNIC(gomock.Any(), gomock.Any()).Return(&computeagent.AddNICInternalResponse{}, nil).AnyTimes() + + // test network + testNetworkName := t.Name() + "-network" + network, err := createTestIPv4NATNetwork(testNetworkName) + if err != nil { + t.Fatalf("failed to create test network with %v", err) + } + defer func() { + _ = network.Delete() + }() + + testEndpointName := t.Name() + "-endpoint" + endpoint, err := createTestEndpoint(testEndpointName, network.Id) + if err != nil { + t.Fatalf("failed to create test endpoint with %v", err) + } + // defer cleanup in case of error. ignore error from the delete call here + // since we may have already successfully deleted the endpoint. + defer func() { + _ = endpoint.Delete() + }() + + testNICID := t.Name() + "-nicID" + req := &ncproxygrpcv0.AddNICRequest{ + ContainerID: containerID, + NicID: testNICID, + EndpointName: testEndpointName, + } + + _, err = v0Service.AddNIC(ctx, req) + if err != nil { + t.Fatalf("expected AddNIC to return no error, instead got %v", err) + } +} + +func TestAddNIC_V0_HCN_Error_InvalidArgument(t *testing.T) { + ctx := context.Background() + + var ( + containerID = t.Name() + "-containerID" + testNICID = t.Name() + "-nicID" + testEndpointName = t.Name() + "-endpoint" + ) + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + // create mocked compute agent service + computeAgentCtrl := gomock.NewController(t) + defer computeAgentCtrl.Finish() + mockedService := computeagentMock.NewMockComputeAgentService(computeAgentCtrl) + mockedAgentClient := &computeAgentClient{nil, mockedService} + + // put mocked compute agent in agent cache for test + if err := agentCache.put(containerID, mockedAgentClient); err != nil { + t.Fatal(err) + } + + // setup expected mocked calls + mockedService.EXPECT().AddNIC(gomock.Any(), gomock.Any()).Return(&computeagent.AddNICInternalResponse{}, nil).AnyTimes() + + type config struct { + name string + containerID string + nicID string + endpointName string + } + tests := []config{ + { + name: "AddNIC returns error with blank container ID", + containerID: "", + nicID: testNICID, + endpointName: testEndpointName, + }, + { + name: "AddNIC returns error with blank nic ID", + containerID: containerID, + nicID: "", + endpointName: testEndpointName, + }, + { + name: "AddNIC returns error with blank endpoint name", + containerID: containerID, + nicID: testNICID, + endpointName: "", + }, + } + + for _, test := range tests { + t.Run(test.name, func(subtest *testing.T) { + req := &ncproxygrpcv0.AddNICRequest{ + ContainerID: test.containerID, + NicID: test.nicID, + EndpointName: test.endpointName, + } + + _, err := v0Service.AddNIC(ctx, req) + if err == nil { + subtest.Fatalf("expected AddNIC to return an error") + } + }) + } +} + +func TestDeleteNIC_V0_HCN(t *testing.T) { + ctx := context.Background() + containerID := t.Name() + "-containerID" + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + // create mocked compute agent service + computeAgentCtrl := gomock.NewController(t) + defer computeAgentCtrl.Finish() + mockedService := computeagentMock.NewMockComputeAgentService(computeAgentCtrl) + mockedAgentClient := &computeAgentClient{nil, mockedService} + + // put mocked compute agent in agent cache for test + if err := agentCache.put(containerID, mockedAgentClient); err != nil { + t.Fatal(err) + } + + // setup expected mocked calls + mockedService.EXPECT().DeleteNIC(gomock.Any(), gomock.Any()).Return(&computeagent.DeleteNICInternalResponse{}, nil).AnyTimes() + + // test network + network, err := createTestIPv4NATNetwork(t.Name() + "network") + if err != nil { + t.Fatalf("failed to create test network with %v", err) + } + defer func() { + _ = network.Delete() + }() + + testEndpointName := t.Name() + "-endpoint" + endpoint, err := createTestEndpoint(testEndpointName, network.Id) + if err != nil { + t.Fatalf("failed to create test endpoint with %v", err) + } + // defer cleanup in case of error. ignore error from the delete call here + // since we may have already successfully deleted the endpoint. + defer func() { + _ = endpoint.Delete() + }() + + testNICID := t.Name() + "-nicID" + req := &ncproxygrpcv0.DeleteNICRequest{ + ContainerID: containerID, + NicID: testNICID, + EndpointName: testEndpointName, + } + + _, err = v0Service.DeleteNIC(ctx, req) + if err != nil { + t.Fatalf("expected DeleteNIC to return no error, instead got %v", err) + } +} + +func TestDeleteNIC_V0_HCN_Error_InvalidArgument(t *testing.T) { + ctx := context.Background() + + var ( + containerID = t.Name() + "-containerID" + testNICID = t.Name() + "-nicID" + testEndpointName = t.Name() + "-endpoint" + ) + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + // create mocked compute agent service + computeAgentCtrl := gomock.NewController(t) + defer computeAgentCtrl.Finish() + mockedService := computeagentMock.NewMockComputeAgentService(computeAgentCtrl) + mockedAgentClient := &computeAgentClient{nil, mockedService} + + // put mocked compute agent in agent cache for test + if err := agentCache.put(containerID, mockedAgentClient); err != nil { + t.Fatal(err) + } + + // setup expected mocked calls + mockedService.EXPECT().DeleteNIC(gomock.Any(), gomock.Any()).Return(&computeagent.DeleteNICInternalResponse{}, nil).AnyTimes() + + type config struct { + name string + containerID string + nicID string + endpointName string + } + tests := []config{ + { + name: "DeleteNIC returns error with blank container ID", + containerID: "", + nicID: testNICID, + endpointName: testEndpointName, + }, + { + name: "DeleteNIC returns error with blank nic ID", + containerID: containerID, + nicID: "", + endpointName: testEndpointName, + }, + { + name: "DeleteNIC returns error with blank endpoint name", + containerID: containerID, + nicID: testNICID, + endpointName: "", + }, + } + + for _, test := range tests { + t.Run(test.name, func(subtest *testing.T) { + req := &ncproxygrpcv0.DeleteNICRequest{ + ContainerID: test.containerID, + NicID: test.nicID, + EndpointName: test.endpointName, + } + + _, err := v0Service.DeleteNIC(ctx, req) + if err == nil { + subtest.Fatalf("expected DeleteNIC to return an error") + } + }) + } +} + +func TestModifyNIC_V0_HCN(t *testing.T) { + // support for setting IOV policy was added in 21H1 + if osversion.Build() < osversion.V21H1 { + t.Skip("Requires build +21H1") + } + ctx := context.Background() + containerID := t.Name() + "-containerID" + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + // create mock compute agent service + computeAgentCtrl := gomock.NewController(t) + defer computeAgentCtrl.Finish() + mockedService := computeagentMock.NewMockComputeAgentService(computeAgentCtrl) + mockedAgentClient := &computeAgentClient{nil, mockedService} + + // populate agent cache with mocked service for test + if err := agentCache.put(containerID, mockedAgentClient); err != nil { + t.Fatal(err) + } + + // setup expected mocked calls + mockedService.EXPECT().ModifyNIC(gomock.Any(), gomock.Any()).Return(&computeagent.ModifyNICInternalResponse{}, nil).AnyTimes() + + iovOffloadOn := &ncproxygrpcv0.IovEndpointPolicySetting{ + IovOffloadWeight: 100, + } + + type config struct { + name string + containerID string + iovPolicySettings *ncproxygrpcv0.IovEndpointPolicySetting + networkCreateFunc func(string) (*hcn.HostComputeNetwork, error) + } + tests := []config{ + { + name: "ModifyNIC returns no error", + containerID: containerID, + networkCreateFunc: createTestIPv4NATNetwork, + iovPolicySettings: iovOffloadOn, + }, + { + name: "ModifyNIC dual stack returns no error", + containerID: containerID, + networkCreateFunc: createTestDualStackNATNetwork, + iovPolicySettings: iovOffloadOn, + }, + { + name: "ModifyNIC returns no error when turning off iov policy", + containerID: containerID, + networkCreateFunc: createTestIPv4NATNetwork, + iovPolicySettings: &ncproxygrpcv0.IovEndpointPolicySetting{ + IovOffloadWeight: 0, + }, + }, + { + name: "ModifyNIC dual stack returns no error when turning off iov policy", + containerID: containerID, + networkCreateFunc: createTestDualStackNATNetwork, + iovPolicySettings: &ncproxygrpcv0.IovEndpointPolicySetting{ + IovOffloadWeight: 0, + }, + }, + } + + for _, test := range tests { + t.Run(test.name, func(subtest *testing.T) { + // create test network + networkName := subtest.Name() + "-network" + network, err := test.networkCreateFunc(networkName) + if err != nil { + subtest.Fatalf("failed to create test network with %v", err) + } + defer func() { + _ = network.Delete() + }() + + // create test endpoint + endpointName := subtest.Name() + "-endpoint" + endpoint, err := createTestEndpoint(endpointName, network.Id) + if err != nil { + subtest.Fatalf("failed to create test endpoint with %v", err) + } + defer func() { + _ = endpoint.Delete() + }() + testNICID := subtest.Name() + "-nicID" + req := &ncproxygrpcv0.ModifyNICRequest{ + ContainerID: test.containerID, + NicID: testNICID, + EndpointName: endpointName, + IovPolicySettings: test.iovPolicySettings, + } + + _, err = v0Service.ModifyNIC(ctx, req) + if err != nil { + subtest.Fatalf("expected ModifyNIC to return no error, instead got %v", err) + } + }) + } +} + +func TestModifyNIC_V0_HCN_Error_InvalidArgument(t *testing.T) { + // support for setting IOV policy was added in 21H1 + if osversion.Build() < osversion.V21H1 { + t.Skip("Requires build +21H1") + } + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + var ( + containerID = t.Name() + "-containerID" + testNICID = t.Name() + "-nicID" + endpointName = t.Name() + "-endpoint" + ) + + // create mock compute agent service + computeAgentCtrl := gomock.NewController(t) + defer computeAgentCtrl.Finish() + mockedService := computeagentMock.NewMockComputeAgentService(computeAgentCtrl) + mockedAgentClient := &computeAgentClient{nil, mockedService} + + // populate agent cache with mocked service for test + if err := agentCache.put(containerID, mockedAgentClient); err != nil { + t.Fatal(err) + } + + // setup expected mocked calls + mockedService.EXPECT().ModifyNIC(gomock.Any(), gomock.Any()).Return(&computeagent.ModifyNICInternalResponse{}, nil).AnyTimes() + + iovOffloadOn := &ncproxygrpcv0.IovEndpointPolicySetting{ + IovOffloadWeight: 100, + } + + type config struct { + name string + containerID string + nicID string + endpointName string + iovPolicySettings *ncproxygrpcv0.IovEndpointPolicySetting + } + tests := []config{ + { + name: "ModifyNIC returns error with blank container ID", + containerID: "", + nicID: testNICID, + endpointName: endpointName, + iovPolicySettings: iovOffloadOn, + }, + { + name: "ModifyNIC returns error with blank nic ID", + containerID: containerID, + nicID: "", + endpointName: endpointName, + iovPolicySettings: iovOffloadOn, + }, + { + name: "ModifyNIC returns error with blank endpoint name", + containerID: containerID, + nicID: testNICID, + endpointName: "", + iovPolicySettings: iovOffloadOn, + }, + { + name: "ModifyNIC returns error with blank iov policy settings", + containerID: containerID, + nicID: testNICID, + endpointName: endpointName, + iovPolicySettings: nil, + }, + } + + for _, test := range tests { + t.Run(test.name, func(subtest *testing.T) { + req := &ncproxygrpcv0.ModifyNICRequest{ + ContainerID: test.containerID, + NicID: test.nicID, + EndpointName: test.endpointName, + IovPolicySettings: test.iovPolicySettings, + } + + _, err := v0Service.ModifyNIC(ctx, req) + if err == nil { + subtest.Fatalf("expected ModifyNIC to return an error") + } + }) + } +} + +func TestCreateNetwork_V0_HCN(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + networkName := t.Name() + "-network" + ipv4Subnets := getTestIPv4Subnets() + req := &ncproxygrpcv0.CreateNetworkRequest{ + Name: networkName, + Mode: ncproxygrpcv0.CreateNetworkRequest_NAT, + SubnetIpaddressPrefix: []string{ipv4Subnets[0].IpAddressPrefix}, + DefaultGateway: ipv4Subnets[0].Routes[0].NextHop, + } + _, err = v0Service.CreateNetwork(ctx, req) + if err != nil { + t.Fatalf("expected CreateNetwork to return no error, instead got %v", err) + } + // validate that the network exists + network, err := hcn.GetNetworkByName(networkName) + if err != nil { + t.Fatalf("failed to find created network with %v", err) + } + // cleanup the created network + if err = network.Delete(); err != nil { + t.Fatalf("failed to cleanup network %v created by test with %v", networkName, err) + } +} + +func TestCreateNetwork_V0_HCN_Error_EmptyNetworkName(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + req := &ncproxygrpcv0.CreateNetworkRequest{ + Name: "", + Mode: ncproxygrpcv0.CreateNetworkRequest_Transparent, + } + _, err = v0Service.CreateNetwork(ctx, req) + if err == nil { + t.Fatalf("expected CreateNetwork to return an error") + } +} + +func TestCreateEndpoint_V0_HCN(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + // test network + networkName := t.Name() + "-network" + network, err := createTestIPv4NATNetwork(networkName) + if err != nil { + t.Fatalf("failed to create test network with %v", err) + } + defer func() { + _ = network.Delete() + }() + + endpointName := t.Name() + "-endpoint" + req := &ncproxygrpcv0.CreateEndpointRequest{ + Name: endpointName, + Macaddress: "00-15-5D-52-C0-00", + Ipaddress: "192.168.100.4", + IpaddressPrefixlength: "24", + NetworkName: networkName, + } + + _, err = v0Service.CreateEndpoint(ctx, req) + if err != nil { + t.Fatalf("expected CreateEndpoint to return no error, instead got %v", err) + } + // validate that the endpoint was created + ep, err := hcn.GetEndpointByName(endpointName) + if err != nil { + t.Fatalf("endpoint was not found: %v", err) + } + // cleanup endpoint + if err := ep.Delete(); err != nil { + t.Fatalf("failed to delete endpoint created for test %v", err) + } +} + +func TestCreateEndpoint_V0_HCN_Error_InvalidArgument(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + type config struct { + name string + networkName string + ipaddress string + macaddress string + } + tests := []config{ + { + name: "CreateEndpoint returns error when network name is empty", + networkName: "", + ipaddress: "192.168.100.4", + macaddress: "00-15-5D-52-C0-00", + }, + { + name: "CreateEndpoint returns error when ip address is empty", + networkName: "testName", + ipaddress: "", + macaddress: "00-15-5D-52-C0-00", + }, + { + name: "CreateEndpoint returns error when mac address is empty", + networkName: "testName", + ipaddress: "192.168.100.4", + macaddress: "", + }, + } + + for i, test := range tests { + t.Run(test.name, func(subtest *testing.T) { + endpointName := t.Name() + "-endpoint-" + strconv.Itoa(i) + + req := &ncproxygrpcv0.CreateEndpointRequest{ + Name: endpointName, + Macaddress: test.macaddress, + Ipaddress: test.ipaddress, + NetworkName: test.networkName, + } + + _, err = v0Service.CreateEndpoint(ctx, req) + if err == nil { + subtest.Fatalf("expected CreateEndpoint to return an error") + } + }) + } +} + +func TestAddEndpoint_V0_NoError(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + // create test network namespace + // we need to create a (host) namespace other than the HostDefault to differentiate between + // the nominal AddEndpoint functionality, and when specifying attach to host + // the DefaultHost namespace is retrieved below. + namespace := hcn.NewNamespace(hcn.NamespaceTypeHost) + namespace, err = namespace.Create() + if err != nil { + t.Fatalf("failed to create test namespace with %v", err) + } + defer func() { + _ = namespace.Delete() + }() + + // test network + networkName := t.Name() + "-network" + network, err := createTestIPv4NATNetwork(networkName) + if err != nil { + t.Fatalf("failed to create test network with %v", err) + } + defer func() { + _ = network.Delete() + }() + + endpointName := t.Name() + "-endpoint" + endpoint, err := createTestEndpoint(endpointName, network.Id) + if err != nil { + t.Fatalf("failed to create test endpoint with %v", err) + } + defer func() { + _ = endpoint.Delete() + }() + + req := &ncproxygrpcv0.AddEndpointRequest{ + Name: endpointName, + NamespaceID: namespace.Id, + } + + _, err = v0Service.AddEndpoint(ctx, req) + if err != nil { + t.Fatalf("expected AddEndpoint to return no error, instead got %v", err) + } + // validate endpoint was added to namespace + endpoints, err := hcn.GetNamespaceEndpointIds(namespace.Id) + if err != nil { + t.Fatalf("failed to get the namespace's endpoints with %v", err) + } + if !exists(strings.ToUpper(endpoint.Id), endpoints) { + t.Fatalf("endpoint %v was not added to namespace %v", endpoint.Id, namespace.Id) + } +} + +func TestAddEndpoint_V0_Error_EmptyEndpointName(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + // create test network namespace + namespace := hcn.NewNamespace(hcn.NamespaceTypeHostDefault) + namespace, err = namespace.Create() + if err != nil { + t.Fatalf("failed to create test namespace with %v", err) + } + defer func() { + _ = namespace.Delete() + }() + + req := &ncproxygrpcv0.AddEndpointRequest{ + Name: "", + NamespaceID: namespace.Id, + } + + _, err = v0Service.AddEndpoint(ctx, req) + if err == nil { + t.Fatal("expected AddEndpoint to return error when endpoint name is empty") + } +} + +func TestAddEndpoint_V0_Error_NoEndpoint(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + // create test network namespace + namespace := hcn.NewNamespace(hcn.NamespaceTypeHostDefault) + namespace, err = namespace.Create() + if err != nil { + t.Fatalf("failed to create test namespace with %v", err) + } + defer func() { + _ = namespace.Delete() + }() + + req := &ncproxygrpcv0.AddEndpointRequest{ + Name: t.Name() + "-endpoint", + NamespaceID: namespace.Id, + } + + _, err = v0Service.AddEndpoint(ctx, req) + if err == nil { + t.Fatal("expected AddEndpoint to return error when endpoint name is empty") + } +} + +func TestAddEndpoint_V0_Error_EmptyNamespaceID(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + // test network + networkName := t.Name() + "-network" + network, err := createTestIPv4NATNetwork(networkName) + if err != nil { + t.Fatalf("failed to create test network with %v", err) + } + defer func() { + _ = network.Delete() + }() + + endpointName := t.Name() + "-endpoint" + endpoint, err := createTestEndpoint(endpointName, network.Id) + if err != nil { + t.Fatalf("failed to create test endpoint with %v", err) + } + defer func() { + _ = endpoint.Delete() + }() + + req := &ncproxygrpcv0.AddEndpointRequest{ + Name: endpointName, + NamespaceID: "", + } + + _, err = v0Service.AddEndpoint(ctx, req) + if err == nil { + t.Fatal("expected AddEndpoint to return error when namespace ID is empty") + } +} + +func TestDeleteEndpoint_V0_NoError(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + // test network + networkName := t.Name() + "-network" + network, err := createTestIPv4NATNetwork(networkName) + if err != nil { + t.Fatalf("failed to create test network with %v", err) + } + // defer cleanup in case of error. ignore error from the delete call here + // since we may have already successfully deleted the network. + defer func() { + _ = network.Delete() + }() + + endpointName := t.Name() + "-endpoint" + endpoint, err := createTestEndpoint(endpointName, network.Id) + if err != nil { + t.Fatalf("failed to create test endpoint with %v", err) + } + // defer cleanup in case of error. ignore error from the delete call here + // since we may have already successfully deleted the endpoint. + defer func() { + _ = endpoint.Delete() + }() + + req := &ncproxygrpcv0.DeleteEndpointRequest{ + Name: endpointName, + } + _, err = v0Service.DeleteEndpoint(ctx, req) + if err != nil { + t.Fatalf("expected DeleteEndpoint to return no error, instead got %v", err) + } + // validate that the endpoint was created + ep, err := hcn.GetEndpointByName(endpointName) + if err == nil { + t.Fatalf("expected endpoint to be deleted, instead found %v", ep) + } +} + +func TestDeleteEndpoint_V0_Error_NoEndpoint(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + // test network + networkName := t.Name() + "-network" + network, err := createTestIPv4NATNetwork(networkName) + if err != nil { + t.Fatalf("failed to create test network with %v", err) + } + defer func() { + _ = network.Delete() + }() + + endpointName := t.Name() + "-endpoint" + req := &ncproxygrpcv0.DeleteEndpointRequest{ + Name: endpointName, + } + + _, err = v0Service.DeleteEndpoint(ctx, req) + if err == nil { + t.Fatalf("expected to return an error on deleting nonexistent endpoint") + } +} + +func TestDeleteEndpoint_V0_Error_EmptyEndpoint_Name(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + endpointName := "" + req := &ncproxygrpcv0.DeleteEndpointRequest{ + Name: endpointName, + } + + _, err = v0Service.DeleteEndpoint(ctx, req) + if err == nil { + t.Fatalf("expected to return an error when endpoint name is empty") + } +} + +func TestDeleteNetwork_V0_NoError(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + // test network + networkName := t.Name() + "-network" + network, err := createTestIPv4NATNetwork(networkName) + if err != nil { + t.Fatalf("failed to create test network with %v", err) + } + // defer cleanup in case of error. ignore error from the delete call here + // since we may have already successfully deleted the network. + defer func() { + _ = network.Delete() + }() + + req := &ncproxygrpcv0.DeleteNetworkRequest{ + Name: networkName, + } + _, err = v0Service.DeleteNetwork(ctx, req) + if err != nil { + t.Fatalf("expected no error, instead got %v", err) + } +} + +func TestDeleteNetwork_V0_Error_NoNetwork(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + fakeNetworkName := t.Name() + "-network" + + req := &ncproxygrpcv0.DeleteNetworkRequest{ + Name: fakeNetworkName, + } + _, err = v0Service.DeleteNetwork(ctx, req) + if err == nil { + t.Fatal("expected to get an error when attempting to delete nonexistent network") + } +} + +func TestDeleteNetwork_V0_Error_EmptyNetworkName(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + req := &ncproxygrpcv0.DeleteNetworkRequest{ + Name: "", + } + _, err = v0Service.DeleteNetwork(ctx, req) + if err == nil { + t.Fatal("expected to get an error when attempting to delete nonexistent network") + } +} + +func TestGetEndpoint_V0_NoError(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + // test network + networkName := t.Name() + "-network" + network, err := createTestIPv4NATNetwork(networkName) + if err != nil { + t.Fatalf("failed to create test network with %v", err) + } + defer func() { + _ = network.Delete() + }() + + // test endpoint + endpointName := t.Name() + "-endpoint" + endpoint, err := createTestEndpoint(endpointName, network.Id) + if err != nil { + t.Fatalf("failed to create test endpoint with %v", err) + } + defer func() { + _ = endpoint.Delete() + }() + + req := &ncproxygrpcv0.GetEndpointRequest{ + Name: endpointName, + } + + if _, err := v0Service.GetEndpoint(ctx, req); err != nil { + t.Fatalf("expected to get no error, instead got %v", err) + } +} + +func TestGetEndpoint_V0_Error_NoEndpoint(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + endpointName := t.Name() + "-endpoint" + req := &ncproxygrpcv0.GetEndpointRequest{ + Name: endpointName, + } + + if _, err := v0Service.GetEndpoint(ctx, req); err == nil { + t.Fatal("expected to get an error trying to get a nonexistent endpoint") + } +} + +func TestGetEndpoint_V0_Error_EmptyEndpointName(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + req := &ncproxygrpcv0.GetEndpointRequest{ + Name: "", + } + + if _, err := v0Service.GetEndpoint(ctx, req); err == nil { + t.Fatal("expected to get an error with empty endpoint name") + } +} + +func TestGetEndpoints_V0_NoError(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + // test network + networkName := t.Name() + "-network" + network, err := createTestIPv4NATNetwork(networkName) + if err != nil { + t.Fatalf("failed to create test network with %v", err) + } + defer func() { + _ = network.Delete() + }() + + // test endpoint + endpointName := t.Name() + "-endpoint" + endpoint, err := createTestEndpoint(endpointName, network.Id) + if err != nil { + t.Fatalf("failed to create test endpoint with %v", err) + } + defer func() { + _ = endpoint.Delete() + }() + + req := &ncproxygrpcv0.GetEndpointsRequest{} + resp, err := v0Service.GetEndpoints(ctx, req) + if err != nil { + t.Fatalf("expected to get no error, instead got %v", err) + } + + if !v0EndpointExists(endpointName, resp.Endpoints) { + t.Fatalf("created endpoint was not found") + } +} + +func TestGetNetwork_V0_NoError(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + // create the test network + networkName := t.Name() + "-network" + network, err := createTestIPv4NATNetwork(networkName) + if err != nil { + t.Fatalf("failed to create test network with %v", err) + } + // defer cleanup in case of error. ignore error from the delete call here + // since we may have already successfully deleted the network. + defer func() { + _ = network.Delete() + }() + + req := &ncproxygrpcv0.GetNetworkRequest{ + Name: networkName, + } + _, err = v0Service.GetNetwork(ctx, req) + if err != nil { + t.Fatalf("expected no error, instead got %v", err) + } +} + +func TestGetNetwork_V0_Error_NoNetwork(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + fakeNetworkName := t.Name() + "-network" + + req := &ncproxygrpcv0.GetNetworkRequest{ + Name: fakeNetworkName, + } + _, err = v0Service.GetNetwork(ctx, req) + if err == nil { + t.Fatal("expected to get an error when attempting to get nonexistent network") + } +} + +func TestGetNetwork_V0_Error_EmptyNetworkName(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + req := &ncproxygrpcv0.GetNetworkRequest{ + Name: "", + } + _, err = v0Service.GetNetwork(ctx, req) + if err == nil { + t.Fatal("expected to get an error when network name is empty") + } +} + +func TestGetNetworks_V0_NoError(t *testing.T) { + ctx := context.Background() + + networkingStore, closer, err := createTestNetworkingStore() + if err != nil { + t.Fatalf("failed to create a test ncproxy networking store with %v", err) + } + defer closer() + + // setup test ncproxy grpc service + agentCache := newComputeAgentCache() + gService := newGRPCService(agentCache, networkingStore) + v0Service := newV0ServiceWrapper(gService) + + // create the test network + networkName := t.Name() + "-network" + network, err := createTestIPv4NATNetwork(networkName) + if err != nil { + t.Fatalf("failed to create test network with %v", err) + } + // defer cleanup in case of error. ignore error from the delete call here + // since we may have already successfully deleted the network. + defer func() { + _ = network.Delete() + }() + + req := &ncproxygrpcv0.GetNetworksRequest{} + resp, err := v0Service.GetNetworks(ctx, req) + if err != nil { + t.Fatalf("expected no error, instead got %v", err) + } + if !v0NetworkExists(networkName, resp.Networks) { + t.Fatalf("failed to find created network") + } +} + +func v0NetworkExists(targetName string, networks []*ncproxygrpcv0.GetNetworkResponse) bool { + for _, resp := range networks { + if resp.Name == targetName { + return true + } + } + return false +} + +func v0EndpointExists(targetName string, endpoints []*ncproxygrpcv0.GetEndpointResponse) bool { + for _, resp := range endpoints { + if resp.Name == targetName { + return true + } + } + return false +} diff --git a/cmd/ncproxy/server.go b/cmd/ncproxy/server.go index 0904d206bd..ac808b5fcf 100644 --- a/cmd/ncproxy/server.go +++ b/cmd/ncproxy/server.go @@ -12,6 +12,7 @@ import ( "github.com/Microsoft/hcsshim/internal/log" ncproxystore "github.com/Microsoft/hcsshim/internal/ncproxy/store" "github.com/Microsoft/hcsshim/internal/ncproxyttrpc" + ncproxygrpcv0 "github.com/Microsoft/hcsshim/pkg/ncproxy/ncproxygrpc/v0" ncproxygrpc "github.com/Microsoft/hcsshim/pkg/ncproxy/ncproxygrpc/v1" "github.com/Microsoft/hcsshim/pkg/octtrpc" "github.com/containerd/ttrpc" @@ -66,6 +67,11 @@ func (s *server) setup(ctx context.Context) (net.Listener, net.Listener, error) gService := newGRPCService(s.cache, s.ncproxyNetworking) ncproxygrpc.RegisterNetworkConfigProxyServer(s.grpc, gService) + // support the v0 ncproxy api + v0Wrapper := newV0ServiceWrapper(gService) + ncproxygrpcv0.RegisterNetworkConfigProxyServer(s.grpc, v0Wrapper) + log.G(ctx).Warnf("ncproxygprc api v0 is deprecated, please use ncproxygrpc api v1") + tService := newTTRPCService(ctx, s.cache, s.agentStore) ncproxyttrpc.RegisterNetworkConfigProxyService(s.ttrpc, tService) diff --git a/pkg/ncproxy/ncproxygrpc/v0/doc.go b/pkg/ncproxy/ncproxygrpc/v0/doc.go new file mode 100644 index 0000000000..59570259ff --- /dev/null +++ b/pkg/ncproxy/ncproxygrpc/v0/doc.go @@ -0,0 +1 @@ +package v0 diff --git a/pkg/ncproxy/ncproxygrpc/v0/networkconfigproxy.pb.go b/pkg/ncproxy/ncproxygrpc/v0/networkconfigproxy.pb.go new file mode 100644 index 0000000000..c78d26cdf6 --- /dev/null +++ b/pkg/ncproxy/ncproxygrpc/v0/networkconfigproxy.pb.go @@ -0,0 +1,6682 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// github.com/Microsoft/hcsshim/pkg/ncproxy/ncproxygrpc/v0/networkconfigproxy.proto is a deprecated file. + +package v0 + +import ( + context "context" + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type CreateNetworkRequest_NetworkMode int32 + +const ( + CreateNetworkRequest_Transparent CreateNetworkRequest_NetworkMode = 0 + CreateNetworkRequest_NAT CreateNetworkRequest_NetworkMode = 1 +) + +var CreateNetworkRequest_NetworkMode_name = map[int32]string{ + 0: "Transparent", + 1: "NAT", +} + +var CreateNetworkRequest_NetworkMode_value = map[string]int32{ + "Transparent": 0, + "NAT": 1, +} + +func (x CreateNetworkRequest_NetworkMode) String() string { + return proto.EnumName(CreateNetworkRequest_NetworkMode_name, int32(x)) +} + +func (CreateNetworkRequest_NetworkMode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{6, 0} +} + +type CreateNetworkRequest_IpamType int32 + +const ( + CreateNetworkRequest_Static CreateNetworkRequest_IpamType = 0 + CreateNetworkRequest_DHCP CreateNetworkRequest_IpamType = 1 +) + +var CreateNetworkRequest_IpamType_name = map[int32]string{ + 0: "Static", + 1: "DHCP", +} + +var CreateNetworkRequest_IpamType_value = map[string]int32{ + "Static": 0, + "DHCP": 1, +} + +func (x CreateNetworkRequest_IpamType) String() string { + return proto.EnumName(CreateNetworkRequest_IpamType_name, int32(x)) +} + +func (CreateNetworkRequest_IpamType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{6, 1} +} + +type AddNICRequest struct { + ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + NicID string `protobuf:"bytes,2,opt,name=nic_id,json=nicId,proto3" json:"nic_id,omitempty"` + EndpointName string `protobuf:"bytes,3,opt,name=endpoint_name,json=endpointName,proto3" json:"endpoint_name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddNICRequest) Reset() { *m = AddNICRequest{} } +func (*AddNICRequest) ProtoMessage() {} +func (*AddNICRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{0} +} +func (m *AddNICRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddNICRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddNICRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AddNICRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddNICRequest.Merge(m, src) +} +func (m *AddNICRequest) XXX_Size() int { + return m.Size() +} +func (m *AddNICRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AddNICRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AddNICRequest proto.InternalMessageInfo + +type AddNICResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddNICResponse) Reset() { *m = AddNICResponse{} } +func (*AddNICResponse) ProtoMessage() {} +func (*AddNICResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{1} +} +func (m *AddNICResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddNICResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddNICResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AddNICResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddNICResponse.Merge(m, src) +} +func (m *AddNICResponse) XXX_Size() int { + return m.Size() +} +func (m *AddNICResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AddNICResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AddNICResponse proto.InternalMessageInfo + +type ModifyNICRequest struct { + ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + NicID string `protobuf:"bytes,2,opt,name=nic_id,json=nicId,proto3" json:"nic_id,omitempty"` + EndpointName string `protobuf:"bytes,3,opt,name=endpoint_name,json=endpointName,proto3" json:"endpoint_name,omitempty"` + IovPolicySettings *IovEndpointPolicySetting `protobuf:"bytes,4,opt,name=iov_policy_settings,json=iovPolicySettings,proto3" json:"iov_policy_settings,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ModifyNICRequest) Reset() { *m = ModifyNICRequest{} } +func (*ModifyNICRequest) ProtoMessage() {} +func (*ModifyNICRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{2} +} +func (m *ModifyNICRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ModifyNICRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ModifyNICRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ModifyNICRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ModifyNICRequest.Merge(m, src) +} +func (m *ModifyNICRequest) XXX_Size() int { + return m.Size() +} +func (m *ModifyNICRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ModifyNICRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ModifyNICRequest proto.InternalMessageInfo + +type ModifyNICResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ModifyNICResponse) Reset() { *m = ModifyNICResponse{} } +func (*ModifyNICResponse) ProtoMessage() {} +func (*ModifyNICResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{3} +} +func (m *ModifyNICResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ModifyNICResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ModifyNICResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ModifyNICResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ModifyNICResponse.Merge(m, src) +} +func (m *ModifyNICResponse) XXX_Size() int { + return m.Size() +} +func (m *ModifyNICResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ModifyNICResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ModifyNICResponse proto.InternalMessageInfo + +type DeleteNICRequest struct { + ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + NicID string `protobuf:"bytes,2,opt,name=nic_id,json=nicId,proto3" json:"nic_id,omitempty"` + EndpointName string `protobuf:"bytes,3,opt,name=endpoint_name,json=endpointName,proto3" json:"endpoint_name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteNICRequest) Reset() { *m = DeleteNICRequest{} } +func (*DeleteNICRequest) ProtoMessage() {} +func (*DeleteNICRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{4} +} +func (m *DeleteNICRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteNICRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteNICRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DeleteNICRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteNICRequest.Merge(m, src) +} +func (m *DeleteNICRequest) XXX_Size() int { + return m.Size() +} +func (m *DeleteNICRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteNICRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteNICRequest proto.InternalMessageInfo + +type DeleteNICResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteNICResponse) Reset() { *m = DeleteNICResponse{} } +func (*DeleteNICResponse) ProtoMessage() {} +func (*DeleteNICResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{5} +} +func (m *DeleteNICResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteNICResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteNICResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DeleteNICResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteNICResponse.Merge(m, src) +} +func (m *DeleteNICResponse) XXX_Size() int { + return m.Size() +} +func (m *DeleteNICResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteNICResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteNICResponse proto.InternalMessageInfo + +type CreateNetworkRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Mode CreateNetworkRequest_NetworkMode `protobuf:"varint,2,opt,name=mode,proto3,enum=ncproxygrpc.CreateNetworkRequest_NetworkMode" json:"mode,omitempty"` + SwitchName string `protobuf:"bytes,3,opt,name=switch_name,json=switchName,proto3" json:"switch_name,omitempty"` + IpamType CreateNetworkRequest_IpamType `protobuf:"varint,4,opt,name=ipam_type,json=ipamType,proto3,enum=ncproxygrpc.CreateNetworkRequest_IpamType" json:"ipam_type,omitempty"` + SubnetIpaddressPrefix []string `protobuf:"bytes,5,rep,name=subnet_ipaddress_prefix,json=subnetIpaddressPrefix,proto3" json:"subnet_ipaddress_prefix,omitempty"` + DefaultGateway string `protobuf:"bytes,6,opt,name=default_gateway,json=defaultGateway,proto3" json:"default_gateway,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateNetworkRequest) Reset() { *m = CreateNetworkRequest{} } +func (*CreateNetworkRequest) ProtoMessage() {} +func (*CreateNetworkRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{6} +} +func (m *CreateNetworkRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreateNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreateNetworkRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CreateNetworkRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateNetworkRequest.Merge(m, src) +} +func (m *CreateNetworkRequest) XXX_Size() int { + return m.Size() +} +func (m *CreateNetworkRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateNetworkRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateNetworkRequest proto.InternalMessageInfo + +type CreateNetworkResponse struct { + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateNetworkResponse) Reset() { *m = CreateNetworkResponse{} } +func (*CreateNetworkResponse) ProtoMessage() {} +func (*CreateNetworkResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{7} +} +func (m *CreateNetworkResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreateNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreateNetworkResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CreateNetworkResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateNetworkResponse.Merge(m, src) +} +func (m *CreateNetworkResponse) XXX_Size() int { + return m.Size() +} +func (m *CreateNetworkResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CreateNetworkResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateNetworkResponse proto.InternalMessageInfo + +type PortNameEndpointPolicySetting struct { + PortName string `protobuf:"bytes,1,opt,name=port_name,json=portName,proto3" json:"port_name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PortNameEndpointPolicySetting) Reset() { *m = PortNameEndpointPolicySetting{} } +func (*PortNameEndpointPolicySetting) ProtoMessage() {} +func (*PortNameEndpointPolicySetting) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{8} +} +func (m *PortNameEndpointPolicySetting) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PortNameEndpointPolicySetting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PortNameEndpointPolicySetting.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PortNameEndpointPolicySetting) XXX_Merge(src proto.Message) { + xxx_messageInfo_PortNameEndpointPolicySetting.Merge(m, src) +} +func (m *PortNameEndpointPolicySetting) XXX_Size() int { + return m.Size() +} +func (m *PortNameEndpointPolicySetting) XXX_DiscardUnknown() { + xxx_messageInfo_PortNameEndpointPolicySetting.DiscardUnknown(m) +} + +var xxx_messageInfo_PortNameEndpointPolicySetting proto.InternalMessageInfo + +type IovEndpointPolicySetting struct { + IovOffloadWeight uint32 `protobuf:"varint,1,opt,name=iov_offload_weight,json=iovOffloadWeight,proto3" json:"iov_offload_weight,omitempty"` + QueuePairsRequested uint32 `protobuf:"varint,2,opt,name=queue_pairs_requested,json=queuePairsRequested,proto3" json:"queue_pairs_requested,omitempty"` + InterruptModeration uint32 `protobuf:"varint,3,opt,name=interrupt_moderation,json=interruptModeration,proto3" json:"interrupt_moderation,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *IovEndpointPolicySetting) Reset() { *m = IovEndpointPolicySetting{} } +func (*IovEndpointPolicySetting) ProtoMessage() {} +func (*IovEndpointPolicySetting) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{9} +} +func (m *IovEndpointPolicySetting) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IovEndpointPolicySetting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IovEndpointPolicySetting.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *IovEndpointPolicySetting) XXX_Merge(src proto.Message) { + xxx_messageInfo_IovEndpointPolicySetting.Merge(m, src) +} +func (m *IovEndpointPolicySetting) XXX_Size() int { + return m.Size() +} +func (m *IovEndpointPolicySetting) XXX_DiscardUnknown() { + xxx_messageInfo_IovEndpointPolicySetting.DiscardUnknown(m) +} + +var xxx_messageInfo_IovEndpointPolicySetting proto.InternalMessageInfo + +type DnsSetting struct { + ServerIpAddrs []string `protobuf:"bytes,1,rep,name=server_ip_addrs,json=serverIpAddrs,proto3" json:"server_ip_addrs,omitempty"` + Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` + Search []string `protobuf:"bytes,3,rep,name=search,proto3" json:"search,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DnsSetting) Reset() { *m = DnsSetting{} } +func (*DnsSetting) ProtoMessage() {} +func (*DnsSetting) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{10} +} +func (m *DnsSetting) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DnsSetting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DnsSetting.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DnsSetting) XXX_Merge(src proto.Message) { + xxx_messageInfo_DnsSetting.Merge(m, src) +} +func (m *DnsSetting) XXX_Size() int { + return m.Size() +} +func (m *DnsSetting) XXX_DiscardUnknown() { + xxx_messageInfo_DnsSetting.DiscardUnknown(m) +} + +var xxx_messageInfo_DnsSetting proto.InternalMessageInfo + +type CreateEndpointRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Macaddress string `protobuf:"bytes,2,opt,name=macaddress,proto3" json:"macaddress,omitempty"` + Ipaddress string `protobuf:"bytes,3,opt,name=ipaddress,proto3" json:"ipaddress,omitempty"` + IpaddressPrefixlength string `protobuf:"bytes,4,opt,name=ipaddress_prefixlength,json=ipaddressPrefixlength,proto3" json:"ipaddress_prefixlength,omitempty"` + NetworkName string `protobuf:"bytes,5,opt,name=network_name,json=networkName,proto3" json:"network_name,omitempty"` + PortnamePolicySetting *PortNameEndpointPolicySetting `protobuf:"bytes,6,opt,name=portname_policy_setting,json=portnamePolicySetting,proto3" json:"portname_policy_setting,omitempty"` + IovPolicySettings *IovEndpointPolicySetting `protobuf:"bytes,7,opt,name=iov_policy_settings,json=iovPolicySettings,proto3" json:"iov_policy_settings,omitempty"` + DnsSetting *DnsSetting `protobuf:"bytes,16,opt,name=dns_setting,json=dnsSetting,proto3" json:"dns_setting,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateEndpointRequest) Reset() { *m = CreateEndpointRequest{} } +func (*CreateEndpointRequest) ProtoMessage() {} +func (*CreateEndpointRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{11} +} +func (m *CreateEndpointRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreateEndpointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreateEndpointRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CreateEndpointRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateEndpointRequest.Merge(m, src) +} +func (m *CreateEndpointRequest) XXX_Size() int { + return m.Size() +} +func (m *CreateEndpointRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateEndpointRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateEndpointRequest proto.InternalMessageInfo + +type CreateEndpointResponse struct { + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateEndpointResponse) Reset() { *m = CreateEndpointResponse{} } +func (*CreateEndpointResponse) ProtoMessage() {} +func (*CreateEndpointResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{12} +} +func (m *CreateEndpointResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreateEndpointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreateEndpointResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CreateEndpointResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateEndpointResponse.Merge(m, src) +} +func (m *CreateEndpointResponse) XXX_Size() int { + return m.Size() +} +func (m *CreateEndpointResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CreateEndpointResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateEndpointResponse proto.InternalMessageInfo + +type AddEndpointRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + NamespaceID string `protobuf:"bytes,2,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddEndpointRequest) Reset() { *m = AddEndpointRequest{} } +func (*AddEndpointRequest) ProtoMessage() {} +func (*AddEndpointRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{13} +} +func (m *AddEndpointRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddEndpointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddEndpointRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AddEndpointRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddEndpointRequest.Merge(m, src) +} +func (m *AddEndpointRequest) XXX_Size() int { + return m.Size() +} +func (m *AddEndpointRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AddEndpointRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AddEndpointRequest proto.InternalMessageInfo + +type AddEndpointResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddEndpointResponse) Reset() { *m = AddEndpointResponse{} } +func (*AddEndpointResponse) ProtoMessage() {} +func (*AddEndpointResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{14} +} +func (m *AddEndpointResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddEndpointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddEndpointResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AddEndpointResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddEndpointResponse.Merge(m, src) +} +func (m *AddEndpointResponse) XXX_Size() int { + return m.Size() +} +func (m *AddEndpointResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AddEndpointResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AddEndpointResponse proto.InternalMessageInfo + +type DeleteEndpointRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteEndpointRequest) Reset() { *m = DeleteEndpointRequest{} } +func (*DeleteEndpointRequest) ProtoMessage() {} +func (*DeleteEndpointRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{15} +} +func (m *DeleteEndpointRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteEndpointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteEndpointRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DeleteEndpointRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteEndpointRequest.Merge(m, src) +} +func (m *DeleteEndpointRequest) XXX_Size() int { + return m.Size() +} +func (m *DeleteEndpointRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteEndpointRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteEndpointRequest proto.InternalMessageInfo + +type DeleteEndpointResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteEndpointResponse) Reset() { *m = DeleteEndpointResponse{} } +func (*DeleteEndpointResponse) ProtoMessage() {} +func (*DeleteEndpointResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{16} +} +func (m *DeleteEndpointResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteEndpointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteEndpointResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DeleteEndpointResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteEndpointResponse.Merge(m, src) +} +func (m *DeleteEndpointResponse) XXX_Size() int { + return m.Size() +} +func (m *DeleteEndpointResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteEndpointResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteEndpointResponse proto.InternalMessageInfo + +type DeleteNetworkRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteNetworkRequest) Reset() { *m = DeleteNetworkRequest{} } +func (*DeleteNetworkRequest) ProtoMessage() {} +func (*DeleteNetworkRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{17} +} +func (m *DeleteNetworkRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteNetworkRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DeleteNetworkRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteNetworkRequest.Merge(m, src) +} +func (m *DeleteNetworkRequest) XXX_Size() int { + return m.Size() +} +func (m *DeleteNetworkRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteNetworkRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteNetworkRequest proto.InternalMessageInfo + +type DeleteNetworkResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteNetworkResponse) Reset() { *m = DeleteNetworkResponse{} } +func (*DeleteNetworkResponse) ProtoMessage() {} +func (*DeleteNetworkResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{18} +} +func (m *DeleteNetworkResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteNetworkResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DeleteNetworkResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteNetworkResponse.Merge(m, src) +} +func (m *DeleteNetworkResponse) XXX_Size() int { + return m.Size() +} +func (m *DeleteNetworkResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteNetworkResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteNetworkResponse proto.InternalMessageInfo + +type GetEndpointRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetEndpointRequest) Reset() { *m = GetEndpointRequest{} } +func (*GetEndpointRequest) ProtoMessage() {} +func (*GetEndpointRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{19} +} +func (m *GetEndpointRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetEndpointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetEndpointRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetEndpointRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetEndpointRequest.Merge(m, src) +} +func (m *GetEndpointRequest) XXX_Size() int { + return m.Size() +} +func (m *GetEndpointRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetEndpointRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetEndpointRequest proto.InternalMessageInfo + +type GetEndpointResponse struct { + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Network string `protobuf:"bytes,3,opt,name=network,proto3" json:"network,omitempty"` + Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"` + DnsSetting *DnsSetting `protobuf:"bytes,5,opt,name=dns_setting,json=dnsSetting,proto3" json:"dns_setting,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetEndpointResponse) Reset() { *m = GetEndpointResponse{} } +func (*GetEndpointResponse) ProtoMessage() {} +func (*GetEndpointResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{20} +} +func (m *GetEndpointResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetEndpointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetEndpointResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetEndpointResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetEndpointResponse.Merge(m, src) +} +func (m *GetEndpointResponse) XXX_Size() int { + return m.Size() +} +func (m *GetEndpointResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetEndpointResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetEndpointResponse proto.InternalMessageInfo + +type GetNetworkRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetNetworkRequest) Reset() { *m = GetNetworkRequest{} } +func (*GetNetworkRequest) ProtoMessage() {} +func (*GetNetworkRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{21} +} +func (m *GetNetworkRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetNetworkRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetNetworkRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNetworkRequest.Merge(m, src) +} +func (m *GetNetworkRequest) XXX_Size() int { + return m.Size() +} +func (m *GetNetworkRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetNetworkRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetNetworkRequest proto.InternalMessageInfo + +type GetNetworkResponse struct { + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetNetworkResponse) Reset() { *m = GetNetworkResponse{} } +func (*GetNetworkResponse) ProtoMessage() {} +func (*GetNetworkResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{22} +} +func (m *GetNetworkResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetNetworkResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetNetworkResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNetworkResponse.Merge(m, src) +} +func (m *GetNetworkResponse) XXX_Size() int { + return m.Size() +} +func (m *GetNetworkResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetNetworkResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetNetworkResponse proto.InternalMessageInfo + +type GetEndpointsRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetEndpointsRequest) Reset() { *m = GetEndpointsRequest{} } +func (*GetEndpointsRequest) ProtoMessage() {} +func (*GetEndpointsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{23} +} +func (m *GetEndpointsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetEndpointsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetEndpointsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetEndpointsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetEndpointsRequest.Merge(m, src) +} +func (m *GetEndpointsRequest) XXX_Size() int { + return m.Size() +} +func (m *GetEndpointsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetEndpointsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetEndpointsRequest proto.InternalMessageInfo + +type GetEndpointsResponse struct { + Endpoints []*GetEndpointResponse `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetEndpointsResponse) Reset() { *m = GetEndpointsResponse{} } +func (*GetEndpointsResponse) ProtoMessage() {} +func (*GetEndpointsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{24} +} +func (m *GetEndpointsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetEndpointsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetEndpointsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetEndpointsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetEndpointsResponse.Merge(m, src) +} +func (m *GetEndpointsResponse) XXX_Size() int { + return m.Size() +} +func (m *GetEndpointsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetEndpointsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetEndpointsResponse proto.InternalMessageInfo + +type GetNetworksRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetNetworksRequest) Reset() { *m = GetNetworksRequest{} } +func (*GetNetworksRequest) ProtoMessage() {} +func (*GetNetworksRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{25} +} +func (m *GetNetworksRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetNetworksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetNetworksRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetNetworksRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNetworksRequest.Merge(m, src) +} +func (m *GetNetworksRequest) XXX_Size() int { + return m.Size() +} +func (m *GetNetworksRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetNetworksRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetNetworksRequest proto.InternalMessageInfo + +type GetNetworksResponse struct { + Networks []*GetNetworkResponse `protobuf:"bytes,1,rep,name=networks,proto3" json:"networks,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetNetworksResponse) Reset() { *m = GetNetworksResponse{} } +func (*GetNetworksResponse) ProtoMessage() {} +func (*GetNetworksResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2f3a1f7794389dcf, []int{26} +} +func (m *GetNetworksResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetNetworksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetNetworksResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetNetworksResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNetworksResponse.Merge(m, src) +} +func (m *GetNetworksResponse) XXX_Size() int { + return m.Size() +} +func (m *GetNetworksResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetNetworksResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetNetworksResponse proto.InternalMessageInfo + +func init() { + proto.RegisterEnum("ncproxygrpc.CreateNetworkRequest_NetworkMode", CreateNetworkRequest_NetworkMode_name, CreateNetworkRequest_NetworkMode_value) + proto.RegisterEnum("ncproxygrpc.CreateNetworkRequest_IpamType", CreateNetworkRequest_IpamType_name, CreateNetworkRequest_IpamType_value) + proto.RegisterType((*AddNICRequest)(nil), "ncproxygrpc.AddNICRequest") + proto.RegisterType((*AddNICResponse)(nil), "ncproxygrpc.AddNICResponse") + proto.RegisterType((*ModifyNICRequest)(nil), "ncproxygrpc.ModifyNICRequest") + proto.RegisterType((*ModifyNICResponse)(nil), "ncproxygrpc.ModifyNICResponse") + proto.RegisterType((*DeleteNICRequest)(nil), "ncproxygrpc.DeleteNICRequest") + proto.RegisterType((*DeleteNICResponse)(nil), "ncproxygrpc.DeleteNICResponse") + proto.RegisterType((*CreateNetworkRequest)(nil), "ncproxygrpc.CreateNetworkRequest") + proto.RegisterType((*CreateNetworkResponse)(nil), "ncproxygrpc.CreateNetworkResponse") + proto.RegisterType((*PortNameEndpointPolicySetting)(nil), "ncproxygrpc.PortNameEndpointPolicySetting") + proto.RegisterType((*IovEndpointPolicySetting)(nil), "ncproxygrpc.IovEndpointPolicySetting") + proto.RegisterType((*DnsSetting)(nil), "ncproxygrpc.DnsSetting") + proto.RegisterType((*CreateEndpointRequest)(nil), "ncproxygrpc.CreateEndpointRequest") + proto.RegisterType((*CreateEndpointResponse)(nil), "ncproxygrpc.CreateEndpointResponse") + proto.RegisterType((*AddEndpointRequest)(nil), "ncproxygrpc.AddEndpointRequest") + proto.RegisterType((*AddEndpointResponse)(nil), "ncproxygrpc.AddEndpointResponse") + proto.RegisterType((*DeleteEndpointRequest)(nil), "ncproxygrpc.DeleteEndpointRequest") + proto.RegisterType((*DeleteEndpointResponse)(nil), "ncproxygrpc.DeleteEndpointResponse") + proto.RegisterType((*DeleteNetworkRequest)(nil), "ncproxygrpc.DeleteNetworkRequest") + proto.RegisterType((*DeleteNetworkResponse)(nil), "ncproxygrpc.DeleteNetworkResponse") + proto.RegisterType((*GetEndpointRequest)(nil), "ncproxygrpc.GetEndpointRequest") + proto.RegisterType((*GetEndpointResponse)(nil), "ncproxygrpc.GetEndpointResponse") + proto.RegisterType((*GetNetworkRequest)(nil), "ncproxygrpc.GetNetworkRequest") + proto.RegisterType((*GetNetworkResponse)(nil), "ncproxygrpc.GetNetworkResponse") + proto.RegisterType((*GetEndpointsRequest)(nil), "ncproxygrpc.GetEndpointsRequest") + proto.RegisterType((*GetEndpointsResponse)(nil), "ncproxygrpc.GetEndpointsResponse") + proto.RegisterType((*GetNetworksRequest)(nil), "ncproxygrpc.GetNetworksRequest") + proto.RegisterType((*GetNetworksResponse)(nil), "ncproxygrpc.GetNetworksResponse") +} + +func init() { + proto.RegisterFile("github.com/Microsoft/hcsshim/pkg/ncproxy/ncproxygrpc/v0/networkconfigproxy.proto", fileDescriptor_2f3a1f7794389dcf) +} + +var fileDescriptor_2f3a1f7794389dcf = []byte{ + // 1279 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcf, 0x6f, 0xe3, 0xc4, + 0x17, 0x8f, 0xfb, 0x23, 0x9b, 0x3c, 0x37, 0x6d, 0x3a, 0x69, 0xda, 0x28, 0xfb, 0xdd, 0x24, 0x3b, + 0xab, 0x2f, 0x5b, 0x2d, 0xd0, 0x2c, 0x41, 0xfc, 0x90, 0x40, 0x88, 0x6e, 0x8b, 0x4a, 0x10, 0xed, + 0x46, 0xde, 0x2e, 0x20, 0x40, 0xb2, 0x5c, 0x7b, 0x92, 0x8c, 0xb6, 0xf1, 0x78, 0xed, 0x49, 0xba, + 0xb9, 0x21, 0x71, 0x40, 0x42, 0xe2, 0x6f, 0xe1, 0xc0, 0x85, 0x13, 0xe7, 0x3d, 0x72, 0xe4, 0xb4, + 0x62, 0x23, 0xfe, 0x10, 0xe4, 0xf1, 0xd8, 0xb1, 0x4d, 0x92, 0x46, 0x70, 0xd9, 0x53, 0xec, 0xf7, + 0xde, 0xbc, 0xf9, 0xcc, 0x7b, 0x9f, 0xf7, 0xf1, 0x04, 0x3a, 0x3d, 0xca, 0xfb, 0xc3, 0x8b, 0x03, + 0x93, 0x0d, 0x9a, 0xa7, 0xd4, 0x74, 0x99, 0xc7, 0xba, 0xbc, 0xd9, 0x37, 0x3d, 0xaf, 0x4f, 0x07, + 0x4d, 0xe7, 0x49, 0xaf, 0x69, 0x9b, 0x8e, 0xcb, 0x9e, 0x8d, 0xc3, 0xdf, 0x9e, 0xeb, 0x98, 0xcd, + 0xd1, 0xfd, 0xa6, 0x4d, 0xf8, 0x15, 0x73, 0x9f, 0x98, 0xcc, 0xee, 0xd2, 0x9e, 0xf0, 0x1c, 0x38, + 0x2e, 0xe3, 0x0c, 0xa9, 0xb1, 0x40, 0xfc, 0xa3, 0x02, 0x85, 0x43, 0xcb, 0x3a, 0x6b, 0x1f, 0x69, + 0xe4, 0xe9, 0x90, 0x78, 0x1c, 0xb5, 0x60, 0xc3, 0x64, 0x36, 0x37, 0xa8, 0x4d, 0x5c, 0x9d, 0x5a, + 0x15, 0xa5, 0xa1, 0xec, 0xe7, 0x1f, 0x6c, 0x4d, 0x5e, 0xd4, 0xd5, 0xa3, 0xd0, 0xde, 0x3e, 0xd6, + 0xd4, 0x28, 0xa8, 0x6d, 0xa1, 0x06, 0x64, 0x6d, 0x6a, 0xfa, 0xd1, 0x2b, 0x22, 0x3a, 0x3f, 0x79, + 0x51, 0x5f, 0x3f, 0xa3, 0x66, 0xfb, 0x58, 0x5b, 0xb7, 0xa9, 0xd9, 0xb6, 0xd0, 0x1d, 0x28, 0x10, + 0xdb, 0x72, 0x18, 0xb5, 0xb9, 0x6e, 0x1b, 0x03, 0x52, 0x59, 0xf5, 0x03, 0xb5, 0x8d, 0xd0, 0x78, + 0x66, 0x0c, 0x08, 0x2e, 0xc2, 0x66, 0x88, 0xc5, 0x73, 0x98, 0xed, 0x11, 0xfc, 0x97, 0x02, 0xc5, + 0x53, 0x66, 0xd1, 0xee, 0xf8, 0x95, 0x40, 0x88, 0x1e, 0x43, 0x89, 0xb2, 0x91, 0xee, 0xb0, 0x4b, + 0x6a, 0x8e, 0x75, 0x8f, 0x70, 0x4e, 0xed, 0x9e, 0x57, 0x59, 0x6b, 0x28, 0xfb, 0x6a, 0xeb, 0xff, + 0x07, 0xb1, 0xca, 0x1e, 0xb4, 0xd9, 0xe8, 0x13, 0xb9, 0xb4, 0x23, 0xc2, 0x1f, 0x05, 0xd1, 0xda, + 0x36, 0x65, 0xa3, 0x84, 0xc5, 0xc3, 0x25, 0xd8, 0x8e, 0x9d, 0x52, 0x9e, 0xfd, 0x27, 0x05, 0x8a, + 0xc7, 0xe4, 0x92, 0x70, 0xf2, 0x6a, 0x74, 0xa7, 0x04, 0xdb, 0x31, 0x38, 0x12, 0xe4, 0xf7, 0xab, + 0xb0, 0x73, 0xe4, 0x12, 0x83, 0x93, 0xb3, 0x80, 0x6f, 0x21, 0x50, 0x04, 0x6b, 0x22, 0x93, 0x00, + 0xa8, 0x89, 0x67, 0x74, 0x08, 0x6b, 0x03, 0x66, 0x11, 0x01, 0x63, 0xb3, 0xf5, 0x66, 0xa2, 0x5c, + 0xb3, 0x92, 0x1c, 0xc8, 0xd7, 0x53, 0x66, 0x11, 0x4d, 0x2c, 0x45, 0x75, 0x50, 0xbd, 0x2b, 0xca, + 0xcd, 0x7e, 0x1c, 0x27, 0x04, 0x26, 0xd1, 0xa1, 0x13, 0xc8, 0x53, 0xc7, 0x18, 0xe8, 0x7c, 0xec, + 0x10, 0xd1, 0x97, 0xcd, 0xd6, 0xbd, 0xeb, 0x37, 0x6a, 0x3b, 0xc6, 0xe0, 0x7c, 0xec, 0x10, 0x2d, + 0x47, 0xe5, 0x13, 0x7a, 0x17, 0xf6, 0xbc, 0xe1, 0x85, 0x4d, 0xb8, 0x4e, 0x1d, 0xc3, 0xb2, 0x5c, + 0xe2, 0x79, 0xba, 0xe3, 0x92, 0x2e, 0x7d, 0x56, 0x59, 0x6f, 0xac, 0xee, 0xe7, 0xb5, 0x72, 0xe0, + 0x6e, 0x87, 0xde, 0x8e, 0x70, 0xa2, 0xbb, 0xb0, 0x65, 0x91, 0xae, 0x31, 0xbc, 0xe4, 0x7a, 0xcf, + 0xe0, 0xe4, 0xca, 0x18, 0x57, 0xb2, 0x02, 0xe5, 0xa6, 0x34, 0x9f, 0x04, 0x56, 0x7c, 0x17, 0xd4, + 0xd8, 0xf9, 0xd0, 0x16, 0xa8, 0xe7, 0xae, 0x61, 0x7b, 0x8e, 0xe1, 0x12, 0x9b, 0x17, 0x33, 0xe8, + 0x06, 0xac, 0x9e, 0x1d, 0x9e, 0x17, 0x15, 0xdc, 0x80, 0x5c, 0x88, 0x0f, 0x01, 0x64, 0x1f, 0x71, + 0x83, 0x53, 0xb3, 0x98, 0x41, 0x39, 0x58, 0x3b, 0xfe, 0xf4, 0xa8, 0x53, 0x54, 0x70, 0x13, 0xca, + 0xa9, 0x63, 0x05, 0xed, 0x41, 0xbb, 0xb0, 0x12, 0x91, 0x24, 0x3b, 0x79, 0x51, 0x5f, 0x69, 0x1f, + 0x6b, 0x2b, 0xd4, 0xc2, 0x1f, 0xc2, 0xad, 0x0e, 0x73, 0x45, 0x5f, 0x67, 0x92, 0x14, 0xdd, 0x84, + 0xbc, 0xc3, 0x5c, 0xc9, 0x86, 0xa0, 0x87, 0x39, 0x47, 0xae, 0xc0, 0x3f, 0x2b, 0x50, 0x99, 0x47, + 0x6f, 0xf4, 0x06, 0x20, 0x7f, 0x44, 0x58, 0xb7, 0x7b, 0xc9, 0x0c, 0x4b, 0xbf, 0x22, 0xb4, 0xd7, + 0xe7, 0x22, 0x45, 0x41, 0x2b, 0x52, 0x36, 0x7a, 0x18, 0x38, 0xbe, 0x14, 0x76, 0xd4, 0x82, 0xf2, + 0xd3, 0x21, 0x19, 0x12, 0xdd, 0x31, 0xa8, 0xeb, 0xe9, 0x6e, 0xd0, 0x0f, 0x12, 0x50, 0xb5, 0xa0, + 0x95, 0x84, 0xb3, 0xe3, 0xfb, 0xb4, 0xd0, 0x85, 0xde, 0x82, 0x1d, 0x6a, 0x73, 0xe2, 0xba, 0x43, + 0x87, 0xeb, 0x3e, 0x2b, 0x5c, 0x83, 0x53, 0x66, 0x0b, 0x32, 0x14, 0xb4, 0x52, 0xe4, 0x3b, 0x8d, + 0x5c, 0xd8, 0x02, 0x38, 0xb6, 0xbd, 0x10, 0xe2, 0x6b, 0xb0, 0xe5, 0x11, 0x77, 0xe4, 0x4f, 0x90, + 0xa3, 0xfb, 0xdd, 0xf3, 0x2a, 0x8a, 0x68, 0x69, 0x21, 0x30, 0xb7, 0x9d, 0x43, 0xdf, 0x88, 0x76, + 0x21, 0x6b, 0xb1, 0x81, 0x41, 0xed, 0x60, 0x70, 0x34, 0xf9, 0xe6, 0xdb, 0x3d, 0x62, 0xb8, 0x66, + 0xbf, 0xb2, 0x2a, 0x96, 0xc9, 0x37, 0xfc, 0xdb, 0x6a, 0xd8, 0x87, 0xb0, 0x34, 0x8b, 0xa6, 0xa1, + 0x06, 0x30, 0x30, 0x4c, 0x49, 0x1e, 0xb9, 0x43, 0xcc, 0x82, 0xfe, 0x27, 0x98, 0x2c, 0xdd, 0x01, + 0xd1, 0xa7, 0x06, 0xf4, 0x0e, 0xec, 0xa6, 0x79, 0x79, 0x49, 0xec, 0x1e, 0xef, 0x0b, 0xd2, 0xe7, + 0xb5, 0x32, 0x4d, 0xf2, 0x32, 0x70, 0xa2, 0xdb, 0xb0, 0x21, 0x3f, 0x0c, 0x41, 0x6b, 0xd7, 0x45, + 0xb0, 0x2a, 0x6d, 0x62, 0x82, 0x2e, 0x60, 0xcf, 0xef, 0xb4, 0xef, 0x4e, 0x09, 0x9d, 0x20, 0xb2, + 0x9a, 0x9a, 0xa7, 0x85, 0x3c, 0xd2, 0xca, 0x61, 0xaa, 0x24, 0x49, 0xe6, 0xe8, 0xe8, 0x8d, 0xff, + 0xa6, 0xa3, 0xe8, 0x7d, 0x50, 0x2d, 0xdb, 0x8b, 0xe0, 0x16, 0x45, 0xba, 0xbd, 0x44, 0xba, 0x29, + 0x0d, 0x34, 0xb0, 0xa2, 0xe7, 0xcf, 0xd6, 0x72, 0xb9, 0x62, 0x11, 0xdf, 0x87, 0xdd, 0x74, 0xff, + 0xae, 0x19, 0xa4, 0x6f, 0x01, 0x1d, 0x5a, 0xd6, 0x32, 0xed, 0x6e, 0xc1, 0x86, 0xff, 0xeb, 0x39, + 0x86, 0x49, 0xa6, 0x5a, 0x2c, 0x94, 0xfb, 0x2c, 0xb4, 0xfb, 0xca, 0x1d, 0x05, 0xb5, 0x2d, 0x5c, + 0x86, 0x52, 0x22, 0xbb, 0x14, 0xdd, 0xd7, 0xa1, 0x1c, 0x28, 0xf1, 0x12, 0xfb, 0xe2, 0x0a, 0xec, + 0xa6, 0x83, 0x65, 0x9a, 0x7b, 0xb0, 0x23, 0x05, 0xfd, 0x5a, 0xe9, 0xc6, 0x7b, 0xe1, 0x96, 0x29, + 0x85, 0xc1, 0xfb, 0x80, 0x4e, 0x08, 0x5f, 0x06, 0xc8, 0x2f, 0x0a, 0x94, 0x12, 0xa1, 0x8b, 0x4b, + 0x1b, 0xe5, 0x58, 0x89, 0x15, 0xb1, 0x02, 0x37, 0x24, 0x55, 0xe5, 0x44, 0x84, 0xaf, 0xfe, 0xb4, + 0x44, 0x95, 0x93, 0x23, 0x30, 0x35, 0xa4, 0x89, 0xb1, 0xbe, 0x34, 0x31, 0xf0, 0x5d, 0xd8, 0x3e, + 0x21, 0x7c, 0x89, 0x0a, 0x7d, 0x2c, 0x0a, 0xb1, 0xa4, 0x00, 0xcf, 0x3a, 0x9c, 0xdf, 0xed, 0x58, + 0x7d, 0x42, 0xc1, 0xc3, 0x5f, 0xc0, 0x4e, 0xd2, 0x2c, 0x53, 0x7f, 0x04, 0xf9, 0xf0, 0xfb, 0x1c, + 0xe8, 0x97, 0xda, 0x6a, 0x24, 0x4e, 0x34, 0xa3, 0xd8, 0xda, 0x74, 0x09, 0xde, 0x89, 0x03, 0x8e, + 0x76, 0xd3, 0x04, 0x88, 0xa9, 0x55, 0x6e, 0xf6, 0x01, 0xe4, 0x64, 0xa5, 0xc3, 0xbd, 0xea, 0xe9, + 0xbd, 0x52, 0x47, 0xd7, 0xa2, 0x05, 0xad, 0x1f, 0x72, 0x80, 0xa4, 0xf7, 0x48, 0x5c, 0x47, 0x3b, + 0xfe, 0x3a, 0x74, 0x04, 0xd9, 0xe0, 0xba, 0x87, 0xaa, 0x89, 0x5c, 0x89, 0xfb, 0x68, 0xf5, 0xe6, + 0x4c, 0x9f, 0x64, 0x5f, 0x06, 0x7d, 0x0e, 0xf9, 0xe8, 0xea, 0x84, 0x6e, 0x25, 0x62, 0xd3, 0x17, + 0xc7, 0x6a, 0x6d, 0x9e, 0x3b, 0x9e, 0x2d, 0xba, 0xe3, 0xa4, 0xb2, 0xa5, 0xaf, 0x62, 0xa9, 0x6c, + 0xff, 0xbc, 0x1a, 0x65, 0xd0, 0x57, 0x50, 0x48, 0x7c, 0x96, 0xd1, 0xed, 0x6b, 0x6f, 0x22, 0x55, + 0xbc, 0x28, 0x24, 0xca, 0xfc, 0x0d, 0x6c, 0x26, 0x85, 0x0a, 0xcd, 0x5a, 0x97, 0x9a, 0xca, 0xea, + 0x9d, 0x85, 0x31, 0x51, 0x72, 0x0d, 0xd4, 0x98, 0xea, 0xa0, 0x7a, 0xba, 0x01, 0xe9, 0xb4, 0x8d, + 0xf9, 0x01, 0x71, 0xc0, 0x49, 0x15, 0x4a, 0x01, 0x9e, 0xa9, 0x67, 0x29, 0xc0, 0x73, 0x64, 0x4c, + 0xd4, 0x39, 0x21, 0x4e, 0xa9, 0x3a, 0xcf, 0x12, 0xb9, 0x2a, 0x5e, 0x14, 0x12, 0x2f, 0x45, 0x6c, + 0x8a, 0x50, 0x7d, 0xfe, 0x7c, 0xcd, 0x2a, 0xc5, 0x8c, 0x01, 0xc4, 0x19, 0xf4, 0x10, 0x60, 0x3a, + 0x2d, 0xa8, 0x36, 0x77, 0x8c, 0x82, 0x8c, 0xd7, 0x8d, 0x19, 0xce, 0xa0, 0xc7, 0xb0, 0x11, 0x17, + 0x08, 0x34, 0x17, 0x44, 0x38, 0xe4, 0xd5, 0xdb, 0x0b, 0x22, 0x52, 0x67, 0x0f, 0x95, 0x00, 0xcd, + 0x03, 0xe2, 0xcd, 0x3d, 0x7b, 0x5a, 0x44, 0x70, 0xe6, 0xc1, 0xf9, 0xf3, 0x97, 0xb5, 0xcc, 0x1f, + 0x2f, 0x6b, 0x99, 0xef, 0x26, 0x35, 0xe5, 0xf9, 0xa4, 0xa6, 0xfc, 0x3e, 0xa9, 0x29, 0x7f, 0x4e, + 0x6a, 0xca, 0xd7, 0xef, 0xfd, 0xcb, 0xff, 0xb9, 0xbf, 0x2a, 0xca, 0x45, 0x56, 0xfc, 0xb1, 0x7d, + 0xfb, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x06, 0x98, 0x52, 0x44, 0x2c, 0x0f, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// NetworkConfigProxyClient is the client API for NetworkConfigProxy service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type NetworkConfigProxyClient interface { + AddNIC(ctx context.Context, in *AddNICRequest, opts ...grpc.CallOption) (*AddNICResponse, error) + ModifyNIC(ctx context.Context, in *ModifyNICRequest, opts ...grpc.CallOption) (*ModifyNICResponse, error) + DeleteNIC(ctx context.Context, in *DeleteNICRequest, opts ...grpc.CallOption) (*DeleteNICResponse, error) + CreateNetwork(ctx context.Context, in *CreateNetworkRequest, opts ...grpc.CallOption) (*CreateNetworkResponse, error) + CreateEndpoint(ctx context.Context, in *CreateEndpointRequest, opts ...grpc.CallOption) (*CreateEndpointResponse, error) + AddEndpoint(ctx context.Context, in *AddEndpointRequest, opts ...grpc.CallOption) (*AddEndpointResponse, error) + DeleteEndpoint(ctx context.Context, in *DeleteEndpointRequest, opts ...grpc.CallOption) (*DeleteEndpointResponse, error) + DeleteNetwork(ctx context.Context, in *DeleteNetworkRequest, opts ...grpc.CallOption) (*DeleteNetworkResponse, error) + GetEndpoint(ctx context.Context, in *GetEndpointRequest, opts ...grpc.CallOption) (*GetEndpointResponse, error) + GetNetwork(ctx context.Context, in *GetNetworkRequest, opts ...grpc.CallOption) (*GetNetworkResponse, error) + GetEndpoints(ctx context.Context, in *GetEndpointsRequest, opts ...grpc.CallOption) (*GetEndpointsResponse, error) + GetNetworks(ctx context.Context, in *GetNetworksRequest, opts ...grpc.CallOption) (*GetNetworksResponse, error) +} + +type networkConfigProxyClient struct { + cc *grpc.ClientConn +} + +func NewNetworkConfigProxyClient(cc *grpc.ClientConn) NetworkConfigProxyClient { + return &networkConfigProxyClient{cc} +} + +func (c *networkConfigProxyClient) AddNIC(ctx context.Context, in *AddNICRequest, opts ...grpc.CallOption) (*AddNICResponse, error) { + out := new(AddNICResponse) + err := c.cc.Invoke(ctx, "/ncproxygrpc.NetworkConfigProxy/AddNIC", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *networkConfigProxyClient) ModifyNIC(ctx context.Context, in *ModifyNICRequest, opts ...grpc.CallOption) (*ModifyNICResponse, error) { + out := new(ModifyNICResponse) + err := c.cc.Invoke(ctx, "/ncproxygrpc.NetworkConfigProxy/ModifyNIC", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *networkConfigProxyClient) DeleteNIC(ctx context.Context, in *DeleteNICRequest, opts ...grpc.CallOption) (*DeleteNICResponse, error) { + out := new(DeleteNICResponse) + err := c.cc.Invoke(ctx, "/ncproxygrpc.NetworkConfigProxy/DeleteNIC", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *networkConfigProxyClient) CreateNetwork(ctx context.Context, in *CreateNetworkRequest, opts ...grpc.CallOption) (*CreateNetworkResponse, error) { + out := new(CreateNetworkResponse) + err := c.cc.Invoke(ctx, "/ncproxygrpc.NetworkConfigProxy/CreateNetwork", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *networkConfigProxyClient) CreateEndpoint(ctx context.Context, in *CreateEndpointRequest, opts ...grpc.CallOption) (*CreateEndpointResponse, error) { + out := new(CreateEndpointResponse) + err := c.cc.Invoke(ctx, "/ncproxygrpc.NetworkConfigProxy/CreateEndpoint", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *networkConfigProxyClient) AddEndpoint(ctx context.Context, in *AddEndpointRequest, opts ...grpc.CallOption) (*AddEndpointResponse, error) { + out := new(AddEndpointResponse) + err := c.cc.Invoke(ctx, "/ncproxygrpc.NetworkConfigProxy/AddEndpoint", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *networkConfigProxyClient) DeleteEndpoint(ctx context.Context, in *DeleteEndpointRequest, opts ...grpc.CallOption) (*DeleteEndpointResponse, error) { + out := new(DeleteEndpointResponse) + err := c.cc.Invoke(ctx, "/ncproxygrpc.NetworkConfigProxy/DeleteEndpoint", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *networkConfigProxyClient) DeleteNetwork(ctx context.Context, in *DeleteNetworkRequest, opts ...grpc.CallOption) (*DeleteNetworkResponse, error) { + out := new(DeleteNetworkResponse) + err := c.cc.Invoke(ctx, "/ncproxygrpc.NetworkConfigProxy/DeleteNetwork", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *networkConfigProxyClient) GetEndpoint(ctx context.Context, in *GetEndpointRequest, opts ...grpc.CallOption) (*GetEndpointResponse, error) { + out := new(GetEndpointResponse) + err := c.cc.Invoke(ctx, "/ncproxygrpc.NetworkConfigProxy/GetEndpoint", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *networkConfigProxyClient) GetNetwork(ctx context.Context, in *GetNetworkRequest, opts ...grpc.CallOption) (*GetNetworkResponse, error) { + out := new(GetNetworkResponse) + err := c.cc.Invoke(ctx, "/ncproxygrpc.NetworkConfigProxy/GetNetwork", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *networkConfigProxyClient) GetEndpoints(ctx context.Context, in *GetEndpointsRequest, opts ...grpc.CallOption) (*GetEndpointsResponse, error) { + out := new(GetEndpointsResponse) + err := c.cc.Invoke(ctx, "/ncproxygrpc.NetworkConfigProxy/GetEndpoints", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *networkConfigProxyClient) GetNetworks(ctx context.Context, in *GetNetworksRequest, opts ...grpc.CallOption) (*GetNetworksResponse, error) { + out := new(GetNetworksResponse) + err := c.cc.Invoke(ctx, "/ncproxygrpc.NetworkConfigProxy/GetNetworks", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NetworkConfigProxyServer is the server API for NetworkConfigProxy service. +type NetworkConfigProxyServer interface { + AddNIC(context.Context, *AddNICRequest) (*AddNICResponse, error) + ModifyNIC(context.Context, *ModifyNICRequest) (*ModifyNICResponse, error) + DeleteNIC(context.Context, *DeleteNICRequest) (*DeleteNICResponse, error) + CreateNetwork(context.Context, *CreateNetworkRequest) (*CreateNetworkResponse, error) + CreateEndpoint(context.Context, *CreateEndpointRequest) (*CreateEndpointResponse, error) + AddEndpoint(context.Context, *AddEndpointRequest) (*AddEndpointResponse, error) + DeleteEndpoint(context.Context, *DeleteEndpointRequest) (*DeleteEndpointResponse, error) + DeleteNetwork(context.Context, *DeleteNetworkRequest) (*DeleteNetworkResponse, error) + GetEndpoint(context.Context, *GetEndpointRequest) (*GetEndpointResponse, error) + GetNetwork(context.Context, *GetNetworkRequest) (*GetNetworkResponse, error) + GetEndpoints(context.Context, *GetEndpointsRequest) (*GetEndpointsResponse, error) + GetNetworks(context.Context, *GetNetworksRequest) (*GetNetworksResponse, error) +} + +// UnimplementedNetworkConfigProxyServer can be embedded to have forward compatible implementations. +type UnimplementedNetworkConfigProxyServer struct { +} + +func (*UnimplementedNetworkConfigProxyServer) AddNIC(ctx context.Context, req *AddNICRequest) (*AddNICResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddNIC not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) ModifyNIC(ctx context.Context, req *ModifyNICRequest) (*ModifyNICResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ModifyNIC not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) DeleteNIC(ctx context.Context, req *DeleteNICRequest) (*DeleteNICResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteNIC not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) CreateNetwork(ctx context.Context, req *CreateNetworkRequest) (*CreateNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateNetwork not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) CreateEndpoint(ctx context.Context, req *CreateEndpointRequest) (*CreateEndpointResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateEndpoint not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) AddEndpoint(ctx context.Context, req *AddEndpointRequest) (*AddEndpointResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddEndpoint not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) DeleteEndpoint(ctx context.Context, req *DeleteEndpointRequest) (*DeleteEndpointResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteEndpoint not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) DeleteNetwork(ctx context.Context, req *DeleteNetworkRequest) (*DeleteNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteNetwork not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) GetEndpoint(ctx context.Context, req *GetEndpointRequest) (*GetEndpointResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEndpoint not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) GetNetwork(ctx context.Context, req *GetNetworkRequest) (*GetNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNetwork not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) GetEndpoints(ctx context.Context, req *GetEndpointsRequest) (*GetEndpointsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEndpoints not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) GetNetworks(ctx context.Context, req *GetNetworksRequest) (*GetNetworksResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNetworks not implemented") +} + +func RegisterNetworkConfigProxyServer(s *grpc.Server, srv NetworkConfigProxyServer) { + s.RegisterService(&_NetworkConfigProxy_serviceDesc, srv) +} + +func _NetworkConfigProxy_AddNIC_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddNICRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkConfigProxyServer).AddNIC(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ncproxygrpc.NetworkConfigProxy/AddNIC", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkConfigProxyServer).AddNIC(ctx, req.(*AddNICRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetworkConfigProxy_ModifyNIC_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModifyNICRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkConfigProxyServer).ModifyNIC(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ncproxygrpc.NetworkConfigProxy/ModifyNIC", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkConfigProxyServer).ModifyNIC(ctx, req.(*ModifyNICRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetworkConfigProxy_DeleteNIC_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteNICRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkConfigProxyServer).DeleteNIC(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ncproxygrpc.NetworkConfigProxy/DeleteNIC", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkConfigProxyServer).DeleteNIC(ctx, req.(*DeleteNICRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetworkConfigProxy_CreateNetwork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateNetworkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkConfigProxyServer).CreateNetwork(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ncproxygrpc.NetworkConfigProxy/CreateNetwork", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkConfigProxyServer).CreateNetwork(ctx, req.(*CreateNetworkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetworkConfigProxy_CreateEndpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateEndpointRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkConfigProxyServer).CreateEndpoint(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ncproxygrpc.NetworkConfigProxy/CreateEndpoint", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkConfigProxyServer).CreateEndpoint(ctx, req.(*CreateEndpointRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetworkConfigProxy_AddEndpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddEndpointRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkConfigProxyServer).AddEndpoint(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ncproxygrpc.NetworkConfigProxy/AddEndpoint", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkConfigProxyServer).AddEndpoint(ctx, req.(*AddEndpointRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetworkConfigProxy_DeleteEndpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteEndpointRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkConfigProxyServer).DeleteEndpoint(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ncproxygrpc.NetworkConfigProxy/DeleteEndpoint", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkConfigProxyServer).DeleteEndpoint(ctx, req.(*DeleteEndpointRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetworkConfigProxy_DeleteNetwork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteNetworkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkConfigProxyServer).DeleteNetwork(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ncproxygrpc.NetworkConfigProxy/DeleteNetwork", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkConfigProxyServer).DeleteNetwork(ctx, req.(*DeleteNetworkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetworkConfigProxy_GetEndpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetEndpointRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkConfigProxyServer).GetEndpoint(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ncproxygrpc.NetworkConfigProxy/GetEndpoint", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkConfigProxyServer).GetEndpoint(ctx, req.(*GetEndpointRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetworkConfigProxy_GetNetwork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNetworkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkConfigProxyServer).GetNetwork(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ncproxygrpc.NetworkConfigProxy/GetNetwork", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkConfigProxyServer).GetNetwork(ctx, req.(*GetNetworkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetworkConfigProxy_GetEndpoints_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetEndpointsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkConfigProxyServer).GetEndpoints(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ncproxygrpc.NetworkConfigProxy/GetEndpoints", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkConfigProxyServer).GetEndpoints(ctx, req.(*GetEndpointsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetworkConfigProxy_GetNetworks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNetworksRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkConfigProxyServer).GetNetworks(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ncproxygrpc.NetworkConfigProxy/GetNetworks", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkConfigProxyServer).GetNetworks(ctx, req.(*GetNetworksRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _NetworkConfigProxy_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ncproxygrpc.NetworkConfigProxy", + HandlerType: (*NetworkConfigProxyServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AddNIC", + Handler: _NetworkConfigProxy_AddNIC_Handler, + }, + { + MethodName: "ModifyNIC", + Handler: _NetworkConfigProxy_ModifyNIC_Handler, + }, + { + MethodName: "DeleteNIC", + Handler: _NetworkConfigProxy_DeleteNIC_Handler, + }, + { + MethodName: "CreateNetwork", + Handler: _NetworkConfigProxy_CreateNetwork_Handler, + }, + { + MethodName: "CreateEndpoint", + Handler: _NetworkConfigProxy_CreateEndpoint_Handler, + }, + { + MethodName: "AddEndpoint", + Handler: _NetworkConfigProxy_AddEndpoint_Handler, + }, + { + MethodName: "DeleteEndpoint", + Handler: _NetworkConfigProxy_DeleteEndpoint_Handler, + }, + { + MethodName: "DeleteNetwork", + Handler: _NetworkConfigProxy_DeleteNetwork_Handler, + }, + { + MethodName: "GetEndpoint", + Handler: _NetworkConfigProxy_GetEndpoint_Handler, + }, + { + MethodName: "GetNetwork", + Handler: _NetworkConfigProxy_GetNetwork_Handler, + }, + { + MethodName: "GetEndpoints", + Handler: _NetworkConfigProxy_GetEndpoints_Handler, + }, + { + MethodName: "GetNetworks", + Handler: _NetworkConfigProxy_GetNetworks_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "github.com/Microsoft/hcsshim/pkg/ncproxy/ncproxygrpc/v0/networkconfigproxy.proto", +} + +func (m *AddNICRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AddNICRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddNICRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.EndpointName) > 0 { + i -= len(m.EndpointName) + copy(dAtA[i:], m.EndpointName) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.EndpointName))) + i-- + dAtA[i] = 0x1a + } + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x12 + } + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddNICResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AddNICResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddNICResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + +func (m *ModifyNICRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ModifyNICRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyNICRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.IovPolicySettings != nil { + { + size, err := m.IovPolicySettings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.EndpointName) > 0 { + i -= len(m.EndpointName) + copy(dAtA[i:], m.EndpointName) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.EndpointName))) + i-- + dAtA[i] = 0x1a + } + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x12 + } + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ModifyNICResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ModifyNICResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyNICResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + +func (m *DeleteNICRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeleteNICRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNICRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.EndpointName) > 0 { + i -= len(m.EndpointName) + copy(dAtA[i:], m.EndpointName) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.EndpointName))) + i-- + dAtA[i] = 0x1a + } + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x12 + } + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DeleteNICResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeleteNICResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNICResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + +func (m *CreateNetworkRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CreateNetworkRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.DefaultGateway) > 0 { + i -= len(m.DefaultGateway) + copy(dAtA[i:], m.DefaultGateway) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.DefaultGateway))) + i-- + dAtA[i] = 0x32 + } + if len(m.SubnetIpaddressPrefix) > 0 { + for iNdEx := len(m.SubnetIpaddressPrefix) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SubnetIpaddressPrefix[iNdEx]) + copy(dAtA[i:], m.SubnetIpaddressPrefix[iNdEx]) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.SubnetIpaddressPrefix[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if m.IpamType != 0 { + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IpamType)) + i-- + dAtA[i] = 0x20 + } + if len(m.SwitchName) > 0 { + i -= len(m.SwitchName) + copy(dAtA[i:], m.SwitchName) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.SwitchName))) + i-- + dAtA[i] = 0x1a + } + if m.Mode != 0 { + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CreateNetworkResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CreateNetworkResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PortNameEndpointPolicySetting) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PortNameEndpointPolicySetting) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PortNameEndpointPolicySetting) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.PortName) > 0 { + i -= len(m.PortName) + copy(dAtA[i:], m.PortName) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.PortName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *IovEndpointPolicySetting) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IovEndpointPolicySetting) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IovEndpointPolicySetting) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.InterruptModeration != 0 { + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.InterruptModeration)) + i-- + dAtA[i] = 0x18 + } + if m.QueuePairsRequested != 0 { + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.QueuePairsRequested)) + i-- + dAtA[i] = 0x10 + } + if m.IovOffloadWeight != 0 { + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IovOffloadWeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DnsSetting) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DnsSetting) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DnsSetting) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Search) > 0 { + for iNdEx := len(m.Search) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Search[iNdEx]) + copy(dAtA[i:], m.Search[iNdEx]) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Search[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0x12 + } + if len(m.ServerIpAddrs) > 0 { + for iNdEx := len(m.ServerIpAddrs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ServerIpAddrs[iNdEx]) + copy(dAtA[i:], m.ServerIpAddrs[iNdEx]) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ServerIpAddrs[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *CreateEndpointRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CreateEndpointRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateEndpointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.DnsSetting != nil { + { + size, err := m.DnsSetting.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if m.IovPolicySettings != nil { + { + size, err := m.IovPolicySettings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.PortnamePolicySetting != nil { + { + size, err := m.PortnamePolicySetting.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.NetworkName) > 0 { + i -= len(m.NetworkName) + copy(dAtA[i:], m.NetworkName) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NetworkName))) + i-- + dAtA[i] = 0x2a + } + if len(m.IpaddressPrefixlength) > 0 { + i -= len(m.IpaddressPrefixlength) + copy(dAtA[i:], m.IpaddressPrefixlength) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.IpaddressPrefixlength))) + i-- + dAtA[i] = 0x22 + } + if len(m.Ipaddress) > 0 { + i -= len(m.Ipaddress) + copy(dAtA[i:], m.Ipaddress) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Ipaddress))) + i-- + dAtA[i] = 0x1a + } + if len(m.Macaddress) > 0 { + i -= len(m.Macaddress) + copy(dAtA[i:], m.Macaddress) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Macaddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CreateEndpointResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CreateEndpointResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateEndpointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddEndpointRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AddEndpointRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddEndpointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.NamespaceID) > 0 { + i -= len(m.NamespaceID) + copy(dAtA[i:], m.NamespaceID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NamespaceID))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddEndpointResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AddEndpointResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddEndpointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + +func (m *DeleteEndpointRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeleteEndpointRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteEndpointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DeleteEndpointResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeleteEndpointResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteEndpointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + +func (m *DeleteNetworkRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeleteNetworkRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DeleteNetworkResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeleteNetworkResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + +func (m *GetEndpointRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetEndpointRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetEndpointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetEndpointResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetEndpointResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetEndpointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.DnsSetting != nil { + { + size, err := m.DnsSetting.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Namespace) > 0 { + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0x22 + } + if len(m.Network) > 0 { + i -= len(m.Network) + copy(dAtA[i:], m.Network) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Network))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetNetworkRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetNetworkRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetNetworkResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetNetworkResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetEndpointsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetEndpointsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetEndpointsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + +func (m *GetEndpointsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetEndpointsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetEndpointsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Endpoints) > 0 { + for iNdEx := len(m.Endpoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Endpoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *GetNetworksRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetNetworksRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNetworksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + +func (m *GetNetworksResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetNetworksResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNetworksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Networks) > 0 { + for iNdEx := len(m.Networks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Networks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintNetworkconfigproxy(dAtA []byte, offset int, v uint64) int { + offset -= sovNetworkconfigproxy(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AddNICRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ContainerID) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + l = len(m.NicID) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + l = len(m.EndpointName) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *AddNICResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ModifyNICRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ContainerID) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + l = len(m.NicID) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + l = len(m.EndpointName) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.IovPolicySettings != nil { + l = m.IovPolicySettings.Size() + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ModifyNICResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DeleteNICRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ContainerID) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + l = len(m.NicID) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + l = len(m.EndpointName) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DeleteNICResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *CreateNetworkRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.Mode != 0 { + n += 1 + sovNetworkconfigproxy(uint64(m.Mode)) + } + l = len(m.SwitchName) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.IpamType != 0 { + n += 1 + sovNetworkconfigproxy(uint64(m.IpamType)) + } + if len(m.SubnetIpaddressPrefix) > 0 { + for _, s := range m.SubnetIpaddressPrefix { + l = len(s) + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + } + l = len(m.DefaultGateway) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *CreateNetworkResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *PortNameEndpointPolicySetting) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortName) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *IovEndpointPolicySetting) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IovOffloadWeight != 0 { + n += 1 + sovNetworkconfigproxy(uint64(m.IovOffloadWeight)) + } + if m.QueuePairsRequested != 0 { + n += 1 + sovNetworkconfigproxy(uint64(m.QueuePairsRequested)) + } + if m.InterruptModeration != 0 { + n += 1 + sovNetworkconfigproxy(uint64(m.InterruptModeration)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DnsSetting) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ServerIpAddrs) > 0 { + for _, s := range m.ServerIpAddrs { + l = len(s) + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + } + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if len(m.Search) > 0 { + for _, s := range m.Search { + l = len(s) + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *CreateEndpointRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + l = len(m.Macaddress) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + l = len(m.Ipaddress) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + l = len(m.IpaddressPrefixlength) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + l = len(m.NetworkName) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.PortnamePolicySetting != nil { + l = m.PortnamePolicySetting.Size() + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.IovPolicySettings != nil { + l = m.IovPolicySettings.Size() + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.DnsSetting != nil { + l = m.DnsSetting.Size() + n += 2 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *CreateEndpointResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *AddEndpointRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + l = len(m.NamespaceID) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *AddEndpointResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DeleteEndpointRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DeleteEndpointResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DeleteNetworkRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DeleteNetworkResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *GetEndpointRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *GetEndpointResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + l = len(m.Network) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + l = len(m.Namespace) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.DnsSetting != nil { + l = m.DnsSetting.Size() + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *GetNetworkRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *GetNetworkResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *GetEndpointsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *GetEndpointsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Endpoints) > 0 { + for _, e := range m.Endpoints { + l = e.Size() + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *GetNetworksRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *GetNetworksResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Networks) > 0 { + for _, e := range m.Networks { + l = e.Size() + n += 1 + l + sovNetworkconfigproxy(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovNetworkconfigproxy(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozNetworkconfigproxy(x uint64) (n int) { + return sovNetworkconfigproxy(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *AddNICRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AddNICRequest{`, + `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, + `NicID:` + fmt.Sprintf("%v", this.NicID) + `,`, + `EndpointName:` + fmt.Sprintf("%v", this.EndpointName) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *AddNICResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AddNICResponse{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ModifyNICRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ModifyNICRequest{`, + `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, + `NicID:` + fmt.Sprintf("%v", this.NicID) + `,`, + `EndpointName:` + fmt.Sprintf("%v", this.EndpointName) + `,`, + `IovPolicySettings:` + strings.Replace(this.IovPolicySettings.String(), "IovEndpointPolicySetting", "IovEndpointPolicySetting", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ModifyNICResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ModifyNICResponse{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *DeleteNICRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeleteNICRequest{`, + `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, + `NicID:` + fmt.Sprintf("%v", this.NicID) + `,`, + `EndpointName:` + fmt.Sprintf("%v", this.EndpointName) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *DeleteNICResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeleteNICResponse{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *CreateNetworkRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CreateNetworkRequest{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Mode:` + fmt.Sprintf("%v", this.Mode) + `,`, + `SwitchName:` + fmt.Sprintf("%v", this.SwitchName) + `,`, + `IpamType:` + fmt.Sprintf("%v", this.IpamType) + `,`, + `SubnetIpaddressPrefix:` + fmt.Sprintf("%v", this.SubnetIpaddressPrefix) + `,`, + `DefaultGateway:` + fmt.Sprintf("%v", this.DefaultGateway) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *CreateNetworkResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CreateNetworkResponse{`, + `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *PortNameEndpointPolicySetting) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PortNameEndpointPolicySetting{`, + `PortName:` + fmt.Sprintf("%v", this.PortName) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *IovEndpointPolicySetting) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&IovEndpointPolicySetting{`, + `IovOffloadWeight:` + fmt.Sprintf("%v", this.IovOffloadWeight) + `,`, + `QueuePairsRequested:` + fmt.Sprintf("%v", this.QueuePairsRequested) + `,`, + `InterruptModeration:` + fmt.Sprintf("%v", this.InterruptModeration) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *DnsSetting) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DnsSetting{`, + `ServerIpAddrs:` + fmt.Sprintf("%v", this.ServerIpAddrs) + `,`, + `Domain:` + fmt.Sprintf("%v", this.Domain) + `,`, + `Search:` + fmt.Sprintf("%v", this.Search) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *CreateEndpointRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CreateEndpointRequest{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Macaddress:` + fmt.Sprintf("%v", this.Macaddress) + `,`, + `Ipaddress:` + fmt.Sprintf("%v", this.Ipaddress) + `,`, + `IpaddressPrefixlength:` + fmt.Sprintf("%v", this.IpaddressPrefixlength) + `,`, + `NetworkName:` + fmt.Sprintf("%v", this.NetworkName) + `,`, + `PortnamePolicySetting:` + strings.Replace(this.PortnamePolicySetting.String(), "PortNameEndpointPolicySetting", "PortNameEndpointPolicySetting", 1) + `,`, + `IovPolicySettings:` + strings.Replace(this.IovPolicySettings.String(), "IovEndpointPolicySetting", "IovEndpointPolicySetting", 1) + `,`, + `DnsSetting:` + strings.Replace(this.DnsSetting.String(), "DnsSetting", "DnsSetting", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *CreateEndpointResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CreateEndpointResponse{`, + `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *AddEndpointRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AddEndpointRequest{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `NamespaceID:` + fmt.Sprintf("%v", this.NamespaceID) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *AddEndpointResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AddEndpointResponse{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *DeleteEndpointRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeleteEndpointRequest{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *DeleteEndpointResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeleteEndpointResponse{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *DeleteNetworkRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeleteNetworkRequest{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *DeleteNetworkResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeleteNetworkResponse{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *GetEndpointRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetEndpointRequest{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *GetEndpointResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetEndpointResponse{`, + `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Network:` + fmt.Sprintf("%v", this.Network) + `,`, + `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, + `DnsSetting:` + strings.Replace(this.DnsSetting.String(), "DnsSetting", "DnsSetting", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *GetNetworkRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetNetworkRequest{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *GetNetworkResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetNetworkResponse{`, + `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *GetEndpointsRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetEndpointsRequest{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *GetEndpointsResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForEndpoints := "[]*GetEndpointResponse{" + for _, f := range this.Endpoints { + repeatedStringForEndpoints += strings.Replace(f.String(), "GetEndpointResponse", "GetEndpointResponse", 1) + "," + } + repeatedStringForEndpoints += "}" + s := strings.Join([]string{`&GetEndpointsResponse{`, + `Endpoints:` + repeatedStringForEndpoints + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *GetNetworksRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetNetworksRequest{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *GetNetworksResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForNetworks := "[]*GetNetworkResponse{" + for _, f := range this.Networks { + repeatedStringForNetworks += strings.Replace(f.String(), "GetNetworkResponse", "GetNetworkResponse", 1) + "," + } + repeatedStringForNetworks += "}" + s := strings.Join([]string{`&GetNetworksResponse{`, + `Networks:` + repeatedStringForNetworks + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func valueToStringNetworkconfigproxy(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *AddNICRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AddNICRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddNICRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NicID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NicID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndpointName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EndpointName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddNICResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AddNICResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddNICResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ModifyNICRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ModifyNICRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModifyNICRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NicID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NicID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndpointName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EndpointName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IovPolicySettings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.IovPolicySettings == nil { + m.IovPolicySettings = &IovEndpointPolicySetting{} + } + if err := m.IovPolicySettings.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ModifyNICResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ModifyNICResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModifyNICResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteNICRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteNICRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteNICRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NicID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NicID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndpointName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EndpointName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteNICResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteNICResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteNICResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateNetworkRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateNetworkRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateNetworkRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) + } + m.Mode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Mode |= CreateNetworkRequest_NetworkMode(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwitchName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SwitchName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IpamType", wireType) + } + m.IpamType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.IpamType |= CreateNetworkRequest_IpamType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubnetIpaddressPrefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubnetIpaddressPrefix = append(m.SubnetIpaddressPrefix, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultGateway", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DefaultGateway = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateNetworkResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateNetworkResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateNetworkResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PortNameEndpointPolicySetting) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PortNameEndpointPolicySetting: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PortNameEndpointPolicySetting: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IovEndpointPolicySetting) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IovEndpointPolicySetting: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IovEndpointPolicySetting: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IovOffloadWeight", wireType) + } + m.IovOffloadWeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.IovOffloadWeight |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field QueuePairsRequested", wireType) + } + m.QueuePairsRequested = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.QueuePairsRequested |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InterruptModeration", wireType) + } + m.InterruptModeration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.InterruptModeration |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DnsSetting) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DnsSetting: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DnsSetting: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServerIpAddrs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServerIpAddrs = append(m.ServerIpAddrs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Search", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Search = append(m.Search, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateEndpointRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateEndpointRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateEndpointRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Macaddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Macaddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ipaddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ipaddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IpaddressPrefixlength", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IpaddressPrefixlength = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NetworkName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NetworkName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortnamePolicySetting", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PortnamePolicySetting == nil { + m.PortnamePolicySetting = &PortNameEndpointPolicySetting{} + } + if err := m.PortnamePolicySetting.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IovPolicySettings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.IovPolicySettings == nil { + m.IovPolicySettings = &IovEndpointPolicySetting{} + } + if err := m.IovPolicySettings.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DnsSetting", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DnsSetting == nil { + m.DnsSetting = &DnsSetting{} + } + if err := m.DnsSetting.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateEndpointResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateEndpointResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateEndpointResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddEndpointRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AddEndpointRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddEndpointRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NamespaceID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NamespaceID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddEndpointResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AddEndpointResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddEndpointResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteEndpointRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteEndpointRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteEndpointRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteEndpointResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteEndpointResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteEndpointResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteNetworkRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteNetworkRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteNetworkRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteNetworkResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteNetworkResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteNetworkResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetEndpointRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetEndpointRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetEndpointRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetEndpointResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetEndpointResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetEndpointResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Network = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DnsSetting", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DnsSetting == nil { + m.DnsSetting = &DnsSetting{} + } + if err := m.DnsSetting.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetNetworkRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetNetworkRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetNetworkRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetNetworkResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetNetworkResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetNetworkResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetEndpointsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetEndpointsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetEndpointsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetEndpointsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetEndpointsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetEndpointsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Endpoints = append(m.Endpoints, &GetEndpointResponse{}) + if err := m.Endpoints[len(m.Endpoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetNetworksRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetNetworksRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetNetworksRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetNetworksResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetNetworksResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetNetworksResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Networks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Networks = append(m.Networks, &GetNetworkResponse{}) + if err := m.Networks[len(m.Networks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNetworkconfigproxy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNetworkconfigproxy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipNetworkconfigproxy(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowNetworkconfigproxy + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthNetworkconfigproxy + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupNetworkconfigproxy + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthNetworkconfigproxy + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthNetworkconfigproxy = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowNetworkconfigproxy = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupNetworkconfigproxy = fmt.Errorf("proto: unexpected end of group") +) diff --git a/pkg/ncproxy/ncproxygrpc/v0/networkconfigproxy.proto b/pkg/ncproxy/ncproxygrpc/v0/networkconfigproxy.proto new file mode 100644 index 0000000000..d703bb3ed1 --- /dev/null +++ b/pkg/ncproxy/ncproxygrpc/v0/networkconfigproxy.proto @@ -0,0 +1,155 @@ +syntax = "proto3"; + +package ncproxygrpc; +option go_package = "github.com/Microsoft/hcsshim/pkg/ncproxy/ncproxygrpc/v0"; +option deprecated = true; + +service NetworkConfigProxy { + rpc AddNIC(AddNICRequest) returns (AddNICResponse) {} + rpc ModifyNIC(ModifyNICRequest) returns (ModifyNICResponse) {} + rpc DeleteNIC(DeleteNICRequest) returns (DeleteNICResponse) {} + + rpc CreateNetwork(CreateNetworkRequest) returns (CreateNetworkResponse) {} + rpc CreateEndpoint(CreateEndpointRequest) returns (CreateEndpointResponse) {} + rpc AddEndpoint(AddEndpointRequest) returns (AddEndpointResponse) {} + rpc DeleteEndpoint(DeleteEndpointRequest) returns (DeleteEndpointResponse) {} + rpc DeleteNetwork(DeleteNetworkRequest) returns (DeleteNetworkResponse) {} + rpc GetEndpoint(GetEndpointRequest) returns (GetEndpointResponse) {} + rpc GetNetwork(GetNetworkRequest) returns (GetNetworkResponse) {} + rpc GetEndpoints(GetEndpointsRequest) returns (GetEndpointsResponse) {} + rpc GetNetworks(GetNetworksRequest) returns (GetNetworksResponse) {} +} + +message AddNICRequest { + string container_id = 1; + string nic_id = 2; + string endpoint_name = 3; +} + +message AddNICResponse {} + +message ModifyNICRequest { + string container_id = 1; + string nic_id = 2; + string endpoint_name = 3; + IovEndpointPolicySetting iov_policy_settings = 4; +} + +message ModifyNICResponse {} + +message DeleteNICRequest { + string container_id = 1; + string nic_id = 2; + string endpoint_name = 3; +} + +message DeleteNICResponse {} + +message CreateNetworkRequest { + enum NetworkMode + { + Transparent = 0; + NAT = 1; + } + + enum IpamType + { + Static = 0; + DHCP = 1; + } + + string name = 1; + NetworkMode mode = 2; + string switch_name = 3; + IpamType ipam_type = 4; + repeated string subnet_ipaddress_prefix = 5; + string default_gateway = 6; +} + +message CreateNetworkResponse{ + string id = 1; +} + +message PortNameEndpointPolicySetting { + string port_name = 1; +} + +message IovEndpointPolicySetting { + uint32 iov_offload_weight = 1; + uint32 queue_pairs_requested = 2; + uint32 interrupt_moderation = 3; +} + +message DnsSetting { + repeated string server_ip_addrs = 1; + string domain = 2; + repeated string search = 3; +} + +message CreateEndpointRequest { + reserved 8 to 15; + string name = 1; + string macaddress = 2; + string ipaddress = 3; + string ipaddress_prefixlength = 4; + string network_name = 5; + PortNameEndpointPolicySetting portname_policy_setting = 6; + IovEndpointPolicySetting iov_policy_settings = 7; + DnsSetting dns_setting = 16; +} + +message CreateEndpointResponse{ + string id = 1; +} + +message AddEndpointRequest { + string name = 1; + string namespace_id = 2; +} + +message AddEndpointResponse{} + +message DeleteEndpointRequest { + string name = 1; +} + +message DeleteEndpointResponse{} + +message DeleteNetworkRequest{ + string name = 1; +} + +message DeleteNetworkResponse{} + +message GetEndpointRequest{ + string name = 1; +} + +message GetEndpointResponse{ + string id = 1; + string name = 2; + string network = 3; // GUID + string namespace = 4; // GUID + DnsSetting dns_setting = 5; +} + +message GetNetworkRequest{ + string name = 1; +} + +message GetNetworkResponse{ + string id = 1; + string name = 2; +} + +message GetEndpointsRequest{} + +message GetEndpointsResponse{ + repeated GetEndpointResponse endpoints = 1; +} + +message GetNetworksRequest{} + +message GetNetworksResponse{ + repeated GetNetworkResponse networks = 1; +} \ No newline at end of file