Not sure how much of a perl question this really is. Perl sits on top of the OS and relies on calls to the devices drivers to perform IO. But the networking device drivers are designed specifically to abstract the MAC addresses and instead present network addresses to the user process. So you first need a driver to interface to the network stack and return MAC addresses. Sitting on top of that you need a library or module to allow perl to access the driver.

Your question then becomes one of how to interface to the module. Usually a trivial question once you have the module and it's documentation.

Having carefully stated the correct way to approach it; here is the wrong way:

tcpdump -xx |perl -lne '/0000:\s+((\w{4}\s){3})/;print "$1"' - tcpdump: verbose output suppressed, use -v or -vv for full protocol de +code listening on fxp0, link-type EN10MB (Ethernet), capture size 96 bytes 0013 20bc 58b5 0013 20bc 58b5 00a0 c9cd 5db1 00a0 c9cd 5db1 00a0 c9cd 5db1 00a0 c9cd 5db1 00a0 c9cd 5db1 000d 889a 8e32 000d 889a 8e32 000d 889a 8e32 000d 889a 8e32 000d 889a 8e32 000d 889a 8e32 000d 889a 8e32 00a0 c9cd 5db1 00a0 c9cd 5db1 . . .

s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}

In reply to Re: Designing a wireless application by starbolin
in thread Designing a wireless application by perlsyntax

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.