Documentation
¶
Overview ¶
Package packet decodes layer two, three and four OSI model layers : ---------------------------------------------------------------------------- : Copyright (C) 2017 Verizon. All Rights Reserved. : All Rights Reserved : : file: ethernet.go : details: TODO : author: Mehrdad Arshad Rad : date: 02/01/2017 : : Licensed under the Apache License, Version 2.0 (the "License"); : you may not use this file except in compliance with the License. : You may obtain a copy of the License at : : http://www.apache.org/licenses/LICENSE-2.0 : : Unless required by applicable law or agreed to in writing, software : distributed under the License is distributed on an "AS IS" BASIS, : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. : See the License for the specific language governing permissions and : limitations under the License. : ----------------------------------------------------------------------------
Package packet decodes layer two, three and four OSI model layers : ---------------------------------------------------------------------------- : Copyright (C) 2017 Verizon. All Rights Reserved. : All Rights Reserved : : file: icmp.go : details: TODO : author: Mehrdad Arshad Rad : date: 02/01/2017 : : Licensed under the Apache License, Version 2.0 (the "License"); : you may not use this file except in compliance with the License. : You may obtain a copy of the License at : : http://www.apache.org/licenses/LICENSE-2.0 : : Unless required by applicable law or agreed to in writing, software : distributed under the License is distributed on an "AS IS" BASIS, : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. : See the License for the specific language governing permissions and : limitations under the License. : ----------------------------------------------------------------------------
Package packet decodes layer two, three and four OSI model layers : ---------------------------------------------------------------------------- : Copyright (C) 2017 Verizon. All Rights Reserved. : All Rights Reserved : : file: network.go : details: TODO : author: Mehrdad Arshad Rad : date: 02/01/2017 : : Licensed under the Apache License, Version 2.0 (the "License"); : you may not use this file except in compliance with the License. : You may obtain a copy of the License at : : http://www.apache.org/licenses/LICENSE-2.0 : : Unless required by applicable law or agreed to in writing, software : distributed under the License is distributed on an "AS IS" BASIS, : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. : See the License for the specific language governing permissions and : limitations under the License. : ----------------------------------------------------------------------------
Package packet decodes layer two, three and four OSI model layers : ---------------------------------------------------------------------------- : Copyright (C) 2017 Verizon. All Rights Reserved. : All Rights Reserved : : file: packet.go : details: TODO : author: Mehrdad Arshad Rad : date: 02/01/2017 : : Licensed under the Apache License, Version 2.0 (the "License"); : you may not use this file except in compliance with the License. : You may obtain a copy of the License at : : http://www.apache.org/licenses/LICENSE-2.0 : : Unless required by applicable law or agreed to in writing, software : distributed under the License is distributed on an "AS IS" BASIS, : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. : See the License for the specific language governing permissions and : limitations under the License. : ----------------------------------------------------------------------------
Package packet decodes layer two, three and four OSI model layers : ---------------------------------------------------------------------------- : Copyright (C) 2017 Verizon. All Rights Reserved. : All Rights Reserved : : file: transport.go : details: TODO : author: Mehrdad Arshad Rad : date: 02/01/2017 : : Licensed under the Apache License, Version 2.0 (the "License"); : you may not use this file except in compliance with the License. : You may obtain a copy of the License at : : http://www.apache.org/licenses/LICENSE-2.0 : : Unless required by applicable law or agreed to in writing, software : distributed under the License is distributed on an "AS IS" BASIS, : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. : See the License for the specific language governing permissions and : limitations under the License. : ----------------------------------------------------------------------------
Index ¶
Constants ¶
const ( // EtherTypeARP is Address Resolution Protocol EtherType value EtherTypeARP = 0x0806 // EtherTypeIPv4 is Internet Protocol version 4 EtherType value EtherTypeIPv4 = 0x0800 // EtherTypeIPv6 is Internet Protocol Version 6 EtherType value EtherTypeIPv6 = 0x86DD // EtherTypeLACP is Link Aggregation Control Protocol EtherType value EtherTypeLACP = 0x8809 // EtherTypeIEEE8021Q is VLAN-tagged frame (IEEE 802.1Q) EtherType value EtherTypeIEEE8021Q = 0x8100 )
const ( // IPv4HLen is IPv4 header length size IPv4HLen = 20 // IPv6HLen is IPv6 header length size IPv6HLen = 40 )
const ( // IANAProtoICMP is IANA Internet Control Message number IANAProtoICMP = 1 // IANAProtoTCP is IANA Transmission Control number IANAProtoTCP = 6 // IANAProtoUDP is IANA User Datagram number IANAProtoUDP = 17 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Datalink ¶
type Datalink struct {
// SrcMAC represents source MAC address
SrcMAC string
// DstMAC represents destination MAC address
DstMAC string
// Vlan represents VLAN value
Vlan int
// EtherType represents upper layer type value
EtherType uint16
}
Datalink represents layer two IEEE 802.11
type IPv4Header ¶
type IPv4Header struct {
Version int // protocol version
TOS int // type-of-service
TotalLen int // packet total length
ID int // identification
Flags int // flags
FragOff int // fragment offset
TTL int // time-to-live
Protocol int // next protocol
Checksum int // checksum
Src string // source address
Dst string // destination address
}
IPv4Header represents an IPv4 header
type IPv6Header ¶
type IPv6Header struct {
Version int // protocol version
TrafficClass int // traffic class
FlowLabel int // flow label
PayloadLen int // payload length
NextHeader int // next header
HopLimit int // hop limit
Src string // source address
Dst string // destination address
}
IPv6Header represents an IPv6 header
type Packet ¶
type Packet struct {
L2 Datalink
L3 interface{}
L4 interface{}
// contains filtered or unexported fields
}
Packet represents layer 2,3,4 available info