network

package
v0.13.5 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AddressFamily_name = map[int32]string{
		0: "AF_UNSPEC",
		2: "AF_INET",

		10: "AF_INET6",
	}
	AddressFamily_value = map[string]int32{
		"AF_UNSPEC": 0,
		"AF_INET":   2,
		"IPV4":      2,
		"AF_INET6":  10,
		"IPV6":      10,
	}
)

Enum value maps for AddressFamily.

View Source
var (
	RouteProtocol_name = map[int32]string{
		0:  "RTPROT_UNSPEC",
		1:  "RTPROT_REDIRECT",
		2:  "RTPROT_KERNEL",
		3:  "RTPROT_BOOT",
		4:  "RTPROT_STATIC",
		8:  "RTPROT_GATED",
		9:  "RTPROT_RA",
		10: "RTPROT_MRT",
		11: "RTPROT_ZEBRA",
		12: "RTPROT_BIRD",
		13: "RTPROT_DNROUTED",
		14: "RTPROT_XORP",
		15: "RTPROT_NTK",
		16: "RTPROT_DHCP",
		17: "RTPROT_MROUTED",
		42: "RTPROT_BABEL",
	}
	RouteProtocol_value = map[string]int32{
		"RTPROT_UNSPEC":   0,
		"RTPROT_REDIRECT": 1,
		"RTPROT_KERNEL":   2,
		"RTPROT_BOOT":     3,
		"RTPROT_STATIC":   4,
		"RTPROT_GATED":    8,
		"RTPROT_RA":       9,
		"RTPROT_MRT":      10,
		"RTPROT_ZEBRA":    11,
		"RTPROT_BIRD":     12,
		"RTPROT_DNROUTED": 13,
		"RTPROT_XORP":     14,
		"RTPROT_NTK":      15,
		"RTPROT_DHCP":     16,
		"RTPROT_MROUTED":  17,
		"RTPROT_BABEL":    42,
	}
)

Enum value maps for RouteProtocol.

View Source
var (
	InterfaceFlags_name = map[int32]string{
		0: "FLAG_UNKNOWN",
		1: "FLAG_UP",
		2: "FLAG_BROADCAST",
		3: "FLAG_LOOPBACK",
		4: "FLAG_POINT_TO_POINT",
		5: "FLAG_MULTICAST",
	}
	InterfaceFlags_value = map[string]int32{
		"FLAG_UNKNOWN":        0,
		"FLAG_UP":             1,
		"FLAG_BROADCAST":      2,
		"FLAG_LOOPBACK":       3,
		"FLAG_POINT_TO_POINT": 4,
		"FLAG_MULTICAST":      5,
	}
)

Enum value maps for InterfaceFlags.

View Source
var (
	ErrInvalidLength        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
)
View Source
var File_network_network_proto protoreflect.FileDescriptor
View Source
var NetworkService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "network.NetworkService",
	HandlerType: (*NetworkServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Routes",
			Handler:    _NetworkService_Routes_Handler,
		},
		{
			MethodName: "Interfaces",
			Handler:    _NetworkService_Interfaces_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "network/network.proto",
}

NetworkService_ServiceDesc is the grpc.ServiceDesc for NetworkService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterNetworkServiceServer

func RegisterNetworkServiceServer(s grpc.ServiceRegistrar, srv NetworkServiceServer)

Types

type AddressFamily

type AddressFamily int32
const (
	AddressFamily_AF_UNSPEC AddressFamily = 0
	AddressFamily_AF_INET   AddressFamily = 2
	AddressFamily_IPV4      AddressFamily = 2
	AddressFamily_AF_INET6  AddressFamily = 10
	AddressFamily_IPV6      AddressFamily = 10
)

func (AddressFamily) Descriptor

func (AddressFamily) Enum

func (x AddressFamily) Enum() *AddressFamily

func (AddressFamily) EnumDescriptor deprecated

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

