From 3b250e29115a063228c4767c1cab247d3d6784ee Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Tue, 7 Jul 2009 09:34:37 -0700 Subject: [PATCH] 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 --- secchan/ofproto.c | 6 ++++++ secchan/ofproto.h | 1 + secchan/status.c | 12 ++++++++++++ 3 files changed, 19 insertions(+) diff --git a/secchan/ofproto.c b/secchan/ofproto.c index aa9e44a1b..e6c384103 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 44fc023f2..f4c1b4098 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 c7598f37b..8bbfd1807 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++) { -- 2.43.0