Comments (7)
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.
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.
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.
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.
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.
closed per work around
from joy.
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)
- Using sleuth to calculate distribution of each individual offered cipher suite type HOT 2
- Incorrect TLS handshake types and TLS content types when generating TLS session metadata
- compilation error on macOS v 10.12.6
- The return value of 'sscanf()' should be checked
- Build failed with VS2019 on win10 HOT 4
- no VLAN support for data link type 12
- make error HOT 1
- Build Error while enable output compress HOT 1
- compile failed
- Number of packets is incorrect HOT 1
- A description of the parameters in joy's tool HOT 1
- Question with “one or more interfaces“
- 'type=1' option does not work
- How to use the FEATURE OPTIONS "payload=N (number)"?
- `sudo ./install_joy/install-sh -p /opt/app/joy` error
- Bytes in/out not correct
- is it prossible to use JOY to analysis malware network traffic online?
- Mac输出乱码
- some problem about sleuth
- some problem about sleuth
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from joy.