Deprecated: Use AddressFamily.Descriptor instead.

func (AddressFamily) Number

func (AddressFamily) String

func (x AddressFamily) String() string

func (AddressFamily) Type

type Interface

type Interface struct {
	Index        uint32         `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	Mtu          uint32         `protobuf:"varint,2,opt,name=mtu,proto3" json:"mtu,omitempty"`
	Name         string         `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	Hardwareaddr string         `protobuf:"bytes,4,opt,name=hardwareaddr,proto3" json:"hardwareaddr,omitempty"`
	Flags        InterfaceFlags `protobuf:"varint,5,opt,name=flags,proto3,enum=network.InterfaceFlags" json:"flags,omitempty"`
	Ipaddress    []string       `protobuf:"bytes,6,rep,name=ipaddress,proto3" json:"ipaddress,omitempty"`
	// contains filtered or unexported fields
}

Interface represents a net.Interface

func (*Interface) Descriptor deprecated

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

Deprecated: Use Interface.ProtoReflect.Descriptor instead.

func (*Interface) GetFlags

func (x *Interface) GetFlags() InterfaceFlags

func (*Interface) GetHardwareaddr

func (x *Interface) GetHardwareaddr() string

func (*Interface) GetIndex

func (x *Interface) GetIndex() uint32

func (*Interface) GetIpaddress

func (x *Interface) GetIpaddress() []string

func (*Interface) GetMtu

func (x *Interface) GetMtu() uint32

func (*Interface) GetName

func (x *Interface) GetName() string

func (*Interface) MarshalToSizedBufferVT added in v0.12.0

func (m *Interface) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Interface) MarshalToVT added in v0.12.0

func (m *Interface) MarshalToVT(dAtA []byte) (int, error)

func (*Interface) MarshalVT added in v0.12.0

func (m *Interface) MarshalVT() (dAtA []byte, err error)

func (*Interface) ProtoMessage

func (*Interface) ProtoMessage()

func (*Interface) ProtoReflect

func (x *Interface) ProtoReflect() protoreflect.Message

func (*Interface) Reset

func (x *Interface) Reset()

func (*Interface) SizeVT added in v0.12.0

func (m *Interface) SizeVT() (n int)

func (*Interface) String

func (x *Interface) String() string

func (*Interface) UnmarshalVT added in v0.12.0

func (m *Interface) UnmarshalVT(dAtA []byte) error

type InterfaceFlags

type InterfaceFlags int32
const (
	InterfaceFlags_FLAG_UNKNOWN        InterfaceFlags = 0
	InterfaceFlags_FLAG_UP             InterfaceFlags = 1
	InterfaceFlags_FLAG_BROADCAST      InterfaceFlags = 2
	InterfaceFlags_FLAG_LOOPBACK       InterfaceFlags = 3
	InterfaceFlags_FLAG_POINT_TO_POINT InterfaceFlags = 4
	InterfaceFlags_FLAG_MULTICAST      InterfaceFlags = 5
)

func (InterfaceFlags) Descriptor

func (InterfaceFlags) Enum

func (x InterfaceFlags) Enum() *InterfaceFlags

func (InterfaceFlags) EnumDescriptor deprecated

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

Deprecated: Use InterfaceFlags.Descriptor instead.

func (InterfaceFlags) Number

func (InterfaceFlags) String

func (x InterfaceFlags) String() string

func (InterfaceFlags) Type

type Interfaces

type Interfaces struct {
	Metadata   *common.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	Interfaces []*Interface     `protobuf:"bytes,2,rep,name=interfaces,proto3" json:"interfaces,omitempty"`
	// contains filtered or unexported fields
}

func (*Interfaces) Descriptor deprecated

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

Deprecated: Use Interfaces.ProtoReflect.Descriptor instead.

func (*Interfaces) GetInterfaces

func (x *Interfaces) GetInterfaces() []*Interface

func (*Interfaces) GetMetadata

