Documentation ¶
Overview ¶
Package ipfix decodes IPFIX packets
Index ¶
- Variables
- func Interpret(b *[]byte, t FieldType) interface{}
- func LoadExtElements(cfgPath string) error
- func RPC(m MemCache, config *RPCConfig)
- func RPCServer(mCache MemCache, config *RPCConfig) error
- type Data
- type DecodedField
- type Decoder
- type Discovery
- type ElementKey
- type FieldType
- type IANAInfoModel
- type IRPC
- type InfoElementEntry
- type MemCache
- type Message
- type MessageHeader
- type RPCClient
- type RPCConfig
- type RPCRequest
- type SetHeader
- type TemplateFieldSpecifier
- type TemplateHeader
- type TemplateRecord
- type TemplatesShard
Constants ¶
This section is empty.
Variables ¶
var FieldTypes = map[string]FieldType{ "unsigned8": Uint8, "unsigned16": Uint16, "unsigned32": Uint32, "unsigned64": Uint64, "signed8": Int8, "signed16": Int16, "signed32": Int32, "signed64": Int64, "float32": Float32, "float64": Float64, "boolean": Boolean, "macAddress": MacAddress, "octetArray": OctetArray, "string": String, "dateTimeSeconds": DateTimeSeconds, "dateTimeMilliseconds": DateTimeMilliseconds, "dateTimeMicroseconds": DateTimeMicroseconds, "dateTimeNanoseconds": DateTimeNanoseconds, "ipv4Address": Ipv4Address, "ipv6Address": Ipv6Address, }
FieldTypes represents data types
var InfoModel = IANAInfoModel{}/* 463 elements not displayed */
InfoModel maps element to name and type based on the field id and enterprise id
Functions ¶
func LoadExtElements ¶ added in v0.9.2
LoadExtElements loads ipfix elements information through ipfix.elemets file
Types ¶
type Data ¶
type Data struct { Template TemplateRecord Timestamp int64 }
Data represents template records and updated timestamp
type DecodedField ¶
DecodedField represents a decoded field
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder represents IPFIX payload and remote address
type Discovery ¶
type Discovery struct {
// contains filtered or unexported fields
}
Discovery represents vflow discovery
type ElementKey ¶ added in v0.3.1
ElementKey represents field specifier format ids
type FieldType ¶
type FieldType int
FieldType is IPFIX Abstract Data Types RFC5102#section-3.1
const ( // Unknown data type Unknown FieldType = iota // Uint8 represents a non-negative integer value in the // range of 0 to 255. Uint8 // Uint16 represents a non-negative integer value in the // range of 0 to 65535. Uint16 // Uint32 represents a non-negative integer value in the // range of 0 to 4294967295. Uint32 // Uint64 represents a non-negative integer value in the // range of 0 to 18446744073709551615. Uint64 // Int8 represents an integer value in the range of -128 // to 127. Int8 // Int16 represents an integer value in the range of // -32768 to 32767. Int16 // Int32 represents an integer value in the range of // -2147483648 to 2147483647. Int32 // Int64 represents an integer value in the range of // -9223372036854775808 to 9223372036854775807. Int64 // Float32 corresponds to an IEEE single-precision 32-bit // floating point type as defined in [IEEE.754.1985]. Float32 // Float64 corresponds to an IEEE double-precision 64-bit // floating point type as defined in [IEEE.754.1985]. Float64 // Boolean represents a binary value. The only allowed // values are "true" and "false". Boolean // MacAddress represents a string of 6 octets. MacAddress // OctetArray represents a finite-length string of octets. OctetArray // String represents a finite-length string of valid String // DateTimeSeconds represents a time value in units of // seconds based on coordinated universal time (UTC). DateTimeSeconds // DateTimeMilliseconds represents a time value in units of // milliseconds based on coordinated universal time (UTC). DateTimeMilliseconds // DateTimeMicroseconds represents a time value in units of // microseconds based on coordinated universal time (UTC). DateTimeMicroseconds // DateTimeNanoseconds represents a time value in units of // nanoseconds based on coordinated universal time (UTC). DateTimeNanoseconds // Ipv4Address represents a value of an IPv4 address. Ipv4Address // Ipv6Address represents a value of an IPv6 address. Ipv6Address )
type IANAInfoModel ¶ added in v0.3.1
type IANAInfoModel map[ElementKey]InfoElementEntry
IANAInfoModel represents IPFIX field's name, identification and type
type IRPC ¶
type IRPC struct {
// contains filtered or unexported fields
}
IRPC represents IPFIX RPC
func (*IRPC) Get ¶
func (r *IRPC) Get(req RPCRequest, resp *TemplateRecord) error
Get retrieves a request from mCache
type InfoElementEntry ¶
InfoElementEntry represents standard name and type for a field - RFC5102
type MemCache ¶
type MemCache []*TemplatesShard
MemCache represents templates shards
type Message ¶
type Message struct { AgentID string Header MessageHeader DataSets [][]DecodedField }
Message represents IPFIX decoded data
type MessageHeader ¶
type MessageHeader struct { Version uint16 // Version of IPFIX to which this Message conforms Length uint16 // Total length of the IPFIX Message, measured in octets ExportTime uint32 // Time at which the IPFIX Message Header leaves the Exporter SequenceNo uint32 // Incremental sequence counter modulo 2^32 DomainID uint32 // A 32-bit id that is locally unique to the Exporting Process }
MessageHeader represents IPFIX message header
type RPCClient ¶
type RPCClient struct {
// contains filtered or unexported fields
}
RPCClient represents RPC client
func NewRPCClient ¶
NewRPCClient initializes a new client connection
func (*RPCClient) Get ¶
func (c *RPCClient) Get(req RPCRequest) (*TemplateRecord, error)
Get tries to get a request from remote server
type RPCRequest ¶
RPCRequest represents RPC request
type TemplateFieldSpecifier ¶
TemplateFieldSpecifier represents field properties
type TemplateHeader ¶
TemplateHeader represents template fields
type TemplateRecord ¶ added in v0.3.1
type TemplateRecord struct { TemplateID uint16 FieldCount uint16 FieldSpecifiers []TemplateFieldSpecifier ScopeFieldCount uint16 ScopeFieldSpecifiers []TemplateFieldSpecifier }
TemplateRecord represents template records