naveed has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks - I seek your wisdom. Anyone know how to set loose source route options in a Perl Sockets application I am writing for network debugging purposes. Infact anyone know generally how to set IP options when using sockets ? Thanks Naveed

Replies are listed 'Best First'.
Re: IP loose source routing option
by bikeNomad (Priest) on Jun 26, 2001 at 21:17 UTC
    Perl has a setsockopt call where you can set the LEVEL:
     setsockopt SOCKET,LEVEL,OPTNAME,OPTVAL
        Sets the socket option requested.  Returns
        undefined if there is an error.  OPTVAL may be
        specified as "undef" if you don't want to pass an
        argument.
    

    I assume that the arguments would be the same as the corresponding C call.

Re: IP loose source routing option
by Big Willy (Scribe) on Jun 26, 2001 at 21:08 UTC
    Maybe you are aware of this but generally routers turn off the option to allow source routing. It's been done for years, practically since the Internet was widely available. I don't think you will get much out of doing source routing.
Re: IP loose source routing option
by cacharbe (Curate) on Jun 26, 2001 at 21:20 UTC
    Okay, have you tried 'Super Search?'
    I typed - IO::Socket - in the search box, and after some brief reading, found the following:
    sockopt(OPT [, VAL]) Unified method to both set and get options in the SOL_SOCKET level. If + called with one argument then getsockopt is called, otherwise setsoc +kopt is called.

    a little follow up to perlman:PerlFunc , brought me here , which shook loose the following:

    usage: setsockopt SOCKET,LEVEL,OPTNAME,OPTVAL

    And Finally, From a Super Search document found here I found out that more info might be available from the C man pages from which the Modules are based.
    The options for setsockopt/getsockopt are in setsockopt(2).

    C-.