Skip to content

Commit

Permalink
isisd: fix json naming format in show isis database detail json
Browse files Browse the repository at this point in the history
JSON keys should not contain '-'. For example, "flag-v" is incorrect and
should be "flagV".

Rename JSON keys in "show isis database detail json" that contains '-'
or '_'.

Signed-off-by: Louis Scalbert <[email protected]>
  • Loading branch information
louis-6wind committed May 21, 2024
1 parent 0675cbf commit 578b3a8
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 112 deletions.
8 changes: 4 additions & 4 deletions isisd/isis_lsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,9 +760,9 @@ void lsp_print_json(struct isis_lsp *lsp, struct json_object *json,
json_object_object_add(json, "lsp", own_json);
json_object_string_add(own_json, "id", LSPid);
json_object_boolean_add(own_json, "own", lsp->own_lsp ? true : false);
json_object_int_add(json, "pdu-len", lsp->hdr.pdu_len);
json_object_int_add(json, "pduLen", lsp->hdr.pdu_len);
snprintfrr(buf, sizeof(buf), "0x%08x", lsp->hdr.seqno);
json_object_string_add(json, "seq-number", buf);
json_object_string_add(json, "seqNumber", buf);
snprintfrr(buf, sizeof(buf), "0x%04hx", lsp->hdr.checksum);
json_object_string_add(json, "chksum", buf);
if (lsp->hdr.rem_lifetime == 0) {
Expand All @@ -772,8 +772,8 @@ void lsp_print_json(struct isis_lsp *lsp, struct json_object *json,
} else {
json_object_int_add(json, "holdtime", lsp->hdr.rem_lifetime);
}
json_object_string_add(
json, "att-p-ol", lsp_bits2string(lsp->hdr.lsp_bits, b, sizeof(b)));
json_object_string_add(json, "attPOl",
lsp_bits2string(lsp->hdr.lsp_bits, b, sizeof(b)));
}

void lsp_print_vty(struct isis_lsp *lsp, struct vty *vty,
Expand Down
Loading

0 comments on commit 578b3a8

Please sign in to comment.