-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgopacket-v1.1.15.patch
44 lines (43 loc) · 2.45 KB
/
gopacket-v1.1.15.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Binary files gopacket/.git/index and gopacket_patched/.git/index differ
Binary files gopacket/goimports and gopacket_patched/goimports differ
diff -rupN gopacket/layers/enums.go gopacket_patched/layers/enums.go
--- gopacket/layers/enums.go 2018-11-01 18:52:33.000000000 +1100
+++ gopacket_patched/layers/enums.go 2018-11-01 19:00:49.000000000 +1100
@@ -103,6 +103,7 @@ const (
LinkTypeSLIP LinkType = 8
LinkTypePPP LinkType = 9
LinkTypeFDDI LinkType = 10
+ LinkTypeOVPN LinkType = 12
LinkTypePPP_HDLC LinkType = 50
LinkTypePPPEthernet LinkType = 51
LinkTypeATM_RFC1483 LinkType = 100
@@ -375,6 +376,7 @@ func initActualTypeData() {
LinkTypeMetadata[LinkTypeLoop] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeLoopback), Name: "Loop"}
LinkTypeMetadata[LinkTypeIEEE802_11] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11), Name: "802.11"}
LinkTypeMetadata[LinkTypeRaw] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv4or6), Name: "Raw"}
+ LinkTypeMetadata[LinkTypeOVPN] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv4or6), Name: "OVPN"} // Open Systems addition for OpenVPN tunnels
LinkTypeMetadata[LinkTypePFLog] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodePFLog), Name: "PFLog"}
LinkTypeMetadata[LinkTypeIEEE80211Radio] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeRadioTap), Name: "RadioTap"}
LinkTypeMetadata[LinkTypeLinuxUSB] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeUSB), Name: "USB"}
diff -rupN gopacket/packet.go gopacket_patched/packet.go
--- gopacket/packet.go 2018-11-01 18:52:33.000000000 +1100
+++ gopacket_patched/packet.go 2018-11-01 19:00:40.000000000 +1100
@@ -31,6 +31,8 @@ type CaptureInfo struct {
Length int
// InterfaceIndex
InterfaceIndex int
+ // Addition to account for LIBPCAP direction patch
+ Inbound uint8
// The packet source can place ancillary data of various types here.
// For example, the afpacket source can report the VLAN of captured
// packets this way.
diff -rupN gopacket/pcap/pcap.go gopacket_patched/pcap/pcap.go
--- gopacket/pcap/pcap.go 2018-11-01 18:52:33.000000000 +1100
+++ gopacket_patched/pcap/pcap.go 2018-11-01 19:00:59.000000000 +1100
@@ -414,6 +414,7 @@ func (p *Handle) getNextBufPtrLocked(ci
ci.CaptureLength = int(p.pkthdr.caplen)
ci.Length = int(p.pkthdr.len)
ci.InterfaceIndex = p.deviceIndex
+ ci.Inbound = uint8(p.pkthdr.inbound)
return nil
case NextErrorNoMorePackets: