recorder

package
v1.10.19 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Protocol_name = map[int32]string{
		0:  "PROTOCOL_ANY",
		6:  "PROTOCOL_TCP",
		17: "PROTOCOL_UDP",
	}
	Protocol_value = map[string]int32{
		"PROTOCOL_ANY": 0,
		"PROTOCOL_TCP": 6,
		"PROTOCOL_UDP": 17,
	}
)

Enum value maps for Protocol.

View Source
var File_recorder_recorder_proto protoreflect.FileDescriptor

Functions

func RegisterRecorderServer

func RegisterRecorderServer(s *grpc.Server, srv RecorderServer)

Types

type FileSinkConfiguration

type FileSinkConfiguration struct {

	// file_prefix is an optional prefix for the file name.
	// Defaults to `hubble` if empty. Must match the following regex if not
	// empty: ^[a-z][a-z0-9]{0,19}$
	// The generated filename will be of format
	//  <file_prefix>_<unixtime>_<unique_random>_<node_name>.pcap
	FilePrefix string `protobuf:"bytes,1,opt,name=file_prefix,json=filePrefix,proto3" json:"file_prefix,omitempty"`
	// contains filtered or unexported fields
}

FileSinkConfiguration configures the file output. Possible future additions might be the selection of the output volume. The initial implementation will only support a single volume which is configured as a cilium-agent CLI flag.

func (*FileSinkConfiguration) Descriptor deprecated

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

Deprecated: Use FileSinkConfiguration.ProtoReflect.Descriptor instead.

func (*FileSinkConfiguration) GetFilePrefix

func (x *FileSinkConfiguration) GetFilePrefix() string

func (*FileSinkConfiguration) MarshalJSON

func (msg *FileSinkConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*FileSinkConfiguration) ProtoMessage

func (*FileSinkConfiguration) ProtoMessage()

func (*FileSinkConfiguration) ProtoReflect

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

func (*FileSinkConfiguration) Reset

func (x *FileSinkConfiguration) Reset()

func (*FileSinkConfiguration) String

func (x *FileSinkConfiguration) String() string

func (*FileSinkConfiguration) UnmarshalJSON

func (msg *FileSinkConfiguration) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type FileSinkResult

type FileSinkResult struct {

	// file_path is the absolute path to the captured pcap file
	FilePath string `protobuf:"bytes,1,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"`
	// contains filtered or unexported fields
}

func (*FileSinkResult) Descriptor deprecated

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

Deprecated: Use FileSinkResult.ProtoReflect.Descriptor instead.

func (*FileSinkResult) GetFilePath

func (x *FileSinkResult) GetFilePath() string

func (*FileSinkResult) MarshalJSON

func (msg *FileSinkResult) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*FileSinkResult) ProtoMessage

func (*FileSinkResult) ProtoMessage()

func (*FileSinkResult) ProtoReflect

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

func (*FileSinkResult) Reset

func (x *FileSinkResult) Reset()

func (*FileSinkResult) String

func (x *FileSinkResult) String() string

func (*FileSinkResult) UnmarshalJSON

func (msg *FileSinkResult) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type Filter

type Filter struct {

	// source_cidr. Must not be empty.
	// Set to 0.0.0.0/0 to match any IPv4 source address (::/0 for IPv6).
	SourceCidr string `protobuf:"bytes,1,opt,name=source_cidr,json=sourceCidr,proto3" json:"source_cidr,omitempty"`
	// source_port. Matches any source port if empty.
	SourcePort uint32 `protobuf:"varint,2,opt,name=source_port,json=sourcePort,proto3" json:"source_port,omitempty"`
	// destination_cidr. Must not be empty.
	// Set to 0.0.0.0/0 to match any IPv4 destination address (::/0 for IPv6).
	DestinationCidr string `protobuf:"bytes,3,opt,name=destination_cidr,json=destinationCidr,proto3" json:"destination_cidr,omitempty"`
	// destination_port. Matches any destination port if empty.
	DestinationPort uint32 `protobuf:"varint,4,opt,name=destination_port,json=destinationPort,proto3" json:"destination_port,omitempty"`
	// protocol. Matches any protocol if empty.
	Protocol Protocol `protobuf:"varint,5,opt,name=protocol,proto3,enum=recorder.Protocol" json:"protocol,omitempty"`
	// contains filtered or unexported fields
}

func (*Filter) Descriptor deprecated

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

Deprecated: Use Filter.ProtoReflect.Descriptor instead.

func (*Filter) GetDestinationCidr

func (x *Filter) GetDestinationCidr() string

func (*Filter) GetDestinationPort

func (x *Filter) GetDestinationPort() uint32

func (*Filter) GetProtocol

func (x *Filter) GetProtocol() Protocol

func (*Filter) GetSourceCidr

func (x *Filter) GetSourceCidr() string

func (*Filter) GetSourcePort

func (x *Filter) GetSourcePort() uint32

func (*Filter) MarshalJSON

func (msg *Filter) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*Filter) ProtoMessage

func (*Filter) ProtoMessage()

func (*Filter) ProtoReflect

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

func (*Filter) Reset

func (x *Filter) Reset()

func (*Filter) String

func (x *Filter) String() string

func (*Filter) UnmarshalJSON

func (msg *Filter) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type Protocol

type Protocol int32

Protocol is a one of the supported protocols for packet capture

const (
	Protocol_PROTOCOL_ANY Protocol = 0
	Protocol_PROTOCOL_TCP Protocol = 6
	Protocol_PROTOCOL_UDP Protocol = 17
)

func (Protocol) Descriptor

func (Protocol) Descriptor() protoreflect.EnumDescriptor

func (Protocol) Enum

func (x Protocol) Enum() *Protocol

func (Protocol) EnumDescriptor deprecated

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

Deprecated: Use Protocol.Descriptor instead.

func (Protocol) Number

func (x Protocol) Number() protoreflect.EnumNumber

func (Protocol) String

func (x Protocol) String() string

func (Protocol) Type

type RecordRequest

type RecordRequest struct {

	// Types that are assignable to RequestType:
	//	*RecordRequest_Start
	//	*RecordRequest_Stop
	RequestType isRecordRequest_RequestType `protobuf_oneof:"request_type"`
	// contains filtered or unexported fields
}

func (*RecordRequest) Descriptor deprecated

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

Deprecated: Use RecordRequest.ProtoReflect.Descriptor instead.

func (*RecordRequest) GetRequestType

func (m *RecordRequest) GetRequestType() isRecordRequest_RequestType

func (*RecordRequest) GetStart

func (x *RecordRequest) GetStart() *StartRecording

func (*RecordRequest) GetStop

func (x *RecordRequest) GetStop() *StopRecording

func (*RecordRequest) MarshalJSON

func (msg *RecordRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*RecordRequest) ProtoMessage

func (*RecordRequest) ProtoMessage()

func (*RecordRequest) ProtoReflect

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

func (*RecordRequest) Reset

func (x *RecordRequest) Reset()

func (*RecordRequest) String

func (x *RecordRequest) String() string

func (*RecordRequest) UnmarshalJSON

func (msg *RecordRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type RecordRequest_Start

type RecordRequest_Start struct {
	// start starts a new recording with the given parameters.
	Start *StartRecording `protobuf:"bytes,1,opt,name=start,proto3,oneof"`
}

type RecordRequest_Stop

type RecordRequest_Stop struct {
	// stop stops the running recording.
	Stop *StopRecording `protobuf:"bytes,2,opt,name=stop,proto3,oneof"`
}

type RecordResponse

type RecordResponse struct {

	// name of the node where this recording is happening
	NodeName string `protobuf:"bytes,1,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"`
	// time at which this event was observed on the above node
	Time *timestamp.Timestamp `protobuf:"bytes,2,opt,name=time,proto3" json:"time,omitempty"`
	// Note: In this initial design, any fatal error will be returned as
	// gRPC errors and are not part of the regular response type.
	// It is a forward-compatible change to introduce additional more
	// granular or structured error responses here.
	//
	// Types that are assignable to ResponseType:
	//	*RecordResponse_Running
	//	*RecordResponse_Stopped
	ResponseType isRecordResponse_ResponseType `protobuf_oneof:"response_type"`
	// contains filtered or unexported fields
}

func (*RecordResponse) Descriptor deprecated

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

Deprecated: Use RecordResponse.ProtoReflect.Descriptor instead.

func (*RecordResponse) GetNodeName

func (x *RecordResponse) GetNodeName() string

func (*RecordResponse) GetResponseType

func (m *RecordResponse) GetResponseType() isRecordResponse_ResponseType

func (*RecordResponse) GetRunning

func (x *RecordResponse) GetRunning() *RecordingRunningResponse

func (*RecordResponse) GetStopped

func (x *RecordResponse) GetStopped() *RecordingStoppedResponse

func (*RecordResponse) GetTime

func (x *RecordResponse) GetTime() *timestamp.Timestamp

func (*RecordResponse) MarshalJSON

func (msg *RecordResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*RecordResponse) ProtoMessage

func (*RecordResponse) ProtoMessage()

func (*RecordResponse) ProtoReflect

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

func (*RecordResponse) Reset

func (x *RecordResponse) Reset()

func (*RecordResponse) String

func (x *RecordResponse) String() string

func (*RecordResponse) UnmarshalJSON

func (msg *RecordResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type RecordResponse_Running

type RecordResponse_Running struct {
	// running means that the recording is capturing packets. This is
	// emitted in regular intervals
	Running *RecordingRunningResponse `protobuf:"bytes,3,opt,name=running,proto3,oneof"`
}

type RecordResponse_Stopped

type RecordResponse_Stopped struct {
	// stopped means the recording has stopped
	Stopped *RecordingStoppedResponse `protobuf:"bytes,4,opt,name=stopped,proto3,oneof"`
}

type RecorderClient

type RecorderClient interface {
	// Record can start and stop a single recording. The recording is
	// automatically stopped if the client aborts this rpc call.
	Record(ctx context.Context, opts ...grpc.CallOption) (Recorder_RecordClient, error)
}

RecorderClient is the client API for Recorder 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.

func NewRecorderClient

func NewRecorderClient(cc grpc.ClientConnInterface) RecorderClient

type RecorderServer

type RecorderServer interface {
	// Record can start and stop a single recording. The recording is
	// automatically stopped if the client aborts this rpc call.
	Record(Recorder_RecordServer) error
}

RecorderServer is the server API for Recorder service. All implementations should embed UnimplementedRecorderServer for forward compatibility

type Recorder_RecordClient

type Recorder_RecordClient interface {
	Send(*RecordRequest) error
	Recv() (*RecordResponse, error)
	grpc.ClientStream
}

type Recorder_RecordServer

type Recorder_RecordServer interface {
	Send(*RecordResponse) error
	Recv() (*RecordRequest, error)
	grpc.ServerStream
}

type RecordingRunningResponse

type RecordingRunningResponse struct {

	// stats for the running recording
	Stats *RecordingStatistics `protobuf:"bytes,1,opt,name=stats,proto3" json:"stats,omitempty"`
	// contains filtered or unexported fields
}

func (*RecordingRunningResponse) Descriptor deprecated

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

Deprecated: Use RecordingRunningResponse.ProtoReflect.Descriptor instead.

func (*RecordingRunningResponse) GetStats

func (*RecordingRunningResponse) MarshalJSON

func (msg *RecordingRunningResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*RecordingRunningResponse) ProtoMessage

func (*RecordingRunningResponse) ProtoMessage()

func (*RecordingRunningResponse) ProtoReflect

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

func (*RecordingRunningResponse) Reset

func (x *RecordingRunningResponse) Reset()

func (*RecordingRunningResponse) String

func (x *RecordingRunningResponse) String() string

func (*RecordingRunningResponse) UnmarshalJSON

func (msg *RecordingRunningResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type RecordingStatistics

type RecordingStatistics struct {

	// bytes_captured is the total amount of bytes captured in the recording
	BytesCaptured uint64 `protobuf:"varint,1,opt,name=bytes_captured,json=bytesCaptured,proto3" json:"bytes_captured,omitempty"`
	// packets_captured is the total amount of packets captured the recording
	PacketsCaptured uint64 `protobuf:"varint,2,opt,name=packets_captured,json=packetsCaptured,proto3" json:"packets_captured,omitempty"`
	// packets_lost is the total amount of packets matching the filter during
	// the recording, but never written to the sink because it was overloaded.
	PacketsLost uint64 `protobuf:"varint,3,opt,name=packets_lost,json=packetsLost,proto3" json:"packets_lost,omitempty"`
	// bytes_lost is the total amount of bytes matching the filter during
	// the recording, but never written to the sink because it was overloaded.
	BytesLost uint64 `protobuf:"varint,4,opt,name=bytes_lost,json=bytesLost,proto3" json:"bytes_lost,omitempty"`
	// contains filtered or unexported fields
}

func (*RecordingStatistics) Descriptor deprecated

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

Deprecated: Use RecordingStatistics.ProtoReflect.Descriptor instead.

func (*RecordingStatistics) GetBytesCaptured

func (x *RecordingStatistics) GetBytesCaptured() uint64

func (*RecordingStatistics) GetBytesLost

func (x *RecordingStatistics) GetBytesLost() uint64

func (*RecordingStatistics) GetPacketsCaptured

func (x *RecordingStatistics) GetPacketsCaptured() uint64

func (*RecordingStatistics) GetPacketsLost

func (x *RecordingStatistics) GetPacketsLost() uint64

func (*RecordingStatistics) MarshalJSON

func (msg *RecordingStatistics) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*RecordingStatistics) ProtoMessage

func (*RecordingStatistics) ProtoMessage()

func (*RecordingStatistics) ProtoReflect

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

func (*RecordingStatistics) Reset

func (x *RecordingStatistics) Reset()

func (*RecordingStatistics) String

func (x *RecordingStatistics) String() string

func (*RecordingStatistics) UnmarshalJSON

func (msg *RecordingStatistics) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type RecordingStoppedResponse

type RecordingStoppedResponse struct {

	// stats for the recording
	Stats *RecordingStatistics `protobuf:"bytes,1,opt,name=stats,proto3" json:"stats,omitempty"`
	// filesink contains the path to the captured file
	Filesink *FileSinkResult `protobuf:"bytes,2,opt,name=filesink,proto3" json:"filesink,omitempty"`
	// contains filtered or unexported fields
}

func (*RecordingStoppedResponse) Descriptor deprecated

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

Deprecated: Use RecordingStoppedResponse.ProtoReflect.Descriptor instead.

func (*RecordingStoppedResponse) GetFilesink

func (x *RecordingStoppedResponse) GetFilesink() *FileSinkResult

func (*RecordingStoppedResponse) GetStats

func (*RecordingStoppedResponse) MarshalJSON

func (msg *RecordingStoppedResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*RecordingStoppedResponse) ProtoMessage

func (*RecordingStoppedResponse) ProtoMessage()

func (*RecordingStoppedResponse) ProtoReflect

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

func (*RecordingStoppedResponse) Reset

func (x *RecordingStoppedResponse) Reset()

func (*RecordingStoppedResponse) String

func (x *RecordingStoppedResponse) String() string

func (*RecordingStoppedResponse) UnmarshalJSON

func (msg *RecordingStoppedResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type StartRecording

type StartRecording struct {

	// filesink configures the outfile of this recording
	// Future alternative sink configurations may be added as a
	// backwards-compatible change by moving this field into a oneof.
	Filesink *FileSinkConfiguration `protobuf:"bytes,1,opt,name=filesink,proto3" json:"filesink,omitempty"`
	// include list for this recording. Packets matching any of the provided
	// filters will be recorded.
	Include []*Filter `protobuf:"bytes,2,rep,name=include,proto3" json:"include,omitempty"`
	// max_capture_length specifies the maximum packet length.
	// Full packet length will be captured if absent/zero.
	MaxCaptureLength uint32 `protobuf:"varint,3,opt,name=max_capture_length,json=maxCaptureLength,proto3" json:"max_capture_length,omitempty"`
	// contains filtered or unexported fields
}

func (*StartRecording) Descriptor deprecated

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

Deprecated: Use StartRecording.ProtoReflect.Descriptor instead.

func (*StartRecording) GetFilesink

func (x *StartRecording) GetFilesink() *FileSinkConfiguration

func (*StartRecording) GetInclude

func (x *StartRecording) GetInclude() []*Filter

func (*StartRecording) GetMaxCaptureLength

func (x *StartRecording) GetMaxCaptureLength() uint32

func (*StartRecording) MarshalJSON

func (msg *StartRecording) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*StartRecording) ProtoMessage

func (*StartRecording) ProtoMessage()

func (*StartRecording) ProtoReflect

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

func (*StartRecording) Reset

func (x *StartRecording) Reset()

func (*StartRecording) String

func (x *StartRecording) String() string

func (*StartRecording) UnmarshalJSON

func (msg *StartRecording) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type StopRecording

type StopRecording struct {
	// contains filtered or unexported fields
}

func (*StopRecording) Descriptor deprecated

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

Deprecated: Use StopRecording.ProtoReflect.Descriptor instead.

func (*StopRecording) MarshalJSON

func (msg *StopRecording) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*StopRecording) ProtoMessage

func (*StopRecording) ProtoMessage()

func (*StopRecording) ProtoReflect

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

func (*StopRecording) Reset

func (x *StopRecording) Reset()

func (*StopRecording) String

func (x *StopRecording) String() string

func (*StopRecording) UnmarshalJSON

func (msg *StopRecording) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type UnimplementedRecorderServer

type UnimplementedRecorderServer struct {
}

UnimplementedRecorderServer should be embedded to have forward compatible implementations.

func (*UnimplementedRecorderServer) Record

Jump to

Keyboard shortcuts

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