cmd_options.c 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (C) 2013 Tobias Brunner
  3. * HSR Hochschule fuer Technik Rapperswil
  4. *
  5. * Copyright (C) 2013 Martin Willi
  6. * Copyright (C) 2013 revosec AG
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  15. * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  16. * for more details.
  17. */
  18. #include "cmd_options.h"
  19. #include <getopt.h>
  20. /**
  21. * See header.
  22. */
  23. cmd_option_t cmd_options[CMD_OPT_COUNT] = {
  24. { CMD_OPT_HELP, "help", no_argument, "",
  25. "print this usage information and exit", {}},
  26. { CMD_OPT_VERSION, "version", no_argument, "",
  27. "show version information and exit", {}},
  28. { CMD_OPT_DEBUG, "debug", required_argument, "level",
  29. "set the default log level (-1..4, default: 1)", {}},
  30. { CMD_OPT_HOST, "host", required_argument, "hostname",
  31. "DNS name or address to connect to", {}},
  32. { CMD_OPT_IDENTITY, "identity", required_argument, "identity",
  33. "identity the client uses for the IKE exchange", {}},
  34. { CMD_OPT_EAP_IDENTITY, "eap-identity", required_argument, "eap-identity",
  35. "identity the client uses for EAP authentication", {}},
  36. { CMD_OPT_XAUTH_USER, "xauth-username", required_argument, "xauth-username",
  37. "username the client uses for XAuth authentication", {}},
  38. { CMD_OPT_REMOTE_IDENTITY, "remote-identity", required_argument, "identity",
  39. "server identity to expect, defaults to host", {}},
  40. { CMD_OPT_CERT, "cert", required_argument, "path",
  41. "certificate for authentication or trust chain validation", {}},
  42. { CMD_OPT_RSA, "rsa", required_argument, "path",
  43. "RSA private key to use for authentication", {}},
  44. { CMD_OPT_PKCS12, "p12", required_argument, "path",
  45. "PKCS#12 file with private key and certificates to use for ", {
  46. "authentication and trust chain validation"
  47. }},
  48. { CMD_OPT_AGENT, "agent", optional_argument, "socket",
  49. "use SSH agent for authentication. If socket is not specified", {
  50. "it is read from the SSH_AUTH_SOCK environment variable",
  51. }},
  52. { CMD_OPT_LOCAL_TS, "local-ts", required_argument, "subnet",
  53. "additional traffic selector to propose for our side", {}},
  54. { CMD_OPT_REMOTE_TS, "remote-ts", required_argument, "subnet",
  55. "traffic selector to propose for remote side", {}},
  56. { CMD_OPT_IKE_PROPOSAL, "ike-proposal", required_argument, "proposal",
  57. "a single IKE proposal to offer instead of the default", {}},
  58. { CMD_OPT_ESP_PROPOSAL, "esp-proposal", required_argument, "proposal",
  59. "a single ESP proposal to offer instead of the default", {}},
  60. { CMD_OPT_AH_PROPOSAL, "ah-proposal", required_argument, "proposal",
  61. "a single AH proposal to offer instead of the default", {}},
  62. { CMD_OPT_PROFILE, "profile", required_argument, "name",
  63. "authentication profile to use, where name is one of:", {
  64. " ikev2-pub, ikev2-eap, ikev2-pub-eap",
  65. " ikev1-pub[-am], ikev1-xauth[-am],",
  66. " ikev1-xauth-psk[-am], ikev1-hybrid[-am]",
  67. }},
  68. };