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 IHLLENGTH = map[uint8]string{
5: "20 bytes",
6: "24 bytes",
7: "28 bytes",
8: "32 bytes",
9: "36 bytes",
10: "40 bytes",
11: "44 bytes",
12: "48 bytes",
13: "52 bytes",
14: "56 bytes",
15: "60 bytes",
}
IHL Lengths
View Source
var IPOPTIONS = map[uint8]string{
0: "end_of_list",
1: "nop",
2: "security",
3: "loose_source_route",
4: "timestamp",
5: "extended_security",
6: "commercial_security",
7: "record_route",
8: "stream_id",
9: "strict_source_route",
10: "experimental_measurement",
11: "mtu_probe",
12: "mtu_reply",
13: "flow_control",
14: "access_control",
15: "encode",
16: "imi_traffic_descriptor",
17: "extended_IP",
18: "traceroute",
19: "address_extension",
20: "router_alert",
21: "selective_directed_broadcast_mode",
23: "dynamic_packet_state",
24: "upstream_multicast_packet",
25: "quick_start",
30: "rfc4727_experiment",
}
IP Options
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 IHL uint8 TOS uint8 Length uint16 ID uint16 Flags uint8 FragOffset uint8 TTL uint8 Protocol uint8 Checksum uint16 Src net.IP Dst net.IP }
func IPLayer ¶ added in v0.4.5
func IPLayer() IP
Create and return an IP layer with default value set
func (*IP) SetDefault ¶ added in v0.4.5
func (i *IP) SetDefault()
type IP_Options ¶ added in v0.4.5
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.