Closed neonbunny closed 7 years ago
Hi. Sorry for super late response. Been traveling. Looks good overall but will look into it in details this coming weekend. Two asks though:
Hey @neonbunny, would you add unit tests etc? In general, I do no accept pull requests without tests...
Sure, please leave it with me. This PR is part of a low priority project so it may take me a little while.
I've added a couple of unit tests now.
This MR now also stops IP packets from inheriting from MAC packets - that was an invalid assumption in the case of LINKTYPE_RAW (and probably a whole bunch of other scenarios). Any code which depends on the old functionality should be modified in the same way the unit tests were - i.e.
pkt.getSourceMacAddress()
becomes:
((MACPacket)pkt.getPacket(Protocol.ETHERNET_II)).getSourceMacAddress()
Callers should probably also do some null checking for cases where there is no Ethernet layer.
I merged this on top of the 3.x branch instead because it did change the interface and as such, it would break 2.x apps. So, all your changes are in the 3.x branch, which I will soon merge to be master. So, closing this one...
and now the 3.x branch is merged back to the master branch... I haven't built a release of 3.x yet because I'm working on some API breaking changes compared to 2.x and want to finalize them before doing the first 3.x release.
Exposes additional fields and fixes a couple of things. This is part of integrating this project with pcap-reconst