From: Justin Pettit Date: Tue, 7 Jul 2009 16:34:37 +0000 (-0700) Subject: secchan: Display mgmt and datapath id in status messages X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b250e29115a063228c4767c1cab247d3d6784ee;p=openvswitch secchan: Display mgmt and datapath id in status messages Since it's not always easy to determine the management id, this adds the ability to see it (and the datapath id) with the "ovs-ofctl status" command. Feature #1533 --- diff --git a/secchan/ofproto.c b/secchan/ofproto.c index aa9e44a1..e6c38410 100644 --- a/secchan/ofproto.c +++ b/secchan/ofproto.c @@ -635,6 +635,12 @@ ofproto_get_datapath_id(const struct ofproto *ofproto) return ofproto->datapath_id; } +uint64_t +ofproto_get_mgmt_id(const struct ofproto *ofproto) +{ + return ofproto->mgmt_id; +} + int ofproto_get_probe_interval(const struct ofproto *ofproto) { diff --git a/secchan/ofproto.h b/secchan/ofproto.h index 44fc023f..f4c1b409 100644 --- a/secchan/ofproto.h +++ b/secchan/ofproto.h @@ -72,6 +72,7 @@ int ofproto_set_remote_execution(struct ofproto *, const char *command_acl, /* Configuration querying. */ uint64_t ofproto_get_datapath_id(const struct ofproto *); +uint64_t ofproto_get_mgmt_id(const struct ofproto *); int ofproto_get_probe_interval(const struct ofproto *); int ofproto_get_max_backoff(const struct ofproto *); bool ofproto_get_in_band(const struct ofproto *); diff --git a/secchan/status.c b/secchan/status.c index c7598f37..8bbfd180 100644 --- a/secchan/status.c +++ b/secchan/status.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include "dynamic-string.h" @@ -118,10 +119,21 @@ static void config_status_cb(struct status_reply *sr, void *ofproto_) { const struct ofproto *ofproto = ofproto_; + uint64_t datapath_id, mgmt_id; struct svec listeners; int probe_interval, max_backoff; size_t i; + datapath_id = ofproto_get_datapath_id(ofproto); + if (datapath_id) { + status_reply_put(sr, "datapath-id=%"PRIx64, datapath_id); + } + + mgmt_id = ofproto_get_mgmt_id(ofproto); + if (mgmt_id) { + status_reply_put(sr, "mgmt-id=%"PRIx64, mgmt_id); + } + svec_init(&listeners); ofproto_get_listeners(ofproto, &listeners); for (i = 0; i < listeners.n; i++) {