flow

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlowService_StreamFlows_FullMethodName = "/netmaker.flow.FlowService/StreamFlows"
)

Variables

View Source
var (
	EventType_name = map[int32]string{
		0: "EVENT_TYPE_UNSPECIFIED",
		1: "EVENT_START",
		2: "EVENT_DESTROY",
	}
	EventType_value = map[string]int32{
		"EVENT_TYPE_UNSPECIFIED": 0,
		"EVENT_START":            1,
		"EVENT_DESTROY":          2,
	}
)

Enum value maps for EventType.

View Source
var (
	ParticipantType_name = map[int32]string{
		0: "PARTICIPANT_UNSPECIFIED",
		1: "PARTICIPANT_NODE",
		2: "PARTICIPANT_USER",
		3: "PARTICIPANT_EXTCLIENT",
		4: "PARTICIPANT_EGRESS_ROUTE",
		5: "PARTICIPANT_EXTERNAL",
	}
	ParticipantType_value = map[string]int32{
		"PARTICIPANT_UNSPECIFIED":  0,
		"PARTICIPANT_NODE":         1,
		"PARTICIPANT_USER":         2,
		"PARTICIPANT_EXTCLIENT":    3,
		"PARTICIPANT_EGRESS_ROUTE": 4,
		"PARTICIPANT_EXTERNAL":     5,
	}
)

Enum value maps for ParticipantType.

View Source
var (
	Direction_name = map[int32]string{
		0: "DIR_UNSPECIFIED",
		1: "DIR_INGRESS",
		2: "DIR_EGRESS",
	}
	Direction_value = map[string]int32{
		"DIR_UNSPECIFIED": 0,
		"DIR_INGRESS":     1,
		"DIR_EGRESS":      2,
	}
)

Enum value maps for Direction.

View Source
var File_grpc_flow_flow_proto protoreflect.FileDescriptor
View Source
var FlowService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "netmaker.flow.FlowService",
	HandlerType: (*FlowServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "StreamFlows",
			Handler:       _FlowService_StreamFlows_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "grpc/flow/flow.proto",
}

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

Functions

func RegisterFlowServiceServer

func RegisterFlowServiceServer(s grpc.ServiceRegistrar, srv FlowServiceServer)

Types

type Direction

type Direction int32

* Direction of the flow relative to the observing node.

const (
	Direction_DIR_UNSPECIFIED Direction = 0
	Direction_DIR_INGRESS     Direction = 1
	Direction_DIR_EGRESS      Direction = 2
)

func (Direction) Descriptor

func (Direction) Descriptor() protoreflect.EnumDescriptor

func (Direction) Enum

func (x Direction) Enum() *Direction

func (Direction) EnumDescriptor deprecated

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

Deprecated: Use Direction.Descriptor instead.

func (Direction) Number

func (x Direction) Number() protoreflect.EnumNumber

func (Direction) String

func (x Direction) String() string

func (Direction) Type

type EventType

type EventType int32

* Lifecycle stage of a flow event as seen by an netclient. A flow produces:

  • EVENT_START when conntrack entry is created
  • EVENT_DESTROY when conntrack entry is removed
const (
	EventType_EVENT_TYPE_UNSPECIFIED EventType = 0
	EventType_EVENT_START            EventType = 1
	EventType_EVENT_DESTROY          EventType = 2
)

func (EventType) Descriptor

func (EventType) Descriptor() protoreflect.EnumDescriptor

func (EventType) Enum

func (x EventType) Enum() *EventType

func (EventType) EnumDescriptor deprecated

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

Deprecated: Use EventType.Descriptor instead.

func (EventType) Number

func (x EventType) Number() protoreflect.EnumNumber

func (EventType) String

func (x EventType) String() string

func (EventType) Type

type FlowEnvelope

