Documentation
¶
Index ¶
Constants ¶
View Source
const ( ProtoAny = 0 // When we want to handle HOPOPT (0) we can change this, if ever ProtoTCP = 6 ProtoUDP = 17 ProtoICMP = 1 ProtoICMPv6 = 58 PortAny = 0 // Special value for matching `port: any` PortFragment = -1 // Special value for matching `port: fragment` )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConntrackCache ¶
type ConntrackCache map[Packet]struct{}
ConntrackCache is used as a local routine cache to know if a given flow has been seen in the conntrack table.
type ConntrackCacheTicker ¶
type ConntrackCacheTicker struct {
// contains filtered or unexported fields
}
func NewConntrackCacheTicker ¶
func (*ConntrackCacheTicker) Get ¶
func (c *ConntrackCacheTicker) Get() ConntrackCache
Get checks if the cache ticker has moved to the next version before returning the map. If it has moved, we reset the map.
type Packet ¶
type Packet struct {
LocalAddr netip.Addr
RemoteAddr netip.Addr
// LocalPort is the destination port for incoming traffic, or the source port for outgoing. Zero for ICMP.
LocalPort uint16
// RemotePort is the source port for incoming traffic, or the destination port for outgoing.
// For ICMP, it's the "identifier". This is only used for connection tracking, actual firewall rules will not filter on ICMP identifier
RemotePort uint16
Protocol uint8
Fragment bool
}
func (Packet) MarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.