/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
char hw_desc[DESC_STR_LEN]; /* Hardware description. */
char sw_desc[DESC_STR_LEN]; /* Software description. */
char serial_num[SERIAL_NUM_LEN]; /* Serial number. */
+ char dp_desc[DESC_STR_LEN]; /* Human readable description of
+ the datapath. */
};
-OFP_ASSERT(sizeof(struct ofp_desc_stats) == 800);
+OFP_ASSERT(sizeof(struct ofp_desc_stats) == 1056);
/* Body for ofp_stats_request of type OFPST_FLOW. */
struct ofp_flow_stats_request {
ds_put_format(string, "Hardware: %s\n", ods->hw_desc);
ds_put_format(string, "Software: %s\n", ods->sw_desc);
ds_put_format(string, "Serial Num: %s\n", ods->serial_num);
+ ds_put_format(string, "DP Description: %s\n", ods->dp_desc);
}
static void
char *hardware; /* Hardware. */
char *software; /* Software version. */
char *serial; /* Serial number. */
+ char *dp_desc; /* Datapath description. */
/* Datapath. */
struct dpif *dpif;
p->hardware = xstrdup("Reference Implementation");
p->software = xstrdup(VERSION BUILDNR);
p->serial = xstrdup("None");
+ p->dp_desc = xstrdup("None");
/* Initialize datapath. */
p->dpif = dpif;
void
ofproto_set_desc(struct ofproto *p,
const char *manufacturer, const char *hardware,
- const char *software, const char *serial)
+ const char *software, const char *serial,
+ const char *dp_desc)
{
if (manufacturer) {
free(p->manufacturer);
free(p->serial);
p->serial = xstrdup(serial);
}
+ if (dp_desc) {
+ free(p->dp_desc);
+ p->dp_desc = xstrdup(dp_desc);
+ }
}
int
strncpy(ods->hw_desc, p->hardware, sizeof ods->hw_desc);
strncpy(ods->sw_desc, p->software, sizeof ods->sw_desc);
strncpy(ods->serial_num, p->serial, sizeof ods->serial_num);
+ strncpy(ods->dp_desc, p->dp_desc, sizeof ods->dp_desc);
queue_tx(msg, ofconn, ofconn->reply_counter);
return 0;
void ofproto_set_max_backoff(struct ofproto *, int max_backoff);
void ofproto_set_desc(struct ofproto *,
const char *manufacturer, const char *hardware,
- const char *software, const char *serial);
+ const char *software, const char *serial,
+ const char *dp_desc);
int ofproto_set_in_band(struct ofproto *, bool in_band);
int ofproto_set_discovery(struct ofproto *, bool discovery,
const char *accept_controller_re,
const char *hw_desc; /* Hardware. */
const char *sw_desc; /* Software version. */
const char *serial_desc; /* Serial number. */
+ const char *dp_desc; /* Serial number. */
/* Related vconns and network devices. */
const char *controller_name; /* Controller (if not discovery mode). */
if (s.datapath_id) {
ofproto_set_datapath_id(ofproto, s.datapath_id);
}
- ofproto_set_desc(ofproto, s.mfr_desc, s.hw_desc, s.sw_desc, s.serial_desc);
+ ofproto_set_desc(ofproto, s.mfr_desc, s.hw_desc, s.sw_desc,
+ s.serial_desc, s.dp_desc);
if (!s.listeners.n) {
svec_add_nocopy(&s.listeners, xasprintf("punix:%s/%s.mgmt",
ovs_rundir, s.dp_name));
OPT_HARDWARE,
OPT_SOFTWARE,
OPT_SERIAL,
+ OPT_DP_DESC,
OPT_ACCEPT_VCONN,
OPT_NO_RESOLV_CONF,
OPT_BR_NAME,
{"hardware", required_argument, 0, OPT_HARDWARE},
{"software", required_argument, 0, OPT_SOFTWARE},
{"serial", required_argument, 0, OPT_SERIAL},
+ {"dp_desc", required_argument, 0, OPT_DP_DESC},
{"accept-vconn", required_argument, 0, OPT_ACCEPT_VCONN},
{"no-resolv-conf", no_argument, 0, OPT_NO_RESOLV_CONF},
{"config", required_argument, 0, 'F'},
s->hw_desc = NULL;
s->sw_desc = NULL;
s->serial_desc = NULL;
+ s->dp_desc = NULL;
svec_init(&s->listeners);
svec_init(&s->snoops);
s->fail_mode = FAIL_OPEN;
s->serial_desc = optarg;
break;
+ case OPT_DP_DESC:
+ s->dp_desc = optarg;
+ break;
+
case OPT_ACCEPT_VCONN:
s->accept_controller_re = optarg;
break;
" --hardware=HW Identify hardware as HW\n"
" --software=SW Identify software as SW\n"
" --serial=SERIAL Identify serial number as SERIAL\n"
+ " --dp_desc=DP_DESC Identify dp description as DP_DESC\n"
"\nController discovery options:\n"
" --accept-vconn=REGEX accept matching discovered controllers\n"
" --no-resolv-conf do not update /etc/resolv.conf\n"