mirror of
https://github.com/adulau/netbeacon.git
synced 2024-11-24 02:57:06 +00:00
-d destination address option added
The destination IPv4 address where to send the netbeacon to. IPv6 is currently not supported.
This commit is contained in:
parent
2441060500
commit
e59ee5e971
1 changed files with 5 additions and 1 deletions
|
@ -42,6 +42,7 @@ usage = "usage: %prog [options] <netbeacon messages>"
|
|||
parser = OptionParser(usage)
|
||||
parser.add_option("-s","--storeseq", dest="storeseq", action='store_true', help="store sequence and validate sequence")
|
||||
parser.add_option("-i","--iteration", dest="iteration", type=int, help="set the number of interation for sending the netbeacon")
|
||||
parser.add_option("-d","--destination", dest="destination", help="set the destination IPv4 address (default: 127.0.0.1)")
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
|
@ -59,8 +60,11 @@ else:
|
|||
if not options.iteration:
|
||||
options.iteration=10
|
||||
|
||||
if not options.destination:
|
||||
options.destination="127.0.0.1"
|
||||
|
||||
for x in range(seqstart,seqstart+options.iteration):
|
||||
nbsend(destination="127.0.0.1", payload=nbmessage(x), logging=True)
|
||||
nbsend(destination=options.destination, payload=nbmessage(x), logging=True)
|
||||
if options.storeseq:
|
||||
s['seq'] = x
|
||||
|
||||
|
|
Loading…
Reference in a new issue