pg

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package pg contains generated bindings for API file pg.api.

Contents: - 2 enums - 14 messages

Index

Constants

View Source
const (
	APIFile    = "pg"
	APIVersion = "2.1.0"
	VersionCrc = 0xeae14b90
)

Variables

View Source
var (
	PgInterfaceFlags_name = map[uint32]string{
		0: "PG_API_FLAG_NONE",
		1: "PG_API_FLAG_CSUM_OFFLOAD",
		2: "PG_API_FLAG_GSO",
		4: "PG_API_FLAG_GRO_COALESCE",
	}
	PgInterfaceFlags_value = map[string]uint32{
		"PG_API_FLAG_NONE":         0,
		"PG_API_FLAG_CSUM_OFFLOAD": 1,
		"PG_API_FLAG_GSO":          2,
		"PG_API_FLAG_GRO_COALESCE": 4,
	}
)
View Source
var (
	PgInterfaceMode_name = map[uint8]string{
		0: "PG_API_MODE_ETHERNET",
		1: "PG_API_MODE_IP4",
		2: "PG_API_MODE_IP6",
	}
	PgInterfaceMode_value = map[string]uint8{
		"PG_API_MODE_ETHERNET": 0,
		"PG_API_MODE_IP4":      1,
		"PG_API_MODE_IP6":      2,
	}
)

Functions

func AllMessages

func AllMessages() []api.Message

Messages returns list of all messages in this module.

Types

type PgCapture

type PgCapture struct {
	InterfaceID  interface_types.InterfaceIndex `binapi:"interface_index,name=interface_id" json:"interface_id,omitempty"`
	IsEnabled    bool                           `binapi:"bool,name=is_enabled,default=true" json:"is_enabled,omitempty"`
	Count        uint32                         `binapi:"u32,name=count" json:"count,omitempty"`
	PcapFileName string                         `binapi:"string[],name=pcap_file_name" json:"pcap_file_name,omitempty"`
}

PacketGenerator capture packets on given interface request

  • interface_id - pg interface index
  • is_enabled - 1 if enabling streams, 0 if disabling
  • count - number of packets to be captured
  • pcap_file_name - pacp file name to store captured packets

PgCapture defines message 'pg_capture'.

func (*PgCapture) GetCrcString

func (*PgCapture) GetCrcString() string

func (*PgCapture) GetMessageName

func (*PgCapture) GetMessageName() string

func (*PgCapture) GetMessageType

func (*PgCapture) GetMessageType() api.MessageType

func (*PgCapture) Marshal

func (m *PgCapture) Marshal(b []byte) ([]byte, error)

func (*PgCapture) Reset

func (m *PgCapture) Reset()

func (*PgCapture) Size

func (m *PgCapture) Size() (size int)

func (*PgCapture) Unmarshal

func (m *PgCapture) Unmarshal(b []byte) error

type PgCaptureReply

type PgCaptureReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

PgCaptureReply defines message 'pg_capture_reply'.

func (*PgCaptureReply) GetCrcString

func (*PgCaptureReply) GetCrcString() string

func (*PgCaptureReply) GetMessageName

func (*PgCaptureReply) GetMessageName() string

func (*PgCaptureReply) GetMessageType

func (*PgCaptureReply) GetMessageType() api.MessageType

func (*PgCaptureReply) Marshal

func (m *PgCaptureReply) Marshal(b []byte) ([]byte, error)

func (*PgCaptureReply) Reset

func (m *PgCaptureReply) Reset()

func (*PgCaptureReply) Size

func (m *PgCaptureReply) Size() (size int)

func (*PgCaptureReply) Unmarshal

func (m *PgCaptureReply) Unmarshal(b []byte) error

type PgCreateInterface

type PgCreateInterface struct {
	InterfaceID interface_types.InterfaceIndex `binapi:"interface_index,name=interface_id" json:"interface_id,omitempty"`
	GsoEnabled  bool                           `binapi:"bool,name=gso_enabled" json:"gso_enabled,omitempty"`
	GsoSize     uint32                         `binapi:"u32,name=gso_size" json:"gso_size,omitempty"`
}

PacketGenerator create interface request

  • interface_id - interface index
  • gso_enabled - enable gso on this interface
  • gso_size - gso size on this interface

PgCreateInterface defines message 'pg_create_interface'. Deprecated: the message will be removed in the future versions

func (*PgCreateInterface) GetCrcString

func (*PgCreateInterface) GetCrcString() string

func (*PgCreateInterface) GetMessageName

func (*PgCreateInterface) GetMessageName() string

func (*PgCreateInterface) GetMessageType

func (*PgCreateInterface) GetMessageType() api.MessageType

func (*PgCreateInterface) Marshal

func (m *PgCreateInterface) Marshal(b []byte) ([]byte, error)

func (*PgCreateInterface) Reset

func (m *PgCreateInterface) Reset()

func (*PgCreateInterface) Size

func (m *PgCreateInterface) Size() (size int)

func (*PgCreateInterface) Unmarshal

func (m *PgCreateInterface) Unmarshal(b []byte) error

type PgCreateInterfaceReply

type PgCreateInterfaceReply struct {
	Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}

PacketGenerator create interface response

  • retval - return value for request

PgCreateInterfaceReply defines message 'pg_create_interface_reply'. Deprecated: the message will be removed in the future versions

func (*PgCreateInterfaceReply) GetCrcString

func (*PgCreateInterfaceReply) GetCrcString() string

func (*PgCreateInterfaceReply) GetMessageName

func (*PgCreateInterfaceReply) GetMessageName() string

func (*PgCreateInterfaceReply) GetMessageType

func (*PgCreateInterfaceReply) GetMessageType() api.MessageType

func (*PgCreateInterfaceReply) Marshal

func (m *PgCreateInterfaceReply) Marshal(b []byte) ([]byte, error)

func (*PgCreateInterfaceReply) Reset

func (m *PgCreateInterfaceReply) Reset()

func (*PgCreateInterfaceReply) Size

func (m *PgCreateInterfaceReply) Size() (size int)

func (*PgCreateInterfaceReply) Unmarshal

func (m *PgCreateInterfaceReply) Unmarshal(b []byte) error

type PgCreateInterfaceV2

type PgCreateInterfaceV2 struct {
	InterfaceID interface_types.InterfaceIndex `binapi:"interface_index,name=interface_id" json:"interface_id,omitempty"`
	GsoEnabled  bool                           `binapi:"bool,name=gso_enabled" json:"gso_enabled,omitempty"`
	GsoSize     uint32                         `binapi:"u32,name=gso_size" json:"gso_size,omitempty"`
	Mode        PgInterfaceMode                `binapi:"pg_interface_mode,name=mode" json:"mode,omitempty"`
}

PgCreateInterfaceV2 defines message 'pg_create_interface_v2'. Deprecated: the message will be removed in the future versions

func (*PgCreateInterfaceV2) GetCrcString

func (*PgCreateInterfaceV2) GetCrcString() string

func (*PgCreateInterfaceV2) GetMessageName

func (*PgCreateInterfaceV2) GetMessageName() string

func (*PgCreateInterfaceV2) GetMessageType

func (*PgCreateInterfaceV2) GetMessageType() api.MessageType

func (*PgCreateInterfaceV2) Marshal

func (m *PgCreateInterfaceV2) Marshal(b []byte) ([]byte, error)

func (*PgCreateInterfaceV2) Reset

func (m *PgCreateInterfaceV2) Reset()

func (*PgCreateInterfaceV2) Size

func (m *PgCreateInterfaceV2) Size() (size int)

func (*PgCreateInterfaceV2) Unmarshal

func (m *PgCreateInterfaceV2) Unmarshal(b []byte) error

type PgCreateInterfaceV2Reply

type PgCreateInterfaceV2Reply struct {
	Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}

PgCreateInterfaceV2Reply defines message 'pg_create_interface_v2_reply'. Deprecated: the message will be removed in the future versions

func (*PgCreateInterfaceV2Reply) GetCrcString

func (*PgCreateInterfaceV2Reply) GetCrcString() string

func (*PgCreateInterfaceV2Reply) GetMessageName

func (*PgCreateInterfaceV2Reply) GetMessageName() string

func (*PgCreateInterfaceV2Reply) GetMessageType

func (*PgCreateInterfaceV2Reply) GetMessageType() api.MessageType

func (*PgCreateInterfaceV2Reply) Marshal

func (m *PgCreateInterfaceV2Reply) Marshal(b []byte) ([]byte, error)

func (*PgCreateInterfaceV2Reply) Reset

func (m *PgCreateInterfaceV2Reply) Reset()

func (*PgCreateInterfaceV2Reply) Size

func (m *PgCreateInterfaceV2Reply) Size() (size int)

func (*PgCreateInterfaceV2Reply) Unmarshal

func (m *PgCreateInterfaceV2Reply) Unmarshal(b []byte) error

type PgCreateInterfaceV3 added in v0.9.0

type PgCreateInterfaceV3 struct {
	InterfaceID interface_types.InterfaceIndex `binapi:"interface_index,name=interface_id" json:"interface_id,omitempty"`
	PgFlags     PgInterfaceFlags               `binapi:"pg_interface_flags,name=pg_flags" json:"pg_flags,omitempty"`
	GsoSize     uint32                         `binapi:"u32,name=gso_size" json:"gso_size,omitempty"`
	Mode        PgInterfaceMode                `binapi:"pg_interface_mode,name=mode" json:"mode,omitempty"`
}

PgCreateInterfaceV3 defines message 'pg_create_interface_v3'.

func (*PgCreateInterfaceV3) GetCrcString added in v0.9.0

func (*PgCreateInterfaceV3) GetCrcString() string

func (*PgCreateInterfaceV3) GetMessageName added in v0.9.0

func (*PgCreateInterfaceV3) GetMessageName() string

func (*PgCreateInterfaceV3) GetMessageType added in v0.9.0

func (*PgCreateInterfaceV3) GetMessageType() api.MessageType

func (*PgCreateInterfaceV3) Marshal added in v0.9.0

func (m *PgCreateInterfaceV3) Marshal(b []byte) ([]byte, error)

func (*PgCreateInterfaceV3) Reset added in v0.9.0

func (m *PgCreateInterfaceV3) Reset()

func (*PgCreateInterfaceV3) Size added in v0.9.0

func (m *PgCreateInterfaceV3) Size() (size int)

func (*PgCreateInterfaceV3) Unmarshal added in v0.9.0

func (m *PgCreateInterfaceV3) Unmarshal(b []byte) error

type PgCreateInterfaceV3Reply added in v0.9.0

type PgCreateInterfaceV3Reply struct {
	Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}

PgCreateInterfaceV3Reply defines message 'pg_create_interface_v3_reply'.

func (*PgCreateInterfaceV3Reply) GetCrcString added in v0.9.0

func (*PgCreateInterfaceV3Reply) GetCrcString() string

func (*PgCreateInterfaceV3Reply) GetMessageName added in v0.9.0

func (*PgCreateInterfaceV3Reply) GetMessageName() string

func (*PgCreateInterfaceV3Reply) GetMessageType added in v0.9.0

func (*PgCreateInterfaceV3Reply) GetMessageType() api.MessageType

func (*PgCreateInterfaceV3Reply) Marshal added in v0.9.0

func (m *PgCreateInterfaceV3Reply) Marshal(b []byte) ([]byte, error)

func (*PgCreateInterfaceV3Reply) Reset added in v0.9.0

func (m *PgCreateInterfaceV3Reply) Reset()

func (*PgCreateInterfaceV3Reply) Size added in v0.9.0

func (m *PgCreateInterfaceV3Reply) Size() (size int)

func (*PgCreateInterfaceV3Reply) Unmarshal added in v0.9.0

func (m *PgCreateInterfaceV3Reply) Unmarshal(b []byte) error

type PgDeleteInterface added in v0.9.0

type PgDeleteInterface struct {
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}

PacketGenerator delete interface request

  • sw_if_index - interface index

PgDeleteInterface defines message 'pg_delete_interface'.

func (*PgDeleteInterface) GetCrcString added in v0.9.0

func (*PgDeleteInterface) GetCrcString() string

func (*PgDeleteInterface) GetMessageName added in v0.9.0

func (*PgDeleteInterface) GetMessageName() string

func (*PgDeleteInterface) GetMessageType added in v0.9.0

func (*PgDeleteInterface) GetMessageType() api.MessageType

