Solved

Net::RawIP, getopts.pl

Posted on 2003-12-10
7
793 Views
Last Modified: 2006-11-17
what is the meaning of these lines ?Thank you


#!/usr/bin/perl

require 'getopts.pl';
use Net::RawIP;
use IO::Socket;

Getopts('s:d:p:q:w:t:');
$synPacket = new Net::RawIP;
$ackPacket = new Net::RawIP;

die "Usage $0 -s <IP source> -d <IP destination> -p <source port> -q <dest port> -w <window> -t <ttl>"
unless ($opt_s && $opt_d && $opt_p && $opt_q && $opt_w);
0
Comment
Question by:bertinoflex
  • 3
  • 2
7 Comments
 
LVL 3

Accepted Solution

by:
mrh30 earned 25 total points
Comment Utility
Net::RawIP is a module for manipulating raw IP packets.  See http://search.cpan.org/~skolychev/Net-RawIP-0.1/RawIP.pm for details.

getopts.pl could be anything!  The require before it just means that if it hasn't been loaded already it will be loaded.  There's no way of telling from this code which getops will actually do.

The most likely explanation is that Getopts('s:d:p:q:w:t:') is a function supplied by getopts.pl and that this plucks the command line arguments and puts them in $opt_s etc appropriately.
0
 
LVL 2

Assisted Solution

by:PurplePerls
PurplePerls earned 25 total points
Comment Utility
0
 
LVL 3

Expert Comment

by:mrh30
Comment Utility
PurplePerls: There's no guarantee that getopts.pl is the same one though.  It could be anything with the same file name.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 2

Expert Comment

by:PurplePerls
Comment Utility
From the upper link:
;# getopts.pl - a better getopt.pl

;# Usage:
;#      do Getopts('a:bc');  # -a takes arg. -b & -c not. Sets opt_* as a
;#                           #  side effect.

Of course you are true, it could be anything but getting options :)

0
 
LVL 3

Expert Comment

by:mrh30
Comment Utility
I do also agree with you though - it is certainly the most likely candidate! :-)
0
 
LVL 20

Expert Comment

by:jmcg
Comment Utility
Nothing has happened on this question in more than 7 weeks. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
split points between mrh30 and PurplePerls.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now