};
struct vsctl_info {
+ struct vsctl_context *ctx;
struct shash bridges;
struct shash ports;
struct shash ifaces;
}
static void
-get_info(const struct ovsrec_open_vswitch *ovs, struct vsctl_info *info)
+get_info(struct vsctl_context *ctx, struct vsctl_info *info)
{
+ const struct ovsrec_open_vswitch *ovs = ctx->ovs;
struct shash bridges, ports;
size_t i;
+ info->ctx = ctx;
shash_init(&info->bridges);
shash_init(&info->ports);
shash_init(&info->ifaces);
ctx->argv[0]);
}
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
if (may_exist) {
struct vsctl_bridge *br;
struct vsctl_bridge *bridge;
struct vsctl_info info;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
bridge = find_bridge(&info, ctx->argv[1], must_exist);
if (bridge) {
struct shash_node *node;
struct vsctl_info info;
struct svec bridges;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
svec_init(&bridges);
SHASH_FOR_EACH (node, &info.bridges) {
{
struct vsctl_info info;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
if (!find_bridge(&info, ctx->argv[1], false)) {
vsctl_exit(2);
}
char **keys, **values;
size_t n;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
bridge = find_bridge(&info, ctx->argv[1], true);
if (bridge->br_cfg) {
set_external_id(bridge->br_cfg->key_external_ids,
struct vsctl_info info;
struct vsctl_bridge *bridge;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
bridge = find_bridge(&info, ctx->argv[1], true);
if (bridge->br_cfg) {
get_external_id(bridge->br_cfg->key_external_ids,
struct vsctl_info info;
struct svec ports;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
br = find_bridge(&info, ctx->argv[1], true);
svec_init(&ports);
struct ovsrec_port *port;
size_t i;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
if (may_exist) {
struct vsctl_port *vsctl_port;
struct vsctl_port *port;
struct vsctl_info info;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
if (!with_iface) {
port = find_port(&info, ctx->argv[ctx->argc - 1], must_exist);
} else {
struct vsctl_port *port;
struct vsctl_info info;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
port = find_port(&info, ctx->argv[1], true);
ds_put_format(&ctx->output, "%s\n", port->bridge->name);
free_info(&info);
struct vsctl_bridge *bridge;
struct vsctl_info info;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
bridge = find_bridge(&info, ctx->argv[1], true);
ds_put_format(&ctx->output, "%d\n", bridge->vlan);
free_info(&info);
struct vsctl_bridge *bridge;
struct vsctl_info info;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
bridge = find_bridge(&info, ctx->argv[1], true);
if (bridge->parent) {
bridge = bridge->parent;
struct vsctl_info info;
struct svec ifaces;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
br = find_bridge(&info, ctx->argv[1], true);
svec_init(&ifaces);
struct vsctl_iface *iface;
struct vsctl_info info;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
iface = find_iface(&info, ctx->argv[1], true);
ds_put_format(&ctx->output, "%s\n", iface->port->bridge->name);
free_info(&info);
struct svec targets;
size_t i;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
br = find_bridge(&info, ctx->argv[1], true);
/* Print the targets in sorted order for reproducibility. */
struct vsctl_info info;
struct vsctl_bridge *br;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
br = find_real_bridge(&info, ctx->argv[1], true);
if (br->ctrl) {
struct ovsrec_controller **controllers;
size_t n;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
br = find_real_bridge(&info, ctx->argv[1], true);
delete_controllers(br->ctrl, br->n_ctrl);
struct vsctl_info info;
struct vsctl_bridge *br;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
br = find_bridge(&info, ctx->argv[1], true);
if (br->fail_mode && strlen(br->fail_mode)) {
struct vsctl_info info;
struct vsctl_bridge *br;
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
br = find_real_bridge(&info, ctx->argv[1], true);
ovsrec_bridge_set_fail_mode(br->br_cfg, NULL);
struct vsctl_bridge *br;
const char *fail_mode = ctx->argv[2];
- get_info(ctx->ovs, &info);
+ get_info(ctx, &info);
br = find_real_bridge(&info, ctx->argv[1], true);
if (strcmp(fail_mode, "standalone") && strcmp(fail_mode, "secure")) {