here i think we just want to return a list of interface names and have
a separate name -> mac API call
On Mon, Nov 1, 2010 at 2:21 PM, Adam Stokes <astokes(a)fedoraproject.org> wrote:
Also updated include to reflect updated schema.
---
src/qmf/netagent.cpp | 23 ++++++++++++++---------
src/qmf/netagent.h | 4 ++--
2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/src/qmf/netagent.cpp b/src/qmf/netagent.cpp
index 46797f2..44bfe0c 100644
--- a/src/qmf/netagent.cpp
+++ b/src/qmf/netagent.cpp
@@ -22,17 +22,19 @@
#endif
#include "netagent.h"
-#include <qpid/agent/ManagementAgent.h>
-#include "qmf/com/redhat/matahari/net/ArgsNetworkList.h"
-#include "qmf/com/redhat/matahari/net/ArgsNetworkStop.h"
-#include "qmf/com/redhat/matahari/net/ArgsNetworkStart.h"
-#include "qmf/com/redhat/matahari/net/ArgsNetworkStatus.h"
-#include "qmf/com/redhat/matahari/net/ArgsNetworkDescribe.h"
-#include "qmf/com/redhat/matahari/net/ArgsNetworkDestroy.h"
#include "host.h"
+#include <qpid/agent/ManagementAgent.h>
+#include "qmf/com/redhat/matahari/ArgsNetworkList.h"
+#include "qmf/com/redhat/matahari/ArgsNetworkStop.h"
+#include "qmf/com/redhat/matahari/ArgsNetworkStart.h"
+#include "qmf/com/redhat/matahari/ArgsNetworkStatus.h"
+#include "qmf/com/redhat/matahari/ArgsNetworkDescribe.h"
+#include "qmf/com/redhat/matahari/ArgsNetworkDestroy.h"
+
extern "C" {
#include <netcf.h>
+#include <stdlib.h>
#include <string.h>
};
@@ -98,10 +100,13 @@ NetAgent::ManagementMethod(uint32_t method, Args& arguments,
string& text)
if(ncf_list_interfaces(ncf, ioArgs.o_max, iface_list,
NETCF_IFACE_ACTIVE|NETCF_IFACE_INACTIVE) < 0) {
ioArgs.o_max = 0;
}
-
+
+ qpid::types::Variant::Map tmp_map;
for(lpc = 0; lpc < ioArgs.o_max; lpc++) {
nif = ncf_lookup_by_name(ncf, iface_list[lpc]);
- ioArgs.o_iface_map.setString(iface_list[lpc],
ncf_if_mac_string(nif));
+ tmp_map["interface"] = iface_list[lpc];
+ tmp_map["mac"] = ncf_if_mac_string(nif);
+ ioArgs.o_iface_map.push_back(tmp_map);
}
}
return Manageable::STATUS_OK;
diff --git a/src/qmf/netagent.h b/src/qmf/netagent.h
index 7d824a5..abc5032 100644
--- a/src/qmf/netagent.h
+++ b/src/qmf/netagent.h
@@ -23,12 +23,12 @@
#include <qpid/management/Manageable.h>
#include <string>
-#include "qmf/com/redhat/matahari/net/Network.h"
+#include "qmf/com/redhat/matahari/Network.h"
using namespace qpid::management;
using namespace std;
-namespace _qmf = qmf::com::redhat::matahari::net;
+namespace _qmf = qmf::com::redhat::matahari;
class NetAgent : public Manageable
{
--
1.7.2.3
_______________________________________________
Matahari mailing list
Matahari(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/matahari