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

Not able to extract packet payload data #30

Closed
kishorer747-zz opened this issue Jun 29, 2015 · 9 comments
Closed

Not able to extract packet payload data #30

kishorer747-zz opened this issue Jun 29, 2015 · 9 comments

Comments

@kishorer747-zz
Copy link

There is no function to get hexdump of a packet payload data. There is a function in PcapReader.java in net.ripe.hadoop.pcap package called readPayload() but it takes a packetdata, payloadDataStart and payloadLength parameters.

@wnagele
Copy link
Contributor

wnagele commented Jun 29, 2015

You can override the readPayload method and create a HEX dump across that. Feel free to provide back code if it's useful to the rest of the project.

@wnagele wnagele closed this as completed Jun 29, 2015
@kishorer747-zz
Copy link
Author

Hi,
I know that i have to override the readpayload method. But how do I get the
packetData byte array , packetPayloadStart and packetPayloadLength? Please
help.

Thanks
Kishore

On 29 June 2015 at 15:25, Wolfgang Nagele notifications@github.com wrote:

You can override the readPayload method and create a HEX dump across that.
Feel free to provide back code if it's useful to the rest of the project.


Reply to this email directly or view it on GitHub
#30 (comment)
.

Cheers

Kishore
http://kishorer.in

@wnagele
Copy link
Contributor

wnagele commented Jun 29, 2015

You don't need to do that. Simply create an extended class (see here for an example https://github.com/RIPE-NCC/hadoop-pcap/blob/master/hadoop-pcap-lib/src/main/java/net/ripe/hadoop/pcap/HashPayloadPcapReader.java). Then use this instead of the PcapReader class.

@wnagele wnagele reopened this Jun 29, 2015
@wnagele wnagele closed this as completed Jun 29, 2015
@kishorer747-zz
Copy link
Author

How do i set Pcap reader class in my Mapper? If i use HttpPcapReader
instead of Packet packet = (Packet)value.get(); , i get this
error: Caused by: java.lang.ClassCastException:
net.ripe.hadoop.pcap.packet.Packet cannot be cast to
net.ripe.hadoop.pcap.packet.HttpPacket

I want raw hex dump of HTTP packets. Also how do i set datastream input for
this HttpPcap reader class? Please help.

On 29 June 2015 at 17:25, Wolfgang Nagele notifications@github.com wrote:

Reopened #30 #30.


Reply to this email directly or view it on GitHub
#30 (comment).

Cheers

Kishore
http://kishorer.in

@wnagele
Copy link
Contributor

wnagele commented Jul 2, 2015

@mayank1807
Copy link

Dear Sir,
I want to read HTTP payload from packet using Hadoop-pcap. I did not found any method for extracting payload from packet.

@SainathB
Copy link

Hi Sir,
In README.md file Configure reader section, I didn't get how to change the value of property net.ripe.hadoop.pcap.io.reader.class. Please help me in this.

Thanks in adavance.

@wnagele
Copy link
Contributor

wnagele commented May 16, 2016

It's a Java system property so you can specify it when starting the JVM with the -D option.

@mayank1807
Copy link

Dear Sir,

I ran example given by you "Example: Count source ports" which ran perfectly but when I make change in mapper class from "Packet packet = (Packet)value.get();" to "HttpPacket packet = (HttpPacket)value.get();" and during runtime I change reader as :
hadoop jar PcapTrial.jar /usr/local/hadoop/input /usr/local/hadoop/output -Dnet.ripe.hadoop.pcap.io.reader.class=net.ripe.hadoop.pcap.HttpPcapReader
then error came as :
java.lang.Exception: java.lang.ClassCastException: net.ripe.hadoop.pcap.packet.Packet cannot be cast to net.ripe.hadoop.pcap.packet.HttpPacket

Please help..!!

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

4 participants