aboutsummaryrefslogtreecommitdiff
path: root/ofproto/ofproto.c
diff options
context:
space:
mode:
Diffstat (limited to 'ofproto/ofproto.c')
-rw-r--r--ofproto/ofproto.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index f22c2070..14a425db 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -189,6 +189,7 @@ struct ofproto {
char *hardware; /* Hardware. */
char *software; /* Software version. */
char *serial; /* Serial number. */
+ char *dp_desc; /* Datapath description. */
/* Datapath. */
struct dpif *dpif;
@@ -300,6 +301,7 @@ ofproto_create(const char *datapath, const char *datapath_type,
p->hardware = xstrdup("Reference Implementation");
p->software = xstrdup(VERSION BUILDNR);
p->serial = xstrdup("None");
+ p->dp_desc = xstrdup("None");
/* Initialize datapath. */
p->dpif = dpif;
@@ -387,7 +389,8 @@ ofproto_set_max_backoff(struct ofproto *p, int max_backoff)
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);
@@ -405,6 +408,10 @@ ofproto_set_desc(struct ofproto *p,
free(p->serial);
p->serial = xstrdup(serial);
}
+ if (dp_desc) {
+ free(p->dp_desc);
+ p->dp_desc = xstrdup(dp_desc);
+ }
}
int
@@ -2385,6 +2392,7 @@ handle_desc_stats_request(struct ofproto *p, struct ofconn *ofconn,
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;