LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-07-2018, 12:49 AM   #1
ghhbak
LQ Newbie
 
Registered: May 2018
Posts: 9

Rep: Reputation: Disabled
Packet parser to extract DHCP options from the DHCP ack packet


Hi - I'm a noob and looking to find open source code to parse incoming packets into my Ubuntu machine, identify a DHCP ack packet and then extract the subnet mask, IP address lease time, TFTP server address etc. So far, I'm able to parse TCP and UDP packets using raw sockets.

Thx
 
Old 05-07-2018, 02:14 AM   #2
FlinchX
Member
 
Registered: Nov 2017
Distribution: Slackware Linux
Posts: 393

Rep: Reputation: Disabled
If you're doing it from a program, you may want to specify which programming language are you using. If it doesn't matter, you could try diving into the source code of Wireshark to learn from it.
 
Old 05-07-2018, 03:33 PM   #3
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,511

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
This is pretty good: https://github.com/mike01/pypacker
 
Old 05-17-2018, 01:07 AM   #4
ghhbak
LQ Newbie
 
Registered: May 2018
Posts: 9

Original Poster
Rep: Reputation: Disabled
I'd like to do it in C code with raw sockets.
 
Old 05-17-2018, 09:24 AM   #5
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,511

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Do you have to do this 'live', or does it have to be particularly fast? Maybe go a bit more into your application. Did you look at pypacker?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] what DHCP SERVER do when receive a dhcp release packet from client arnold.king Linux - Networking 2 04-17-2013 12:39 PM
altering dhcp request packet iluvatar Linux - Networking 0 09-24-2007 06:06 PM
why DHCP client not sending own host name in DHCP request packet? sonika_singhi Linux - Networking 7 05-28-2005 06:18 AM
DHCP offer packet refused David_Moses Linux - Wireless Networking 2 01-15-2005 07:59 AM
DHCP packet building payal_shah Linux - Networking 1 12-22-2004 11:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration