format

package
v0.0.0-...-007c8aa Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package format provides methods for converting various netflow-related structures and values into strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CIDR

func CIDR(ipAddr []byte, ones uint32) string

CIDR formats an IP and number of bits in CIDR format (e.g. `192.1.128.64/26`). ones should be the number of ones in the bitmask, e.g. 26 in the example above.

func Direction

func Direction(direction uint32) string

Direction remaps direction from 0 or 1 to respectively ingress or egress.

func EtherType

func EtherType(etherTypeNumber uint32) string

EtherType formats an Ether Type number as a human-readable name. https://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml

func IPAddr

func IPAddr(ip []byte) string

IPAddr formats an IP address as a string. If the given bytes are not a valid IP address, the behavior is undefined.

func IPProtocol

func IPProtocol(protocolNumber uint32) string

IPProtocol maps an IP protocol number to a standard name. https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml

func MacAddress

func MacAddress(fieldValue uint64) string

MacAddress formats a mac address as "xx:xx:xx:xx:xx:xx"

func Port

func Port(port int32) string

Port formats a port number. It's the same as strconv.Itoa, except that port -1 is mapped to the special string '*'.

func TCPFlags

func TCPFlags(flags uint32) []string

TCPFlags formats a TCP bitmask as a set of strings.

Types

This section is empty.

Jump to

Keyboard shortcuts

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