cloptions.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  9. * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  10. * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  11. * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  12. * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  13. * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  14. * PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef CLOPTIONS_H
  17. #define CLOPTIONS_H
  18. #include <stdint.h>
  19. #include "procconf.h"
  20. /*
  21. * Process the options/arguments passed to the program.
  22. *
  23. * Input varibles:
  24. * argc, argv: Command line data.
  25. *
  26. * Return value:
  27. * 0 if the command has been satisfied and the program should exit 0.
  28. * 2 for usage error, in which case an error message will have been printed.
  29. * 1 if argument processing was successful and the program should continue.
  30. */
  31. int procArgs(int argc, const char* argv[]);
  32. /*
  33. * These functions return values set by command line options
  34. */
  35. int getv6(void); // DHCPv6 operation (-6)
  36. int getinitialOnly(void); // Do only initial exchange (-i)
  37. unsigned getrate(void); // Request rate (-r)
  38. unsigned getnumRequest(void); // Number of requests (-n)
  39. double getdropTime(void); // Response timeout (-d)
  40. double gettestPeriod(void); // Test period (-p)
  41. const char* getserver(void); // Server to contact
  42. const char* getlocalName(void); // Local host/interface (-l)
  43. const char* getmaxDrop(void); // Max dropped responses (-D)
  44. #endif