Skip to content

Commit

Permalink
Add version number to usage
Browse files Browse the repository at this point in the history
  • Loading branch information
rigtorp committed Mar 27, 2020
1 parent 4dc31ab commit 5ad5a0d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 35 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Erik Rigtorp <erik@rigtorp.se>
Copyright (c) 2020 Erik Rigtorp <erik@rigtorp.se>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
53 changes: 19 additions & 34 deletions src/udpreplay.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
/*
Copyright (c) 2019 Erik Rigtorp <erik@rigtorp.se>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
// © 2020 Erik Rigtorp <erik@rigtorp.se>
// SPDX-License-Identifier: MIT

#include <cstring>
#include <iostream>
Expand All @@ -33,16 +14,6 @@ SOFTWARE.
#define NANOSECONDS_PER_SECOND 1000000000L

int main(int argc, char *argv[]) {
static const char usage[] =
" [-i iface] [-l] [-s speed] [-c millisec] [-r repeat] [-t ttl] pcap\n"
"\n"
" -i iface interface to send packets through\n"
" -l enable loopback\n"
" -c millisec constant milliseconds between packets\n"
" -r repeat number of times to loop data (-1 for infinite loop)\n"
" -s speed replay speed relative to pcap timestamps\n"
" -t ttl packet ttl\n"
" -b enable broadcast (SO_BROADCAST)";

int ifindex = 0;
int loopback = 0;
Expand Down Expand Up @@ -96,12 +67,26 @@ int main(int argc, char *argv[]) {
broadcast = 1;
break;
default:
std::cerr << "usage: " << argv[0] << usage << std::endl;
return 1;
goto usage;
}
}
if (optind >= argc) {
std::cerr << "usage: " << argv[0] << usage << std::endl;
usage:
std::cerr
<< "udpreplay 1.0.0 © 2020 Erik Rigtorp <erik@rigtorp.se> "
"https://github.com/rigtorp/udpreplay\n"
"usage: udpreplay [-i iface] [-l] [-s speed] [-c millisec] [-r "
"repeat] [-t ttl] "
"pcap\n"
"\n"
" -i iface interface to send packets through\n"
" -l enable loopback\n"
" -c millisec constant milliseconds between packets\n"
" -r repeat number of times to loop data (-1 for infinite loop)\n"
" -s speed replay speed relative to pcap timestamps\n"
" -t ttl packet ttl\n"
" -b enable broadcast (SO_BROADCAST)"
<< std::endl;
return 1;
}

Expand Down

0 comments on commit 5ad5a0d

Please sign in to comment.