cne

package module
v0.0.0-...-fd522d2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: BSD-3-Clause Imports: 18 Imported by: 1

Documentation

Overview

Package cne is a collection of binding APIs for CNDP. The goal of the Go binding layer is to hide the details for calling CNDP APIs from the developer, plus create higher level APIs.

Index

Constants

View Source
const (
	EtherAddrLen = 6  // Length of a MAC address
	IPv4AddrLen  = 4  // Length of a IPv4 address
	IPv6AddrLen  = 16 // Length of a IPv6 address
)

Length of protocol addresses.

View Source
const (
	EtherHdrLen = 14 // Length of a ethernet header
	IPv4HdrLen  = 20 // Length of a IPv4 header without options
	IPv6HdrLen  = 40 // Length of a IPv6 header without options
)

These constants keep length of supported headers in bytes.

IPv6Len - minimum length of IPv6 header in bytes. It can be higher and it is not determined inside packet. Only default minimum size is used.

View Source
const (
	IPProtoNumber  = 0x04 // IPv4 protocol number
	TCPProtoNumber = 0x06 // TCP protocol number
	UDPProtoNumber = 0x11 // UDP protocol number
)

Supported L4 types

View Source
const (
	EtherTypeIPV4           = 0x0800 // IPv4 Protocol
	EtherTypeIPV6           = 0x86DD // IPv6 Protocol
	EtherTypeARP            = 0x0806 // Arp Protocol
	EtherTypeRARP           = 0x8035 // Reverse Arp Protocol
	EtherTypeVLAN           = 0x8100 // IEEE 802.1Q VLAN tagging
	EtherTypeQINQ           = 0x88A8 // IEEE 802.1ad QinQ tagging
	EtherTypePPPOEDiscovery = 0x8863 // PPPoE Discovery Stage
	EtherTypePPPOESession   = 0x8864 // PPPoE Session Stage
	EtherTypeETAG           = 0x893F // IEEE 802.1BR E-Tag
	EtherType1588           = 0x88F7 // RFC-1588 Timestamp Format
	EtherTypeSLOW           = 0x8809 // Slow protocols (LACP and Marker)
	EtherTypeTEB            = 0x6558 // Transparent Ethernet Bridging
	EtherTypeLLDP           = 0x88CC // LLDP Protocol
	EtherTypeMPLS           = 0x8847 // MPLS ethertype
	EtherTypeMPLSM          = 0x8848 // MPLS multicast ethertype
)

Supported EtherType for L2

View Source
const (
	TCPFlagFin = 0x01 // TCP FIN flag
	TCPFlagSyn = 0x02 // TCP SYN flag
	TCPFlagRst = 0x04 // TCP RST flag
	TCPFlagPsh = 0x08 // TCP Push flag
	TCPFlagAck = 0x10 // TCP ACK flag
	TCPFlagUrg = 0x20 // TCP URG (Urgent) flag
	TCPFlagEcn = 0x40 // TCP ECN (ECN-Echo) flag
	TCPFlagCwr = 0x80 // TCP CWR (Congestion Window Reduced) flag
)

Constants for values of TCP flags.

View Source
const (
	LPortInhibitProgLoad      = (1 << 0) // Inhibit Loading the BPF program & config of busy poll
	LPortForceWakeup          = (1 << 1) // Force a wakeup, for CVL NICs
	LPortSkbMode              = (1 << 2) // Force the SKB_MODE or copy mode
	LPortBusyPolling          = (1 << 3) // Enable busy polling
	LPortSharedUmem           = (1 << 4) // Enable UMEM Shared mode if available
	LPortUserManagedBuffers   = (1 << 5) // Enable Buffer Manager outside of CNDP
	LPortUmemUnalignedBuffers = (1 << 6) // Enable unaligned frame UMEM support
)
View Source
const (
	UmemMaxRegions = 16   // Maximum number of regions allowed
	UnitMultiplier = 1024 // Multiplier number for each unit or count value
)
View Source
const (
	DefaultLCoreGroup = "default" // the lcore group used if a thread if not assigned to a group
	MainThreadName    = "main"    // the thread name used to register the main CNDP thread
)

Variables

View Source
var (
	RingFlagSingleProducer = "SP_ENQ"     // Single producer string
	RingFlagSingleConsumer = "SC_DEQ"     // Single consumer string
	RingFlagExactSize      = "EXACT_SIZE" // Exact size string

	RingFlagSingleProducerValue uint = C.RING_F_SP_ENQ   // Single producer value
	RingFlagSingleConsumerValue uint = C.RING_F_SC_DEQ   // Single consumer value
	RingFlagExactSizeValue      uint = C.RING_F_EXACT_SZ // Exact Size value
)

Functions

func DisablePromiscuous

func DisablePromiscuous(name string) error

DisablePromiscuous disables promiscuous for the given netdev device name

func EnablePromiscuous

func EnablePromiscuous(name string) error

EnablePromiscuous enables promiscuous for the given netdev device name

func GetChannels

func GetChannels(name string) (int, error)

GetChannels returns the number of channels enabled for the given netdev device name

func GetHash

func GetHash(pkt *Packet) uint32

GetHash will calculate with 3 tuples (src ip, dst ip and protocol)

func GetPromiscuous

func GetPromiscuous(name string) (bool, error)

GetPromiscuous returns promiscuous status for the given netdev device name

func GetRingParams

func GetRingParams(name string) (rxDesc int, txDesc int, err error)

GetRingParams returns the rx and tx ring count for the given netdev device name

func IPv4Checksum

func IPv4Checksum(ip4Hdr *IPv4Hdr) uint16

IPv4Checksum will return the IPv4 checksum calculation The returned value could be zero in the case when verifying the checksum.

func IPv6Checksum

func IPv6Checksum(ip6Hdr *IPv6Hdr) uint16

IPv6Checksum will return the IPv6 checksum calculation The returned value could be zero in the case when verifying the checksum.

func InitCNE

func InitCNE() error

InitCNE initializes the CNE system and returns error on failure.

The cne_init() is also called from OpenWithConfig(), which means this routine does not need to be called if OpenWith*() routines are used. It is OK to call this routine multiple times as it is protected to only initialize once.

func MakeByteSlice

func MakeByteSlice(start uintptr, length int) (data []byte)

MakeByteSlice creates a byte slice of the given size using the array starting address

func MakeUint16Slice

func MakeUint16Slice(start uintptr, length int) (data []uint16)

MakeUint16Slice creates a uint16 slice of the given size using the array starting address

func PktBufferAlloc

func PktBufferAlloc(lportId int, packets []*Packet) int

PktBufferAlloc will allocate a set of pktmbuf structures or buffers Returns the number of packets allocated or -1 on error

func PktBufferFree

func PktBufferFree(packets []*Packet)

PktBufferFree will free a set of pktmbuf structures or buffers

func PktData

func PktData(pkt *Packet) []byte

PktData returns a byte slice of the packet data associated with the Packet

func PktType

func PktType(pkt *Packet) uint32

PktType will process the packet and return the pType value a bitwise value describing the packet type

func PktTypes

func PktTypes(pkts []*Packet) []uint32

PktTypes will return a list of ptype values for each packet processed

func RxBurst

func RxBurst(lportId int, packets []*Packet) int

RxBurst will attempt to receive packets from the given lportID value Returns -1 on error or number of packets received

func SetChannels

func SetChannels(name string, count uint) error

SetChannels sets the number of channels for the given netdev device name

func SetLinkDown

func SetLinkDown(name string) error

SetLinkDown sets the link down for the given netdev device name

func SetLinkUp

func SetLinkUp(name string) error

SetLinkUp sets the link up for the given netdev device name

func SwapMacAddr

func SwapMacAddr(pkt *Packet)

SwapMacAddr will swap the MAC addresses of the packet The packet must have a valid EthernetHeader at the start or the packet data

func SwapMacAddrs

func SwapMacAddrs(pkt []*Packet)

SwapMacAddrs will swap the MAC address of the set of packet buffers.

func SwapUint16

func SwapUint16(x uint16) uint16

SwapUint16 swaps a uint16 in place for Big/Little Endian

func TxBurst

func TxBurst(lportId int, packets []*Packet, sendAll bool) int

TxBurst transmits packets to the given lportId value

If sendAll is true the routine will attempt to send all of the packets as the TX ring could get full. If sendAll flag is false the routine will not attempt to send all of the packet. Returns the number of packets sent or -1 on error

func WritePktData

func WritePktData(pkt *Packet, offset int, data []byte) int

WritePktData writes a byte slice of the packet data into the packet buffer.

func WritePktDataList

func WritePktDataList(pkts []*Packet, offset int, data []byte) error

WritePktDataList take a slice of *Packet objects and writes the data to each packet at the given offset

Types

type ApplicationInfo

type ApplicationInfo struct {
	Name        string `json:"name"`        // Name of the application
	Description string `json:"description"` // Description of the application
}

ApplicationInfo is the JSON Application data structure

type Config

type Config struct {
	ApplicationData *ApplicationInfo       `json:"application"`  // Application data
	DefaultData     *DefaultInfo           `json:"defaults"`     // Default data
	UmemInfoMap     map[string]*UmemInfo   `json:"umems"`        // UMEM data
	LPortInfoMap    map[string]*LPortInfo  `json:"lports"`       // LPort data
	LCoreGroupData  map[string]LCoreInfo   `json:"lcore-groups"` // LCoreGroup data
	OptionData      *OptionInfo            `json:"options"`      // Option data
	ThreadInfoMap   map[string]*ThreadInfo `json:"threads"`      // Thread data
}

Config is the top level JSON configuration structure

func (*Config) LPortByName

func (jcfg *Config) LPortByName(lportName string) *LPortInfo

LPortByName returns the LPortInfo pointer for the given LPort name

func (*Config) LPortNames

func (jcfg *Config) LPortNames() []string

LPortName returns a array of strings giving the list of LPorts

func (*Config) String

func (jcfg *Config) String() string

func (*Config) ThreadByName

func (jcfg *Config) ThreadByName(threadName string) *ThreadInfo

ThreadByName returns the ThreadInfo structure for the given thread name

func (*Config) ThreadNames

func (jcfg *Config) ThreadNames() []string

ThreadNames returns the array of thread names

func (*Config) UmemByName

func (jcfg *Config) UmemByName(umemName string) *UmemInfo

UmemByName returns the UmemInfo structure for the UMEM name

func (*Config) UmemNames

func (jcfg *Config) UmemNames() []string

UmemNames returns a slice of strings for each UMEM structure

type DefaultInfo

type DefaultInfo struct {
	BufCnt  uint   `json:"bufcnt"` // Default number of buffers
	BufSize uint   `json:"bufsz"`  // Default size of the buffer
	RxDesc  uint   `json:"rxdesc"` // Default size of RX ring
	TxDesc  uint   `json:"txdesc"` // Default size of TX ring
	Cache   uint   `json:"cache"`  // Default size of cache entries, can be 0
	MemType string `json:"mtype"`  // Default memory allocation type
}

DefaultInfo is the JSON Default data structure

type EthernetHeader

type EthernetHeader struct {
	DAddr     MACAddress // Destination address
	SAddr     MACAddress // Source address
	EtherType uint16     // Frame type
}

EthernetHeader represents a Ethernet header

func GetEtherHdr

func GetEtherHdr(pkt *Packet) *EthernetHeader

GetEtherHdr will return a pointer to the ether header or nil on error

func (*EthernetHeader) String

func (ethHdr *EthernetHeader) String() string

type IPv4Address

type IPv4Address uint32

IPv4Address represents a IPv4 address octets

func (*IPv4Address) String

func (addr *IPv4Address) String() string

type IPv4Hdr

type IPv4Hdr struct {
	VersionIhl     uint8       // version and header length
	TypeOfService  uint8       // type of service
	TotalLength    uint16      // length of packet
	PacketID       uint16      // packet ID
	FragmentOffset uint16      // fragmentation offset
	TimeToLive     uint8       // time to live
	NextProtoID    uint8       // protocol ID
	HdrChecksum    uint16      // header checksum
	SrcAddr        IPv4Address // source address
	DstAddr        IPv4Address // destination address
}

IPv4Hdr represents a IPv4 header

func GetIPv4

func GetIPv4(pkt *Packet) *IPv4Hdr

GetIPv4 will return the IPv4 header pointer or nil on error

func (*IPv4Hdr) String

func (hdr *IPv4Hdr) String() string

type IPv6Address

type IPv6Address [IPv6AddrLen]uint8

IPv6Address represents a IPv6 address octets

func (IPv6Address) String

func (addr IPv6Address) String() string

type IPv6Hdr

type IPv6Hdr struct {
	VtcFlow    uint32      // IP version, traffic class & flow label
	PayloadLen uint16      // IP packet length - includes sizeof(ip_header)
	Proto      uint8       // Protocol, next header
	HopLimits  uint8       // Hop limits
	SrcAddr    IPv6Address // IP address of source host
	DstAddr    IPv6Address // IP address of destination host(s)
}

IPv6Hdr represents a IPv6 header

func GetIPv6

func GetIPv6(pkt *Packet) *IPv6Hdr

GetIPv6 will return the IPv6 header pointer or nil on error

func (*IPv6Hdr) String

func (hdr *IPv6Hdr) String() string

type LCoreInfo

type LCoreInfo []int

LCoreInfo is the list of lcores for a JSON LCoreGroup

func (LCoreInfo) MarshalJSON

func (lc LCoreInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface. The output is sorted by core number with duplicates removed. Contiguous ranges will be unmashalled as a string of the form "x-y".

func (*LCoreInfo) UnmarshalJSON

func (lc *LCoreInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface. The marshalled LCoreInfo is sorted by core number with duplicates removed.

type LPort

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

LPort is the logical port data structure to hold information for accessing the logical port or netdev/queue ID.

func (*LPort) GetLPortChannels

func (p *LPort) GetLPortChannels() (int, error)

GetLPortChannels using an LPort structure return the number of channels of a netdev device.

func (*LPort) LPortID

func (p *LPort) LPortID() int

LPortID returns the lport ID value for the given LPort

func (*LPort) LPortStats

func (p *LPort) LPortStats() (*LPortStats, error)

LPortStats returns the lport statistics structure for the given LPort

func (*LPort) Name

func (p *LPort) Name() string

Name returns the netdev name of the given LPort

func (*LPort) NetdevName

func (p *LPort) NetdevName() string

NetdevName returns the name of the given LPort

func (*LPort) ResetLPortStats

func (p *LPort) ResetLPortStats() error

ResetLPortStats resets the LPort statistics

type LPortInfo

type LPortInfo struct {
	Pmd             string `json:"pmd"`               // PMD name
	Qid             uint16 `json:"qid"`               // QID number
	Umem            string `json:"umem"`              // UMEM name string for this LPort to use
	Region          int    `json:"region"`            // The UMEM region index value
	Description     string `json:"description"`       // Description of the LPort
	BusyPolling     bool   `json:"busy_polling"`      // "busy_poll" enable busy polling if true
	BusyTimeout     uint16 `json:"busy_timeout"`      // Busy timeout value in seconds
	BusyBudget      uint16 `json:"busy_budget"`       // Busy budget value
	InhibitProgLoad bool   `json:"inhibit_prog_load"` // Inhibit eBPD program load flag
	ForceWakeup     bool   `json:"force_wakeup"`      // Force wakeup calls for AF_XDP
	SkbMode         bool   `json:"skb_mode"`          // Force SKB_MODE or copy mode flag
	// contains filtered or unexported fields
}

LPortInfo is the JSON LPort information data structure(s)

func (*LPortInfo) LPortFlags

func (lport *LPortInfo) LPortFlags() int

LPortFlags returns the LPort configuration flags

type LPortStats

type LPortStats struct {
	InPackets     uint64 // Number of input packets
	InBytes       uint64 // Number of input bytes
	InErrors      uint64 // Number of input errors
	InMissed      uint64 // Number of missed input packets
	RxInvalid     uint64 // Number of invalid Rx packets
	OutPackets    uint64 // Number of output packets
	OutBytes      uint64 // Number of output bytes
	OutErrors     uint64 // Number of output errors
	OutDropped    uint64 // Number of dropped output packets
	TxInvalid     uint64 // Number of invalid Tx packets
	InPacketRate  uint64 // Packet rate for input
	OutPacketRate uint64 // Packet rate for output
}

LPortStats is the Go structure for LPort statistics

type LocklessRing

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

LocklessRing structure contains internal information for a lockless ring.

func LRingCreateElem

func LRingCreateElem(name string, elementSz, count uint, strFlags []string) (*LocklessRing, error)

LRingCreateElem creates the lockless ring given the specified arguments and element size.

The name is used to give the ring a name. The elementSz is the element size of each element in the ring. The count is used to set the max number of elements in the ring. strFlags are used in creating the lockless ring.

Returns the internal lockless ring object or error value is set

func NewLRing

func NewLRing(name string, count uint, strFlags []string) (*LocklessRing, error)

NewLRing create a lockless ring using default element size of 8 bytes.

The name is used to give the ring a name. The count is used to set the max number of elements in the ring. strFlags are used in creating the lockless ring.

Returns the internal lockless ring object or error value is set

func (*LocklessRing) Count

func (lr *LocklessRing) Count() uint

Count returns the number of elements currently in the ring

func (*LocklessRing) DequeueN

func (lr *LocklessRing) DequeueN(values []uintptr, cnt int) int

DequeueN dequeue a number of elements from the ring defined by the specified count

func (*LocklessRing) Destroy

func (lr *LocklessRing) Destroy()

Destroy a lockless ring object given the valid LocklessRing structure pointer.

func (*LocklessRing) Dump

func (lr *LocklessRing) Dump()

Dump the lockless ring information to the console.

func (*LocklessRing) ElemSize

func (lr *LocklessRing) ElemSize() uint

ElemSize returns the size of each element in the ring.

func (*LocklessRing) Empty

func (lr *LocklessRing) Empty() bool

Empty returns true if the ring is empty.

func (*LocklessRing) EnqueueN

func (lr *LocklessRing) EnqueueN(values []uintptr, cnt int) int

EnqueueN enqueues N number of elements into a lockless ring.

func (*LocklessRing) Flags

func (lr *LocklessRing) Flags() []string

Flags returns the flags of the lockless ring.

func (*LocklessRing) FreeCount

func (lr *LocklessRing) FreeCount() uint

FreeCount returns the number of elements currently free in the ring

func (*LocklessRing) Full

func (lr *LocklessRing) Full() bool

Full returns true if the ring is full.

func (*LocklessRing) Name

func (lr *LocklessRing) Name() string

Name returns the name of the lockless ring.

func (*LocklessRing) Pointer

func (lr *LocklessRing) Pointer() unsafe.Pointer

Pointer returns the pointer to the C ring struct.

func (*LocklessRing) RawFlags

func (lr *LocklessRing) RawFlags() uint

RawFlags returns the flags of the lockless ring.

func (*LocklessRing) Size

func (lr *LocklessRing) Size() uint

Size returns the size of the lockless ring.

type MACAddress

type MACAddress [EtherAddrLen]uint8

MACAddress represents a MAC address octets

func (*MACAddress) String

func (mac *MACAddress) String() string

type MsgChannel

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

MsgChannel is the structure to hold information about the MsgChan

func NewMsgChannel

func NewMsgChannel(name string, sz uint) (*MsgChannel, error)

NewMsgChannel creates a new MsgChannel object with the given name and size

func (*MsgChannel) Close

func (mc *MsgChannel) Close() error

Close the MsgChannel and release the resources

func (*MsgChannel) Info

func (mc *MsgChannel) Info() *MsgChannelInfo

Info returns the msgchan information structure

func (*MsgChannel) Lookup

func (mc *MsgChannel) Lookup(name string) *MsgChannel

Lookup a msgchan by name and return MsgChannel pointer

func (*MsgChannel) Name

func (mc *MsgChannel) Name() string

Name for the message channel Returns the message channel string or empty if error

func (*MsgChannel) Pointers

func (mc *MsgChannel) Pointers() (recv unsafe.Pointer, send unsafe.Pointer)

Pointers returns the recv and send ring pointers or nil on error

func (*MsgChannel) Recv

func (mc *MsgChannel) Recv(objs []uintptr, timo uint64) int

Recv objs from the msgChan

func (*MsgChannel) RecvFree

func (mc *MsgChannel) RecvFree() int

RecvFree is the number of free entries in the receive ring Return number of free entries or -1 on error

func (*MsgChannel) Send

func (mc *MsgChannel) Send(objs []uintptr) int

Send object values on the msgChan Returns the number of objects sent

func (*MsgChannel) SendFree

func (mc *MsgChannel) SendFree() int

SendFree is the number of free entries in the send ring Return number of free entries or -1 on error

func (*MsgChannel) Size

func (mc *MsgChannel) Size() int

Size of the message channel structure and rings

type MsgChannelInfo

type MsgChannelInfo struct {
	RecvRing     unsafe.Pointer // RecvRing pointer
	SendRing     unsafe.Pointer // SendRing pointer
	ChildCount   int            // Number of children attached to this msgChan
	SendCalls    uint64         // Number of calls to send routine
	SendCnt      uint64         // Number of items sent in send routine
	RecvCalls    uint64         // Number of calls to recv routine
	RecvCnt      uint64         // Number of items received in recv routine
	RecvTimeouts uint64         // Number of timeouts the receive routine had
}

MsgChannelInfo is the structure to hold information about a MsgChannel

type OptionInfo

type OptionInfo struct {
	PktApi    string `json:"pkt_api"`    // Define the packet device API pktdev or xskdev
	NoMetrics bool   `json:"no-metrics"` // Disable Metrics collecting
	NoRestapi bool   `json:"no-restapi"` // Disable RestAPI support
	Cli       bool   `json:"cli"`        // Enable CLI mode or command line mode
	Mode      string `json:"mode"`       // Type of mode to use rx-only, tx-only, loopback, ...
	UdsPath   string `json:"uds_path"`   // UDS path string
}

OptionInfo is the JSON Option information structure

type Packet

type Packet C.pktmbuf_t // Packet is the interface type for C.pktmbuf_t structure

type System

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

System structure to hold internal information for binding layer to CNDP

func OpenWithConfig

func OpenWithConfig(cfg *Config) (*System, error)

OpenWithConfig by passing in a initialized cne.Config structure

func OpenWithFile

func OpenWithFile(path string) (*System, error)

OpenWithFile by passing in a filename or path to a JSON-C or JSON configuration

func OpenWithString

func OpenWithString(s string) (*System, error)

OpenWithString by passing in a string containing JSON-C or JSON text

func (*System) Close

func (sys *System) Close() error

Close the binding layer and cleanup UMEM and LPorts

func (*System) JsonCfg

func (sys *System) JsonCfg() *Config

JsonCfg returns the JSON configuration structure pointer

func (*System) LPortByName

func (sys *System) LPortByName(name string) *LPort

LPortByName returns the LPort for the given name

func (*System) LPortList

func (sys *System) LPortList() []*LPort

LPortList returns the List of LPorts

func (*System) LPortMap

func (sys *System) LPortMap() map[string]*LPort

LPortMap returns the MAP of LPorts

func (*System) LPortsByName

func (sys *System) LPortsByName(names []string) []*LPort

LPortsByName return a list of LPort structure pointers

func (*System) RegisterThread

func (sys *System) RegisterThread(name string) error

RegisterThread locks a thread and registers it to CNDP to get the CNE UID value

func (*System) UmemData

func (sys *System) UmemData(umemName string) *UmemData

UmemData returns the information about a UMEM for the given name

func (*System) UmemMap

func (sys *System) UmemMap() map[string]*UmemData

UmemMap returns the map structure of all UMEMs

func (*System) UnregisterThread

func (sys *System) UnregisterThread(name string) error

UnregisterThread unregister the thread from CNDP

type TCPFlags

type TCPFlags uint8

TCPFlags represents the TCP flags

type TCPHdr

type TCPHdr struct {
	SrcPort  uint16   // TCP source port
	DstPort  uint16   // TCP destination port
	SentSeq  uint32   // TX data sequence number
	RecvAck  uint32   // RX data acknowledgement sequence number
	DataOff  uint8    // Data offset
	TCPFlags TCPFlags // TCP flags
	RxWin    uint16   // RX flow control window
	Cksum    uint16   // TCP checksum
	TCPUrp   uint16   // TCP urgent pointer, if any
}

TCPHdr represents the TCP header

func GetTCP

func GetTCP(pkt *Packet) *TCPHdr

GetTCP will return the TCP header pointer for IPv4 or IPv6 packets or nil on error

type ThreadInfo

type ThreadInfo struct {
	Group       string   `json:"group"`       // LCoreGroup string name
	LPorts      []string `json:"lports"`      // List of LPorts for this thread to manage
	Description string   `json:"description"` // Description of the thread
}

ThreadInfo is the JSON Thread structure(s)

type UDPHdr

type UDPHdr struct {
	SrcPort    uint16 // UDP source port
	DstPort    uint16 // UDP destination port
	DgramLen   uint16 // UDP datagram length
	DgramCksum uint16 // UDP datagram checksum
}

UDPHdr represents the UDP header

func GetUDP

func GetUDP(pkt *Packet) *UDPHdr

GetUDP will return the UDP header pointer for IPv4 or IPv6 packets or nil on error

func (*UDPHdr) String

func (hdr *UDPHdr) String() string

type UmemData

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

UmemData is the primary structure for UMEM information and data

func (*UmemData) Name

func (ud *UmemData) Name() string

Name returns the UMEM name string

type UmemInfo

type UmemInfo struct {
	BufCnt      uint   `json:"bufcnt"`      // Number of buffers in 1024 increments
	BufSize     uint   `json:"bufsz"`       // Size of each buffer in 1024 increments
	MemType     string `json:"mtype"`       // Memory type for buffer allocation
	Regions     []uint `json:"regions"`     // Region array for size of each region in 1024 increments
	RxDesc      uint   `json:"rxdesc"`      // Rx Descriptor ring size in 1024 increments
	TxDesc      uint   `json:"txdesc"`      // Tx Descriptor ring size in 1024 increments
	SharedUmem  bool   `json:"shared_umem"` // Use Shared UMEM flag
	Description string `json:"description"` // UMEM description
}

UmemInfo is the JSON UMEM data structure(s)

Jump to

Keyboard shortcuts

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