func (x *Interfaces) GetMetadata() *common.Metadata

func (*Interfaces) MarshalToSizedBufferVT added in v0.12.0

func (m *Interfaces) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Interfaces) MarshalToVT added in v0.12.0

func (m *Interfaces) MarshalToVT(dAtA []byte) (int, error)

func (*Interfaces) MarshalVT added in v0.12.0

func (m *Interfaces) MarshalVT() (dAtA []byte, err error)

func (*Interfaces) ProtoMessage

func (*Interfaces) ProtoMessage()

func (*Interfaces) ProtoReflect

func (x *Interfaces) ProtoReflect() protoreflect.Message

func (*Interfaces) Reset

func (x *Interfaces) Reset()

func (*Interfaces) SizeVT added in v0.12.0

func (m *Interfaces) SizeVT() (n int)

func (*Interfaces) String

func (x *Interfaces) String() string

func (*Interfaces) UnmarshalVT added in v0.12.0

func (m *Interfaces) UnmarshalVT(dAtA []byte) error

type InterfacesResponse

type InterfacesResponse struct {
	Messages []*Interfaces `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
	// contains filtered or unexported fields
}

func (*InterfacesResponse) Descriptor deprecated

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

Deprecated: Use InterfacesResponse.ProtoReflect.Descriptor instead.

func (*InterfacesResponse) GetMessages

func (x *InterfacesResponse) GetMessages() []*Interfaces

func (*InterfacesResponse) MarshalToSizedBufferVT added in v0.12.0

func (m *InterfacesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*InterfacesResponse) MarshalToVT added in v0.12.0

func (m *InterfacesResponse) MarshalToVT(dAtA []byte) (int, error)

func (*InterfacesResponse) MarshalVT added in v0.12.0

func (m *InterfacesResponse) MarshalVT() (dAtA []byte, err error)

func (*InterfacesResponse) ProtoMessage

func (*InterfacesResponse) ProtoMessage()

func (*InterfacesResponse) ProtoReflect

func (x *InterfacesResponse) ProtoReflect() protoreflect.Message

func (*InterfacesResponse) Reset

func (x *InterfacesResponse) Reset()

func (*InterfacesResponse) SizeVT added in v0.12.0

func (m *InterfacesResponse) SizeVT() (n int)

func (*InterfacesResponse) String

func (x *InterfacesResponse) String() string

func (*InterfacesResponse) UnmarshalVT added in v0.12.0

func (m *InterfacesResponse) UnmarshalVT(dAtA []byte) error

type NetworkServiceClient

type NetworkServiceClient interface {
	// Deprecated: Do not use.
	Routes(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*RoutesResponse, error)
	// Deprecated: Do not use.
	Interfaces(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*InterfacesResponse, error)
}

NetworkServiceClient is the client API for NetworkService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type NetworkServiceServer

type NetworkServiceServer interface {
	// Deprecated: Do not use.
	Routes(context.Context, *emptypb.Empty) (*RoutesResponse, error)
	// Deprecated: Do not use.
	Interfaces(context.Context, *emptypb.Empty) (*InterfacesResponse, error)
	// contains filtered or unexported methods
}

NetworkServiceServer is the server API for NetworkService service. All implementations must embed UnimplementedNetworkServiceServer for forward compatibility

type Route

type Route struct {

	// Interface is the interface over which traffic to this destination should be sent
	Interface string `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"`
	// Destination is the network prefix CIDR which this route provides
	Destination string `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"`
	// Gateway is the gateway address to which traffic to this destination should be sent
	Gateway string `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"`
	// Metric is the priority of the route, where lower metrics have higher priorities
	Metric uint32 `protobuf:"varint,4,opt,name=metric,proto3" json:"metric,omitempty"`
	// Scope desribes the scope of this route
	Scope uint32 `protobuf:"varint,5,opt,name=scope,proto3" json:"scope,omitempty"`
	// Source is the source prefix CIDR for the route, if one is defined
	Source string `protobuf:"bytes,6,opt,name=source,proto3" json:"source,omitempty"`
	// Family is the address family of the route.  Currently, the only options are AF_INET (IPV4) and AF_INET6 (IPV6).
	Family AddressFamily `protobuf:"varint,7,opt,name=family,proto3,enum=network.AddressFamily" json:"family,omitempty"`
	// Protocol is the protocol by which this route came to be in place
	Protocol RouteProtocol `protobuf:"varint,8,opt,name=protocol,proto3,enum=network.RouteProtocol" json:"protocol,omitempty"`
	// Flags indicate any special flags on the route
	Flags uint32 `protobuf:"varint,9,opt,name=flags,proto3" json:"flags,omitempty"`
	// contains filtered or unexported fields
}

The messages message containing a route.

func (*Route) Descriptor deprecated

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

Deprecated: Use Route.ProtoReflect.Descriptor instead.

func (*Route) GetDestination

func (x *Route) GetDestination() string

func (*Route) GetFamily

func (x *Route) GetFamily() AddressFamily

func (*Route) GetFlags

func (x *Route) GetFlags() uint32

func (*Route) GetGateway

func (x *Route) GetGateway() string

func (*Route) GetInterface

func (x *Route) GetInterface() string

func (*Route) GetMetric

func (x *Route) GetMetric() uint32

func (*Route) GetProtocol

func (x *Route) GetProtocol() RouteProtocol

func (*Route) GetScope

func (x *Route) GetScope() uint32

func (*Route) GetSource

func (x *Route) GetSource() string

func (*Route) MarshalToSizedBufferVT added in v0.12.0

func (m *Route) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Route) MarshalToVT added in v0.12.0

func (m *Route) MarshalToVT(dAtA []byte) (int, error)

func (*Route) MarshalVT added in v0.12.0

func (m *Route) MarshalVT() (dAtA []byte, err error)

func (*Route) ProtoMessage

func (*Route) ProtoMessage()

func (*Route) ProtoReflect

func (x *Route) ProtoReflect() protoreflect.Message

func (*Route) Reset

func (x *Route) Reset()

func (*Route) SizeVT added in v0.12.0

func (m *Route) SizeVT() (n int)

func (*Route) String

func (x *Route) String() string

func (*Route) UnmarshalVT added in v0.12.0

func (m *Route) UnmarshalVT(dAtA []byte) error

type RouteProtocol

type RouteProtocol int32
const (
	RouteProtocol_RTPROT_UNSPEC   RouteProtocol = 0
	RouteProtocol_RTPROT_REDIRECT RouteProtocol = 1  // Route installed by ICMP redirects
	RouteProtocol_RTPROT_KERNEL   RouteProtocol = 2  // Route installed by kernel
	RouteProtocol_RTPROT_BOOT     RouteProtocol = 3  // Route installed during boot
	RouteProtocol_RTPROT_STATIC   RouteProtocol = 4  // Route installed by administrator
	RouteProtocol_RTPROT_GATED    RouteProtocol = 8  // Route installed by gated
	RouteProtocol_RTPROT_RA       RouteProtocol = 9  // Route installed by router advertisement
	RouteProtocol_RTPROT_MRT      RouteProtocol = 10 // Route installed by Merit MRT
	RouteProtocol_RTPROT_ZEBRA    RouteProtocol = 11 // Route installed by Zebra/Quagga
	RouteProtocol_RTPROT_BIRD     RouteProtocol = 12 // Route installed by Bird
	RouteProtocol_RTPROT_DNROUTED RouteProtocol = 13 // Route installed by DECnet routing daemon
	RouteProtocol_RTPROT_XORP     RouteProtocol = 14 // Route installed by XORP
	RouteProtocol_RTPROT_NTK      RouteProtocol = 15 // Route installed by Netsukuku
	RouteProtocol_RTPROT_DHCP     RouteProtocol = 16 // Route installed by DHCP
	RouteProtocol_RTPROT_MROUTED  RouteProtocol = 17 // Route installed by Multicast daemon
	RouteProtocol_RTPROT_BABEL    RouteProtocol = 42 // Route installed by Babel daemon
)