func (*PgDeleteInterface) Marshal added in v0.9.0

func (m *PgDeleteInterface) Marshal(b []byte) ([]byte, error)

func (*PgDeleteInterface) Reset added in v0.9.0

func (m *PgDeleteInterface) Reset()

func (*PgDeleteInterface) Size added in v0.9.0

func (m *PgDeleteInterface) Size() (size int)

func (*PgDeleteInterface) Unmarshal added in v0.9.0

func (m *PgDeleteInterface) Unmarshal(b []byte) error

type PgDeleteInterfaceReply added in v0.9.0

type PgDeleteInterfaceReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

PgDeleteInterfaceReply defines message 'pg_delete_interface_reply'.

func (*PgDeleteInterfaceReply) GetCrcString added in v0.9.0

func (*PgDeleteInterfaceReply) GetCrcString() string

func (*PgDeleteInterfaceReply) GetMessageName added in v0.9.0

func (*PgDeleteInterfaceReply) GetMessageName() string

func (*PgDeleteInterfaceReply) GetMessageType added in v0.9.0

func (*PgDeleteInterfaceReply) GetMessageType() api.MessageType

func (*PgDeleteInterfaceReply) Marshal added in v0.9.0

func (m *PgDeleteInterfaceReply) Marshal(b []byte) ([]byte, error)

func (*PgDeleteInterfaceReply) Reset added in v0.9.0

func (m *PgDeleteInterfaceReply) Reset()

func (*PgDeleteInterfaceReply) Size added in v0.9.0

func (m *PgDeleteInterfaceReply) Size() (size int)

func (*PgDeleteInterfaceReply) Unmarshal added in v0.9.0

func (m *PgDeleteInterfaceReply) Unmarshal(b []byte) error

type PgEnableDisable

type PgEnableDisable struct {
	IsEnabled  bool   `binapi:"bool,name=is_enabled,default=true" json:"is_enabled,omitempty"`
	StreamName string `binapi:"string[],name=stream_name" json:"stream_name,omitempty"`
}

Enable / disable packet generator request

  • is_enabled - 1 if enabling streams, 0 if disabling
  • stream_name - stream name to be enable/disabled, if not specified handle all streams

PgEnableDisable defines message 'pg_enable_disable'.

func (*PgEnableDisable) GetCrcString

func (*PgEnableDisable) GetCrcString() string

func (*PgEnableDisable) GetMessageName

func (*PgEnableDisable) GetMessageName() string

func (*PgEnableDisable) GetMessageType

func (*PgEnableDisable) GetMessageType() api.MessageType

func (*PgEnableDisable) Marshal

func (m *PgEnableDisable) Marshal(b []byte) ([]byte, error)

func (*PgEnableDisable) Reset

func (m *PgEnableDisable) Reset()

func (*PgEnableDisable) Size

func (m *PgEnableDisable) Size() (size int)

func (*PgEnableDisable) Unmarshal

func (m *PgEnableDisable) Unmarshal(b []byte) error

type PgEnableDisableReply

type PgEnableDisableReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

PgEnableDisableReply defines message 'pg_enable_disable_reply'.

func (*PgEnableDisableReply) GetCrcString

func (*PgEnableDisableReply) GetCrcString() string

func (*PgEnableDisableReply) GetMessageName

func (*PgEnableDisableReply) GetMessageName() string

func (*PgEnableDisableReply) GetMessageType

func (*PgEnableDisableReply) GetMessageType() api.MessageType

func (*PgEnableDisableReply) Marshal

func (m *PgEnableDisableReply) Marshal(b []byte) ([]byte, error)

func (*PgEnableDisableReply) Reset

func (m *PgEnableDisableReply) Reset()

func (*PgEnableDisableReply) Size

func (m *PgEnableDisableReply) Size() (size int)

func (*PgEnableDisableReply) Unmarshal

func (m *PgEnableDisableReply) Unmarshal(b []byte) error

type PgInterfaceEnableDisableCoalesce

type PgInterfaceEnableDisableCoalesce struct {
	SwIfIndex       interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
	CoalesceEnabled bool                           `binapi:"bool,name=coalesce_enabled" json:"coalesce_enabled,omitempty"`
}

