}
entrynumber[currentjsondepth]++;
}
+
+void abuf_json_prefix(struct autobuf *abuf, const char* key, struct olsr_ip_prefix *prefix) {
+ struct ipaddr_str ipStr;
+ const char * value;
+
+ assert(abuf);
+ assert(key || prefix);
+
+ if (!prefix) {
+ value = empty;
+ } else {
+ value = olsr_ip_to_string(&ipStr, &prefix->prefix);
+ }
+
+ abuf_json_insert_comma(abuf);
+ abuf_json_new_indent(abuf);
+ if (!key) {
+ abuf_appendf(abuf, "\"%s/%d\"", value, prefix->prefix_len);
+ } else {
+ abuf_appendf(abuf, "\"%s\": \"%s/%d\"", key, value, prefix->prefix_len);
+ }
+ entrynumber[currentjsondepth]++;
+}
void abuf_json_ip_address46(struct autobuf *abuf, const char* key, void *ip, int af);
+void abuf_json_prefix(struct autobuf *abuf, const char* key, struct olsr_ip_prefix *prefix);
+
#endif /* _OLSRD_LIB_INFO_JSON_HELPERS_H_ */