Skip to content

Conversation

@zecke
Copy link

@zecke zecke commented Jun 2, 2017

No description provided.

@zecke
Copy link
Author

zecke commented Jun 2, 2017

It is based on the PR for DLT_RAW. I don't comprehend the relationship between LayerType and EnumMetadata yet. In the EnumMetadata instance one can refer a LayerType (and that is done for higher level IP protocols but not for the link layer). At the same time a generic LayerType could probably use EnumMetadata.

The above seems to lead to some code duplication and difficulty to test things (E.g. DecodeFromBytes not called)

@tsg
Copy link
Owner

tsg commented Jun 6, 2017

@zecke Would it be possible to (also) open this upstream at https://github.com/google/gopacket ? I do hope to resync gopacket with the upstream code at some point, and the more custom code we have, the harder will be. This might also give you better reviews.

@zecke
Copy link
Author

zecke commented Jun 6, 2017

I have done so and had to fix some testcases. Do you want to enable travis-ci support for your clone to see if I should fix things here as well?

@tsg
Copy link
Owner

tsg commented Jun 7, 2017

@zecke Thanks, I enabled travis checks in #10. Can you rebase this one to have the tests run?

Thanks for submitting the patch upstream, I'll follow the discussion on google/gopacket#324.

zecke added 2 commits June 7, 2017 18:59
According to http://www.tcpdump.org/linktypes.html the value is 101
but in reality it is 12 (and on OpenBSD 14). While browsing through
the list on OpenBSD the DLT_LOOP is 12 (and not 108). In the long it
might make sense to back these values with cgo (and pcap/bpf.h).
Create a Raw struct and make it implement the LayerType interface. Add
a testcase to decode a raw IPv4/ICMPv4 frames. Remove decodeIPv4or6
that was only used for the raw ip link type.

The DecodeFromBytes method is not tested/used yet and packetbeat
might be the first user.
@zecke zecke force-pushed the add-raw-layertype branch from 90d9279 to 9a9a563 Compare June 7, 2017 10:59
@zecke
Copy link
Author

zecke commented Jun 7, 2017

Done that but looking at the build log I wonder..

The command "go test github.com/google/gopacket/layers" exited with 0.
0.68s$ go test github.com/google/gopacket/tcpassembly
ok  	github.com/google/gopacket/tcpassembly	0.147s

shouldn't this be "tsg/gopacket"? .travis.yml change s/google/tsg/?

@tsg
Copy link
Owner

tsg commented Jun 7, 2017

@zecke ah, missed that :). Fixing it in #11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants