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

how to extract data packet from PDU object? #363

Open
DarrenSong opened this issue Aug 4, 2019 · 1 comment
Open

how to extract data packet from PDU object? #363

DarrenSong opened this issue Aug 4, 2019 · 1 comment

Comments

@DarrenSong
Copy link

i can get the IP though IP &ip = pdu.rfind_pdu();but i don't know how to extract data? could you help me?

@hawake
Copy link

hawake commented Aug 31, 2019

Hi,
in order to extract data you could try to rfind the RawPDU (or whatever else it is) inside the IP PDU and use the payload() getter method. Something like this, for example:

auto a = pkt.rfind_pdu<Tins::RawPDU>().payload();

Hope it could be useful.

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