LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-27-2009, 03:10 AM   #1
robel
Member
 
Registered: Oct 2008
Location: Norway
Distribution: Slackware
Posts: 77

Rep: Reputation: 19
tcpdump version 4.0.0 decode Agent-Information Option 82


Using tcpdump version 4.0.0 (libpcap version 1.0.0) to decode Agent-Information Option 82, I would like to get the output a little more human readable.

Code:
            Agent-Information Option 82, length 14:
              Circuit-ID SubOption 1, length 4: M-^@^A^@^C
              Remote-ID SubOption 2, length 6: ^@^[M-]M-,^T4
I've searched through the man-pages but could not find any appropriate switch.

tcpdump version 3.9.2 (libpcap version 0.9.2) works like this on the very same packet:

Code:
            ACKT:1.4.128.1.0.3.2.6.0.27.221.172.20.52
"Pretty" readable. 1.4 is SubOption 1, length 4 (data follows, 4 bytes). 2.6 is SubOption 2, length 6 (data follows, 6 bytes). The last six bytes it the data I need. It is a hardware address: 00:1b:dd:ac:14:34 (translated to hex).

I guess it's not that easy to "see" that ^@^[M-]M-,^T4 is the same hardware address...

Any clue how to solve this with tcpdump 4.0.0?

-Bob-
 
Old 03-28-2009, 11:40 AM   #2
robel
Member
 
Registered: Oct 2008
Location: Norway
Distribution: Slackware
Posts: 77

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by robel View Post
Any clue how to solve this with tcpdump 4.0.0?
Ok, didn't get any answer to I had to alter the code. Maybe it can be done without tampering with the code, but I have no clue how...


print-bootp.c line 693:

Old code:

Code:
                                        case AGENT_SUBOPTION_CIRCUIT_ID: /* fall through */
                                        case AGENT_SUBOPTION_REMOTE_ID:
                                        case AGENT_SUBOPTION_SUBSCRIBER_ID:
                                                fn_printn(bp, suboptlen, NULL);
                                                break;
New code:

Code:
                                        case AGENT_SUBOPTION_REMOTE_ID:
                                            printf("%s", etheraddr_string(bp));
                                            break;
                                        case AGENT_SUBOPTION_CIRCUIT_ID: /* fall through */
                                        case AGENT_SUBOPTION_SUBSCRIBER_ID:
                                                fn_printn(bp, suboptlen, NULL);
                                                break;
This will give:
Code:
            Agent-Information Option 82, length 14:
              Circuit-ID SubOption 1, length 4: M-^@^A^@^C
              Remote-ID SubOption 2, length 6: 00:1b:dd:ac:14:34
Still Circuit-ID SubOption 1 is unreadable, but I don't need it so I left it untouched. Something can probably be done in the case AGENT_SUBOPTION_CIRCUIT_ID instead of "falling through" to pn_printn()

-Bob-
 
  


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
LXer: Using Wget's User Agent Option Safely On Linux And Unix LXer Syndicated Linux News 0 01-06-2009 09:40 AM
Error: Agent Configuration Agent (use Oracle with Linux) shipon_97 Linux - Enterprise 0 02-02-2007 12:11 AM
DHCP Option-82 Relay Agent Information - RFC 3046 aussiecanuck46 Linux - Kernel 0 07-05-2006 08:49 AM
can't find ide.agent & block.agent for hotplug for 2.6 jg167 Linux - Newbie 1 06-23-2004 05:20 PM
Hotplug problems: RH 9, 2.6.6, PCMCIA-CS 3.2.7 (missing ide.agent & block.agent) jg167 Red Hat 1 06-23-2004 05:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:30 AM.

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
Open Source Consulting | Domain Registration