-/* POSIX extended regular expression for an 8-bit unsigned decimal integer. */
-#define OCTET_RE "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"
-
-/* POSIX extended regular expression for an IP address. */
-#define IP_RE "("OCTET_RE"\\."OCTET_RE"\\."OCTET_RE"\\."OCTET_RE")"
-
-/* POSIX extended regular expression for a netmask. */
-#define NETMASK_RE \
- "255.255.255."NETMASK_END_RE"|" \
- "255.255."NETMASK_END_RE".0|" \
- "255."NETMASK_END_RE".0.0|" \
- NETMASK_END_RE".0.0.0"
-#define NETMASK_END_RE "(255|254|252|248|240|224|192|128|0)"
-
-/* POSIX extended regular expression for an Ethernet address. */
-#define XX_RE "[0-9a-fA-F][0-9a-fA-F]"
-#define MAC_RE XX_RE":"XX_RE":"XX_RE":"XX_RE":"XX_RE":"XX_RE
-
-/* POSIX extended regular expression for a TCP or UDP port number. */
-#define PORT_RE \
- "([0-9]|" \
- "[1-9][0-9]|" \
- "[1-9][0-9][0-9]|" \
- "[1-9][0-9][0-9][0-9]|" \
- "[1-5][0-9][0-9][0-9][0-9]|" \
- "6[1-4][0-9][0-9][0-9]|" \
- "65[1-4][0-9][0-9]|" \
- "655[1-2][0-9]|" \
- "6553[1-5])"
-
-enum {
- VSCF_READONLY = 1 << 0,
- VSCF_HIDDEN = 1 << 1
-};
-
-struct vsctl_column {
- struct ovsdb_idl_column *idl;
- int flags;
- const char *constraint;
-};
-
-static const struct vsctl_column bridge_columns[] = {
- {&ovsrec_bridge_col_datapath_id, VSCF_READONLY, NULL},
- {&ovsrec_bridge_col_name, VSCF_READONLY, NULL},
- {&ovsrec_bridge_col_mirrors, VSCF_READONLY, NULL},
- {&ovsrec_bridge_col_other_config, 0, NULL},
- {&ovsrec_bridge_col_flood_vlans, 0, "[1,4095]"},
- {&ovsrec_bridge_col_controller, VSCF_READONLY, NULL},
- {&ovsrec_bridge_col_netflow, VSCF_READONLY, NULL},
- {&ovsrec_bridge_col_external_ids, 0, NULL},
- {&ovsrec_bridge_col_ports, VSCF_READONLY, NULL},
- {NULL, 0, NULL},
-};
-
-static const struct vsctl_column controller_columns[] = {
- {&ovsrec_controller_col_connection_mode, 0, "in-band|out-of-band"},
- {&ovsrec_controller_col_controller_burst_limit, 0, "[25,]"},
- {&ovsrec_controller_col_controller_rate_limit, 0, "[100,]"},
- {&ovsrec_controller_col_discover_accept_regex, 0, NULL},
- {&ovsrec_controller_col_discover_update_resolv_conf, 0, NULL},
- {&ovsrec_controller_col_fail_mode, 0, "standalone|secure"},
- {&ovsrec_controller_col_inactivity_probe, 0, "[5000,]"},
- {&ovsrec_controller_col_local_gateway, 0, IP_RE},
- {&ovsrec_controller_col_local_ip, 0, IP_RE},
- {&ovsrec_controller_col_local_netmask, 0, NETMASK_RE},
- {&ovsrec_controller_col_max_backoff, 0, "[1000,]"},
- {&ovsrec_controller_col_target, 0, NULL},
- {NULL, 0, NULL},
-};
-
-static const struct vsctl_column interface_columns[] = {
- {&ovsrec_interface_col_external_ids, 0, NULL},
- {&ovsrec_interface_col_ingress_policing_burst, 0, "[10,]"},
- {&ovsrec_interface_col_ingress_policing_rate, 0, "[100,]"},
- {&ovsrec_interface_col_mac, 0, MAC_RE},
- {&ovsrec_interface_col_name, VSCF_READONLY, NULL},
- {&ovsrec_interface_col_ofport, VSCF_READONLY, NULL},
- {&ovsrec_interface_col_options, 0, NULL},
- {&ovsrec_interface_col_type, VSCF_READONLY, NULL},
- {NULL, 0, NULL},
-};
-
-static const struct vsctl_column mirror_columns[] = {
- {&ovsrec_mirror_col_name, VSCF_READONLY, NULL},
- {&ovsrec_mirror_col_output_port, 0, "Port"},
- {&ovsrec_mirror_col_output_vlan, 0, "[1,4095]"},
- {&ovsrec_mirror_col_select_dst_port, 0, "Port"},
- {&ovsrec_mirror_col_select_src_port, 0, "Port"},
- {&ovsrec_mirror_col_select_vlan, 0, "[1,4095]"},
- {NULL, 0, NULL},
-};
-
-static const struct vsctl_column netflow_columns[] = {
- {&ovsrec_netflow_col_active_timeout, 0, "[-1,]"},
- {&ovsrec_netflow_col_add_id_to_interface, 0, NULL},
- {&ovsrec_netflow_col_targets, 0, IP_RE":"PORT_RE},
- {&ovsrec_netflow_col_engine_type, 0, "[0,255]"},
- {&ovsrec_netflow_col_engine_id, 0, "[0,255]"},
- {NULL, 0, NULL},
-};
-
-static const struct vsctl_column open_vswitch_columns[] = {
- {&ovsrec_open_vswitch_col_bridges, VSCF_READONLY, NULL},
- {&ovsrec_open_vswitch_col_controller, VSCF_READONLY, NULL},
- {&ovsrec_open_vswitch_col_cur_cfg, VSCF_HIDDEN, NULL},
- {&ovsrec_open_vswitch_col_management_id, 0, "[0-9a-fA-F]{12}"},
- {&ovsrec_open_vswitch_col_managers, 0, "p?(ssl|tcp|unix):.*"},
- {&ovsrec_open_vswitch_col_next_cfg, VSCF_HIDDEN, NULL},
- {&ovsrec_open_vswitch_col_ssl, VSCF_READONLY, NULL},
- {NULL, 0, NULL},
-};
-
-static const struct vsctl_column port_columns[] = {
- {&ovsrec_port_col_bond_updelay, 0, "[0,]"},
- {&ovsrec_port_col_bond_downdelay, 0, "[0,]"},
- {&ovsrec_port_col_bond_fake_iface, VSCF_READONLY, NULL},
- {&ovsrec_port_col_external_ids, 0, NULL},
- {&ovsrec_port_col_fake_bridge, VSCF_READONLY, NULL},
- {&ovsrec_port_col_interfaces, VSCF_READONLY, NULL},
- {&ovsrec_port_col_mac, 0, MAC_RE},
- {&ovsrec_port_col_name, VSCF_READONLY, NULL},
- {&ovsrec_port_col_other_config, 0, NULL},
- {&ovsrec_port_col_tag, 0, "[0,4095]"},
- {&ovsrec_port_col_trunks, 0, "[0,4095]"},
- {NULL, 0, NULL},
-};
-
-static const struct vsctl_column ssl_columns[] = {
- {&ovsrec_ssl_col_bootstrap_ca_cert, 0, NULL},
- {&ovsrec_ssl_col_ca_cert, 0, NULL},
- {&ovsrec_ssl_col_certificate, 0, NULL},
- {&ovsrec_ssl_col_private_key, 0, NULL},
- {NULL, 0, NULL},
-};
-