@@ -796,6 +796,27 @@ ofproto_set_threads(int n_handlers_, int n_revalidators_)
n_handlers = MAX(n_handlers_, 0);
}
+void
+ofproto_set_mfr_desc(struct ofproto *p, const char *mfr_desc)
+{
+ free(p->mfr_desc);
+ p->mfr_desc = nullable_xstrdup(mfr_desc);
+}
+
+void
+ofproto_set_hw_desc(struct ofproto *p, const char *hw_desc)
+{
+ free(p->hw_desc);
+ p->hw_desc = nullable_xstrdup(hw_desc);
+}
+
+void
+ofproto_set_sw_desc(struct ofproto *p, const char *sw_desc)
+{
+ free(p->sw_desc);
+ p->sw_desc = nullable_xstrdup(sw_desc);
+}
+
void
ofproto_set_dp_desc(struct ofproto *p, const char *dp_desc)
{
@@ -350,6 +350,9 @@ int ofproto_port_set_mcast_snooping(struct ofproto *ofproto, void *aux,
void ofproto_set_threads(int n_handlers, int n_revalidators);
void ofproto_type_set_config(const char *type,
const struct smap *other_config);
+void ofproto_set_mfr_desc(struct ofproto *, const char *mfr_desc);
+void ofproto_set_hw_desc(struct ofproto *, const char *hw_desc);
+void ofproto_set_sw_desc(struct ofproto *, const char *sw_desc);
void ofproto_set_dp_desc(struct ofproto *, const char *dp_desc);
void ofproto_set_serial_desc(struct ofproto *p, const char *serial_desc);
int ofproto_set_snoops(struct ofproto *, const struct sset *snoops);
@@ -287,8 +287,7 @@ static void bridge_configure_sflow(struct bridge *, int *sflow_bridge_number);
static void bridge_configure_ipfix(struct bridge *);
static void bridge_configure_spanning_tree(struct bridge *);
static void bridge_configure_tables(struct bridge *);
-static void bridge_configure_dp_desc(struct bridge *);
-static void bridge_configure_serial_desc(struct bridge *);
+static void bridge_configure_ofp_desc(struct bridge *);
static void bridge_configure_aa(struct bridge *);
static void bridge_aa_refresh_queued(struct bridge *);
static bool bridge_aa_need_refresh(struct bridge *);
@@ -942,8 +941,7 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg)
bridge_configure_ipfix(br);
bridge_configure_spanning_tree(br);
bridge_configure_tables(br);
- bridge_configure_dp_desc(br);
- bridge_configure_serial_desc(br);
+ bridge_configure_ofp_desc(br);
bridge_configure_aa(br);
}
free(managers);
@@ -4123,17 +4121,23 @@ bridge_configure_tables(struct bridge *br)
}
static void
-bridge_configure_dp_desc(struct bridge *br)
-{
- ofproto_set_dp_desc(br->ofproto,
- smap_get(&br->cfg->other_config, "dp-desc"));
-}
-
-static void
-bridge_configure_serial_desc(struct bridge *br)
-{
+bridge_configure_ofp_desc(struct bridge *br)
+{
+ /* Manufacturer description */
+ ofproto_set_mfr_desc(br->ofproto,
+ smap_get(&br->cfg->other_config, "mfr-desc"));
+ /* Hardware description */
+ ofproto_set_hw_desc(br->ofproto,
+ smap_get(&br->cfg->other_config, "hw-desc"));
+ /* Software description */
+ ofproto_set_sw_desc(br->ofproto,
+ smap_get(&br->cfg->other_config, "sw-desc"));
+ /* Serial number */
ofproto_set_serial_desc(br->ofproto,
smap_get(&br->cfg->other_config, "dp-sn"));
+ /* DP description */
+ ofproto_set_dp_desc(br->ofproto,
+ smap_get(&br->cfg->other_config, "dp-desc"));
}
static struct aa_mapping *
@@ -1309,6 +1309,27 @@
prefix or be exactly 16 hex digits long. May not be all-zero.
</column>
+ <column name="other_config" key="mfr-desc">
+ Manufacturer description. Defaults to "Nicira, Inc.".
+ The value is returned by the switch as a part of reply to OFPMP_DESC
+ request (ofp_desc). The OpenFlow specification (e.g. 1.3.5) describes
+ the ofp_desc structure to contaion "NULL terminated ASCII strings".
+ </column>
+
+ <column name="other_config" key="hw-desc">
+ Hardware description. Defaults to "Open vSwitch".
+ The value is returned by the switch as a part of reply to OFPMP_DESC
+ request (ofp_desc). The OpenFlow specification (e.g. 1.3.5) describes
+ the ofp_desc structure to contaion "NULL terminated ASCII strings".
+ </column>
+
+ <column name="other_config" key="sw-desc">
+ Software description. Defaults to the current Open vSwitch version.
+ The value is returned by the switch as a part of reply to OFPMP_DESC
+ request (ofp_desc). The OpenFlow specification (e.g. 1.3.5) describes
+ the ofp_desc structure to contaion "NULL terminated ASCII strings".
+ </column>
+
<column name="other_config" key="dp-desc">
Human readable description of datapath. It is a maximum 256
byte-long free-form string to describe the datapath for