Coder Social home page Coder Social logo

no VLAN support for data link type 12 about joy HOT 7 CLOSED

cisco avatar cisco commented on September 13, 2024
no VLAN support for data link type 12

from joy.

Comments (7)

bhudson33 avatar bhudson33 commented on September 13, 2024

this error is coming from libpcap. As you can see here https://linux.die.net/man/7/pcap-linktype, libpcap does not support a link type of 12. I am curious, what kind of link layer do you believe the packets are using? Do you have the cap file of the data and can it be sent to us for examination?

from joy.

wtoxin avatar wtoxin commented on September 13, 2024

Actually, my pcap files are made of raw packets without link layers. I intuitively thought parsing raw IP packets would not be a problem. The cap file of the data is captured from TUN interface in a phone. It's OK to send you the file for examination. What I do concern is how to fix the problem. Any suggestions?

from joy.

bhudson33 avatar bhudson33 commented on September 13, 2024

Joy leverages the libpcap library to bring the packet information into the code base. Joy does not pull packets off the wire or read in raw data itself. In order to get Joy to process your raw packets, you are going to have to put some type of link layer data on it, so that a tool like libpcap can process and hand the data off to Joy.

Now, you could mess around with joy.c and have it read in the file as raw data and then modify a few of the routines (process_packet) to accept just an IP packet with no other information. I do not believe this would difficult at all. Process_packet takes in 3 parameters. The first parameter can be NULL. The second can be faked as it is the PCAP library header. The third parameter is a pointer to the actual data packet. If you take a look in process_packet, it should be pretty clear what you would need to do. Then you just need to modify joy.c to read and feed your data format.

This isn't something we support today. However, if you can figure out a elegant way to implement the code and not break the libpcap implementation, you could do a pull-request and we could look at merging in your changes for others to utilize.

from joy.

wtoxin avatar wtoxin commented on September 13, 2024

It's quite simple to modify process_packet() to feed raw IP packets. The previous problem is actually caused by calling pcap_compile() when reading a pcap file in process_pcap_file(). I don't see why pcap_compile() fails when feeding LINKTYPE_RAW files. So I had to delete the set-filter part in my code.

from joy.

bhudson33 avatar bhudson33 commented on September 13, 2024

Glad you found a workaround. If you could send along your diffs, we can take a look at them and see what we can incorporate into the repo. Thanks!

from joy.

bhudson33 avatar bhudson33 commented on September 13, 2024

closed per work around

from joy.

oasiszrz avatar oasiszrz commented on September 13, 2024

I have encounter the same problem for some loopback packets with just 0x20000000 flag in eth layer. Also i have to remove the set-filter part and process this flag in process_packet like:

uint32_t loopback_flag = htonl(*(const uint32_t *)(packet + 0));
if(loopback_flag == 0X02000000){...}

from joy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.