cni

package
v0.0.0-...-2d08fe4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CNIReply_Interface_IP_Version_name = map[int32]string{
	0: "IPV4",
	1: "IPV6",
}
View Source
var CNIReply_Interface_IP_Version_value = map[string]int32{
	"IPV4": 0,
	"IPV6": 1,
}

Functions

func RegisterRemoteCNIServer

func RegisterRemoteCNIServer(s *grpc.Server, srv RemoteCNIServer)

Types

type CNIReply

type CNIReply struct {
	// Result code. 0 = success, non-zero = error.
	Result uint32 `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"`
	// Error string in case that result != 0.
	Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// List of interfaces connected to the container.
	Interfaces []*CNIReply_Interface `protobuf:"bytes,4,rep,name=interfaces,proto3" json:"interfaces,omitempty"`
	// List of routes configured in the container.
	Routes []*CNIReply_Route `protobuf:"bytes,5,rep,name=routes,proto3" json:"routes,omitempty"`
	// DNS entries. Repeated only because it is optional, normally there should be only one dns member.
	Dns                  []*CNIReply_DNS `protobuf:"bytes,6,rep,name=dns,proto3" json:"dns,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

The response to the CNIRequest. Corresponds to the CNI specification at https://github.com/containernetworking/cni/blob/master/SPEC.md#parameters

func (*CNIReply) Descriptor

func (*CNIReply) Descriptor() ([]byte, []int)

func (*CNIReply) GetDns

func (m *CNIReply) GetDns() []*CNIReply_DNS

func (*CNIReply) GetError

func (m *CNIReply) GetError() string

func (*CNIReply) GetInterfaces

func (m *CNIReply) GetInterfaces() []*CNIReply_Interface

func (*CNIReply) GetResult

func (m *CNIReply) GetResult() uint32

func (*CNIReply) GetRoutes

func (m *CNIReply) GetRoutes() []*CNIReply_Route

func (*CNIReply) ProtoMessage

func (*CNIReply) ProtoMessage()

func (*CNIReply) Reset

func (m *CNIReply) Reset()

func (*CNIReply) String

func (m *CNIReply) String() string

func (*CNIReply) XXX_DiscardUnknown

func (m *CNIReply) XXX_DiscardUnknown()

func (*CNIReply) XXX_Marshal

func (m *CNIReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CNIReply) XXX_Merge

func (m *CNIReply) XXX_Merge(src proto.Message)

func (*CNIReply) XXX_Size

func (m *CNIReply) XXX_Size() int

func (*CNIReply) XXX_Unmarshal

func (m *CNIReply) XXX_Unmarshal(b []byte) error

type CNIReply_DNS

type CNIReply_DNS struct {
	// The local domain used for short hostname lookups.
	Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"`
	// List of a priority-ordered list of DNS nameservers that this network is aware of.
	Nameservers []string `protobuf:"bytes,2,rep,name=nameservers,proto3" json:"nameservers,omitempty"`
	// List of priority ordered search domains for short hostname lookups. Will be preferred over domain by most resolvers.
	Search []string `protobuf:"bytes,3,rep,name=search,proto3" json:"search,omitempty"`
	// Listt of options that can be passed to the resolver.
	Options              []string `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

DNS details, as described in https://github.com/containernetworking/cni/blob/master/SPEC.md#dns

func (*CNIReply_DNS) Descriptor

func (*CNIReply_DNS) Descriptor() ([]byte, []int)

func (*CNIReply_DNS) GetDomain

func (m *CNIReply_DNS) GetDomain() string

func (*CNIReply_DNS) GetNameservers

func (m *CNIReply_DNS) GetNameservers() []string

func (*CNIReply_DNS) GetOptions

func (m *CNIReply_DNS) GetOptions() []string

func (*CNIReply_DNS) GetSearch

func (m *CNIReply_DNS) GetSearch() []string

func (*CNIReply_DNS) ProtoMessage

func (*CNIReply_DNS) ProtoMessage()

func (*CNIReply_DNS) Reset

func (m *CNIReply_DNS) Reset()

func (*CNIReply_DNS) String

func (m *CNIReply_DNS) String() string

func (*CNIReply_DNS) XXX_DiscardUnknown

func (m *CNIReply_DNS) XXX_DiscardUnknown()

func (*CNIReply_DNS) XXX_Marshal

func (m *CNIReply_DNS) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CNIReply_DNS) XXX_Merge

func (m *CNIReply_DNS) XXX_Merge(src proto.Message)

func (*CNIReply_DNS) XXX_Size

func (m *CNIReply_DNS) XXX_Size() int

func (*CNIReply_DNS) XXX_Unmarshal

func (m *CNIReply_DNS) XXX_Unmarshal(b []byte) error

type CNIReply_Interface

type CNIReply_Interface struct {
	// Name if the interface.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// MAC address of the interface.
	Mac string `protobuf:"bytes,2,opt,name=mac,proto3" json:"mac,omitempty"`
	// Details about the sandbox (if any) the interface is in. Can be a netns path, empty/omitted for host interfaces.
	Sandbox string `protobuf:"bytes,3,opt,name=sandbox,proto3" json:"sandbox,omitempty"`
	// List of IP addresses applied on the interface.
	IpAddresses          []*CNIReply_Interface_IP `protobuf:"bytes,4,rep,name=ip_addresses,json=ipAddresses,proto3" json:"ip_addresses,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                 `json:"-"`
	XXX_unrecognized     []byte                   `json:"-"`
	XXX_sizecache        int32                    `json:"-"`
}

