Greetings:
I am looking for a way to put a raw packet on the network wire. I have built the IP header myself, and included all needed data in a scalar. Now, all I need is to send it out on the cable. Is there a way to do this in WinNT?
I’ve opened the socket, and attempted a write as below:
I get an “unknown error”
my $temp=socket(SOCK,PF_INET,SOCK_RAW,0) or die('Can not open socket')
+;
printf "%d $@ $!\n",$temp;
my $temp=syswrite(SOCK,$packed); #send the data
printf "%d $@ $!\n",$temp;
close SOCK;
Thx for any help!
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|