Hello,

I would like to ask you for hints towards standard Perl functions, modules, or CPAN modules that can help in trying to relate INET sockets to PIDs in the process table.

I think there are some tools in the public domain such as lsof that can be used as command line programmes. However, I would prefer to use a Perl contained solution.

The OS is HP-UX 10.20. I have no notion of system programming on HP-UX using the HP-UX libc, or how to access kernel space to retrieve the wanted connection.

Would one need a packet filtering library like libpcap and a NIC in promiscous mode to achieve this?

I wonder how netstat -an -f inet is filering all active INET sockets. But then I'd still need the link to which proc is having handles on which socket.

I would know enough about basic Perl IPC in order to parse output from forked external commands, but as mentioned I'd prefer a Perl solution, if this is possible at all.

Rgds.

In reply to Relating AF_INET sockets to processes using Perl by SIGSEGV

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.