summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Pettit <jpettit@ovn.org>2016-06-08 17:15:02 -0700
committerJustin Pettit <jpettit@ovn.org>2016-06-11 16:59:15 -0700
commitea46a4e9707921fa6bfd5fcffc5da31960788ee9 (patch)
tree6686d6bb40091d884675098f6085b8c8047d7e97
parent31ed1192e282b5ffa8af8a3933ee672cb74a13da (diff)
downloadopenvswitch-ea46a4e9707921fa6bfd5fcffc5da31960788ee9.tar.gz
ovn-nbctl: Update logical switch commands.
A few minor changes related to logical switch commands: - Use "ls" instead of "lswitch" to be more consistent with other command changes. - Use commands where possible in ovn unit tests. - Update references from "lswitch" to "ls" (code) or "switch" (user). Signed-off-by: Justin Pettit <jpettit@ovn.org> Acked-by: Ryan Moats <rmoats@us.ibm.com> Acked-by: Ben Pfaff <blp@ovn.org>
-rw-r--r--INSTALL.Docker.md2
-rwxr-xr-xovn/utilities/ovn-docker-overlay-driver8
-rw-r--r--ovn/utilities/ovn-nbctl.8.xml48
-rw-r--r--ovn/utilities/ovn-nbctl.c278
-rw-r--r--tests/ovn-controller-vtep.at10
-rw-r--r--tests/ovn-nbctl.at58
-rw-r--r--tests/ovn-sbctl.at2
-rw-r--r--tests/ovn.at96
-rw-r--r--tutorial/OVN-Tutorial.md32
-rwxr-xr-xtutorial/ovn/env1/setup.sh2
-rwxr-xr-xtutorial/ovn/env2/setup.sh4
-rwxr-xr-xtutorial/ovn/env3/setup.sh2
-rwxr-xr-xtutorial/ovn/env4/setup2.sh2
-rwxr-xr-xtutorial/ovn/env5/setup.sh16
-rwxr-xr-xtutorial/ovn/env6/setup.sh2
-rwxr-xr-xtutorial/ovn/env7/add-container-ports.sh2
-rwxr-xr-xtutorial/ovn/env7/setup.sh2
-rw-r--r--utilities/ovs-sim.1.xml4
18 files changed, 283 insertions, 287 deletions
diff --git a/INSTALL.Docker.md b/INSTALL.Docker.md
index cf15b29f3..fd082cbad 100644
--- a/INSTALL.Docker.md
+++ b/INSTALL.Docker.md
@@ -138,7 +138,7 @@ You can also look at this logical switch in OVN's northbound database by
running the following command.
```
-ovn-nbctl --db=tcp:$CENTRAL_IP:6640 lswitch-list
+ovn-nbctl --db=tcp:$CENTRAL_IP:6640 ls-list
```
* Docker creates your logical port and attaches it to the logical network
diff --git a/ovn/utilities/ovn-docker-overlay-driver b/ovn/utilities/ovn-docker-overlay-driver
index 467a22354..52de3dbe0 100755
--- a/ovn/utilities/ovn-docker-overlay-driver
+++ b/ovn/utilities/ovn-docker-overlay-driver
@@ -167,11 +167,11 @@ def create_network():
return jsonify({'Err': error})
try:
- ovn_nbctl("lswitch-add", network, "--", "set", "Logical_Switch",
+ ovn_nbctl("ls-add", network, "--", "set", "Logical_Switch",
network, "external_ids:subnet=" + subnet,
"external_ids:gateway_ip=" + gateway_ip)
except Exception as e:
- error = "create_network: lswitch-add %s" % (str(e))
+ error = "create_network: ls-add %s" % (str(e))
return jsonify({'Err': error})
return jsonify({})
@@ -189,9 +189,9 @@ def delete_network():
abort(400)
try:
- ovn_nbctl("lswitch-del", nid)
+ ovn_nbctl("ls-del", nid)
except Exception as e:
- error = "delete_network: lswitch-del %s" % (str(e))
+ error = "delete_network: ls-del %s" % (str(e))
return jsonify({'Err': error})
return jsonify({})
diff --git a/ovn/utilities/ovn-nbctl.8.xml b/ovn/utilities/ovn-nbctl.8.xml
index 35a44f8b8..c2ca420c7 100644
--- a/ovn/utilities/ovn-nbctl.8.xml
+++ b/ovn/utilities/ovn-nbctl.8.xml
@@ -12,10 +12,10 @@
<h1>General Commands</h1>
<dl>
- <dt><code>show [<var>lswitch</var> | <var>router</var>]</code></dt>
+ <dt><code>show [<var>switch</var> | <var>router</var>]</code></dt>
<dd>
Prints a brief overview of the database contents. If
- <var>lswitch</var> is provided, only records related to that
+ <var>switch</var> is provided, only records related to that
logical switch are shown. If
<var>router</var> is provided, only records related to that
logical router are shown.
@@ -25,7 +25,7 @@
<h1>Logical Switch Commands</h1>
<dl>
- <dt><code>lswitch-add</code></dt>
+ <dt><code>ls-add</code></dt>
<dd>
<p>
Creates a new, unnamed logical switch, which initially has no ports.
@@ -34,10 +34,10 @@
</p>
</dd>
- <dt>[<code>--may-exist</code> | <code>--add-duplicate</code>] <code>lswitch-add</code> <var>lswitch</var></dt>
+ <dt>[<code>--may-exist</code> | <code>--add-duplicate</code>] <code>ls-add</code> <var>switch</var></dt>
<dd>
<p>
- Creates a new logical switch named <var>lswitch</var>, which
+ Creates a new logical switch named <var>switch</var>, which
initially has no ports.
</p>
@@ -46,7 +46,7 @@
names to be unique, but the whole point to the names is to provide an
easy way for humans to refer to the switches, making duplicate names
unhelpful. Thus, without any options, this command regards it as an
- error if <var>lswitch</var> is a duplicate name. With
+ error if <var>switch</var> is a duplicate name. With
<code>--may-exist</code>, adding a duplicate name succeeds but does
not create a new logical switch. With <code>--add-duplicate</code>,
the command really creates a new logical switch with a duplicate
@@ -54,23 +54,23 @@
</p>
</dd>
- <dt>[<code>--if-exists</code>] <code>lswitch-del</code> <var>lswitch</var></dt>
+ <dt>[<code>--if-exists</code>] <code>ls-del</code> <var>switch</var></dt>
<dd>
- Deletes <var>lswitch</var>. It is an error if <var>lswitch</var> does
+ Deletes <var>switch</var>. It is an error if <var>switch</var> does
not exist, unless <code>--if-exists</code> is specified.
</dd>
- <dt><code>lswitch-list</code></dt>
+ <dt><code>ls-list</code></dt>
<dd>
Lists all existing switches on standard output, one per line.
</dd>
</dl>
- <h1>ACL Commands</h1>
+ <h1>Logical Switch ACL Commands</h1>
<dl>
- <dt>[<code>--log</code>] <code>acl-add</code> <var>lswitch</var> <var>direction</var> <var>priority</var> <var>match</var> <var>action</var></dt>
+ <dt>[<code>--log</code>] <code>acl-add</code> <var>switch</var> <var>direction</var> <var>priority</var> <var>match</var> <var>action</var></dt>
<dd>
- Adds the specified ACL to <var>lswitch</var>.
+ Adds the specified ACL to <var>switch</var>.
<var>direction</var> must be either <code>from-lport</code> or
<code>to-lport</code>. <var>priority</var> must be between
<code>1</code> and <code>65534</code>, inclusive. If
@@ -78,25 +78,25 @@
ACL. A full description of the fields are in <code>ovn-nb</code>(5).
</dd>
- <dt><code>acl-del</code> <var>lswitch</var> [<var>direction</var> [<var>priority</var> <var>match</var>]]</dt>
+ <dt><code>acl-del</code> <var>switch</var> [<var>direction</var> [<var>priority</var> <var>match</var>]]</dt>
<dd>
- Deletes ACLs from <var>lswitch</var>. If only
- <var>lswitch</var> is supplied, all the ACLs from the logical
+ Deletes ACLs from <var>switch</var>. If only
+ <var>switch</var> is supplied, all the ACLs from the logical
switch are deleted. If <var>direction</var> is also specified,
then all the flows in that direction will be deleted from the
logical switch. If all the fields are given, then a single flow
that matches all the fields will be deleted.
</dd>
- <dt><code>acl-list</code> <var>lswitch</var></dt>
+ <dt><code>acl-list</code> <var>switch</var></dt>
<dd>
- Lists the ACLs on <var>lswitch</var>.
+ Lists the ACLs on <var>switch</var>.
</dd>
</dl>
<h1>Logical Switch Port Commands</h1>
<dl>
- <dt>[<code>--may-exist</code>] <code>lsp-add</code> <var>lswitch</var> <var>port</var></dt>
+ <dt>[<code>--may-exist</code>] <code>lsp-add</code> <var>switch</var> <var>port</var></dt>
<dd>
<p>
Creates on <var>lswitch</var> a new logical switch port named
@@ -107,15 +107,15 @@
It is an error if a logical port named <var>port</var> already
exists, unless <code>--may-exist</code> is specified. Regardless of
<code>--may-exist</code>, it is an error if the existing port is in
- some logical switch other than <var>lswitch</var> or if it has a
+ some logical switch other than <var>switch</var> or if it has a
parent port.
</p>
</dd>
- <dt>[<code>--may-exist</code>] <code>lsp-add</code> <var>lswitch</var> <var>port</var> <var>parent</var> <var>tag</var></dt>
+ <dt>[<code>--may-exist</code>] <code>lsp-add</code> <var>switch</var> <var>port</var> <var>parent</var> <var>tag</var></dt>
<dd>
<p>
- Creates on <var>lswitch</var> a logical switch port named
+ Creates on <var>switch</var> a logical switch port named
<var>port</var> that is a child of <var>parent</var> that is
identifed with VLAN ID <var>tag</var>. This is useful in
cases such as virtualized container environments where Open
@@ -127,7 +127,7 @@
It is an error if a logical port named <var>port</var> already
exists, unless <code>--may-exist</code> is specified. Regardless of
<code>--may-exist</code>, it is an error if the existing port is not
- in <var>lswitch</var> or if it does not have the specified
+ in <var>switch</var> or if it does not have the specified
<var>parent</var> and <var>tag</var>.
</p>
</dd>
@@ -138,9 +138,9 @@
not exist, unless <code>--if-exists</code> is specified.
</dd>
- <dt><code>lsp-list</code> <var>lswitch</var></dt>
+ <dt><code>lsp-list</code> <var>switch</var></dt>
<dd>
- Lists all the logical switch ports within <var>lswitch</var> on
+ Lists all the logical switch ports within <var>switch</var> on
standard output, one per line.
</dd>
diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index 10ff952a0..a3bd619d6 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -292,28 +292,28 @@ usage: %s [OPTIONS] COMMAND [ARG...]\n\
\n\
General commands:\n\
show print overview of database contents\n\
- show LSWITCH print overview of database contents for LSWITCH\n\
+ show SWITCH print overview of database contents for SWITCH\n\
show ROUTER print overview of database contents for ROUTER\n\
\n\
Logical switch commands:\n\
- lswitch-add [LSWITCH] create a logical switch named LSWITCH\n\
- lswitch-del LSWITCH delete LSWITCH and all its ports\n\
- lswitch-list print the names of all logical switches\n\
+ ls-add [SWITCH] create a logical switch named SWITCH\n\
+ ls-del SWITCH delete SWITCH and all its ports\n\
+ ls-list print the names of all logical switches\n\
\n\
ACL commands:\n\
- acl-add LSWITCH DIRECTION PRIORITY MATCH ACTION [log]\n\
- add an ACL to LSWITCH\n\
- acl-del LSWITCH [DIRECTION [PRIORITY MATCH]]\n\
- remove ACLs from LSWITCH\n\
- acl-list LSWITCH print ACLs for LSWITCH\n\
+ acl-add SWITCH DIRECTION PRIORITY MATCH ACTION [log]\n\
+ add an ACL to SWITCH\n\
+ acl-del SWITCH [DIRECTION [PRIORITY MATCH]]\n\
+ remove ACLs from SWITCH\n\
+ acl-list SWITCH print ACLs for SWITCH\n\
\n\
Logical switch port commands:\n\
- lsp-add LSWITCH PORT add logical port PORT on LSWITCH\n\
- lsp-add LSWITCH PORT PARENT TAG\n\
- add logical port PORT on LSWITCH with PARENT\n\
+ lsp-add SWITCH PORT add logical port PORT on SWITCH\n\
+ lsp-add SWITCH PORT PARENT TAG\n\
+ add logical port PORT on SWITCH with PARENT\n\
on TAG\n\
lsp-del PORT delete PORT from its attached switch\n\
- lsp-list LSWITCH print the names of all logical ports on LSWITCH\n\
+ lsp-list SWITCH print the names of all logical ports on SWITCH\n\
lsp-get-parent PORT get the parent of PORT if set\n\
lsp-get-tag PORT get the PORT's tag if set\n\
lsp-set-addresses PORT [ADDRESS]...\n\
@@ -414,37 +414,36 @@ lr_by_name_or_uuid(struct ctl_context *ctx, const char *id,
}
static const struct nbrec_logical_switch *
-lswitch_by_name_or_uuid(struct ctl_context *ctx, const char *id,
- bool must_exist)
+ls_by_name_or_uuid(struct ctl_context *ctx, const char *id, bool must_exist)
{
- const struct nbrec_logical_switch *lswitch = NULL;
+ const struct nbrec_logical_switch *ls = NULL;
- struct uuid lswitch_uuid;
- bool is_uuid = uuid_from_string(&lswitch_uuid, id);
+ struct uuid ls_uuid;
+ bool is_uuid = uuid_from_string(&ls_uuid, id);
if (is_uuid) {
- lswitch = nbrec_logical_switch_get_for_uuid(ctx->idl, &lswitch_uuid);
+ ls = nbrec_logical_switch_get_for_uuid(ctx->idl, &ls_uuid);
}
- if (!lswitch) {
+ if (!ls) {
const struct nbrec_logical_switch *iter;
NBREC_LOGICAL_SWITCH_FOR_EACH(iter, ctx->idl) {
if (strcmp(iter->name, id)) {
continue;
}
- if (lswitch) {
+ if (ls) {
ctl_fatal("Multiple logical switches named '%s'. "
"Use a UUID.", id);
}
- lswitch = iter;
+ ls = iter;
}
}
- if (!lswitch && must_exist) {
- ctl_fatal("%s: lswitch %s not found", id, is_uuid ? "UUID" : "name");
+ if (!ls && must_exist) {
+ ctl_fatal("%s: switch %s not found", id, is_uuid ? "UUID" : "name");
}
- return lswitch;
+ return ls;
}
/* Given pointer to logical router, this routine prints the router
@@ -467,13 +466,13 @@ print_lr(const struct nbrec_logical_router *lr, struct ds *s)
}
static void
-print_lswitch(const struct nbrec_logical_switch *lswitch, struct ds *s)
+print_ls(const struct nbrec_logical_switch *ls, struct ds *s)
{
- ds_put_format(s, " lswitch "UUID_FMT" (%s)\n",
- UUID_ARGS(&lswitch->header_.uuid), lswitch->name);
+ ds_put_format(s, " switch "UUID_FMT" (%s)\n",
+ UUID_ARGS(&ls->header_.uuid), ls->name);
- for (size_t i = 0; i < lswitch->n_ports; i++) {
- const struct nbrec_logical_switch_port *lsp = lswitch->ports[i];
+ for (size_t i = 0; i < ls->n_ports; i++) {
+ const struct nbrec_logical_switch_port *lsp = ls->ports[i];
ds_put_format(s, " port %s\n", lsp->name);
if (lsp->parent_name) {
@@ -497,16 +496,16 @@ print_lswitch(const struct nbrec_logical_switch *lswitch, struct ds *s)
static void
nbctl_show(struct ctl_context *ctx)
{
- const struct nbrec_logical_switch *lswitch;
+ const struct nbrec_logical_switch *ls;
if (ctx->argc == 2) {
- lswitch = lswitch_by_name_or_uuid(ctx, ctx->argv[1], false);
- if (lswitch) {
- print_lswitch(lswitch, &ctx->output);
+ ls = ls_by_name_or_uuid(ctx, ctx->argv[1], false);
+ if (ls) {
+ print_ls(ls, &ctx->output);
}
} else {
- NBREC_LOGICAL_SWITCH_FOR_EACH(lswitch, ctx->idl) {
- print_lswitch(lswitch, &ctx->output);
+ NBREC_LOGICAL_SWITCH_FOR_EACH(ls, ctx->idl) {
+ print_ls(ls, &ctx->output);
}
}
const struct nbrec_logical_router *lr;
@@ -524,9 +523,9 @@ nbctl_show(struct ctl_context *ctx)
}
static void
-nbctl_lswitch_add(struct ctl_context *ctx)
+nbctl_ls_add(struct ctl_context *ctx)
{
- const char *lswitch_name = ctx->argc == 2 ? ctx->argv[1] : NULL;
+ const char *ls_name = ctx->argc == 2 ? ctx->argv[1] : NULL;
bool may_exist = shash_find(&ctx->options, "--may-exist") != NULL;
bool add_duplicate = shash_find(&ctx->options, "--add-duplicate") != NULL;
@@ -534,16 +533,16 @@ nbctl_lswitch_add(struct ctl_context *ctx)
ctl_fatal("--may-exist and --add-duplicate may not be used together");
}
- if (lswitch_name) {
+ if (ls_name) {
if (!add_duplicate) {
- const struct nbrec_logical_switch *lswitch;
- NBREC_LOGICAL_SWITCH_FOR_EACH (lswitch, ctx->idl) {
- if (!strcmp(lswitch->name, lswitch_name)) {
+ const struct nbrec_logical_switch *ls;
+ NBREC_LOGICAL_SWITCH_FOR_EACH (ls, ctx->idl) {
+ if (!strcmp(ls->name, ls_name)) {
if (may_exist) {
return;
}
- ctl_fatal("%s: an lswitch with this name already exists",
- lswitch_name);
+ ctl_fatal("%s: a switch with this name already exists",
+ ls_name);
}
}
}
@@ -553,38 +552,38 @@ nbctl_lswitch_add(struct ctl_context *ctx)
ctl_fatal("--add-duplicate requires specifying a name");
}
- struct nbrec_logical_switch *lswitch;
- lswitch = nbrec_logical_switch_insert(ctx->txn);
- if (lswitch_name) {
- nbrec_logical_switch_set_name(lswitch, lswitch_name);
+ struct nbrec_logical_switch *ls;
+ ls = nbrec_logical_switch_insert(ctx->txn);
+ if (ls_name) {
+ nbrec_logical_switch_set_name(ls, ls_name);
}
}
static void
-nbctl_lswitch_del(struct ctl_context *ctx)
+nbctl_ls_del(struct ctl_context *ctx)
{
bool must_exist = !shash_find(&ctx->options, "--if-exists");
const char *id = ctx->argv[1];
- const struct nbrec_logical_switch *lswitch;
+ const struct nbrec_logical_switch *ls;
- lswitch = lswitch_by_name_or_uuid(ctx, id, must_exist);
- if (!lswitch) {
+ ls = ls_by_name_or_uuid(ctx, id, must_exist);
+ if (!ls) {
return;
}
- nbrec_logical_switch_delete(lswitch);
+ nbrec_logical_switch_delete(ls);
}
static void
-nbctl_lswitch_list(struct ctl_context *ctx)
+nbctl_ls_list(struct ctl_context *ctx)
{
- const struct nbrec_logical_switch *lswitch;
+ const struct nbrec_logical_switch *ls;
struct smap lswitches;
smap_init(&lswitches);
- NBREC_LOGICAL_SWITCH_FOR_EACH(lswitch, ctx->idl) {
- smap_add_format(&lswitches, lswitch->name, UUID_FMT " (%s)",
- UUID_ARGS(&lswitch->header_.uuid), lswitch->name);
+ NBREC_LOGICAL_SWITCH_FOR_EACH(ls, ctx->idl) {
+ smap_add_format(&lswitches, ls->name, UUID_FMT " (%s)",
+ UUID_ARGS(&ls->header_.uuid), ls->name);
}
const struct smap_node **nodes = smap_sort(&lswitches);
for (size_t i = 0; i < smap_count(&lswitches); i++) {
@@ -622,16 +621,16 @@ lsp_by_name_or_uuid(struct ctl_context *ctx, const char *id,
return lsp;
}
-/* Returns the lswitch that contains 'lsp'. */
+/* Returns the logical switch that contains 'lsp'. */
static const struct nbrec_logical_switch *
-lsp_to_lswitch(const struct ovsdb_idl *idl,
+lsp_to_ls(const struct ovsdb_idl *idl,
const struct nbrec_logical_switch_port *lsp)
{
- const struct nbrec_logical_switch *lswitch;
- NBREC_LOGICAL_SWITCH_FOR_EACH (lswitch, idl) {
- for (size_t i = 0; i < lswitch->n_ports; i++) {
- if (lswitch->ports[i] == lsp) {
- return lswitch;
+ const struct nbrec_logical_switch *ls;
+ NBREC_LOGICAL_SWITCH_FOR_EACH (ls, idl) {
+ for (size_t i = 0; i < ls->n_ports; i++) {
+ if (ls->ports[i] == lsp) {
+ return ls;
}
}
}
@@ -642,13 +641,13 @@ lsp_to_lswitch(const struct ovsdb_idl *idl,
}
static const char *
-lswitch_get_name(const struct nbrec_logical_switch *lswitch,
+ls_get_name(const struct nbrec_logical_switch *ls,
char uuid_s[UUID_LEN + 1], size_t uuid_s_size)
{
- if (lswitch->name[0]) {
- return lswitch->name;
+ if (ls->name[0]) {
+ return ls->name;
}
- snprintf(uuid_s, uuid_s_size, UUID_FMT, UUID_ARGS(&lswitch->header_.uuid));
+ snprintf(uuid_s, uuid_s_size, UUID_FMT, UUID_ARGS(&ls->header_.uuid));
return uuid_s;
}
@@ -657,8 +656,8 @@ nbctl_lsp_add(struct ctl_context *ctx)
{
bool may_exist = shash_find(&ctx->options, "--may-exist") != NULL;
- const struct nbrec_logical_switch *lswitch;
- lswitch = lswitch_by_name_or_uuid(ctx, ctx->argv[1], true);
+ const struct nbrec_logical_switch *ls;
+ ls = ls_by_name_or_uuid(ctx, ctx->argv[1], true);
const char *parent_name;
int64_t tag;
@@ -686,11 +685,11 @@ nbctl_lsp_add(struct ctl_context *ctx)
}
const struct nbrec_logical_switch *lsw;
- lsw = lsp_to_lswitch(ctx->idl, lsp);
- if (lsw != lswitch) {
+ lsw = lsp_to_ls(ctx->idl, lsp);
+ if (lsw != ls) {
char uuid_s[UUID_LEN + 1];
- ctl_fatal("%s: port already exists but in lswitch %s", lsp_name,
- lswitch_get_name(lsw, uuid_s, sizeof uuid_s));
+ ctl_fatal("%s: port already exists but in switch %s", lsp_name,
+ ls_get_name(lsw, uuid_s, sizeof uuid_s));
}
if (parent_name) {
@@ -728,30 +727,30 @@ nbctl_lsp_add(struct ctl_context *ctx)
}
/* Insert the logical port into the logical switch. */
- nbrec_logical_switch_verify_ports(lswitch);
+ nbrec_logical_switch_verify_ports(ls);
struct nbrec_logical_switch_port **new_ports = xmalloc(sizeof *new_ports *
- (lswitch->n_ports + 1));
- memcpy(new_ports, lswitch->ports, sizeof *new_ports * lswitch->n_ports);
- new_ports[lswitch->n_ports] = CONST_CAST(struct nbrec_logical_switch_port *,
+ (ls->n_ports + 1));
+ memcpy(new_ports, ls->ports, sizeof *new_ports * ls->n_ports);
+ new_ports[ls->n_ports] = CONST_CAST(struct nbrec_logical_switch_port *,
lsp);
- nbrec_logical_switch_set_ports(lswitch, new_ports, lswitch->n_ports + 1);
+ nbrec_logical_switch_set_ports(ls, new_ports, ls->n_ports + 1);
free(new_ports);
}
-/* Removes logical switch port 'lswitch->ports[idx]'. */
+/* Removes logical switch port 'ls->ports[idx]'. */
static void
-remove_lsp(const struct nbrec_logical_switch *lswitch, size_t idx)
+remove_lsp(const struct nbrec_logical_switch *ls, size_t idx)
{
- const struct nbrec_logical_switch_port *lsp = lswitch->ports[idx];
+ const struct nbrec_logical_switch_port *lsp = ls->ports[idx];
/* First remove 'lsp' from the array of ports. This is what will
* actually cause the logical port to be deleted when the transaction is
* sent to the database server (due to garbage collection). */
struct nbrec_logical_switch_port **new_ports
- = xmemdup(lswitch->ports, sizeof *new_ports * lswitch->n_ports);
- new_ports[idx] = new_ports[lswitch->n_ports - 1];
- nbrec_logical_switch_verify_ports(lswitch);
- nbrec_logical_switch_set_ports(lswitch, new_ports, lswitch->n_ports - 1);
+ = xmemdup(ls->ports, sizeof *new_ports * ls->n_ports);
+ new_ports[idx] = new_ports[ls->n_ports - 1];
+ nbrec_logical_switch_verify_ports(ls);
+ nbrec_logical_switch_set_ports(ls, new_ports, ls->n_ports - 1);
free(new_ports);
/* Delete 'lsp' from the IDL. This won't have a real effect on the
@@ -773,11 +772,11 @@ nbctl_lsp_del(struct ctl_context *ctx)
}
/* Find the switch that contains 'lsp', then delete it. */
- const struct nbrec_logical_switch *lswitch;
- NBREC_LOGICAL_SWITCH_FOR_EACH (lswitch, ctx->idl) {
- for (size_t i = 0; i < lswitch->n_ports; i++) {
- if (lswitch->ports[i] == lsp) {
- remove_lsp(lswitch, i);
+ const struct nbrec_logical_switch *ls;
+ NBREC_LOGICAL_SWITCH_FOR_EACH (ls, ctx->idl) {
+ for (size_t i = 0; i < ls->n_ports; i++) {
+ if (ls->ports[i] == lsp) {
+ remove_lsp(ls, i);
return;
}
}
@@ -792,15 +791,15 @@ static void
nbctl_lsp_list(struct ctl_context *ctx)
{
const char *id = ctx->argv[1];
- const struct nbrec_logical_switch *lswitch;
+ const struct nbrec_logical_switch *ls;
struct smap lsps;
size_t i;
- lswitch = lswitch_by_name_or_uuid(ctx, id, true);
+ ls = ls_by_name_or_uuid(ctx, id, true);
smap_init(&lsps);
- for (i = 0; i < lswitch->n_ports; i++) {
- const struct nbrec_logical_switch_port *lsp = lswitch->ports[i];
+ for (i = 0; i < ls->n_ports; i++) {
+ const struct nbrec_logical_switch_port *lsp = ls->ports[i];
smap_add_format(&lsps, lsp->name, UUID_FMT " (%s)",
UUID_ARGS(&lsp->header_.uuid), lsp->name);
}
@@ -1059,20 +1058,20 @@ acl_cmp(const void *acl1_, const void *acl2_)
static void
nbctl_acl_list(struct ctl_context *ctx)
{
- const struct nbrec_logical_switch *lswitch;
+ const struct nbrec_logical_switch *ls;
const struct nbrec_acl **acls;
size_t i;
- lswitch = lswitch_by_name_or_uuid(ctx, ctx->argv[1], true);
+ ls = ls_by_name_or_uuid(ctx, ctx->argv[1], true);
- acls = xmalloc(sizeof *acls * lswitch->n_acls);
- for (i = 0; i < lswitch->n_acls; i++) {
- acls[i] = lswitch->acls[i];
+ acls = xmalloc(sizeof *acls * ls->n_acls);
+ for (i = 0; i < ls->n_acls; i++) {
+ acls[i] = ls->acls[i];
}
- qsort(acls, lswitch->n_acls, sizeof *acls, acl_cmp);
+ qsort(acls, ls->n_acls, sizeof *acls, acl_cmp);
- for (i = 0; i < lswitch->n_acls; i++) {
+ for (i = 0; i < ls->n_acls; i++) {
const struct nbrec_acl *acl = acls[i];
ds_put_format(&ctx->output, "%10s %5"PRId64" (%s) %s%s\n",
acl->direction, acl->priority,
@@ -1110,10 +1109,10 @@ parse_priority(const char *arg)
static void
nbctl_acl_add(struct ctl_context *ctx)
{
- const struct nbrec_logical_switch *lswitch;
+ const struct nbrec_logical_switch *ls;
const char *action = ctx->argv[5];
- lswitch = lswitch_by_name_or_uuid(ctx, ctx->argv[1], true);
+ ls = ls_by_name_or_uuid(ctx, ctx->argv[1], true);
const char *direction = parse_direction(ctx->argv[2]);
int64_t priority = parse_priority(ctx->argv[3]);
@@ -1137,20 +1136,19 @@ nbctl_acl_add(struct ctl_context *ctx)
}
/* Insert the acl into the logical switch. */
- nbrec_logical_switch_verify_acls(lswitch);
- struct nbrec_acl **new_acls = xmalloc(sizeof *new_acls *
- (lswitch->n_acls + 1));
- memcpy(new_acls, lswitch->acls, sizeof *new_acls * lswitch->n_acls);
- new_acls[lswitch->n_acls] = acl;
- nbrec_logical_switch_set_acls(lswitch, new_acls, lswitch->n_acls + 1);
+ nbrec_logical_switch_verify_acls(ls);
+ struct nbrec_acl **new_acls = xmalloc(sizeof *new_acls * (ls->n_acls + 1));
+ memcpy(new_acls, ls->acls, sizeof *new_acls * ls->n_acls);
+ new_acls[ls->n_acls] = acl;
+ nbrec_logical_switch_set_acls(ls, new_acls, ls->n_acls + 1);
free(new_acls);
}
static void
nbctl_acl_del(struct ctl_context *ctx)
{
- const struct nbrec_logical_switch *lswitch;
- lswitch = lswitch_by_name_or_uuid(ctx, ctx->argv[1], true);
+ const struct nbrec_logical_switch *ls;
+ ls = ls_by_name_or_uuid(ctx, ctx->argv[1], true);
if (ctx->argc != 2 && ctx->argc != 3 && ctx->argc != 5) {
ctl_fatal("cannot specify priority without match");
@@ -1159,8 +1157,8 @@ nbctl_acl_del(struct ctl_context *ctx)
if (ctx->argc == 2) {
/* If direction, priority, and match are not specified, delete
* all ACLs. */
- nbrec_logical_switch_verify_acls(lswitch);
- nbrec_logical_switch_set_acls(lswitch, NULL, 0);
+ nbrec_logical_switch_verify_acls(ls);
+ nbrec_logical_switch_set_acls(ls, NULL, 0);
return;
}
@@ -1169,18 +1167,17 @@ nbctl_acl_del(struct ctl_context *ctx)
/* If priority and match are not specified, delete all ACLs with the
* specified direction. */
if (ctx->argc == 3) {
- struct nbrec_acl **new_acls
- = xmalloc(sizeof *new_acls * lswitch->n_acls);
+ struct nbrec_acl **new_acls = xmalloc(sizeof *new_acls * ls->n_acls);
int n_acls = 0;
- for (size_t i = 0; i < lswitch->n_acls; i++) {
- if (strcmp(direction, lswitch->acls[i]->direction)) {
- new_acls[n_acls++] = lswitch->acls[i];
+ for (size_t i = 0; i < ls->n_acls; i++) {
+ if (strcmp(direction, ls->acls[i]->direction)) {
+ new_acls[n_acls++] = ls->acls[i];
}
}
- nbrec_logical_switch_verify_acls(lswitch);
- nbrec_logical_switch_set_acls(lswitch, new_acls, n_acls);
+ nbrec_logical_switch_verify_acls(ls);
+ nbrec_logical_switch_set_acls(ls, new_acls, n_acls);
free(new_acls);
return;
}
@@ -1188,17 +1185,17 @@ nbctl_acl_del(struct ctl_context *ctx)
int64_t priority = parse_priority(ctx->argv[3]);
/* Remove the matching rule. */
- for (size_t i = 0; i < lswitch->n_acls; i++) {
- struct nbrec_acl *acl = lswitch->acls[i];
+ for (size_t i = 0; i < ls->n_acls; i++) {
+ struct nbrec_acl *acl = ls->acls[i];
if (priority == acl->priority && !strcmp(ctx->argv[4], acl->match) &&
!strcmp(direction, acl->direction)) {
struct nbrec_acl **new_acls
- = xmemdup(lswitch->acls, sizeof *new_acls * lswitch->n_acls);
- new_acls[i] = lswitch->acls[lswitch->n_acls - 1];
- nbrec_logical_switch_verify_acls(lswitch);
- nbrec_logical_switch_set_acls(lswitch, new_acls,
- lswitch->n_acls - 1);
+ = xmemdup(ls->acls, sizeof *new_acls * ls->n_acls);
+ new_acls[i] = ls->acls[ls->n_acls - 1];
+ nbrec_logical_switch_verify_acls(ls);
+ nbrec_logical_switch_set_acls(ls, new_acls,
+ ls->n_acls - 1);
free(new_acls);
return;
}
@@ -2067,27 +2064,26 @@ nbctl_exit(int status)
}
static const struct ctl_command_syntax nbctl_commands[] = {
- { "show", 0, 1, "[LSWITCH]", NULL, nbctl_show, NULL, "", RO },
+ { "show", 0, 1, "[SWITCH]", NULL, nbctl_show, NULL, "", RO },
- /* lswitch commands. */
- { "lswitch-add", 0, 1, "[LSWITCH]", NULL, nbctl_lswitch_add,
- NULL, "--may-exist,--add-duplicate", RW },
- { "lswitch-del", 1, 1, "LSWITCH", NULL, nbctl_lswitch_del,
- NULL, "--if-exists", RW },
- { "lswitch-list", 0, 0, "", NULL, nbctl_lswitch_list, NULL, "", RO },
+ /* logical switch commands. */
+ { "ls-add", 0, 1, "[SWITCH]", NULL, nbctl_ls_add, NULL,
+ "--may-exist,--add-duplicate", RW },
+ { "ls-del", 1, 1, "SWITCH", NULL, nbctl_ls_del, NULL, "--if-exists", RW },
+ { "ls-list", 0, 0, "", NULL, nbctl_ls_list, NULL, "", RO },
/* acl commands. */
- { "acl-add", 5, 5, "LSWITCH DIRECTION PRIORITY MATCH ACTION", NULL,
+ { "acl-add", 5, 5, "SWITCH DIRECTION PRIORITY MATCH ACTION", NULL,
nbctl_acl_add, NULL, "--log", RW },
- { "acl-del", 1, 4, "LSWITCH [DIRECTION [PRIORITY MATCH]]", NULL,
+ { "acl-del", 1, 4, "SWITCH [DIRECTION [PRIORITY MATCH]]", NULL,
nbctl_acl_del, NULL, "", RW },
- { "acl-list", 1, 1, "LSWITCH", NULL, nbctl_acl_list, NULL, "", RO },
+ { "acl-list", 1, 1, "SWITCH", NULL, nbctl_acl_list, NULL, "", RO },
/* logical switch port commands. */
- { "lsp-add", 2, 4, "LSWITCH PORT [PARENT] [TAG]", NULL, nbctl_lsp_add,
+ { "lsp-add", 2, 4, "SWITCH PORT [PARENT] [TAG]", NULL, nbctl_lsp_add,
NULL, "--may-exist", RW },
{ "lsp-del", 1, 1, "PORT", NULL, nbctl_lsp_del, NULL, "--if-exists", RW },
- { "lsp-list", 1, 1, "LSWITCH", NULL, nbctl_lsp_list, NULL, "", RO },
+ { "lsp-list", 1, 1, "SWITCH", NULL, nbctl_lsp_list, NULL, "", RO },
{ "lsp-get-parent", 1, 1, "PORT", NULL, nbctl_lsp_get_parent, NULL,
"", RO },
{ "lsp-get-tag", 1, 1, "PORT", NULL, nbctl_lsp_get_tag, NULL, "", RO },
diff --git a/tests/ovn-controller-vtep.at b/tests/ovn-controller-vtep.at
index 5c4b5a2c2..4bbda73d2 100644
--- a/tests/ovn-controller-vtep.at
+++ b/tests/ovn-controller-vtep.at
@@ -59,7 +59,7 @@ m4_define([OVN_CONTROLLER_VTEP_START],
OVS_WAIT_UNTIL([test -n "`vtep-ctl show | grep Physical_Port`"])
dnl Start ovn-northd.
- AT_CHECK([ovn-nbctl lswitch-add br-test])
+ AT_CHECK([ovn-nbctl ls-add br-test])
AT_CHECK([ovn-northd --detach --pidfile --log-file], [0], [], [stderr])
on_exit "kill `cat ovn-northd.pid`"
AT_CHECK([[sed < stderr '
@@ -252,7 +252,7 @@ OVN_NB_ADD_VTEP_PORT([br-test], [br-vtep_lswitch0], [br-vtep], [lswitch0])
OVS_WAIT_UNTIL([test -n "`ovn-sbctl list Port_Binding | grep br-vtep_lswitch0`"])
# adds another lswitch 'br-void' in ovn-nb database.
-AT_CHECK([ovn-nbctl lswitch-add br-void])
+AT_CHECK([ovn-nbctl ls-add br-void])
# adds another vtep pswitch 'br-vtep-void' in vtep database.
AT_CHECK([vtep-ctl add-ps br-vtep-void -- add-port br-vtep-void p0-void -- bind-ls br-vtep-void p0-void 100 lswitch0])
# adds a conflicting logical port (both br-vtep_lswitch0 and br-vtep-void_lswitch0
@@ -267,7 +267,7 @@ AT_CHECK([sed -n 's/^.*\(|WARN|.*\)$/\1/p' ovn-controller-vtep.log | sed 's/([[-
# then deletes 'br-void' and 'br-vtep-void', should see 'br-vtep_lswitch0'
# bound correctly.
-AT_CHECK([ovn-nbctl lswitch-del br-void])
+AT_CHECK([ovn-nbctl ls-del br-void])
# adds another vtep pswitch 'br-vtep-void' in vtep database.
AT_CHECK([vtep-ctl del-ps br-vtep-void])
OVS_WAIT_UNTIL([test -z "`ovn-sbctl list Port_Binding | grep br-vtep-void_lswitch0`"])
@@ -350,7 +350,7 @@ OVN_NB_ADD_VTEP_PORT([br-test], [br-vtep_lswitch0], [br-vtep], [lswitch0])
OVS_WAIT_UNTIL([test -n "`ovn-sbctl list Port_Binding | grep br-vtep_lswitch0`"])
# adds another lswitch 'br-void' in ovn-nb database.
-AT_CHECK([ovn-nbctl lswitch-add br-void])
+AT_CHECK([ovn-nbctl ls-add br-void])
# adds fake hv chassis 'ch1'.
AT_CHECK([ovn-nbctl lsp-add br-void vif1])
AT_CHECK([ovn-nbctl lsp-set-addresses vif1 f0:ab:cd:ef:01:02])
@@ -441,7 +441,7 @@ AT_CHECK([sed -n 's/^.*\(|WARN|.*\)$/\1/p' ovn-controller-vtep.log | sed 's/([[-
AT_CHECK([ovn-nbctl lsp-del vif1])
# adds another lswitch 'br-void' in ovn-nb database.
-AT_CHECK([ovn-nbctl lswitch-add br-void])
+AT_CHECK([ovn-nbctl ls-add br-void])
# adds fake hv chassis 'ch1' and vif1 with same mac address as vif0.
AT_CHECK([ovn-nbctl lsp-add br-void vif1])
AT_CHECK([ovn-nbctl lsp-set-addresses vif1 f0:ab:cd:ef:01:02])
diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at
index 8b4195ed4..91d482b8c 100644
--- a/tests/ovn-nbctl.at
+++ b/tests/ovn-nbctl.at
@@ -29,56 +29,56 @@ m4_define([OVN_NBCTL_TEST_STOP],
OVS_APP_EXIT_AND_WAIT([ovsdb-server])])
-AT_SETUP([ovn-nbctl - basic lswitch commands])
+AT_SETUP([ovn-nbctl - basic switch commands])
OVN_NBCTL_TEST_START
-AT_CHECK([ovn-nbctl lswitch-add ls0])
-AT_CHECK([ovn-nbctl lswitch-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl
+AT_CHECK([ovn-nbctl ls-add ls0])
+AT_CHECK([ovn-nbctl ls-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl
<0> (ls0)
])
-AT_CHECK([ovn-nbctl lswitch-add ls1])
-AT_CHECK([ovn-nbctl lswitch-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl
+AT_CHECK([ovn-nbctl ls-add ls1])
+AT_CHECK([ovn-nbctl ls-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl
<0> (ls0)
<1> (ls1)
])
-AT_CHECK([ovn-nbctl lswitch-del ls0])
-AT_CHECK([ovn-nbctl lswitch-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl
+AT_CHECK([ovn-nbctl ls-del ls0])
+AT_CHECK([ovn-nbctl ls-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl
<0> (ls1)
])
AT_CHECK([ovn-nbctl show ls0])
-AT_CHECK([ovn-nbctl lswitch-add ls0])
+AT_CHECK([ovn-nbctl ls-add ls0])
AT_CHECK([ovn-nbctl show ls0 | ${PERL} $srcdir/uuidfilt.pl], [0],
- [ lswitch <0> (ls0)
+ [ switch <0> (ls0)
])
-AT_CHECK([ovn-nbctl lswitch-add ls0], [1], [],
- [ovn-nbctl: ls0: an lswitch with this name already exists
+AT_CHECK([ovn-nbctl ls-add ls0], [1], [],
+ [ovn-nbctl: ls0: a switch with this name already exists
])
-AT_CHECK([ovn-nbctl --may-exist lswitch-add ls0])
+AT_CHECK([ovn-nbctl --may-exist ls-add ls0])
AT_CHECK([ovn-nbctl show ls0 | ${PERL} $srcdir/uuidfilt.pl], [0],
- [ lswitch <0> (ls0)
+ [ switch <0> (ls0)
])
-AT_CHECK([ovn-nbctl --add-duplicate lswitch-add ls0])
-AT_CHECK([ovn-nbctl --may-exist --add-duplicate lswitch-add ls0], [1], [],
+AT_CHECK([ovn-nbctl --add-duplicate ls-add ls0])
+AT_CHECK([ovn-nbctl --may-exist --add-duplicate ls-add ls0], [1], [],
[ovn-nbctl: --may-exist and --add-duplicate may not be used together
])
-AT_CHECK([ovn-nbctl lswitch-del ls0], [1], [],
+AT_CHECK([ovn-nbctl ls-del ls0], [1], [],
[ovn-nbctl: Multiple logical switches named 'ls0'. Use a UUID.
])
-AT_CHECK([ovn-nbctl lswitch-del ls2], [1], [],
- [ovn-nbctl: ls2: lswitch name not found
+AT_CHECK([ovn-nbctl ls-del ls2], [1], [],
+ [ovn-nbctl: ls2: switch name not found
])
-AT_CHECK([ovn-nbctl --if-exists lswitch-del ls2])
+AT_CHECK([ovn-nbctl --if-exists ls-del ls2])
-AT_CHECK([ovn-nbctl lswitch-add])
-AT_CHECK([ovn-nbctl lswitch-add])
-AT_CHECK([ovn-nbctl --add-duplicate lswitch-add], [1], [],
+AT_CHECK([ovn-nbctl ls-add])
+AT_CHECK([ovn-nbctl ls-add])
+AT_CHECK([ovn-nbctl --add-duplicate ls-add], [1], [],
[ovn-nbctl: --add-duplicate requires specifying a name
])
-AT_CHECK([ovn-nbctl --may-exist lswitch-add], [1], [],
+AT_CHECK([ovn-nbctl --may-exist ls-add], [1], [],
[ovn-nbctl: --may-exist requires specifying a name
])
@@ -90,7 +90,7 @@ dnl ---------------------------------------------------------------------
AT_SETUP([ovn-nbctl - basic logical switch port commands])
OVN_NBCTL_TEST_START
-AT_CHECK([ovn-nbctl lswitch-add ls0])
+AT_CHECK([ovn-nbctl ls-add ls0])
AT_CHECK([ovn-nbctl lsp-add ls0 lp0])
AT_CHECK([ovn-nbctl lsp-add ls0 lp0], [1], [],
[ovn-nbctl: lp0: a port with this name already exists
@@ -106,12 +106,12 @@ AT_CHECK([ovn-nbctl lsp-list ls0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl
<1> (lp1)
])
-AT_CHECK([ovn-nbctl lswitch-add ls1])
+AT_CHECK([ovn-nbctl ls-add ls1])
AT_CHECK([ovn-nbctl lsp-add ls0 lp1], [1], [],
[ovn-nbctl: lp1: a port with this name already exists
])
AT_CHECK([ovn-nbctl --may-exist lsp-add ls1 lp1], [1], [],
- [ovn-nbctl: lp1: port already exists but in lswitch ls0
+ [ovn-nbctl: lp1: port already exists but in switch ls0
])
AT_CHECK([ovn-nbctl --may-exist lsp-add ls0 lp1 lp0 5], [1], [],
[ovn-nbctl: lp1: port already exists but has no parent
@@ -142,7 +142,7 @@ dnl ---------------------------------------------------------------------
AT_SETUP([ovn-nbctl - lport addresses])
OVN_NBCTL_TEST_START
-AT_CHECK([ovn-nbctl lswitch-add ls0])
+AT_CHECK([ovn-nbctl ls-add ls0])
AT_CHECK([ovn-nbctl lsp-add ls0 lp0])
AT_CHECK([ovn-nbctl lsp-get-addresses lp0], [0], [dnl
])
@@ -165,7 +165,7 @@ dnl ---------------------------------------------------------------------
AT_SETUP([ovn-nbctl - port security])
OVN_NBCTL_TEST_START
-AT_CHECK([ovn-nbctl lswitch-add ls0])
+AT_CHECK([ovn-nbctl ls-add ls0])
AT_CHECK([ovn-nbctl lsp-add ls0 lp0])
AT_CHECK([ovn-nbctl lsp-get-addresses lp0], [0], [dnl
])
@@ -188,7 +188,7 @@ dnl ---------------------------------------------------------------------
AT_SETUP([ovn-nbctl - ACLs])
OVN_NBCTL_TEST_START
-AT_CHECK([ovn-nbctl lswitch-add ls0])
+AT_CHECK([ovn-nbctl ls-add ls0])
AT_CHECK([ovn-nbctl --log acl-add ls0 from-lport 600 udp drop])
AT_CHECK([ovn-nbctl --log acl-add ls0 to-lport 500 udp drop])
AT_CHECK([ovn-nbctl acl-add ls0 from-lport 400 tcp drop])
diff --git a/tests/ovn-sbctl.at b/tests/ovn-sbctl.at
index 65d5fe090..efdc8e2cb 100644
--- a/tests/ovn-sbctl.at
+++ b/tests/ovn-sbctl.at
@@ -79,7 +79,7 @@ dnl ---------------------------------------------------------------------
AT_SETUP([ovn-sbctl])
OVN_SBCTL_TEST_START
-AT_CHECK([ovn-nbctl lswitch-add br-test])
+AT_CHECK([ovn-nbctl ls-add br-test])
AT_CHECK([ovn-nbctl lsp-add br-test vif0])
AT_CHECK([ovn-nbctl lsp-set-addresses vif0 f0:ab:cd:ef:01:02])
AT_CHECK([ovn-sbctl chassis-add ch0 stt 1.2.3.5])
diff --git a/tests/ovn.at b/tests/ovn.at
index 34fbb11e2..a31a5025b 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -555,7 +555,7 @@ ovn_start
# Turn on port security on all the vifs except vif[123]1.
# Make vif13, vif2[23], vif3[123] destinations for unknown MACs.
# Add some ACLs for Ethertypes 1234, 1235, 1236.
-ovn-nbctl lswitch-add lsw0
+ovn-nbctl ls-add lsw0
net_add n1
for i in 1 2 3; do
sim_add hv$i
@@ -669,22 +669,22 @@ ip_to_hex() {
# 2. Broadcast and multicast are delivered to all logical switch ports
# except the input port.
#
-# 3. When port security is turned on, the lswitch drops packets from the wrong
+# 3. When port security is turned on, the switch drops packets from the wrong
# MAC address.
#
-# 4. The lswitch drops all packets with a VLAN tag.
+# 4. The switch drops all packets with a VLAN tag.
#
-# 5. The lswitch drops all packets with a multicast source address. (This only
+# 5. The switch drops all packets with a multicast source address. (This only
# affects behavior when port security is turned off, since otherwise port
# security would drop the packet anyway.)
#
-# 6. The lswitch delivers packets with an unknown destination to logical
+# 6. The switch delivers packets with an unknown destination to logical
# switch ports with "unknown" among their MAC addresses (and port
# security disabled).
#
-# 7. The lswitch drops unicast packets that violate an ACL.
+# 7. The switch drops unicast packets that violate an ACL.
#
-# 8. The lswitch drops multicast and broadcast packets that violate an ACL.
+# 8. The switch drops multicast and broadcast packets that violate an ACL.
#
# 9. ARP requests to known IPs are responded directly.
#
@@ -833,35 +833,35 @@ AT_KEYWORDS([ovn-localnet])
AT_SKIP_IF([test $HAVE_PYTHON = no])
ovn_start
-# In this test cases we create 3 lswitches, all connected to same
-# physical network (through br-phys on each HV). Each lswitch has
+# In this test cases we create 3 switches, all connected to same
+# physical network (through br-phys on each HV). Each switch has
# VIF ports across 2 HVs. Each HV has 5 VIF ports. The first digit
# of VIF port name indicates the hypervisor it is bound to, e.g.
# lp23 means VIF 3 on hv2.
#
-# lswitch's VLAN tag and their logical switch ports are:
+# Each switch's VLAN tag and their logical switch ports are:
# - ls1:
# - untagged
-# - lports: lp11, lp12, lp21, lp22
+# - ports: lp11, lp12, lp21, lp22
#
# - ls2:
# - tagged with VLAN 101
-# - lports: lp13, lp14, lp23, lp24
+# - ports: lp13, lp14, lp23, lp24
# - ls3:
# - untagged
-# - lports: lp15, lp25
+# - ports: lp15, lp25
#
-# Note: a localnet port is created for each lswitch to connect to
+# Note: a localnet port is created for each switch to connect to
# physical network.
for i in 1 2 3; do
- lswitch_name=ls$i
- ovn-nbctl lswitch-add $lswitch_name
+ ls_name=ls$i
+ ovn-nbctl ls-add $ls_name
ln_port_name=ln$i
if test $i -eq 2; then
- ovn-nbctl lsp-add $lswitch_name $ln_port_name "" 101
+ ovn-nbctl lsp-add $ls_name $ln_port_name "" 101
else
- ovn-nbctl lsp-add $lswitch_name $ln_port_name
+ ovn-nbctl lsp-add $ls_name $ln_port_name
fi
ovn-nbctl lsp-set-addresses $ln_port_name unknown
ovn-nbctl lsp-set-type $ln_port_name localnet
@@ -885,14 +885,14 @@ for i in 1 2; do
lsp_name=lp$i$j
if test $j -le 2; then
- lswitch_name=ls1
+ ls_name=ls1
elif test $j -le 4; then
- lswitch_name=ls2
+ ls_name=ls2
else
- lswitch_name=ls3
+ ls_name=ls3
fi
- ovn-nbctl lsp-add $lswitch_name $lsp_name
+ ovn-nbctl lsp-add $ls_name $lsp_name
ovn-nbctl lsp-set-addresses $lsp_name f0:00:00:00:00:$i$j
ovn-nbctl lsp-set-port-security $lsp_name f0:00:00:00:00:$i$j
@@ -957,12 +957,12 @@ test_packet 13 f00000000014 f00000000013 1314 14
test_packet 14 f00000000013 f00000000014 1413 13
# lp11 and lp15 are on the same network (phys, untagged),
-# same hypervisor, and on different lswitches
+# same hypervisor, and on different switches
test_packet 11 f00000000015 f00000000011 1115 15
test_packet 15 f00000000011 f00000000015 1511 11
# lp11 and lp25 are on the same network (phys, untagged),
-# different hypervisors, and on different lswitches
+# different hypervisors, and on different switches
test_packet 11 f00000000025 f00000000011 1125 25
test_packet 25 f00000000011 f00000000025 2511 11
@@ -1034,7 +1034,7 @@ AT_SKIP_IF([test $HAVE_PYTHON = no])
ovn_start
# Configure the Northbound database
-ovn-nbctl lswitch-add lsw0
+ovn-nbctl ls-add lsw0
ovn-nbctl lsp-add lsw0 lp1
ovn-nbctl lsp-set-addresses lp1 f0:00:00:00:00:01
@@ -1145,7 +1145,7 @@ test_packet() {
# 2. Broadcast and multicast are delivered to all logical switch ports
# except the input port.
#
-# 3. The lswitch delivers packets with an unknown destination to logical
+# 3. The switch delivers packets with an unknown destination to logical
# switch ports with "unknown" among their MAC addresses (and port
# security disabled).
for s in 1 2 3; do
@@ -1253,7 +1253,7 @@ ovn_start
# 27 VIFs, 9 per LS, 3 per subnet: lp[123][123][123], where the first two
# digits are the subnet and the last digit distinguishes the VIF.
for i in 1 2 3; do
- ovn-nbctl lswitch-add ls$i
+ ovn-nbctl ls-add ls$i
for j in 1 2 3; do
for k in 1 2 3; do
# Add "unknown" to MAC addresses for lp?11, so packets for
@@ -1454,7 +1454,7 @@ for is in 1 2 3; do
dip=`ip_to_hex 192 168 $id$jd $o4`
test_ip $s $smac $dmac $sip $dip
- # Every LP on the destination subnet's lswitch should
+ # Every LP on the destination subnet's switch should
# receive the ARP request.
lrmac=00000000ff$id$jd
lrip=`ip_to_hex 192 168 $id$jd 254`
@@ -1488,12 +1488,12 @@ test_arp() {
#as $hv ovs-appctl ofproto/trace br-int in_port=$inport $request
# Expect to receive the broadcast ARP on the other logical switch ports if
- # IP address is not configured to the lswitch patch port.
+ # IP address is not configured to the switch patch port.
local i=`vif_to_ls $inport`
local j k
for j in 1 2 3; do
for k in 1 2 3; do
- # 192.168.33.254 is configured to the lswitch patch port for lrp33,
+ # 192.168.33.254 is configured to the switch patch port for lrp33,
# so no ARP flooding expected for it.
if test $i$j$k != $inport && test $tpa != `ip_to_hex 192 168 33 254`; then
echo $request >> $i$j$k.expected
@@ -1672,7 +1672,7 @@ ovn_start
# Turn on l2 port security on vifs vif[123]2
# Turn of l2 and l3 port security on vifs vif[123]3
# Make vif13, vif2[23], vif3[123] destinations for unknown MACs.
-ovn-nbctl lswitch-add lsw0
+ovn-nbctl ls-add lsw0
net_add n1
for i in 1 2 3; do
sim_add hv$i
@@ -2084,8 +2084,8 @@ ovn_start
ovn-nbctl lr-add R1
ovn-nbctl lr-add R2
-ovn-nbctl lswitch-add ls1
-ovn-nbctl lswitch-add ls2
+ovn-nbctl ls-add ls1
+ovn-nbctl ls-add ls2
# Connect ls1 to R1
ovn-nbctl lrp-add R1 ls1 00:00:00:01:02:03 192.168.1.1/24 rp-ls1
@@ -2228,8 +2228,8 @@ ovn_start
ovn-nbctl lr-add R1
-ovn-nbctl lswitch-add ls1
-ovn-nbctl lswitch-add ls2
+ovn-nbctl ls-add ls1
+ovn-nbctl ls-add ls2
# Connect ls1 to R1
ovn-nbctl lrp-add R1 ls1 00:00:00:01:02:03 192.168.1.1/24 rp-ls1
@@ -2366,9 +2366,9 @@ ovn_start
ovn-nbctl lr-add R1
ovn-nbctl lr-add R2
-ovn-nbctl lswitch-add foo
-ovn-nbctl lswitch-add alice
-ovn-nbctl lswitch-add bob
+ovn-nbctl ls-add foo
+ovn-nbctl ls-add alice
+ovn-nbctl ls-add bob
# Connect foo to R1
ovn-nbctl lrp-add R1 foo 00:00:00:01:02:03 192.168.1.1/24 rp-foo
@@ -2534,7 +2534,7 @@ AT_CLEANUP
AT_SETUP([ovn -- send gratuitous arp on localnet])
AT_KEYWORDS([ovn])
ovn_start
-ovn-nbctl lswitch-add lsw0
+ovn-nbctl ls-add lsw0
net_add n1
sim_add hv
as hv
@@ -2610,10 +2610,10 @@ ovn-nbctl lr-add R1
ovn-nbctl lr-add R2
ovn-nbctl lr-add R3
-ovn-nbctl lswitch-add foo
-ovn-nbctl lswitch-add alice
-ovn-nbctl lswitch-add bob
-ovn-nbctl lswitch-add join
+ovn-nbctl ls-add foo
+ovn-nbctl ls-add alice
+ovn-nbctl ls-add bob
+ovn-nbctl ls-add join
# Connect foo to R1
ovn-nbctl lrp-add R1 foo 00:00:01:01:02:03 192.168.1.1/24
@@ -2844,9 +2844,9 @@ ovn_populate_arp
ovn-nbctl create Logical_Router name=R1
ovn-nbctl create Logical_Router name=R2 options:chassis="hv2"
-ovn-nbctl lswitch-add foo
-ovn-nbctl lswitch-add alice
-ovn-nbctl lswitch-add join
+ovn-nbctl ls-add foo
+ovn-nbctl ls-add alice
+ovn-nbctl ls-add join
# Connect foo to R1
ovn-nbctl lrp-add R1 foo 00:00:01:01:02:03 192.168.1.1/24
@@ -2980,8 +2980,8 @@ ovn_start
ovn-nbctl lr-add R1
-ovn-nbctl lswitch-add ls1
-ovn-nbctl lswitch-add ls2
+ovn-nbctl ls-add ls1
+ovn-nbctl ls-add ls2
# Connect ls1 to R1
ovn-nbctl lrp-add R1 ls1 00:00:00:01:02:f1 192.168.1.1/24
diff --git a/tutorial/OVN-Tutorial.md b/tutorial/OVN-Tutorial.md
index 41e9456e6..c4bcbae42 100644
--- a/tutorial/OVN-Tutorial.md
+++ b/tutorial/OVN-Tutorial.md
@@ -64,7 +64,7 @@ Start by running the setup script for this environment.
You can use the `ovn-nbctl` utility to see an overview of the logical topology.
$ ovn-nbctl show
- lswitch 78687d53-e037-4555-bcd3-f4f8eaf3f2aa (sw0)
+ switch 78687d53-e037-4555-bcd3-f4f8eaf3f2aa (sw0)
port sw0-port1
addresses: 00:00:00:00:00:01
port sw0-port2
@@ -237,12 +237,12 @@ switch.
View the logical topology with `ovn-nbctl`.
$ ovn-nbctl show
- lswitch e3190dc2-89d1-44ed-9308-e7077de782b3 (sw0)
+ switch e3190dc2-89d1-44ed-9308-e7077de782b3 (sw0)
port sw0-port1
addresses: 00:00:00:00:00:01
port sw0-port2
addresses: 00:00:00:00:00:02
- lswitch c8ed4c5f-9733-43f6-93da-795b1aabacb1 (sw1)
+ switch c8ed4c5f-9733-43f6-93da-795b1aabacb1 (sw1)
port sw1-port1
addresses: 00:00:00:00:00:03
port sw1-port2
@@ -348,7 +348,7 @@ two hypervisors with two of the logical ports bound to each hypervisor.
You can start by viewing the logical topology with `ovn-nbctl`.
$ ovn-nbctl show
- lswitch b977dc03-79a5-41ba-9665-341a80e1abfd (sw0)
+ switch b977dc03-79a5-41ba-9665-341a80e1abfd (sw0)
port sw0-port1
addresses: 00:00:00:00:00:01
port sw0-port2
@@ -463,22 +463,22 @@ regular VIF port and a `localnet` port.
The logical topology from `ovn-nbctl` should look like this.
$ ovn-nbctl show
- lswitch 5a652488-cfba-4f3e-929d-00010cdfde40 (provnet1-2)
+ switch 5a652488-cfba-4f3e-929d-00010cdfde40 (provnet1-2)
port provnet1-2-physnet1
addresses: unknown
port provnet1-2-port1
addresses: 00:00:00:00:00:02
- lswitch 5829b60a-eda8-4d78-94f6-7017ff9efcf0 (provnet1-4)
+ switch 5829b60a-eda8-4d78-94f6-7017ff9efcf0 (provnet1-4)
port provnet1-4-port1
addresses: 00:00:00:00:00:04
port provnet1-4-physnet1
addresses: unknown
- lswitch 06cbbcb6-38e3-418d-a81e-634ec9b54ad6 (provnet1-1)
+ switch 06cbbcb6-38e3-418d-a81e-634ec9b54ad6 (provnet1-1)
port provnet1-1-port1
addresses: 00:00:00:00:00:01
port provnet1-1-physnet1
addresses: unknown
- lswitch 9cba3b3b-59ae-4175-95f5-b6f1cd9c2afb (provnet1-3)
+ switch 9cba3b3b-59ae-4175-95f5-b6f1cd9c2afb (provnet1-3)
port provnet1-3-physnet1
addresses: unknown
port provnet1-3-port1
@@ -616,45 +616,45 @@ ports representing connectivity to VLAN 101 of `physnet1` have the `tag` field
set to `101`.
$ ovn-nbctl show
- lswitch 12ea93d0-694b-48e9-adef-d0ddd3ec4ac9 (provnet1-7-101)
+ switch 12ea93d0-694b-48e9-adef-d0ddd3ec4ac9 (provnet1-7-101)
port provnet1-7-physnet1-101
parent: , tag:101
addresses: unknown
port provnet1-7-101-port1
addresses: 00:00:00:00:00:07
- lswitch c9a5ce3a-15ec-48ea-a898-416013463589 (provnet1-4)
+ switch c9a5ce3a-15ec-48ea-a898-416013463589 (provnet1-4)
port provnet1-4-port1
addresses: 00:00:00:00:00:04
port provnet1-4-physnet1
addresses: unknown
- lswitch e07d4f7a-2085-4fbb-9937-d6192b79a397 (provnet1-1)
+ switch e07d4f7a-2085-4fbb-9937-d6192b79a397 (provnet1-1)
port provnet1-1-physnet1
addresses: unknown
port provnet1-1-port1
addresses: 00:00:00:00:00:01
- lswitch 6c098474-0509-4219-bc9b-eb4e28dd1aeb (provnet1-2)
+ switch 6c098474-0509-4219-bc9b-eb4e28dd1aeb (provnet1-2)
port provnet1-2-physnet1
addresses: unknown
port provnet1-2-port1
addresses: 00:00:00:00:00:02
- lswitch 723c4684-5d58-4202-b8e3-4ba99ad5ed9e (provnet1-8-101)
+ switch 723c4684-5d58-4202-b8e3-4ba99ad5ed9e (provnet1-8-101)
port provnet1-8-101-port1
addresses: 00:00:00:00:00:08
port provnet1-8-physnet1-101
parent: , tag:101
addresses: unknown
- lswitch 8444e925-ceb2-4b02-ac20-eb2e4cfb954d (provnet1-6-101)
+ switch 8444e925-ceb2-4b02-ac20-eb2e4cfb954d (provnet1-6-101)
port provnet1-6-physnet1-101
parent: , tag:101
addresses: unknown
port provnet1-6-101-port1
addresses: 00:00:00:00:00:06
- lswitch e11e5605-7c46-4395-b28d-cff57451fc7e (provnet1-3)
+ switch e11e5605-7c46-4395-b28d-cff57451fc7e (provnet1-3)
port provnet1-3-port1
addresses: 00:00:00:00:00:03
port provnet1-3-physnet1
addresses: unknown
- lswitch 0706b697-6c92-4d54-bc0a-db5bababb74a (provnet1-5-101)
+ switch 0706b697-6c92-4d54-bc0a-db5bababb74a (provnet1-5-101)
port provnet1-5-101-port1
addresses: 00:00:00:00:00:05
port provnet1-5-physnet1-101
diff --git a/tutorial/ovn/env1/setup.sh b/tutorial/ovn/env1/setup.sh
index a89c0091e..08496432e 100755
--- a/tutorial/ovn/env1/setup.sh
+++ b/tutorial/ovn/env1/setup.sh
@@ -20,7 +20,7 @@
set -o xtrace
# Create a logical switch named "sw0"
-ovn-nbctl lswitch-add sw0
+ovn-nbctl ls-add sw0
# Create two logical ports on "sw0".
ovn-nbctl lsp-add sw0 sw0-port1
diff --git a/tutorial/ovn/env2/setup.sh b/tutorial/ovn/env2/setup.sh
index 370882f2c..008caa1d1 100755
--- a/tutorial/ovn/env2/setup.sh
+++ b/tutorial/ovn/env2/setup.sh
@@ -15,8 +15,8 @@
set -o xtrace
-ovn-nbctl lswitch-add sw0
-ovn-nbctl lswitch-add sw1
+ovn-nbctl ls-add sw0
+ovn-nbctl ls-add sw1
ovn-nbctl lsp-add sw0 sw0-port1
ovn-nbctl lsp-add sw0 sw0-port2
ovn-nbctl lsp-add sw1 sw1-port1
diff --git a/tutorial/ovn/env3/setup.sh b/tutorial/ovn/env3/setup.sh
index fc214a7b4..3f8ef54e4 100755
--- a/tutorial/ovn/env3/setup.sh
+++ b/tutorial/ovn/env3/setup.sh
@@ -15,7 +15,7 @@
set -o xtrace
-ovn-nbctl lswitch-add sw0
+ovn-nbctl ls-add sw0
ovn-nbctl lsp-add sw0 sw0-port1
ovn-nbctl lsp-add sw0 sw0-port2
diff --git a/tutorial/ovn/env4/setup2.sh b/tutorial/ovn/env4/setup2.sh
index 3daeff67c..234508337 100755
--- a/tutorial/ovn/env4/setup2.sh
+++ b/tutorial/ovn/env4/setup2.sh
@@ -28,7 +28,7 @@ set -o xtrace
ovn-sbctl chassis-add fakechassis geneve 127.0.0.1
for n in 1 2 3 4; do
- ovn-nbctl lswitch-add provnet1-$n
+ ovn-nbctl ls-add provnet1-$n
ovn-nbctl lsp-add provnet1-$n provnet1-$n-port1
ovn-nbctl lsp-set-addresses provnet1-$n-port1 00:00:00:00:00:0$n
diff --git a/tutorial/ovn/env5/setup.sh b/tutorial/ovn/env5/setup.sh
index 7690aacff..a1c5a8a5d 100755
--- a/tutorial/ovn/env5/setup.sh
+++ b/tutorial/ovn/env5/setup.sh
@@ -32,24 +32,24 @@ ovn-sbctl chassis-add fakechassis geneve 127.0.0.1
for n in 1 2 3 4 5 6 7 8; do
if [ $n -gt 4 ] ; then
- lswitch_name="provnet1-$n-101"
- lsp_name="$lswitch_name-port1"
+ ls_name="provnet1-$n-101"
+ lsp_name="$ls_name-port1"
else
- lswitch_name="provnet1-$n"
+ ls_name="provnet1-$n"
fi
- ovn-nbctl lswitch-add $lswitch_name
+ ovn-nbctl ls-add $ls_name
- lsp_name="$lswitch_name-port1"
- ovn-nbctl lsp-add $lswitch_name $lsp_name
+ lsp_name="$ls_name-port1"
+ ovn-nbctl lsp-add $ls_name $lsp_name
ovn-nbctl lsp-set-addresses $lsp_name 00:00:00:00:00:0$n
ovn-nbctl lsp-set-port-security $lsp_name 00:00:00:00:00:0$n
if [ $n -gt 4 ] ; then
lsp_name="provnet1-$n-physnet1-101"
- ovn-nbctl lsp-add $lswitch_name $lsp_name "" 101
+ ovn-nbctl lsp-add $ls_name $lsp_name "" 101
else
lsp_name="provnet1-$n-physnet1"
- ovn-nbctl lsp-add $lswitch_name $lsp_name
+ ovn-nbctl lsp-add $ls_name $lsp_name
fi
ovn-nbctl lsp-set-addresses $lsp_name unknown
ovn-nbctl lsp-set-type $lsp_name localnet
diff --git a/tutorial/ovn/env6/setup.sh b/tutorial/ovn/env6/setup.sh
index a89c0091e..08496432e 100755
--- a/tutorial/ovn/env6/setup.sh
+++ b/tutorial/ovn/env6/setup.sh
@@ -20,7 +20,7 @@
set -o xtrace
# Create a logical switch named "sw0"
-ovn-nbctl lswitch-add sw0
+ovn-nbctl ls-add sw0
# Create two logical ports on "sw0".
ovn-nbctl lsp-add sw0 sw0-port1
diff --git a/tutorial/ovn/env7/add-container-ports.sh b/tutorial/ovn/env7/add-container-ports.sh
index c7308492b..fc9b001f9 100755
--- a/tutorial/ovn/env7/add-container-ports.sh
+++ b/tutorial/ovn/env7/add-container-ports.sh
@@ -16,7 +16,7 @@
set -o xtrace
# create a logical switch
-ovn-nbctl lswitch-add csw0
+ovn-nbctl ls-add csw0
# create a container port with parent set to sw0-port1
ovn-nbctl lsp-add csw0 csw0-cport1 sw0-port1 42
diff --git a/tutorial/ovn/env7/setup.sh b/tutorial/ovn/env7/setup.sh
index 05fd5c59b..39acf3a6e 100755
--- a/tutorial/ovn/env7/setup.sh
+++ b/tutorial/ovn/env7/setup.sh
@@ -16,7 +16,7 @@
set -o xtrace
# Create a logical switch named "sw0"
-ovn-nbctl lswitch-add sw0
+ovn-nbctl ls-add sw0
# Create two logical ports on "sw0".
ovn-nbctl lsp-add sw0 sw0-port1
diff --git a/utilities/ovs-sim.1.xml b/utilities/ovs-sim.1.xml
index 2e95a9234..36be81263 100644
--- a/utilities/ovs-sim.1.xml
+++ b/utilities/ovs-sim.1.xml
@@ -266,7 +266,7 @@ done
<pre>
ovn_start
-ovn-nbctl lswitch-add lsw0
+ovn-nbctl ls-add lsw0
net_add n1
for i in 0 1; do
@@ -289,7 +289,7 @@ done
n=200; export n
ovn_start
net_add n1
-ovn-nbctl lswitch-add br0
+ovn-nbctl ls-add br0
for i in `seq $n`; do
(sim_add hv$i
as hv$i