Interface details, as described in https://github.com/containernetworking/cni/blob/master/SPEC.md#result

func (*CNIReply_Interface) Descriptor

func (*CNIReply_Interface) Descriptor() ([]byte, []int)

func (*CNIReply_Interface) GetIpAddresses

func (m *CNIReply_Interface) GetIpAddresses() []*CNIReply_Interface_IP

func (*CNIReply_Interface) GetMac

func (m *CNIReply_Interface) GetMac() string

func (*CNIReply_Interface) GetName

func (m *CNIReply_Interface) GetName() string

func (*CNIReply_Interface) GetSandbox

func (m *CNIReply_Interface) GetSandbox() string

func (*CNIReply_Interface) ProtoMessage

func (*CNIReply_Interface) ProtoMessage()

func (*CNIReply_Interface) Reset

func (m *CNIReply_Interface) Reset()

func (*CNIReply_Interface) String

func (m *CNIReply_Interface) String() string

func (*CNIReply_Interface) XXX_DiscardUnknown

func (m *CNIReply_Interface) XXX_DiscardUnknown()

func (*CNIReply_Interface) XXX_Marshal

func (m *CNIReply_Interface) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CNIReply_Interface) XXX_Merge

func (m *CNIReply_Interface) XXX_Merge(src proto.Message)

func (*CNIReply_Interface) XXX_Size

func (m *CNIReply_Interface) XXX_Size() int

func (*CNIReply_Interface) XXX_Unmarshal

func (m *CNIReply_Interface) XXX_Unmarshal(b []byte) error

type CNIReply_Interface_IP

