proto

package
v0.0.0-...-52fba49 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AgentStatus_name = map[int32]string{
		0: "UNKNOWN",
		1: "ACTIVE",
		2: "SLEEPING",
		3: "DEAD",
	}
	AgentStatus_value = map[string]int32{
		"UNKNOWN":  0,
		"ACTIVE":   1,
		"SLEEPING": 2,
		"DEAD":     3,
	}
)

Enum value maps for AgentStatus.

View Source
var (
	ResponseType_name = map[int32]string{
		0: "NONE",
		1: "TASK",
		2: "CONFIG",
		3: "ERROR",
		4: "ACK",
	}
	ResponseType_value = map[string]int32{
		"NONE":   0,
		"TASK":   1,
		"CONFIG": 2,
		"ERROR":  3,
		"ACK":    4,
	}
)

Enum value maps for ResponseType.

View Source
var File_proto_c2_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AgentInfo

type AgentInfo struct {
	AgentId      string   `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"`
	Hostname     string   `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"`
	Username     string   `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`
	OsInfo       string   `protobuf:"bytes,4,opt,name=os_info,json=osInfo,proto3" json:"os_info,omitempty"`
	Architecture string   `protobuf:"bytes,5,opt,name=architecture,proto3" json:"architecture,omitempty"`
	Capabilities []string `protobuf:"bytes,6,rep,name=capabilities,proto3" json:"capabilities,omitempty"`
	FirstSeen    int64    `protobuf:"varint,7,opt,name=first_seen,json=firstSeen,proto3" json:"first_seen,omitempty"`
	LastSeen     int64    `protobuf:"varint,8,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"`
	// contains filtered or unexported fields
}

AgentInfo contains information about the agent

func (*AgentInfo) Descriptor deprecated

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

Deprecated: Use AgentInfo.ProtoReflect.Descriptor instead.

func (*AgentInfo) GetAgentId

func (x *AgentInfo) GetAgentId() string

func (*AgentInfo) GetArchitecture

func (x *AgentInfo) GetArchitecture() string

func (*AgentInfo) GetCapabilities

func (x *AgentInfo) GetCapabilities() []string

func (*AgentInfo) GetFirstSeen

func (x *AgentInfo) GetFirstSeen() int64

func (*AgentInfo) GetHostname

func (x *AgentInfo) GetHostname() string

func (*AgentInfo) GetLastSeen

func (x *AgentInfo) GetLastSeen() int64

func (*AgentInfo) GetOsInfo

func (x *AgentInfo) GetOsInfo() string

func (*AgentInfo) GetUsername

func (x *AgentInfo) GetUsername() string

func (*AgentInfo) ProtoMessage

func (*AgentInfo) ProtoMessage()

func (*AgentInfo) ProtoReflect

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

func (*AgentInfo) Reset

func (x *AgentInfo) Reset()

func (*AgentInfo) String

func (x *AgentInfo) String() string

type AgentStatus

type AgentStatus int32

AgentStatus represents the current state of the agent

const (
	AgentStatus_UNKNOWN  AgentStatus = 0
	AgentStatus_ACTIVE   AgentStatus = 1
	AgentStatus_SLEEPING AgentStatus = 2
	AgentStatus_DEAD     AgentStatus = 3
)

func (AgentStatus) Descriptor

func (AgentStatus) Enum

func (x AgentStatus) Enum() *AgentStatus

func (AgentStatus) EnumDescriptor deprecated

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

Deprecated: Use AgentStatus.Descriptor instead.

func (AgentStatus) Number

func (x AgentStatus) Number() protoreflect.EnumNumber

func (AgentStatus) String

func (x AgentStatus) String() string

func (AgentStatus) Type

type Heartbeat

type Heartbeat struct {
	AgentId      string      `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"`
	Timestamp    int64       `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Status       AgentStatus `protobuf:"varint,3,opt,name=status,proto3,enum=c2.AgentStatus" json:"status,omitempty"`
	PendingTasks []string    `protobuf:"bytes,4,rep,name=pending_tasks,json=pendingTasks,proto3" json:"pending_tasks,omitempty"`
	// contains filtered or unexported fields
}

Heartbeat is used for agent-server communication

func (*Heartbeat) Descriptor deprecated

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

Deprecated: Use Heartbeat.ProtoReflect.Descriptor instead.

func (*Heartbeat) GetAgentId

func (x *Heartbeat) GetAgentId() string

func (*Heartbeat) GetPendingTasks

func (x *Heartbeat) GetPendingTasks() []string

func (*Heartbeat) GetStatus

func (x *Heartbeat) GetStatus() AgentStatus

func (*Heartbeat) GetTimestamp

func (x *Heartbeat) GetTimestamp() int64

func (*Heartbeat) ProtoMessage

func (*Heartbeat) ProtoMessage()

func (*Heartbeat) ProtoReflect

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

func (*Heartbeat) Reset

func (x *Heartbeat) Reset()

func (*Heartbeat) String

func (x *Heartbeat) String() string

type Registration

type Registration struct {
	AgentInfo       *AgentInfo `protobuf:"bytes,1,opt,name=agent_info,json=agentInfo,proto3" json:"agent_info,omitempty"`
	PublicKey       []byte     `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	ProtocolVersion string     `protobuf:"bytes,3,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"`
	// contains filtered or unexported fields
}

