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

what happen ? unresolve IPv4Packet #684

Open
Rgoogle opened this issue May 5, 2024 · 3 comments
Open

what happen ? unresolve IPv4Packet #684

Rgoogle opened this issue May 5, 2024 · 3 comments

Comments

@Rgoogle
Copy link

Rgoogle commented May 5, 2024

image

I use the example in the respository code .
and my enable all feature

pnet = { version = "0.34.0", features = ["std", "pnet_transport",
"ipnetwork", "appveyor",
"default", "netmap",
"pcap", "serde", "travis"] }

but not resolve yet .

@Paul-weqe
Copy link
Contributor

Have you been able to fix this @Rgoogle ?

@Rgoogle
Copy link
Author

Rgoogle commented May 6, 2024

This is really frustrating. I ran it on another cloud computer, downloaded WinPcap and packet.lib, and then wrote it in Visual Code. But there were no red error prompts like before. When I press Ctrl to jump, it basically jumps to the #Packet property macro. It's similar to my previous error.

I'm now suspecting that these red error prompts are just a compiler issue. In reality, it can still run.

My original problem was that I didn't download WinPcap and packet.lib at first, so I'm not sure what the reason is now. The most likely possibility is that the compiler is having trouble with the code generated by the Packet macro, which the compiler can't see.

now,i had fix it in another pc

@Paul-weqe
Copy link
Contributor

Paul-weqe commented May 6, 2024

Hmm...so first, Windows seems to be bringing issues to more than just you (see here). The documentation will be improved on that. I am on Ubuntu so I could have been of little help anyway.

Now to the second problem. I will be using MutableEthernetPacket and EthernetPacket to illustrate. The problem comes out because the structs such as EthernetPacket and MutableEthernetPacket and the rest of the packets are not manually coded, they are generated via the Packet Macro when the library is compiled, (look here). From line 10 it describes how they are automatically generated.

Basically this means that when you look for their written code, such as by pressing Ctrl + Enter, the only place it can take you is to the Macro that produced it. If you really want to have a look at the struct that called the macro for e.g MutableEthernetPacket and EthernetPacket to be produced, most of them are inside here.

I don't know if I have answered your question correctly. If not, let me know where I can elaborate.

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

No branches or pull requests

2 participants