Documentation ¶
Overview ¶
Package ip handles the IP L3 portion of the packet. Lucius supports IP packets such as IPv4, IPv6 and IP tunnels such as GRE and IP-IP tunnels with IPv4, IPv6 payload and IPv4, IPv6 transport.
Index ¶
- type GRE
- func (gre *GRE) Find(id fwdpacket.FieldID) ([]byte, error)
- func (gre *GRE) Header() []byte
- func (GRE) ID() fwdpb.PacketHeaderId
- func (gre *GRE) Payload() (fwdpb.PacketHeaderId, int64)
- func (gre *GRE) SetPayload(id fwdpb.PacketHeaderId, length int64)
- func (gre *GRE) Update(id fwdpacket.FieldID, oper int, arg []byte) (bool, error)
- type IP
- func (ip *IP) Field(id fwdpacket.FieldID) ([]byte, error)
- func (ip *IP) Header() []byte
- func (ip *IP) ID(instance int) fwdpb.PacketHeaderId
- func (ip *IP) Modify(id fwdpb.PacketHeaderId) error
- func (ip *IP) Rebuild() error
- func (ip *IP) Remove(id fwdpb.PacketHeaderId) error
- func (IP) Trailer() []byte
- func (ip *IP) UpdateField(id fwdpacket.FieldID, op int, arg []byte) (bool, error)
- type IP4
- func (ip *IP4) Find(id fwdpacket.FieldID) ([]byte, error)
- func (ip *IP4) Header() []byte
- func (IP4) ID() fwdpb.PacketHeaderId
- func (ip *IP4) Payload() (fwdpb.PacketHeaderId, int64)
- func (ip *IP4) SetPayload(id fwdpb.PacketHeaderId, length int64)
- func (ip *IP4) Update(id fwdpacket.FieldID, op int, arg []byte) (bool, error)
- type IP6
- func (ip *IP6) Find(id fwdpacket.FieldID) ([]byte, error)
- func (ip *IP6) Header() []byte
- func (IP6) ID() fwdpb.PacketHeaderId
- func (ip *IP6) Payload() (fwdpb.PacketHeaderId, int64)
- func (ip *IP6) SetPayload(id fwdpb.PacketHeaderId, length int64)
- func (ip *IP6) Update(id fwdpacket.FieldID, op int, arg []byte) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GRE ¶
type GRE struct {
// contains filtered or unexported fields
}
A GRE represents a GRE header in the packet. It can be queried, updated added and removed. It supports GRE headers with the optional key and sequence-id attributes.
func (*GRE) Payload ¶
func (gre *GRE) Payload() (fwdpb.PacketHeaderId, int64)
Payload gets the payload information.
func (*GRE) SetPayload ¶
func (gre *GRE) SetPayload(id fwdpb.PacketHeaderId, length int64)
SetPayload sets the payload.
type IP ¶
type IP struct {
// contains filtered or unexported fields
}
An IP is a group of IP headers in the L3 portion of the packet. The L3/IP portion of a packet can contain a series IPv4, IPv6 and GRE headers in-case of nested tunnels.
Note that the GRE implementation does not support UDF.
func (*IP) ID ¶
func (ip *IP) ID(instance int) fwdpb.PacketHeaderId
ID returns the protocol header ID of the outermost ip header.
func (*IP) Modify ¶
func (ip *IP) Modify(id fwdpb.PacketHeaderId) error
Modify adds an addition IP header effectively tunneling the packet.
type IP4 ¶
type IP4 struct {
// contains filtered or unexported fields
}
An IP4 represents an IPv4 header including IP options in the packet. It can be query, update, add and remove the IP header.
func (*IP4) Payload ¶
func (ip *IP4) Payload() (fwdpb.PacketHeaderId, int64)
Payload gets the payload information.
func (*IP4) SetPayload ¶
func (ip *IP4) SetPayload(id fwdpb.PacketHeaderId, length int64)
SetPayload sets the payload.
type IP6 ¶
type IP6 struct {
// contains filtered or unexported fields
}
An IP6 represents an IPv6 header in the packet. It can query, update, add and remove the IPv6 header. Note that it does not support IPv6 extensions.
func (*IP6) Payload ¶
func (ip *IP6) Payload() (fwdpb.PacketHeaderId, int64)
Payload gets the payload information.
func (*IP6) SetPayload ¶
func (ip *IP6) SetPayload(id fwdpb.PacketHeaderId, length int64)
SetPayload sets the payload.