Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pcap-ng: export linktype or convert to DLT_* #139

Closed
guyharris opened this issue Apr 15, 2013 · 1 comment
Closed

pcap-ng: export linktype or convert to DLT_* #139

guyharris opened this issue Apr 15, 2013 · 1 comment

Comments

@guyharris
Copy link
Member

Converted from SourceForge issue 3032040, submitted by georgm

for classic pcap, pcap_datalink() returns the DLT_* types (linktype is converted via linktype_to_dlt when reading a packet)

for pcap-ng, pcap_datalink() retuns the LINKTYPE_* types (linktype is not converted when reading) as described here:
http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html#appendixLinkTypes

Now, these constants are not exported (defined in pcap-common.c).
In order to use a generic api for reading pcap and pcap-ng, pcap_datalink() should return the DLT_* value for pcap-ng.

As a second option, the LINKTYPE_* values should be exported to a header file and a second function (pcap_linktype() or so) should be introduced to return the LINKTYPE_* values without conversion.

@guyharris
Copy link
Member Author

Submitted by guy_harris

I've checked a fix into the trunk and 1.x branch to convert the LINKTYPE_ value to a DLT_ value in sf-pcap-ng.c.

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

No branches or pull requests

1 participant