Registration is used when an agent first connects to the server

func (*Registration) Descriptor deprecated

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

Deprecated: Use Registration.ProtoReflect.Descriptor instead.

func (*Registration) GetAgentInfo

func (x *Registration) GetAgentInfo() *AgentInfo

func (*Registration) GetProtocolVersion

func (x *Registration) GetProtocolVersion() string

func (*Registration) GetPublicKey

func (x *Registration) GetPublicKey() []byte

func (*Registration) ProtoMessage

func (*Registration) ProtoMessage()

func (*Registration) ProtoReflect

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

func (*Registration) Reset

func (x *Registration) Reset()

func (*Registration) String

func (x *Registration) String() string

type ResponseType

type ResponseType int32

ResponseType indicates the type of server response

const (
	ResponseType_NONE   ResponseType = 0
	ResponseType_TASK   ResponseType = 1
	ResponseType_CONFIG ResponseType = 2
	ResponseType_ERROR  ResponseType = 3
	ResponseType_ACK    ResponseType = 4
)

func (ResponseType) Descriptor

func (ResponseType) Enum

func (x ResponseType) Enum() *ResponseType

func (ResponseType) EnumDescriptor deprecated

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

Deprecated: Use ResponseType.Descriptor instead.

func (ResponseType) Number

func (ResponseType) String

func (x ResponseType) String() string

func (ResponseType) Type

type ServerResponse

type ServerResponse struct {
	MessageId string       `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
	Type      ResponseType `protobuf:"varint,2,opt,name=type,proto3,enum=c2.ResponseType" json:"type,omitempty"`
	Data      []byte       `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	Error     string       `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

ServerResponse is the generic response from the server

func (*ServerResponse) Descriptor deprecated

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

Deprecated: Use ServerResponse.ProtoReflect.Descriptor instead.

func (*ServerResponse) GetData

func (x *ServerResponse) GetData() []byte

func (*ServerResponse) GetError

func (x *ServerResponse) GetError() string

func (*ServerResponse) GetMessageId

func (x *ServerResponse) GetMessageId() string

func (*ServerResponse) GetType

func (x *ServerResponse) GetType() ResponseType

func (*ServerResponse) ProtoMessage

func (*ServerResponse) ProtoMessage()

func (*ServerResponse) ProtoReflect

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

func (*ServerResponse) Reset

func (x *ServerResponse) Reset()

func (*ServerResponse) String

func (x *ServerResponse) String() string

type Task

type Task struct {
	TaskId    string   `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
	Command   string   `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"`
	Arguments []string `protobuf:"bytes,3,rep,name=arguments,proto3" json:"arguments,omitempty"`
	Timestamp int64    `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Timeout   int32    `protobuf:"varint,5,opt,name=timeout,proto3" json:"timeout,omitempty"`
	// contains filtered or unexported fields
}

Task represents a command to be executed by the agent

func (*Task) Descriptor deprecated

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

Deprecated: Use Task.ProtoReflect.Descriptor instead.

func (*Task) GetArguments

func (x *Task) GetArguments() []string

func (*Task) GetCommand

func (x *Task) GetCommand() string

func (*Task) GetTaskId

func (x *Task) GetTaskId() string

func (*Task) GetTimeout

func (x *Task) GetTimeout() int32

func (*Task) GetTimestamp

func (x *Task) GetTimestamp() int64

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) ProtoReflect

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

func (*Task) Reset

func (x *Task) Reset()

func (*Task) String

func (x *Task) String() string

type TaskResult

type TaskResult struct {
	TaskId    string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
	AgentId   string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"`
	ExitCode  int32  `protobuf:"varint,3,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
	Output    []byte `protobuf:"bytes,4,opt,name=output,proto3" json:"output,omitempty"`
	Error     []byte `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"`
	Timestamp int64  `protobuf:"varint,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

TaskResult contains the output of a executed task

func (*TaskResult) Descriptor deprecated

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

Deprecated: Use TaskResult.ProtoReflect.Descriptor instead.

func (*TaskResult) GetAgentId

func (x *TaskResult) GetAgentId() string

func (*TaskResult) GetError

func (x *TaskResult) GetError() []byte

func (*TaskResult) GetExitCode

func (x *TaskResult) GetExitCode() int32

func (*TaskResult) GetOutput

func (x *TaskResult) GetOutput() []byte

func (*TaskResult) GetTaskId

func (x *TaskResult) GetTaskId() string

func (*TaskResult) GetTimestamp

func (x *TaskResult) GetTimestamp() int64

func (*TaskResult) ProtoMessage

func (*TaskResult) ProtoMessage()

func (*TaskResult) ProtoReflect

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

func (*TaskResult) Reset

func (x *TaskResult) Reset()

func (*TaskResult) String

func (x *TaskResult) String() string

Jump to

Keyboard shortcuts

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