type CNIReply_Interface_IP struct {
	// IP version.
	Version CNIReply_Interface_IP_Version `protobuf:"varint,1,opt,name=version,proto3,enum=cni.CNIReply_Interface_IP_Version" json:"version,omitempty"`
	// IP address in CIDR notation (eg "192.168.1.3/24").
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	// The default gateway for this subnet, if one exists.
	Gateway              string   `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

IP address details, as described in https://github.com/containernetworking/cni/blob/master/SPEC.md#ips

func (*CNIReply_Interface_IP) Descriptor

func (*CNIReply_Interface_IP) Descriptor() ([]byte, []int)

func (*CNIReply_Interface_IP) GetAddress

func (m *CNIReply_Interface_IP) GetAddress() string

func (*CNIReply_Interface_IP) GetGateway

func (m *CNIReply_Interface_IP) GetGateway() string

func (*CNIReply_Interface_IP) GetVersion

func (*CNIReply_Interface_IP) ProtoMessage

func (*CNIReply_Interface_IP) ProtoMessage()

func (*CNIReply_Interface_IP) Reset

func (m *CNIReply_Interface_IP) Reset()

func (*CNIReply_Interface_IP) String

func (m *CNIReply_Interface_IP) String() string

func (*CNIReply_Interface_IP) XXX_DiscardUnknown

func (m *CNIReply_Interface_IP) XXX_DiscardUnknown()

func (*CNIReply_Interface_IP) XXX_Marshal

func (m *CNIReply_Interface_IP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CNIReply_Interface_IP) XXX_Merge

func (m *CNIReply_Interface_IP) XXX_Merge(src proto.Message)

func (*CNIReply_Interface_IP) XXX_Size

func (m *CNIReply_Interface_IP) XXX_Size() int

func (*CNIReply_Interface_IP) XXX_Unmarshal

func (m *CNIReply_Interface_IP) XXX_Unmarshal(b []byte) error

type CNIReply_Interface_IP_Version

type CNIReply_Interface_IP_Version int32
const (
	CNIReply_Interface_IP_IPV4 CNIReply_Interface_IP_Version = 0
	CNIReply_Interface_IP_IPV6 CNIReply_Interface_IP_Version = 1
)

func (CNIReply_Interface_IP_Version) EnumDescriptor

func (CNIReply_Interface_IP_Version) EnumDescriptor() ([]byte, []int)

func (CNIReply_Interface_IP_Version) String

type CNIReply_Route

type CNIReply_Route struct {
	// Destination subnet specified in CIDR notation.
	Dst string `protobuf:"bytes,1,opt,name=dst,proto3" json:"dst,omitempty"`
	// IP of the gateway. If omitted, a default gateway is assumed.
	Gw                   string   `protobuf:"bytes,2,opt,name=gw,proto3" json:"gw,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Route details, as described in https://github.com/containernetworking/cni/blob/master/SPEC.md#routes

func (*CNIReply_Route) Descriptor

func (*CNIReply_Route) Descriptor() ([]byte, []int)

func (*CNIReply_Route) GetDst

func (m *CNIReply_Route) GetDst() string

func (*CNIReply_Route) GetGw

func (m *CNIReply_Route) GetGw() string

func (*CNIReply_Route) ProtoMessage

func (*CNIReply_Route) ProtoMessage()

func (*CNIReply_Route) Reset

func (m *CNIReply_Route) Reset()

func (*CNIReply_Route) String

func (m *CNIReply_Route) String() string

func (*CNIReply_Route) XXX_DiscardUnknown

func (m *CNIReply_Route) XXX_DiscardUnknown()

func (*CNIReply_Route) XXX_Marshal

func (m *CNIReply_Route) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CNIReply_Route) XXX_Merge

func (m *CNIReply_Route) XXX_Merge(src proto.Message)

func (*CNIReply_Route) XXX_Size

func (m *CNIReply_Route) XXX_Size() int

func (*CNIReply_Route) XXX_Unmarshal

func (m *CNIReply_Route) XXX_Unmarshal(b []byte) error

type CNIRequest

