diff options
author | Simon Horman <horms@verge.net.au> | 2012-11-27 10:12:26 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2012-11-27 10:13:16 -0800 |
commit | 020c93874e22c1c7492c30fe76a8e496571ede13 (patch) | |
tree | a28f1caba9ad98367ec943ff8ca969ed9db28582 /lib/ofp-version-opt.h | |
parent | 2e1ae2005ed347d2dfebd23fff40c54a1a2a6716 (diff) | |
download | openvswitch-020c93874e22c1c7492c30fe76a8e496571ede13.tar.gz |
lib: Add helpers for OpenFlow version command line options
Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com renamed some functions and options and revised
the documentation]
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/ofp-version-opt.h')
-rw-r--r-- | lib/ofp-version-opt.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/ofp-version-opt.h b/lib/ofp-version-opt.h new file mode 100644 index 000000000..78e313529 --- /dev/null +++ b/lib/ofp-version-opt.h @@ -0,0 +1,25 @@ +#ifndef OFP_VERSION_H +#define OFP_VERSION_H 1 + +#include <openflow/openflow-common.h> +#include "util.h" +#include "ofp-util.h" + +#define OFP_VERSION_LONG_OPTIONS \ + {"version", no_argument, NULL, 'V'}, \ + {"protocols", required_argument, NULL, 'O'} + +#define OFP_VERSION_OPTION_HANDLERS \ + case 'V': \ + ovs_print_version(OFP10_VERSION, OFP13_VERSION); \ + exit(EXIT_SUCCESS); \ + \ + case 'O': \ + set_allowed_ofp_versions(optarg); \ + break; + +uint32_t get_allowed_ofp_versions(void); +void set_allowed_ofp_versions(const char *string); +void ofp_version_usage(void); + +#endif |