|
@@ -259,11 +259,39 @@ static void rpc_pkg_stats(rpc_t* rpc, void* ctx)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ *
|
|
|
+ */
|
|
|
+static const char* rpc_pkg_info_doc[2] = {
|
|
|
+ "Private memory manager details",
|
|
|
+ 0
|
|
|
+};
|
|
|
+
|
|
|
+/**
|
|
|
+ *
|
|
|
+ */
|
|
|
+static void rpc_pkg_info(rpc_t* rpc, void* ctx)
|
|
|
+{
|
|
|
+ void* th;
|
|
|
+
|
|
|
+ if (rpc->add(ctx, "{", &th) < 0) {
|
|
|
+ rpc->fault(ctx, 500, "Internal error creating rpc");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(rpc->struct_add(th, "su",
|
|
|
+ "name", (_pkg_root.mname)?_pkg_root.mname:"unknown",
|
|
|
+ "size", (unsigned int)pkg_mem_size) <0) {
|
|
|
+ rpc->fault(ctx, 500, "Internal error adding fields");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
*
|
|
|
*/
|
|
|
rpc_export_t kex_pkg_rpc[] = {
|
|
|
{"pkg.stats", rpc_pkg_stats, rpc_pkg_stats_doc, RET_ARRAY},
|
|
|
+ {"pkg.info", rpc_pkg_info, rpc_pkg_info_doc, 0},
|
|
|
{0, 0, 0, 0}
|
|
|
};
|
|
|
|