cloptions.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. #include <stdint.h>
  22. #include "procconf.h"
  23. /*
  24. * Process the options/arguments passed to the program.
  25. *
  26. * Input varibles:
  27. * argc, argv: Command line data.
  28. *
  29. * Return value:
  30. * 0 if the command has been satisfied and the program should exit 0.
  31. * 2 for usage error, in which case an error message will have been printed.
  32. * 1 if argument processing was successful and the program should continue.
  33. */
  34. int procArgs(int argc, const char* argv[]);
  35. /*
  36. * These functions return values set by command line options
  37. */
  38. int isV6(void); // DHCPv6 operation (-6)
  39. int getInitialOnly(void); // Do only initial exchange (-i)
  40. unsigned getRate(void); // Request rate (-r)
  41. unsigned getNumRequest(void); // Number of requests (-n)
  42. double getDropTime(void); // Response timeout (-d)
  43. double getTestPeriod(void); // Test period (-p)
  44. const char* getServer(void); // Server to contact
  45. const char* getLocalName(void); // Local host/interface (-l)
  46. const char* getMaxDrop(void); // Max dropped responses (-D)
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50. #endif