trp/trp_upd.c
trp/trpc.c
trp/trps.c include/tr_name_internal.h mon/mon_req.c mon/mon_req_encode.c mon/mon_req_decode.c
- mon/mon_resp.c mon/mon_common.c mon/mon_resp_encode.c mon/mon_resp_decode.c tr/tr_mon.c mon/mons.c include/tr_socket.h common/tr_gss.c include/tr_gss.h common/tr_config_internal.c mon/mons_handlers.c include/mons_handlers.h tr/tr_tid_mons.c tr/tr_tid_mons.c trp/trp_route.c include/trp_route.h trp/trp_rtable_encoders.c trp/trp_route_encoders.c trp/trp_peer.c include/trp_peer.h trp/trp_peer_encoders.c trp/trp_ptable_encoders.c)
+ mon/mon_resp.c mon/mon_common.c mon/mon_resp_encode.c mon/mon_resp_decode.c tr/tr_mon.c mon/mons.c include/tr_socket.h common/tr_gss.c include/tr_gss.h common/tr_config_internal.c mon/mons_handlers.c include/mons_handlers.h tr/tr_tid_mons.c tr/tr_tid_mons.c trp/trp_route.c include/trp_route.h trp/trp_rtable_encoders.c trp/trp_route_encoders.c trp/trp_peer.c include/trp_peer.h trp/trp_peer_encoders.c trp/trp_ptable_encoders.c common/tr_idp_encoders.c common/tr_comm_encoders.c)
# Does not actually build!
add_executable(trust_router ${SOURCE_FILES})
common/tr_util.c \
common/tr_apc.c \
common/tr_comm.c \
+ common/tr_comm_encoders.c \
common/tr_rp.c \
common/tr_idp.c \
+ common/tr_idp_encoders.c \
common/tr_filter.c \
common/tr_gss_names.c \
common/tr_socket.c \
/*
- * Copyright (c) 2012, JANET(UK)
+ * Copyright (c) 2012-2018, JANET(UK)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
--- /dev/null
+/*
+ * Copyright (c) 2012-2018, JANET(UK)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of JANET(UK) nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <jansson.h>
+#include <tr_idp.h>
+#include <tr_comm.h>
+#include <tr_util.h>
+#include <tr_debug.h>
+
+/* helper */
+static json_t *expiry_to_json_string(TR_COMM_MEMB *memb)
+{
+ struct timespec ts_zero = {0, 0};
+ char *s = NULL;
+ json_t *jstr = NULL;
+
+ if (tr_cmp_timespec(tr_comm_memb_get_expiry(memb), &ts_zero) == 0) {
+ s = strdup("");
+ } else {
+ s = timespec_to_str(tr_comm_memb_get_expiry(memb));
+ }
+
+ if (s) {
+ jstr = json_string(s);
+ free(s);
+ }
+
+ return jstr;
+}
+
+/**
+ * Get the provenance from the member, handling empty provenance safely
+ */
+static json_t *provenance_to_json(TR_COMM_MEMB *memb)
+{
+ json_t *prov = tr_comm_memb_get_provenance(memb);
+
+ if (prov) {
+ json_incref(prov);
+ return prov;
+ } else {
+ return json_array();
+ }
+}
+
+/* helper for below */
+#define OBJECT_SET_OR_FAIL(jobj, key, val) \
+do { \
+ if (val) \
+ json_object_set_new((jobj),(key),(val)); \
+ else \
+ goto cleanup; \
+} while (0)
+
+json_t *tr_comm_memb_to_json(TR_COMM_MEMB *memb)
+{
+ json_t *memb_json = NULL;
+ json_t *retval = NULL;
+
+ memb_json = json_object();
+ if (memb_json == NULL)
+ goto cleanup;
+
+ OBJECT_SET_OR_FAIL(memb_json, "realm",
+ tr_name_to_json_string(tr_comm_memb_get_realm_id(memb)));
+ OBJECT_SET_OR_FAIL(memb_json, "expires",
+ expiry_to_json_string(memb));
+ OBJECT_SET_OR_FAIL(memb_json, "announce_interval",
+ json_integer(tr_comm_memb_get_interval(memb)));
+ OBJECT_SET_OR_FAIL(memb_json, "times_expired",
+ json_integer(tr_comm_memb_get_times_expired(memb)));
+ OBJECT_SET_OR_FAIL(memb_json, "provenance",
+ provenance_to_json(memb));
+
+ /* succeeded - set the return value and increment the reference count */
+ retval = memb_json;
+ json_incref(retval);
+
+cleanup:
+ if (memb_json)
+ json_decref(memb_json);
+ return retval;
+}
+
+json_t *tr_comm_idp_realms_to_json(TR_COMM_TABLE *ctable, TR_NAME *comm_name)
+{
+ json_t *jarray = json_array();
+ TR_COMM_ITER *iter = NULL;
+ TR_IDP_REALM *idp = NULL;
+ TR_COMM_MEMB *memb = NULL;
+
+ iter = tr_comm_iter_new(NULL);
+ idp = tr_idp_realm_iter_first(iter, ctable, comm_name);
+ while(idp) {
+ tr_debug("<<<<<<<<<<<<<<<<<<<<<<<<< GOT IDP REALM %s", tr_idp_realm_get_id(idp)->buf);
+ memb = tr_comm_table_find_idp_memb(ctable,
+ tr_idp_realm_get_id(idp),
+ comm_name);
+ tr_debug("<<<<<<<<<<<<<<<<<<<<<<<<< FOUND MEMB %p", memb);
+ json_array_append_new(jarray, tr_comm_memb_to_json(memb));
+ idp = tr_idp_realm_iter_next(iter);
+ }
+ tr_comm_iter_free(iter);
+
+ return jarray;
+}
+
+json_t *tr_comm_rp_realms_to_json(TR_COMM_TABLE *ctable, TR_NAME *comm_id)
+{
+ json_t *jarray = json_array();
+ TR_COMM_ITER *iter = NULL;
+ TR_RP_REALM *rp = NULL;
+ TR_COMM_MEMB *memb = NULL;
+
+ iter = tr_comm_iter_new(NULL);
+ rp = tr_rp_realm_iter_first(iter, ctable, comm_id);
+ while(rp) {
+ tr_debug("<<<<<<<<<<<<<<<<<<<<<<<<< GOT RP REALM ");
+ memb = tr_comm_table_find_rp_memb(ctable,
+ tr_rp_realm_get_id(rp),
+ comm_id);
+ json_array_append_new(jarray, tr_comm_memb_to_json(memb));
+ rp = tr_rp_realm_iter_next(iter);
+ }
+ tr_comm_iter_free(iter);
+
+ return jarray;
+}
+
+/**
+ * Convert TR_NAME n to a JSON string, returning the empty string if n is null
+ */
+static json_t *safe_name_to_json_string(TR_NAME *n)
+{
+ if (n)
+ return tr_name_to_json_string(n);
+ else
+ return json_string("");
+}
+
+json_t *tr_comm_to_json(TR_COMM_TABLE *ctable, TR_COMM *comm)
+{
+ json_t *comm_json = NULL;
+ json_t *retval = NULL;
+
+ comm_json = json_object();
+ if (comm_json == NULL)
+ goto cleanup;
+
+ OBJECT_SET_OR_FAIL(comm_json, "type",
+ json_string(tr_comm_type_to_str(tr_comm_get_type(comm))));
+ if (tr_comm_get_type(comm) == TR_COMM_APC) {
+ OBJECT_SET_OR_FAIL(comm_json, "expiration_interval",
+ json_integer(comm->expiration_interval));
+ } else {
+ /* just get the first apc */
+ OBJECT_SET_OR_FAIL(comm_json, "apc",
+ tr_name_to_json_string(
+ tr_apc_get_id(
+ tr_comm_get_apcs(comm))));
+ }
+ OBJECT_SET_OR_FAIL(comm_json, "name",
+ tr_name_to_json_string(tr_comm_get_id(comm)));
+ OBJECT_SET_OR_FAIL(comm_json, "owner_realm",
+ safe_name_to_json_string(tr_comm_get_owner_realm(comm)));
+ OBJECT_SET_OR_FAIL(comm_json, "owner_contact",
+ safe_name_to_json_string(tr_comm_get_owner_contact(comm)));
+
+ OBJECT_SET_OR_FAIL(comm_json, "idp_realms",
+ tr_comm_idp_realms_to_json(ctable, tr_comm_get_id(comm)));
+ OBJECT_SET_OR_FAIL(comm_json, "rp_realms",
+ tr_comm_rp_realms_to_json(ctable, tr_comm_get_id(comm)));
+
+ /* succeeded - set the return value and increment the reference count */
+ retval = comm_json;
+ json_incref(retval);
+
+ cleanup:
+ if (comm_json)
+ json_decref(comm_json);
+ return retval;
+}
+
+json_t *tr_comm_table_to_json(TR_COMM_TABLE *ctable)
+{
+ json_t *ctable_json = NULL;
+ json_t *retval = NULL;
+ json_t *comm_json = NULL;
+ TR_COMM_ITER *iter = NULL;
+ TR_COMM *comm = NULL;
+
+ ctable_json = json_array();
+ if (ctable_json == NULL)
+ goto cleanup;
+
+ iter = tr_comm_iter_new(NULL);
+ if (iter == NULL)
+ goto cleanup;
+
+ /* Iterate over communities in the table */
+ comm = tr_comm_table_iter_first(iter, ctable);
+ while (comm) {
+ comm_json = tr_comm_to_json(ctable, comm);
+
+ if (comm_json == NULL)
+ goto cleanup;
+
+ json_array_append_new(ctable_json, comm_json);
+ comm = tr_comm_table_iter_next(iter);
+ }
+
+ /* succeeded - set the return value and increment the reference count */
+ retval = ctable_json;
+ json_incref(retval);
+
+cleanup:
+ if (iter)
+ tr_comm_iter_free(iter);
+
+ if (ctable_json)
+ json_decref(ctable_json);
+
+ return retval;
+
+}
\ No newline at end of file
return head;
}
-static int tr_idp_realm_apc_count(TR_IDP_REALM *idp)
+int tr_idp_realm_apc_count(TR_IDP_REALM *idp)
{
int ii=0;
TR_APC *apc=idp->apcs;
return ii;
}
-static int tr_idp_realm_aaa_server_count(TR_IDP_REALM *idp)
+int tr_idp_realm_aaa_server_count(TR_IDP_REALM *idp)
{
int ii=0;
TR_AAA_SERVER *aaa=idp->aaa_servers;
return ii;
}
-static char *tr_aaa_server_to_str(TALLOC_CTX *mem_ctx, TR_AAA_SERVER *aaa)
-{
- return talloc_strndup(mem_ctx, aaa->hostname->buf, aaa->hostname->len);
-}
-
-char *tr_idp_realm_to_str(TALLOC_CTX *mem_ctx, TR_IDP_REALM *idp)
-{
- TALLOC_CTX *tmp_ctx=talloc_new(NULL);
- char **s_aaa=NULL, *aaa_servers=NULL;
- char **s_apc=NULL, *apcs=NULL;
- int ii=0, aaa_servers_strlen=0, apcs_strlen=0;
- int n_aaa_servers=tr_idp_realm_aaa_server_count(idp);
- int n_apcs=tr_idp_realm_apc_count(idp);
- TR_AAA_SERVER *aaa=NULL;
- TR_APC *apc=NULL;
- char *result=NULL;
-
- /* get the AAA servers */
- if (n_aaa_servers<=0)
- aaa_servers=talloc_strdup(tmp_ctx, "");
- else {
- s_aaa=talloc_array(tmp_ctx, char *, n_aaa_servers);
- for (aaa=idp->aaa_servers,ii=0; aaa!=NULL; aaa=aaa->next,ii++) {
- s_aaa[ii]=tr_aaa_server_to_str(s_aaa, aaa);
- aaa_servers_strlen+=strlen(s_aaa[ii]);
- }
-
- /* add space for comma-space separators */
- aaa_servers_strlen+=2*(n_aaa_servers-1);
-
- aaa_servers=talloc_array(tmp_ctx, char, aaa_servers_strlen+1);
- aaa_servers[0]='\0';
- for (ii=0; ii<n_aaa_servers; ii++) {
- strcat(aaa_servers, s_aaa[ii]);
- if (ii<(n_aaa_servers-1))
- strcat(aaa_servers, ", ");
- }
- talloc_free(s_aaa);
- }
-
- /* get the APCs */
- if (n_apcs<=0)
- apcs=talloc_strdup(tmp_ctx, "");
- else {
- s_apc=talloc_array(tmp_ctx, char *, n_apcs);
- for (apc=idp->apcs,ii=0; apc!=NULL; apc=apc->next,ii++) {
- s_apc[ii]=tr_apc_to_str(s_apc, apc);
- apcs_strlen+=strlen(s_apc[ii]);
- }
-
- /* add space for comma-space separators */
- apcs_strlen+=2*(n_apcs-1);
-
- apcs=talloc_array(tmp_ctx, char, apcs_strlen+1);
- apcs[0]='\0';
- for (ii=0; ii<n_apcs; ii++) {
- strcat(apcs, s_apc[ii]);
- if (ii<(n_apcs-1))
- strcat(apcs, ", ");
- }
- talloc_free(s_apc);
- }
-
- result=talloc_asprintf(mem_ctx,
- "IDP realm: \"%.*s\""
- " shared: %s"
- " local: %s"
- " AAA servers: %s"
- " APCs: %s",
- idp->realm_id->len, idp->realm_id->buf,
- (idp->shared_config)?"yes":"no",
- (idp->origin==TR_REALM_LOCAL)?"yes":"no",
- aaa_servers,
- apcs);
- talloc_free(tmp_ctx);
- return result;
-}
-
void tr_idp_realm_incref(TR_IDP_REALM *realm)
{
realm->refcount++;
--- /dev/null
+/*
+ * Copyright (c) 2012-2018, JANET(UK)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of JANET(UK) nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <talloc.h>
+#include <time.h>
+
+#include <tr_name_internal.h>
+#include <tr_idp.h>
+#include <tr_config.h>
+#include <tr_debug.h>
+
+static char *tr_aaa_server_to_str(TALLOC_CTX *mem_ctx, TR_AAA_SERVER *aaa)
+{
+ return talloc_strndup(mem_ctx, aaa->hostname->buf, aaa->hostname->len);
+}
+
+
+char *tr_idp_realm_to_str(TALLOC_CTX *mem_ctx, TR_IDP_REALM *idp)
+{
+ TALLOC_CTX *tmp_ctx=talloc_new(NULL);
+ char **s_aaa=NULL, *aaa_servers=NULL;
+ char **s_apc=NULL, *apcs=NULL;
+ int ii=0, aaa_servers_strlen=0, apcs_strlen=0;
+ int n_aaa_servers=tr_idp_realm_aaa_server_count(idp);
+ int n_apcs=tr_idp_realm_apc_count(idp);
+ TR_AAA_SERVER *aaa=NULL;
+ TR_APC *apc=NULL;
+ char *result=NULL;
+
+ /* get the AAA servers */
+ if (n_aaa_servers<=0)
+ aaa_servers=talloc_strdup(tmp_ctx, "");
+ else {
+ s_aaa=talloc_array(tmp_ctx, char *, n_aaa_servers);
+ for (aaa=idp->aaa_servers,ii=0; aaa!=NULL; aaa=aaa->next,ii++) {
+ s_aaa[ii]=tr_aaa_server_to_str(s_aaa, aaa);
+ aaa_servers_strlen+=strlen(s_aaa[ii]);
+ }
+
+ /* add space for comma-space separators */
+ aaa_servers_strlen+=2*(n_aaa_servers-1);
+
+ aaa_servers=talloc_array(tmp_ctx, char, aaa_servers_strlen+1);
+ aaa_servers[0]='\0';
+ for (ii=0; ii<n_aaa_servers; ii++) {
+ strcat(aaa_servers, s_aaa[ii]);
+ if (ii<(n_aaa_servers-1))
+ strcat(aaa_servers, ", ");
+ }
+ talloc_free(s_aaa);
+ }
+
+ /* get the APCs */
+ if (n_apcs<=0)
+ apcs=talloc_strdup(tmp_ctx, "");
+ else {
+ s_apc=talloc_array(tmp_ctx, char *, n_apcs);
+ for (apc=idp->apcs,ii=0; apc!=NULL; apc=apc->next,ii++) {
+ s_apc[ii]=tr_apc_to_str(s_apc, apc);
+ apcs_strlen+=strlen(s_apc[ii]);
+ }
+
+ /* add space for comma-space separators */
+ apcs_strlen+=2*(n_apcs-1);
+
+ apcs=talloc_array(tmp_ctx, char, apcs_strlen+1);
+ apcs[0]='\0';
+ for (ii=0; ii<n_apcs; ii++) {
+ strcat(apcs, s_apc[ii]);
+ if (ii<(n_apcs-1))
+ strcat(apcs, ", ");
+ }
+ talloc_free(s_apc);
+ }
+
+ result=talloc_asprintf(mem_ctx,
+ "IDP realm: \"%.*s\""
+ " shared: %s"
+ " local: %s"
+ " AAA servers: %s"
+ " APCs: %s",
+ idp->realm_id->len, idp->realm_id->buf,
+ (idp->shared_config)?"yes":"no",
+ (idp->origin==TR_REALM_LOCAL)?"yes":"no",
+ aaa_servers,
+ apcs);
+ talloc_free(tmp_ctx);
+ return result;
+}
+
"RP realm: \"%.*s\"\n",
rp->realm_id->len, rp->realm_id->buf);
}
+
+json_t *tr_rp_realm_to_json(TR_RP_REALM *rp)
+{
+ return tr_name_to_json_string(tr_rp_realm_get_id(rp));
+}
\ No newline at end of file
const char *tr_realm_role_to_str(TR_REALM_ROLE role);
TR_REALM_ROLE tr_realm_role_from_str(const char *s);
+/* tr_comm_encoders.c */
+json_t *tr_comm_memb_to_json(TR_COMM_MEMB *memb);
+json_t *tr_comm_to_json(TR_COMM_TABLE *ctable, TR_COMM *comm);
+json_t *tr_comm_table_to_json(TR_COMM_TABLE *ctable);
+json_t *tr_comm_rp_realms_to_json(TR_COMM_TABLE *ctable, TR_NAME *comm_id);
+json_t *tr_comm_idp_realms_to_json(TR_COMM_TABLE *ctable, TR_NAME *comm_name);
+
#endif
#define tr_idp_realm_remove(head,remove) ((head)=tr_idp_realm_remove_func((head),(remove)))
TR_IDP_REALM *tr_idp_realm_sweep_func(TR_IDP_REALM *head);
#define tr_idp_realm_sweep(head) ((head)=tr_idp_realm_sweep_func((head)))
-char *tr_idp_realm_to_str(TALLOC_CTX *mem_ctx, TR_IDP_REALM *idp);
+int tr_idp_realm_aaa_server_count(TR_IDP_REALM *idp);
+int tr_idp_realm_apc_count(TR_IDP_REALM *idp);
void tr_idp_realm_incref(TR_IDP_REALM *realm);
void tr_idp_realm_decref(TR_IDP_REALM *realm);
TR_AAA_SERVER *tr_idp_aaa_server_lookup(TR_IDP_REALM *idp_realms, TR_NAME *idp_realm_name, TR_NAME *comm, int *shared_out);
TR_AAA_SERVER *tr_default_server_lookup(TR_AAA_SERVER *default_servers, TR_NAME *comm);
+/* tr_idp_encoders.c */
+char *tr_idp_realm_to_str(TALLOC_CTX *mem_ctx, TR_IDP_REALM *idp);
+json_t *tr_idp_realm_to_json(TR_IDP_REALM *idp);
+
#endif
void tr_rp_realm_decref(TR_RP_REALM *realm);
char *tr_rp_realm_to_str(TALLOC_CTX *mem_ctx, TR_RP_REALM *rp);
+json_t *tr_rp_realm_to_json(TR_RP_REALM *rp);
#endif
#include <tr_trp.h>
#include <trp_rtable.h>
#include <trp_ptable.h>
+#include <tr_comm.h>
#include <mon_internal.h>
#include <mons_handlers.h>
return (*response_ptr == NULL) ? MON_NOMEM : MON_SUCCESS;
}
+static MON_RC handle_show_communities(void *cookie, json_t **response_ptr)
+{
+ TRPS_INSTANCE *trps = talloc_get_type_abort(cookie, TRPS_INSTANCE);
+
+ *response_ptr = tr_comm_table_to_json(trps->ctable);
+ return (*response_ptr == NULL) ? MON_NOMEM : MON_SUCCESS;
+}
+
void tr_trp_register_mons_handlers(TRPS_INSTANCE *trps, MONS_INSTANCE *mons)
{
mons_register_handler(mons,
mons_register_handler(mons,
MON_CMD_SHOW, OPT_TYPE_SHOW_PEERS,
handle_show_peers, trps);
+ mons_register_handler(mons,
+ MON_CMD_SHOW, OPT_TYPE_SHOW_COMMUNITIES,
+ handle_show_communities, trps);
}
}
/* Print the JSON to stdout */
- json_dumpf(mon_resp_encode(resp), stdout, JSON_INDENT(4) | JSON_SORT_KEYS);
+ json_dumpf(mon_resp_encode(resp), stdout, JSON_INDENT(4));
printf("\n");
/* success */