#include <tr_gss_names.h>
#include <trp_peer.h>
#include <tr_util.h>
+#include <tr_json_util.h>
char *trp_peer_to_str(TALLOC_CTX *memctx, TRP_PEER *peer, const char *sep)
{
}
/* helper for encoding to json */
-static json_t *server_to_json_string(const char *server, unsigned int port)
+static json_t *server_to_json_string(const char *server, int port)
{
char *s = talloc_asprintf(NULL, "%s:%u", server, port);
json_t *jstr = json_string(s);
return jstr;
}
-/* 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 *trp_peer_to_json(TRP_PEER *peer)
{
json_t *peer_json = NULL;