Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ETHERTYPE = map[uint16]string{
0x0800: "IPv4",
0x0806: "ARP",
0x86dd: "IPv6",
}
Ethernet Types
View Source
var HARDWARE_TYPES = map[uint16]string{
1: "Ethernet (10Mb)",
2: "Ethernet (3Mb)",
3: "AX.25",
4: "Proteon ProNET Token Ring",
5: "Chaos",
6: "IEEE 802 Networks",
7: "ARCNET",
8: "Hyperchannel",
9: "Lanstar",
10: "Autonet Short Address",
11: "LocalTalk",
12: "LocalNet",
13: "Ultra link",
14: "SMDS",
15: "Frame relay",
16: "ATM",
17: "HDLC",
18: "Fibre Channel",
19: "ATM",
20: "Serial Line",
21: "ATM",
}
View Source
var OPCODE = map[uint16]string{
1: "who-has",
2: "is-at",
3: "RARP-req",
4: "RARP-rep",
5: "Dyn-RARP-req",
6: "Dyn-RAR-rep",
7: "Dyn-RARP-err",
8: "InARP-req",
9: "InARP-rep",
}
Functions ¶
This section is empty.
Types ¶
type ARP ¶
type ARP struct { Hwtype uint16 Ptype uint16 Hwlen uint8 Plen uint8 Opcode uint16 Hwsrc net.HardwareAddr Psrc net.IP Hwdst net.HardwareAddr Pdst net.IP }
func ARPLayer ¶ added in v0.3.0
func ARPLayer() ARP
Create and return an ARP layer with default value set
func (*ARP) SetDefault ¶ added in v0.3.0
func (a *ARP) SetDefault()
Set a default value for each layer field
type Ether ¶
type Ether struct { Dst net.HardwareAddr Src net.HardwareAddr Type uint16 }
func EtherLayer ¶ added in v0.3.0
func EtherLayer() Ether
Create and return an Ether layer with default value set
func (*Ether) SetDefault ¶ added in v0.3.0
func (e *Ether) SetDefault()
Set a default value for each layer field
type IP ¶
type IP struct { Version uint8 `field:"Version"` IHL uint8 `field:"IHL"` TOS uint8 `field:"TOS"` Length uint16 `field:"Length"` ID uint16 `field:"ID"` Flags uint8 `field:"Flags"` FragOffset uint16 `field:"FlagOffset"` TTL uint8 `field:"TTL"` Protocol uint8 `field:"Protocol"` Checksum uint16 `field:"Checksum"` Src net.IP `field:"Src"` Dst net.IP `field:"Dst"` Options []byte `field:"Options"` Padding []byte `field:"Padding"` }
type Layer ¶
type Layer interface { GetName() string SetDefault() Build() *buffer.ProtoBuff Dissect(*buffer.ProtoBuff) *buffer.ProtoBuff BindLayer() Layer }
Layer is an interface representing a layer of the package.
Click to show internal directories.
Click to hide internal directories.