type FlowEnvelope struct {
	Events []*FlowEvent `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
	// contains filtered or unexported fields
}

* Envelope sent by netclients containing multiple FlowEvents.

func (*FlowEnvelope) Descriptor deprecated

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

Deprecated: Use FlowEnvelope.ProtoReflect.Descriptor instead.

func (*FlowEnvelope) GetEvents

func (x *FlowEnvelope) GetEvents() []*FlowEvent

func (*FlowEnvelope) ProtoMessage

func (*FlowEnvelope) ProtoMessage()

func (*FlowEnvelope) ProtoReflect

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

func (*FlowEnvelope) Reset

func (x *FlowEnvelope) Reset()

func (*FlowEnvelope) String

func (x *FlowEnvelope) String() string

type FlowEvent

type FlowEvent struct {

	// Flow lifecycle event type (START or DESTROY)
	Type EventType `protobuf:"varint,1,opt,name=type,proto3,enum=netmaker.flow.EventType" json:"type,omitempty"`
	// Stable identity
	FlowId    string `protobuf:"bytes,2,opt,name=flow_id,json=flowId,proto3" json:"flow_id,omitempty"`          // unique per flow
	HostId    string `protobuf:"bytes,3,opt,name=host_id,json=hostId,proto3" json:"host_id,omitempty"`          // node reporting this event
	HostName  string `protobuf:"bytes,4,opt,name=host_name,json=hostName,proto3" json:"host_name,omitempty"`    // name of the node reporting this event
	NetworkId string `protobuf:"bytes,5,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` // network this flow belongs to
	// L3/L4 metadata
	Protocol  uint32    `protobuf:"varint,6,opt,name=protocol,proto3" json:"protocol,omitempty"`
	SrcPort   uint32    `protobuf:"varint,7,opt,name=src_port,json=srcPort,proto3" json:"src_port,omitempty"`
	DstPort   uint32    `protobuf:"varint,8,opt,name=dst_port,json=dstPort,proto3" json:"dst_port,omitempty"`
	IcmpType  uint32    `protobuf:"varint,9,opt,name=icmp_type,json=icmpType,proto3" json:"icmp_type,omitempty"`
	IcmpCode  uint32    `protobuf:"varint,10,opt,name=icmp_code,json=icmpCode,proto3" json:"icmp_code,omitempty"`
	Direction Direction `protobuf:"varint,11,opt,name=direction,proto3,enum=netmaker.flow.Direction" json:"direction,omitempty"`
	// Participants — enriched by client
	Src *FlowParticipant `protobuf:"bytes,12,opt,name=src,proto3" json:"src,omitempty"`
	Dst *FlowParticipant `protobuf:"bytes,13,opt,name=dst,proto3" json:"dst,omitempty"`
	// Timestamps (milliseconds since epoch)
	StartTsMs int64 `protobuf:"varint,14,opt,name=start_ts_ms,json=startTsMs,proto3" json:"start_ts_ms,omitempty"`
	EndTsMs   int64 `protobuf:"varint,15,opt,name=end_ts_ms,json=endTsMs,proto3" json:"end_ts_ms,omitempty"`
	// Traffic counters (only valid for destroy events)
	BytesSent   uint64 `protobuf:"varint,16,opt,name=bytes_sent,json=bytesSent,proto3" json:"bytes_sent,omitempty"`
	BytesRecv   uint64 `protobuf:"varint,17,opt,name=bytes_recv,json=bytesRecv,proto3" json:"bytes_recv,omitempty"`
	PacketsSent uint64 `protobuf:"varint,18,opt,name=packets_sent,json=packetsSent,proto3" json:"packets_sent,omitempty"`
	PacketsRecv uint64 `protobuf:"varint,19,opt,name=packets_recv,json=packetsRecv,proto3" json:"packets_recv,omitempty"`
	// Netfilter conntrack status flags (bitmask)
	Status uint32 `protobuf:"varint,20,opt,name=status,proto3" json:"status,omitempty"`
	// *
	// Version used by ClickHouse for merging.
	// Must be strictly increasing for START → DESTROY.
	// Usually equal to the netclient event timestamp (ms).
	Version int64 `protobuf:"varint,21,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

* Flow event generated by netclient.

func (*FlowEvent) Descriptor deprecated

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

Deprecated: Use FlowEvent.ProtoReflect.Descriptor instead.

func (*FlowEvent) GetBytesRecv

func (x *FlowEvent) GetBytesRecv() uint64

func (*FlowEvent) GetBytesSent

func (x *FlowEvent) GetBytesSent() uint64

func (*FlowEvent) GetDirection

func (x *FlowEvent) GetDirection() Direction

func (*FlowEvent) GetDst

func (x *FlowEvent) GetDst() *FlowParticipant

func (*FlowEvent) GetDstPort

func (x *FlowEvent) GetDstPort() uint32

func (*FlowEvent) GetEndTsMs

func (x *FlowEvent) GetEndTsMs() int64

func (*FlowEvent) GetFlowId

func (x *FlowEvent) GetFlowId() string

func (*FlowEvent) GetHostId

func (x *FlowEvent) GetHostId() string

func (*FlowEvent) GetHostName added in v1.5.0

func (x *FlowEvent) GetHostName() string

func (*FlowEvent) GetIcmpCode

func (x *FlowEvent) GetIcmpCode() uint32

func (*FlowEvent) GetIcmpType

func (x *FlowEvent) GetIcmpType() uint32

func (*FlowEvent) GetNetworkId

func (x *FlowEvent) GetNetworkId() string

func (*FlowEvent) GetPacketsRecv

func (x *FlowEvent) GetPacketsRecv() uint64

func (*FlowEvent) GetPacketsSent

func (x *FlowEvent) GetPacketsSent() uint64

func (*FlowEvent) GetProtocol

func (x *FlowEvent) GetProtocol() uint32

func (*FlowEvent) GetSrc

func (x *FlowEvent) GetSrc() *FlowParticipant

func (*FlowEvent) GetSrcPort

func (x *FlowEvent) GetSrcPort() uint32

func (*FlowEvent) GetStartTsMs

func (x *FlowEvent) GetStartTsMs() int64

func (*FlowEvent) GetStatus

func (x *FlowEvent) GetStatus() uint32

func (*FlowEvent) GetType

func (x *FlowEvent) GetType() EventType

func (*FlowEvent) GetVersion

func (x *FlowEvent) GetVersion() int64

func (*FlowEvent) ProtoMessage

func (*FlowEvent) ProtoMessage()

func (*FlowEvent) ProtoReflect

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

func (*FlowEvent) Reset

func (x *FlowEvent) Reset()

func (*FlowEvent) String

func (x *FlowEvent) String() string

type FlowParticipant

type FlowParticipant struct {
	Ip   string          `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
	Type ParticipantType `protobuf:"varint,2,opt,name=type,proto3,enum=netmaker.flow.ParticipantType" json:"type,omitempty"`
	Id   string          `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"`
	Name string          `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

* Fully enriched representation of one endpoint of a flow.

func (*FlowParticipant) Descriptor deprecated

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

Deprecated: Use FlowParticipant.ProtoReflect.Descriptor instead.

func (*FlowParticipant) GetId

func (x *FlowParticipant) GetId() string

func (*FlowParticipant) GetIp

func (x *FlowParticipant) GetIp() string

func (*FlowParticipant) GetName added in v1.5.0

func (x *FlowParticipant) GetName() string

func (*FlowParticipant) GetType

func (x *FlowParticipant) GetType() ParticipantType

func (*FlowParticipant) ProtoMessage

func (*FlowParticipant) ProtoMessage()

func (*FlowParticipant) ProtoReflect

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

func (*FlowParticipant) Reset

func (x *FlowParticipant) Reset()

func (*FlowParticipant) String

func (x *FlowParticipant) String() string

type FlowResponse

type FlowResponse struct {
	Success bool   `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // true if batch was accepted
	Error   string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`      // optional error information
	// contains filtered or unexported fields
}

* Response from server acknowledging receipt of a batch.

func (*FlowResponse) Descriptor deprecated

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

Deprecated: Use FlowResponse.ProtoReflect.Descriptor instead.

func (*FlowResponse) GetError

func (x *FlowResponse) GetError() string

func (*FlowResponse) GetSuccess

func (x *FlowResponse) GetSuccess() bool

func (*FlowResponse) ProtoMessage

func (*FlowResponse) ProtoMessage()

func (*FlowResponse) ProtoReflect

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

func (*FlowResponse) Reset

func (x *FlowResponse) Reset()

func (*FlowResponse) String

func (x *FlowResponse) String() string

type FlowServiceClient

type FlowServiceClient interface {
	StreamFlows(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[FlowEnvelope, FlowResponse], error)
}

FlowServiceClient is the client API for FlowService 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.

* Bidirectional streaming:

  • Agents continuously send FlowEnvelope batches.
  • Server replies with FlowResponse ACKs.

type FlowServiceServer

type FlowServiceServer interface {
	StreamFlows(grpc.BidiStreamingServer[FlowEnvelope, FlowResponse]) error
	// contains filtered or unexported methods
}

FlowServiceServer is the server API for FlowService service. All implementations must embed UnimplementedFlowServiceServer for forward compatibility.

* Bidirectional streaming:

  • Agents continuously send FlowEnvelope batches.
  • Server replies with FlowResponse ACKs.

type FlowService_StreamFlowsClient

type FlowService_StreamFlowsClient = grpc.BidiStreamingClient[FlowEnvelope, FlowResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type FlowService_StreamFlowsServer

type FlowService_StreamFlowsServer = grpc.BidiStreamingServer[FlowEnvelope, FlowResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type ParticipantType

type ParticipantType int32

* Identifies what kind of participant an IP belongs to.

const (
	ParticipantType_PARTICIPANT_UNSPECIFIED  ParticipantType = 0
	ParticipantType_PARTICIPANT_NODE         ParticipantType = 1
	ParticipantType_PARTICIPANT_USER         ParticipantType = 2
	ParticipantType_PARTICIPANT_EXTCLIENT    ParticipantType = 3
	ParticipantType_PARTICIPANT_EGRESS_ROUTE ParticipantType = 4
	ParticipantType_PARTICIPANT_EXTERNAL     ParticipantType = 5 // anything not part of the Netmaker network
)

func (ParticipantType) Descriptor

func (ParticipantType) Enum

func (x ParticipantType) Enum() *ParticipantType

func (ParticipantType) EnumDescriptor deprecated

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

Deprecated: Use ParticipantType.Descriptor instead.

func (ParticipantType) Number

func (ParticipantType) String

func (x ParticipantType) String() string

func (ParticipantType) Type

type UnimplementedFlowServiceServer

type UnimplementedFlowServiceServer struct{}

UnimplementedFlowServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedFlowServiceServer) StreamFlows

type UnsafeFlowServiceServer

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

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

Jump to

Keyboard shortcuts

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