mirror of
https://github.com/openvswitch/ovs
synced 2025-10-19 14:37:21 +00:00
All existing ovs-ofctl flow mod commands now take an optional '--bundle' argument, which executes the flow mods as a single transaction. OpenFlow 1.4+ is implicitly assumed when '--bundle' is specified. ovs-ofctl 'add-flow' and 'add-flows' commands now accept flow specifications that start with an optional 'add', 'modify', 'delete', 'modify_strict', or 'delete_strict' keyword, so that arbitrary flow table modifications may be specified. For backwards compatibility, a missing keyword is treated as an 'add'. With the new '--bundle' option all the modifications are executed as a single transaction using an OpenFlow 1.4 bundle. OpenFlow 1.4 requires bundles to support at least flow and port mods. This implementation does not yet support port mods in bundles. Another restriction is that the atomic transactions are not yet supported. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
#include <config.h>
|
|
#include "dynamic-string.h"
|
|
#include "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);
|
|
}
|