Documentation
¶
Index ¶
- Constants
- func BuildTTLExceededPacket(packetInfo PacketInfo) ([]byte, error)
- func EncodeDatagram(packet []byte, WireVersion WireVersion, traceContext TraceContext) ([]byte, error)
- func EncodeV3Datagram(packet []byte) ([]byte, error)
- func MaxEncodedPacketLen(WireVersion WireVersion, traceContext TraceContext) int
- type Bridge
- type FlowKey
- type FlowState
- type PacketInfo
- func (i *PacketInfo) DecrementTTL() error
- func (i PacketInfo) FlowKey() FlowKey
- func (i PacketInfo) IsEchoReply() bool
- func (i PacketInfo) IsEchoRequest() bool
- func (i PacketInfo) ReplyRequestKey() RequestKey
- func (i PacketInfo) RequestKey() RequestKey
- func (i PacketInfo) TTL() uint8
- func (i PacketInfo) TTLExpired() bool
- type ReplyWriter
- type RequestKey
- type RouteHandler
- type TraceContext
- type TraceEntry
- type WireVersion
Constants ¶
View Source
const ( FlowTimeout = 30 * time.Second TraceIdentityLength = 16 + 8 + 1 IPv4TTLExceededQuoteLen = 548 IPv6TTLExceededQuoteLen = 1232 MaxPayloadLen = 1280 )
Variables ¶
This section is empty.
Functions ¶
func BuildTTLExceededPacket ¶
func BuildTTLExceededPacket(packetInfo PacketInfo) ([]byte, error)
func EncodeDatagram ¶
func EncodeDatagram(packet []byte, WireVersion WireVersion, traceContext TraceContext) ([]byte, error)
func EncodeV3Datagram ¶
func MaxEncodedPacketLen ¶
func MaxEncodedPacketLen(WireVersion WireVersion, traceContext TraceContext) int
Types ¶
type Bridge ¶
type Bridge struct {
WireVersion WireVersion
// contains filtered or unexported fields
}
func NewBridge ¶
func NewBridge(ctx context.Context, handler RouteHandler, sender protocol.DatagramSender, WireVersion WireVersion, logger logger.ContextLogger) *Bridge
type PacketInfo ¶
type PacketInfo struct {
IPVersion uint8
Protocol uint8
SourceIP netip.Addr
Destination netip.Addr
ICMPType uint8
ICMPCode uint8
Identifier uint16
Sequence uint16
IPv4HeaderLen int
IPv4TTL uint8
IPv6HopLimit uint8
RawPacket []byte
}
func ParsePacket ¶
func ParsePacket(packet []byte) (PacketInfo, error)
func (*PacketInfo) DecrementTTL ¶
func (i *PacketInfo) DecrementTTL() error
func (PacketInfo) FlowKey ¶
func (i PacketInfo) FlowKey() FlowKey
func (PacketInfo) IsEchoReply ¶
func (i PacketInfo) IsEchoReply() bool
func (PacketInfo) IsEchoRequest ¶
func (i PacketInfo) IsEchoRequest() bool
func (PacketInfo) ReplyRequestKey ¶
func (i PacketInfo) ReplyRequestKey() RequestKey
func (PacketInfo) RequestKey ¶
func (i PacketInfo) RequestKey() RequestKey
func (PacketInfo) TTL ¶
func (i PacketInfo) TTL() uint8
func (PacketInfo) TTLExpired ¶
func (i PacketInfo) TTLExpired() bool
type ReplyWriter ¶
type ReplyWriter struct {
WireVersion WireVersion
// contains filtered or unexported fields
}
func NewReplyWriter ¶
func NewReplyWriter(sender protocol.DatagramSender, WireVersion WireVersion) *ReplyWriter
func (*ReplyWriter) RegisterRequestTrace ¶
func (w *ReplyWriter) RegisterRequestTrace(packetInfo PacketInfo, traceContext TraceContext)
func (*ReplyWriter) WritePacket ¶
func (w *ReplyWriter) WritePacket(packet []byte) error
type RequestKey ¶
type RouteHandler ¶
type RouteHandler interface {
RouteICMPConnection(
ctx context.Context,
session tun.DirectRouteSession,
routeContext tun.DirectRouteContext,
timeout time.Duration,
) (tun.DirectRouteDestination, error)
}
type TraceContext ¶
type TraceEntry ¶
type TraceEntry struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.