Re: Perl Module for Sockets that can Mark DSCP



Scott (Scooter) McHugh wrote:
"Brian McCauley" <nobull67@xxxxxxxxx> wrote in message

But note the constants SOL_IP, IP_TOS and IPTOS_LOWDELAY are probably
not in the Socket module so you'll hace to grab them out of the C
header files yourself.


Ughhh sorry but I am really a newbie. How do I grab them from the C header files? I have googled for this but I am just really lost.
TIA



Assuming you have the C header files installed, the following command ought to find what you're looking for:

find /usr/include -name "*.h" -type f | \
xargs grep '\<\(SOL_IP\|IP_TOS\|IPTOS_LOWDELAY\)\>'

For instance, I dredge up the following on Debian Linux:

#define SOL_IP 0
#define IP_TOS 1
#define IPTOS_LOWDELAY 0x10

The equivalent Perl code is:

use constant SOL_IP => 0;
use constant IP_TOS => 1;
use constant IPTOS_LOWDELAY => 0x10;

--
Donald King, a.k.a. Chronos Tachyon
http://chronos-tachyon.net/
.