sub sendraw { my ($pstr)=@_; $PROTO=getprotobyname('tcp')||0; @DXX=(); $pstr=~s/\n/\r\n/g; $pstr=~s/\r\r/\r/g; debugprint("Sending raw: $pstr"); if($D{'XXinet_aton'} eq ''){ if(!($D{'XXinet_aton'}=inet_pton(FAMILY,$D{'XXTarget'}))){ wprint("! DNS lookup failure."); $D{'XXDead'}=1; return;}} if($^O=~/win/i){ sendraw_win($pstr);} else { sendraw_unix($pstr);} } sub sendraw_unix { my ($pstr)=@_; $D{'XXHaveHeaders'}=0; eval { alarm($D{'XXTimeoutVal'}); $D{'XXDead'}=1; if(!(socket(S,PF_INET,SOCK_STREAM,$PROTO))){ wprint("= Socket problems"); return;} if($D{'XXSessSplice'}>0){ # session splicing setsockopt(S,SOL_SOCKET,SO_SNDLOWAT,1); @chars=split(//,$pstr);} if(connect(S,sockaddr_in($D{'XXPort'},$D{'XXinet_aton'}))){ select(S); $|=1; if($D{'XXSessSplice'}>0){foreach $char (@chars){print $char; select(undef,undef,undef,$D{'XXIDSMode9Wait'});} }else{print $pstr;} while(<S>){ $line=$_; push(@DXX,$line); if ($line=~/^[\r\n]+$/){ # we can continue $D{'XXHaveHeaders'}=1; $D{'XXDead'}=0; +} last if ($line=~/^[\r\n]+$/ && $D{'XXNoContent +'} > 0);} select(STDOUT); close(S); alarm(0); $D{'XXDead'}=0; return; } else { wprint("= Not responding...");} alarm(0);}; if ($@) { if ($@ =~ /timeout/){wprint("= Timed out\\"); $D{'XXDead'}==1?wprint(". Aborting."):wprint(", but continuing +.");}}}
Particulrly could you pealse tell me the corresponding functions for "inet_aton", how to open a raw socket in v6,send raw data and in which format we have to provide IPv6 format (2222:10::3). I went through http://search.cpan.org/~umemoto/Socket6-0.19/Socket6.pm README, but it's not giving clear information. Aprrecitae your help!!

In reply to please provide solution to convert the follwoing IPv4 Socket functions to Ipv6 using Socket6 by phemal

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.