type CNIRequest struct {
	// The version of CNI spec that the caller is using (container management system or the invoking plugin).
	Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	// Container ID unique across an administrative domain while the container is live.
	ContainerId string `protobuf:"bytes,2,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
	// Path to the network namespace to be added, i.e. /proc/[pid]/ns/net or a bind-mount/link to it.
	NetworkNamespace string `protobuf:"bytes,3,opt,name=network_namespace,json=networkNamespace,proto3" json:"network_namespace,omitempty"`
	// Name of the interface inside the container. This is the name that should be assigned to the interface created inside the container (network namespace); consequently it must comply with the standard Linux restrictions on interface names.
	InterfaceName string `protobuf:"bytes,4,opt,name=interface_name,json=interfaceName,proto3" json:"interface_name,omitempty"`
	// Network configuration. This is a JSON document describing a network to which a container can be joined. Optional.
	ExtraNwConfig string `protobuf:"bytes,5,opt,name=extra_nw_config,json=extraNwConfig,proto3" json:"extra_nw_config,omitempty"`
	// Extra arguments passed to CNI plugin. Optional.
	ExtraArguments string `protobuf:"bytes,6,opt,name=extra_arguments,json=extraArguments,proto3" json:"extra_arguments,omitempty"`
	// IPAM type (plugin name) configured for the CNI (empty for Contiv-internal IPAM).
	IpamType string `protobuf:"bytes,7,opt,name=ipam_type,json=ipamType,proto3" json:"ipam_type,omitempty"`
	// result of the IPAM plugin if it was configured for the CNI (empty for Contiv-internal IPAM).
	IpamData             string   `protobuf:"bytes,8,opt,name=ipam_data,json=ipamData,proto3" json:"ipam_data,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The request to add a container to network. Corresponds to the CNI specification at https://github.com/containernetworking/cni/blob/master/SPEC.md#parameters

func (*CNIRequest) Descriptor

func (*CNIRequest) Descriptor() ([]byte, []int)

func (*CNIRequest) GetContainerId

func (m *CNIRequest) GetContainerId() string

func (*CNIRequest) GetExtraArguments

func (m *CNIRequest) GetExtraArguments() string

func (*CNIRequest) GetExtraNwConfig

func (m *CNIRequest) GetExtraNwConfig() string

func (*CNIRequest) GetInterfaceName

func (m *CNIRequest) GetInterfaceName() string

func (*CNIRequest) GetIpamData

func (m *CNIRequest) GetIpamData() string

func (*CNIRequest) GetIpamType

func (m *CNIRequest) GetIpamType() string

func (*CNIRequest) GetNetworkNamespace

func (m *CNIRequest) GetNetworkNamespace() string

func (*CNIRequest) GetVersion

func (m *CNIRequest) GetVersion() string

func (*CNIRequest) ProtoMessage

func (*CNIRequest) ProtoMessage()

func (*CNIRequest) Reset

func (m *CNIRequest) Reset()

func (*CNIRequest) String

func (m *CNIRequest) String() string

func (*CNIRequest) XXX_DiscardUnknown

func (m *CNIRequest) XXX_DiscardUnknown()

func (*CNIRequest) XXX_Marshal

func (m *CNIRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CNIRequest) XXX_Merge

func (m *CNIRequest) XXX_Merge(src proto.Message)

func (*CNIRequest) XXX_Size

func (m *CNIRequest) XXX_Size() int

func (*CNIRequest) XXX_Unmarshal

func (m *CNIRequest) XXX_Unmarshal(b []byte) error

type RemoteCNIClient

type RemoteCNIClient interface {
	// The request to add a container to network.
	Add(ctx context.Context, in *CNIRequest, opts ...grpc.CallOption) (*CNIReply, error)
	// The request to delete a container from network.
	Delete(ctx context.Context, in *CNIRequest, opts ...grpc.CallOption) (*CNIReply, error)
}

RemoteCNIClient is the client API for RemoteCNI service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewRemoteCNIClient

func NewRemoteCNIClient(cc *grpc.ClientConn) RemoteCNIClient

type RemoteCNIServer

type RemoteCNIServer interface {
	// The request to add a container to network.
	Add(context.Context, *CNIRequest) (*CNIReply, error)
	// The request to delete a container from network.
	Delete(context.Context, *CNIRequest) (*CNIReply, error)
}

RemoteCNIServer is the server API for RemoteCNI service.

type UnimplementedRemoteCNIServer

type UnimplementedRemoteCNIServer struct {
}

UnimplementedRemoteCNIServer can be embedded to have forward compatible implementations.

func (*UnimplementedRemoteCNIServer) Add

func (*UnimplementedRemoteCNIServer) Delete

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL