ovs-brcompatd: Fix dangling reference in del_port().
[openvswitch] / vswitchd / vswitch.ovsschema
index 2c7fdf18ebd7531947044331d163512e59cefd24..02fd94e21bd6a80b9ade704d7b4439a06c13ed7f 100644 (file)
@@ -1,4 +1,4 @@
-{"name": "ovs_vswitchd_db",
+{"name": "Open_vSwitch",
  "comment": "Configuration for one Open vSwitch daemon.",
  "tables": {
    "Open_vSwitch": {
@@ -6,19 +6,22 @@
      "columns": {
        "bridges": {
          "comment": "Set of bridges managed by the daemon.",
-         "type": {"key": "uuid", "min": 0, "max": "unlimited"}},
-       "management_id": {
-         "comment": "Exactly 12 hex digits that identify the daemon.",
-         "type": "string"},
+         "type": {"key": {"type": "uuid",
+                          "refTable": "Bridge"},
+                  "min": 0, "max": "unlimited"}},
        "controller": {
          "comment": "Default Controller used by bridges.",
-         "type": {"key": "uuid", "min": 0, "max": 1}},
+         "type": {"key": {"type": "uuid",
+                          "refTable": "Controller"},
+                   "min": 0, "max": 1}},
        "managers": {
          "comment": "Remote database clients to which the Open vSwitch's database server should connect or to which it should listen.",
          "type": {"key": "string", "min": 0, "max": "unlimited"}},
        "ssl": {
          "comment": "SSL used globally by the daemon.",
-         "type": {"key": "uuid", "min": 0, "max": 1}},
+         "type": {"key": {"type": "uuid",
+                          "refTable": "SSL"},
+                  "min": 0, "max": 1}},
        "next_cfg": {
          "comment": "Sequence number for client to increment when it modifies the configuration and wishes to wait for Open vSwitch to finish applying the changes.",
          "type": "integer"},
        "name": {
          "comment": "Bridge identifier.  Should be alphanumeric and no more than about 8 bytes long.  Must be unique among the names of ports, interfaces, and bridges on a host.",
          "type": "string"},
+       "datapath_type": {
+         "comment": "Name of datapath provider.  The kernel datapath has type \"system\".  The userspace datapath has type \"netdev\".",
+         "type": "string"},
        "datapath_id": {
          "comment": "Reports the OpenFlow datapath ID in use.  Exactly 12 hex digits.",
          "type": {"key": "string", "min": 0, "max": 1},
          "ephemeral": true},
        "ports": {
          "comment": "Ports included in the bridge.",
-         "type": {"key": "uuid", "min": 0, "max": "unlimited"}},
+         "type": {"key": {"type": "uuid",
+                          "refTable": "Port"},
+                  "min": 0, "max": "unlimited"}},
        "mirrors": {
          "comment": "Port mirroring configuration.",
-         "type": {"key": "uuid", "min": 0, "max": "unlimited"}},
+         "type": {"key": {"type": "uuid",
+                          "refTable": "Mirror"},
+                  "min": 0, "max": "unlimited"}},
        "netflow": {
          "comment": "NetFlow configuration.",
-         "type": {"key": "uuid", "min": 0, "max": 1}},
+         "type": {"key": {"type": "uuid",
+                          "refTable": "NetFlow"},
+                  "min": 0, "max": 1}},
+       "sflow": {
+         "comment": "sFlow configuration.",
+         "type": {"key": {"type": "uuid",
+                          "refTable": "sFlow"},
+                  "min": 0, "max": 1}},
        "controller": {
          "comment": "OpenFlow controller.  If unset, defaults to that specified by the parent Open_vSwitch.",
-         "type": {"key": "uuid", "min": 0, "max": 1}},
+         "type": {"key": {"type": "uuid",
+                          "refTable": "Controller"},
+                  "min": 0, "max": 1}},
        "other_config": {
          "comment": "Key-value pairs for configuring rarely used bridge features.  The currently defined key-value pairs are: \"datapath-id\", exactly 12 hex digits to set the OpenFlow datapath ID to a specific value; \"hwaddr\", exactly 12 hex digits in the form \"XX:XX:XX:XX:XX:XX\" to set the hardware address of the local port and influence the datapath ID.",
          "type": {"key": "string", "value": "string", "min": 0, "max": "unlimited"}},
          "type": {"key": "string", "value": "string", "min": 0, "max": "unlimited"}},
        "flood_vlans": {
          "comment": "VLAN IDs of VLANs on which MAC address learning should be disabled, so that packets are flooded instead of being sent to specific ports that are believed to contain packets' destination MACs.  This should ordinarily be used to disable MAC learning on VLANs used for mirroring (RSPAN VLANs).  It may also be useful for debugging.",
-         "type": {"key": "integer", "min": 0, "max": 4096}
-}}},
+         "type": {"key": {"type": "integer",
+                          "minInteger": 0, 
+                          "maxInteger": 4095},
+                  "min": 0, "max": 4096}}}},
    "Port": {
      "comment": "A port within a Bridge.  May contain a single Interface or multiple (bonded) Interfaces.",
      "columns": {
          "type": "string"},
        "interfaces": {
          "comment": "The Port's Interfaces.  If there is more than one, this is a bonded Port.",
-         "type": {"key": "uuid", "min": 1, "max": "unlimited"}},
+         "type": {"key": {"type": "uuid",
+                          "refTable": "Interface"},
+                  "min": 1, "max": "unlimited"}},
        "trunks": {
          "comment": "The 802.1Q VLAN(s) that this port trunks.  Should be empty if this port trunks all VLAN(s) or if this is not a trunk port.",
-         "type": {"key": "integer", "min": 0, "max": 4096}},
+         "type": {"key": {"type": "integer",
+                          "minInteger": 0,
+                          "maxInteger": 4095},
+                  "min": 0, "max": 4096}},
        "tag": {
          "comment": "This port's implicitly tagged VLAN.  Should be empty if this is a trunk port.",
-         "type": {"key": "integer", "min": 0, "max": 1}},
+         "type": {"key": {"type": "integer",
+                          "minInteger": 0,
+                          "maxInteger": 4095},
+                  "min": 0, "max": 1}},
        "mac": {
-         "comment": "The MAC address to use for this port for the purpose of choosing the bridge's MAC address.  This column does not necessarily reflect the port's actual MAC address, nor will setting it change the port's actual MAC address.  Exactly 12 hex digits in the form XX:XX:XX:XX:XX:XX.",
-         "type": {"key": "string", "min": 0, "max": 1}},
+         "comment": "The MAC address to use for this port for the purpose of choosing the bridge's MAC address.  This column does not necessarily reflect the port's actual MAC address, nor will setting it change the port's actual MAC address.",
+         "type": {"key": {"type": "string",
+                          "reMatch": "[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}",
+                          "reComment": "an Ethernet address in the form XX:XX:XX:XX:XX:XX, where each X is a hex digit"},
+                  "min": 0, "max": 1}},
        "bond_updelay": {
          "comment": "For a bonded port, the number of milliseconds for which carrier must stay up on an interface before the interface is considered to be up.  Ignored for non-bonded ports.",
          "type": "integer"},
          "type": {"key": "string", "value": "string", "min": 0, "max": "unlimited"}},
        "ingress_policing_rate": {
          "comment": "Maximum rate for data received on this interface, in kbps.  Set to 0 to disable policing.",
-         "type": "integer"},
+         "type": {"key": {"type": "integer",
+                          "minInteger": 0}}},
        "ingress_policing_burst": {
          "comment": "Maximum burst size for data received on this interface, in kb.  The default burst size if set to 0 is 1000 kb.",
-         "type": "integer"},
+         "type": {"key": {"type": "integer",
+                          "minInteger": 0}}},
        "mac": {
-         "comment": "Ethernet address to set for this interface.  If unset then the default MAC address is used.  May not be supported on all interfaces.  Exactly 12 hex digits in the form XX:XX:XX:XX:XX:XX.",
-         "type": {"key": "string", "min": 0, "max": 1}},
+         "comment": "Ethernet address to set for this interface.  If unset then the default MAC address is used.  May not be supported on all interfaces.",
+         "type": {"key": {"type": "string",
+                          "reMatch": "[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}",
+                          "reComment": "an Ethernet address in the form XX:XX:XX:XX:XX:XX, where each X is a hex digit"},
+                  "min": 0, "max": 1}},
        "external_ids": {
          "comment": "Key-value pairs that identify this interface's role in external systems.  The currently defined key-value pairs are: \"xs-vif-uuid\", the UUID of the Citrix XenServer VIF associated with this interface; \"xs-network-uuid\", the UUID of the Citrix XenServer network to which this interface is attached; \"xs-vif-vm-uuid\", the UUID of the Citrix XenServer VM to which this interface belongs; \"xs-vif-mac\", the value of the \"MAC\" field in the Citrix XenServer VIF record for this interface.",
          "type": {"key": "string", "value": "string", "min": 0, "max": "unlimited"}},
          "comment": "Arbitrary identifier for the Mirror.",
          "type": "string"},
        "select_src_port": {
-         "comment": "Ports on which arriving packets are selected for mirroring.",
-         "type": {"key": "uuid", "min": 0, "max": "unlimited"}},
+         "comment": "Ports on which arriving packets are selected for mirroring.  If this column and select_dst_port are both empty, then all packets on all ports are selected for mirroring.",
+         "type": {"key": {"type": "uuid",
+                          "refTable": "Port"},
+                   "min": 0, "max": "unlimited"}},
        "select_dst_port": {
          "comment": "Ports on which departing packets are selected for mirroring.",
-         "type": {"key": "uuid", "min": 0, "max": "unlimited"}},
+         "type": {"key": {"type": "uuid",
+                          "refTable": "Port"}, "min": 0, "max": "unlimited"}},
        "select_vlan": {
-         "comment": "VLANs on which packets are selected for mirroring.",
-         "type": {"key": "integer", "min": 0, "max": 4096}},
+         "comment": "VLANs on which packets are selected for mirroring.  An empty set selects packets on all VLANs.",
+         "type": {"key": {"type": "integer",
+                          "minInteger": 0,
+                          "maxInteger": 4095},
+                  "min": 0, "max": 4096}},
        "output_port": {
          "comment": "Output port for selected packets.  Mutually exclusive with output_vlan.",
-         "type": {"key": "uuid", "min": 0, "max": 1}},
+         "type": {"key": {"type": "uuid",
+                          "refTable": "Port"}, "min": 0, "max": 1}},
        "output_vlan": {
          "comment": "Output VLAN for selected packets.  Mutually exclusive with output_port.",
-         "type": {"key": "integer", "min": 0, "max": 1}}}},
+         "type": {"key": {"type": "integer",
+                          "minInteger": 1,
+                          "maxInteger": 4095},
+                  "min": 0, "max": 1}}}},
    "NetFlow": {
      "comment": "A NetFlow target.",
      "columns": {
        "targets": {
          "comment": "NetFlow targets in the form \"IP:PORT\".",
-         "type": {"key": "string", "min": 1, "max": "unlimited"}},
+         "type": {"key": {"type": "string",
+                          "reMatch": "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\.[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]){3}:[0-9]{1,5}",
+                          "reComment": "an IP address followed by a UDP port number, separated by \":\""},
+                  "min": 1, "max": "unlimited"}},
        "engine_type": {
          "comment": "Engine type to use in NetFlow messages.  Defaults to datapath index if not specified.",
-         "type": {"key": "integer", "min": 0, "max": 1}},
+         "type": {"key": {"type": "integer",
+                          "minInteger": 0,
+                          "maxInteger": 255},
+                  "min": 0, "max": 1}},
        "engine_id": {
          "comment": "Engine ID to use in NetFlow messages.  Defaults to datapath index if not specified.",
-         "type": {"key": "integer", "min": 0, "max": 1}},
+         "type": {"key": {"type": "integer",
+                          "minInteger": 0,
+                          "maxInteger": 255},
+                  "min": 0, "max": 1}},
        "add_id_to_interface": {
          "comment": "Place least-significant 7 bits of engine ID into most significant bits of ingress and egress interface fields of NetFlow records?",
          "type": "boolean"},
        "active_timeout": {
          "comment": "Active timeout interval, in seconds.  A value of 0 requests the default timeout; a negative value disables active timeouts.",
-         "type": "integer"}}},
+         "type": {"key": {"type": "integer",
+                          "minInteger": -1}}}}},
+   "sFlow": {
+     "comment": "A sFlow target.",
+     "columns": {
+       "targets": {
+         "comment": "sFlow targets in the form \"IP:PORT\".",
+         "type": {"key": "string", "min": 1, "max": "unlimited"}},
+       "sampling": {
+         "comment": "Rate at which packets should be sampled and sent to the collector.  If not specified, defaults to 400, which means one out of 400, on average, will be sent to the collector.",
+         "type": {"key": "integer", "min": 0, "max": 1}},
+       "polling": {
+         "comment": "Polling rate in seconds to send port statistics to the collector.  If not specified, defaults to 30 seconds.",
+         "type": {"key": "integer", "min": 0, "max": 1}},
+       "header": {
+         "comment": "Number of bytes of a sampled packet to send to the collector.  If not specified, defaults is 128 bytes.",
+         "type": {"key": "integer", "min": 0, "max": 1}},
+       "agent": {
+         "comment": "IP address to report as \"agent address\" to collectors.  If not specified, defaults to collector's \"local_ip\" value.  If neither is specified, sFlow is disabled.",
+         "type": {"key": "string", "min": 0, "max": 1}}}},
    "Controller": {
      "comment": "An OpenFlow controller.",
      "columns": {
          "type": "string"},
        "max_backoff": {
          "comment": "Maximum number of milliseconds to wait between connection attempts.  Default is implementation-specific.",
-         "type": {"key": "integer", "min": 0, "max": 1}},
+         "type": {"key": {"type": "integer",
+                          "minInteger": 1000},
+                  "min": 0, "max": 1}},
        "inactivity_probe": {
          "comment": "Maximum number of milliseconds of idle time on connection to controller before sending an inactivity probe message.  Default is implementation-specific.",
          "type": {"key": "integer", "min": 0, "max": 1}},
        "fail_mode": {
          "comment": "Either \"standalone\" or \"secure\", or empty to use the implementation's default.",
-         "type": {"key": "string", "min": 0, "max": 1}},
+         "type": {"key": {"type": "string",
+                          "reMatch": "standalone|secure",
+                          "reComment": "either \"standalone\" or \"secure\""},
+                  "min": 0, "max": 1}},
        "discover_accept_regex": {
          "comment": "If \"target\" is \"discover\", a POSIX extended regular expression against which the discovered controller location is validated.  If not specified, the default is implementation-specific.",
          "type": {"key": "string", "min": 0, "max": 1}},
          "type": {"key": "boolean", "min": 0, "max": 1}},
        "connection_mode": {
          "comment": "Either \"in-band\" or \"out-of-band\".  If not specified, the default is implementation-specific.",
-         "type": {"key": "string", "min": 0, "max": 1}},
+         "type": {"key": {"type": "string",
+                          "reMatch": "in-band|out-of-band",
+                          "reComment": "either \"in-band\" or \"out-of-band\""},
+                  "min": 0, "max": 1}},
        "local_ip": {
          "comment": "If \"target\" is not \"discover\", the IP address to configure on the local port.",
-         "type": {"key": "string", "min": 0, "max": 1}},
+         "type": {"key": {"type": "string",
+                          "reMatch": "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\.[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]){3}",
+                          "reComment": "an IP address"},
+                  "min": 0, "max": 1}},
        "local_netmask": {
          "comment": "If \"target\" is not \"discover\", the IP netmask to configure on the local port.",
-         "type": {"key": "string", "min": 0, "max": 1}},
+         "type": {"key": {"type": "string", 
+                          "reMatch": "255\\.255\\.255\\.(255|254|252|248|240|224|192|128|0)|255\\.255\\.(255|254|252|248|240|224|192|128|0)\\.0|255\\.(255|254|252|248|240|224|192|128|0)\\.0\\.0|(255|254|252|248|240|224|192|128|0)\\.0\\.0\\.0",
+                          "reComment": "a netmask"},
+                  "min": 0, "max": 1}},
        "local_gateway": {
          "comment": "If \"target\" is not \"discover\", the IP gateway to configure on the local port.",
-         "type": {"key": "string", "min": 0, "max": 1}},
+         "type": {"key": {"type": "string",
+                          "reMatch": "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\.[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]){3}",
+                          "reComment": "an IP address"},
+                  "min": 0, "max": 1}},
        "controller_rate_limit": {
          "comment": "The maximum rate at which packets will be forwarded to the OpenFlow controller, in packets per second.  If not specified, the default is implementation-specific.",
-         "type": {"key": "integer", "min": 0, "max": 1}},
+         "type": {"key": {"type": "integer",
+                          "minInteger": 100},
+                  "min": 0, "max": 1}},
        "controller_burst_limit": {
          "comment": "The maximum number of unused packet credits that the bridge will allow to accumulate, in packets.  If not specified, the default is implementation-specific.",
-         "type": {"key": "integer", "min": 0, "max": 1}}}},
+         "type": {"key": {"type": "integer", 
+                          "minInteger": 25},
+                  "min": 0, "max": 1}}}},
    "SSL": {
      "comment": "SSL configuration for an Open_vSwitch.",
      "columns": {