Documentation
¶
Overview ¶
Package ndntdump processes captured NDN traffic.
Index ¶
Constants ¶
View Source
const AnonymizerSecretLen = 14
AnonymizerSecretLen is the length of secret key inside Anonymizer.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Anonymizer ¶
type Anonymizer struct {
// contains filtered or unexported fields
}
Anonymizer anonymizes IP addresses and MAC addresses. IPv4 address keeps its leading 24 bits; IPv6 address keeps its leading 48 bits; MAC address keeps its leading 24 bits. Lower bits are XOR'ed with a random value.
func NewAnonymizer ¶
func NewAnonymizer(keepIPs *netipx.IPSet, keepMAC bool, secret *[AnonymizerSecretLen]byte) (anon *Anonymizer)
NewAnonymizer creates Anonymizer.
func (*Anonymizer) AnonymizeIP ¶
func (anon *Anonymizer) AnonymizeIP(ip net.IP)
AnonymizeIP anonymizes an IP address.
func (*Anonymizer) AnonymizeMAC ¶
func (anon *Anonymizer) AnonymizeMAC(mac net.HardwareAddr)
AnonymizeMAC anonymizes a MAC address.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader reads NDN packets from ZeroCopyPacketDataSource.
func NewReader ¶
func NewReader(src gopacket.ZeroCopyPacketDataSource, opts ReaderOptions) (r *Reader)
NewReader creates Reader.
type ReaderOptions ¶
type ReaderOptions struct {
IsLocal func(net.HardwareAddr) bool
TCPPort int
WebSocketPort int
Anonymizer *Anonymizer
KeepPayload bool
}
ReaderOptions passes options to NewReader.
type Record ¶
type Record struct {
Wire []byte `json:"-"`
CaptureInfo gopacket.CaptureInfo `json:"-"`
DirType string `json:"t"` // packet direction and type
Timestamp int64 `json:"ts"` // Unix epoch nanoseconds
Flow []byte `json:"flow"` // flow key
Size2 int `json:"size2"` // packet size at NDNLPv2 layer
Size3 int `json:"size3,omitempty"` // packet size at L3
NackReason int `json:"nackReason,omitempty"` // Nack reason
Name ndn.Name `json:"name,omitempty"` // packet name
CanBePrefix bool `json:"cbp,omitempty"` // Interest CanBePrefix
MustBeFresh bool `json:"mbf,omitempty"` // Interest MustBeFresh
FwHint []ndn.Name `json:"fwHint,omitempty"` // Interest ForwardingHint
Lifetime int `json:"lifetime,omitempty"` // Interest InterestLifetime (ms)
HopLimit int `json:"hopLimit,omitempty"` // Interest HopLimit
ContentType int `json:"contentType,omitempty"` // Data ContentType
Freshness int `json:"freshness,omitempty"` // Data FreshnessPeriod (ms)
FinalBlock bool `json:"finalBlock,omitempty"` // Data is final block
}
Record describes a parsed NDN packet.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
ndntdump
command
Command ndntdump captures NDN traffic from a network interface.
|
Command ndntdump captures NDN traffic from a network interface. |
|
Package fileoutput saves captured NDN trafic to files.
|
Package fileoutput saves captured NDN trafic to files. |
|
Package pcapinput opens GoPacket input handle.
|
Package pcapinput opens GoPacket input handle. |
|
Package websocket parses WebSocket frames out of TCP payload.
|
Package websocket parses WebSocket frames out of TCP payload. |
Click to show internal directories.
Click to hide internal directories.