PacketGenerator interface enable/disable packet coalesce

  • interface_id - interface index
  • coalesce_enabled - enable/disable packet coalesce on this interface

PgInterfaceEnableDisableCoalesce defines message 'pg_interface_enable_disable_coalesce'. InProgress: the message form may change in the future versions

func (*PgInterfaceEnableDisableCoalesce) GetCrcString

func (*PgInterfaceEnableDisableCoalesce) GetCrcString() string

func (*PgInterfaceEnableDisableCoalesce) GetMessageName

func (*PgInterfaceEnableDisableCoalesce) GetMessageName() string

func (*PgInterfaceEnableDisableCoalesce) GetMessageType

func (*PgInterfaceEnableDisableCoalesce) Marshal

func (m *PgInterfaceEnableDisableCoalesce) Marshal(b []byte) ([]byte, error)

func (*PgInterfaceEnableDisableCoalesce) Reset

func (*PgInterfaceEnableDisableCoalesce) Size

func (m *PgInterfaceEnableDisableCoalesce) Size() (size int)

func (*PgInterfaceEnableDisableCoalesce) Unmarshal

func (m *PgInterfaceEnableDisableCoalesce) Unmarshal(b []byte) error

type PgInterfaceEnableDisableCoalesceReply

type PgInterfaceEnableDisableCoalesceReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

PgInterfaceEnableDisableCoalesceReply defines message 'pg_interface_enable_disable_coalesce_reply'. InProgress: the message form may change in the future versions

func (*PgInterfaceEnableDisableCoalesceReply) GetCrcString

func (*PgInterfaceEnableDisableCoalesceReply) GetMessageName

func (*PgInterfaceEnableDisableCoalesceReply) GetMessageType

func (*PgInterfaceEnableDisableCoalesceReply) Marshal

func (*PgInterfaceEnableDisableCoalesceReply) Reset

func (*PgInterfaceEnableDisableCoalesceReply) Size

func (m *PgInterfaceEnableDisableCoalesceReply) Size() (size int)

func (*PgInterfaceEnableDisableCoalesceReply) Unmarshal

type PgInterfaceFlags added in v0.9.0

type PgInterfaceFlags uint32

PgInterfaceFlags defines enum 'pg_interface_flags'.

const (
	PG_API_FLAG_NONE         PgInterfaceFlags = 0
	PG_API_FLAG_CSUM_OFFLOAD PgInterfaceFlags = 1
	PG_API_FLAG_GSO          PgInterfaceFlags = 2
	PG_API_FLAG_GRO_COALESCE PgInterfaceFlags = 4
)

func (PgInterfaceFlags) String added in v0.9.0

func (x PgInterfaceFlags) String() string

type PgInterfaceMode

type PgInterfaceMode uint8

PgInterfaceMode defines enum 'pg_interface_mode'.

const (
	PG_API_MODE_ETHERNET PgInterfaceMode = 0
	PG_API_MODE_IP4      PgInterfaceMode = 1
	PG_API_MODE_IP6      PgInterfaceMode = 2
)

func (PgInterfaceMode) String

func (x PgInterfaceMode) String() string

type RPCService

type RPCService interface {
	PgCapture(ctx context.Context, in *PgCapture) (*PgCaptureReply, error)
	PgCreateInterface(ctx context.Context, in *PgCreateInterface) (*PgCreateInterfaceReply, error)
	PgCreateInterfaceV2(ctx context.Context, in *PgCreateInterfaceV2) (*PgCreateInterfaceV2Reply, error)
	PgCreateInterfaceV3(ctx context.Context, in *PgCreateInterfaceV3) (*PgCreateInterfaceV3Reply, error)
	PgDeleteInterface(ctx context.Context, in *PgDeleteInterface) (*PgDeleteInterfaceReply, error)
	PgEnableDisable(ctx context.Context, in *PgEnableDisable) (*PgEnableDisableReply, error)
	PgInterfaceEnableDisableCoalesce(ctx context.Context, in *PgInterfaceEnableDisableCoalesce) (*PgInterfaceEnableDisableCoalesceReply, error)
}

RPCService defines RPC service pg.

func NewServiceClient

func NewServiceClient(conn api.Connection) RPCService

Jump to

Keyboard shortcuts

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