func (RouteProtocol) Descriptor

func (RouteProtocol) Enum

func (x RouteProtocol) Enum() *RouteProtocol

func (RouteProtocol) EnumDescriptor deprecated

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

Deprecated: Use RouteProtocol.Descriptor instead.

func (RouteProtocol) Number

func (RouteProtocol) String

func (x RouteProtocol) String() string

func (RouteProtocol) Type

type Routes

type Routes struct {
	Metadata *common.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	Routes   []*Route         `protobuf:"bytes,2,rep,name=routes,proto3" json:"routes,omitempty"`
	// contains filtered or unexported fields
}

func (*Routes) Descriptor deprecated

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

Deprecated: Use Routes.ProtoReflect.Descriptor instead.

func (*Routes) GetMetadata

func (x *Routes) GetMetadata() *common.Metadata

func (*Routes) GetRoutes

func (x *Routes) GetRoutes() []*Route

func (*Routes) MarshalToSizedBufferVT added in v0.12.0

func (m *Routes) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Routes) MarshalToVT added in v0.12.0

func (m *Routes) MarshalToVT(dAtA []byte) (int, error)

func (*Routes) MarshalVT added in v0.12.0

func (m *Routes) MarshalVT() (dAtA []byte, err error)

func (*Routes) ProtoMessage

func (*Routes) ProtoMessage()

func (*Routes) ProtoReflect

func (x *Routes) ProtoReflect() protoreflect.Message

func (*Routes) Reset

func (x *Routes) Reset()

func (*Routes) SizeVT added in v0.12.0

func (m *Routes) SizeVT() (n int)

func (*Routes) String

func (x *Routes) String() string

func (*Routes) UnmarshalVT added in v0.12.0

func (m *Routes) UnmarshalVT(dAtA []byte) error

type RoutesResponse

type RoutesResponse struct {
	Messages []*Routes `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
	// contains filtered or unexported fields
}

The messages message containing the routes.

func (*RoutesResponse) Descriptor deprecated

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

Deprecated: Use RoutesResponse.ProtoReflect.Descriptor instead.

func (*RoutesResponse) GetMessages

func (x *RoutesResponse) GetMessages() []*Routes

func (*RoutesResponse) MarshalToSizedBufferVT added in v0.12.0

func (m *RoutesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*RoutesResponse) MarshalToVT added in v0.12.0

func (m *RoutesResponse) MarshalToVT(dAtA []byte) (int, error)

func (*RoutesResponse) MarshalVT added in v0.12.0

func (m *RoutesResponse) MarshalVT() (dAtA []byte, err error)

func (*RoutesResponse) ProtoMessage

func (*RoutesResponse) ProtoMessage()

func (*RoutesResponse) ProtoReflect

func (x *RoutesResponse) ProtoReflect() protoreflect.Message

func (*RoutesResponse) Reset

func (x *RoutesResponse) Reset()

func (*RoutesResponse) SizeVT added in v0.12.0

func (m *RoutesResponse) SizeVT() (n int)

func (*RoutesResponse) String

func (x *RoutesResponse) String() string

func (*RoutesResponse) UnmarshalVT added in v0.12.0

func (m *RoutesResponse) UnmarshalVT(dAtA []byte) error

type UnimplementedNetworkServiceServer

type UnimplementedNetworkServiceServer struct{}

UnimplementedNetworkServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedNetworkServiceServer) Interfaces

func (UnimplementedNetworkServiceServer) Routes

type UnsafeNetworkServiceServer

type UnsafeNetworkServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeNetworkServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NetworkServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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