Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Net::RawIP, getopts.pl

Posted on 2003-12-10
7
Medium Priority
?
845 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 3

Accepted Solution

by:
mrh30 earned 100 total points
ID: 9912492
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 100 total points
ID: 9912887
0
 
LVL 3

Expert Comment

by:mrh30
ID: 9912918
PurplePerls: There's no guarantee that getopts.pl is the same one though.  It could be anything with the same file name.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:PurplePerls
ID: 9913072
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
ID: 9913092
I do also agree with you though - it is certainly the most likely candidate! :-)
0
 
LVL 20

Expert Comment

by:jmcg
ID: 10218553
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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…
Six Sigma Control Plans

618 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