2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-19 14:37:21 +00:00
Files
openvswitch/lib/ofp-version-opt.c
Ben Warren f424833659 Move lib/ofp-util.h to include/openvswitch directory
This commit also adds several #include directives in source files in
order to make the 'ofp-util.h' move possible

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2016-04-14 13:48:25 -07:00

50 lines
1.1 KiB
C

#include <config.h>
#include "openvswitch/dynamic-string.h"
#include "openvswitch/ofp-util.h"
#include "ofp-version-opt.h"
#include "ovs-thread.h"
static uint32_t allowed_versions = 0;
uint32_t
get_allowed_ofp_versions(void)
{
return allowed_versions ? allowed_versions : OFPUTIL_DEFAULT_VERSIONS;
}
void
set_allowed_ofp_versions(const char *string)
{
assert_single_threaded();
allowed_versions = ofputil_versions_from_string(string);
}
void
mask_allowed_ofp_versions(uint32_t bitmap)
{
assert_single_threaded();
allowed_versions &= bitmap;
}
void
add_allowed_ofp_versions(uint32_t bitmap)
{
assert_single_threaded();
allowed_versions |= bitmap;
}
void
ofp_version_usage(void)
{
struct ds msg = DS_EMPTY_INITIALIZER;
ofputil_format_version_bitmap_names(&msg, OFPUTIL_DEFAULT_VERSIONS);
printf(
"\nOpenFlow version options:\n"
" -V, --version display version information\n"
" -O, --protocols set allowed OpenFlow versions\n"
" (default: %s)\n",
ds_cstr(&msg));
ds_destroy(&msg);
}