]> git.puffer.fish Git - mirror/frr.git/commit
vtysh, lib: fix 'show ip[v6] prefix-list ... json' formatting by moving it to vtysh 15750/head
authorPiotr Suchy <piotrsuchy6@tlen.pl>
Mon, 15 Apr 2024 19:33:40 +0000 (21:33 +0200)
committerPiotr Suchy <piotrsuchy@proton.me>
Sun, 21 Apr 2024 21:40:06 +0000 (23:40 +0200)
commit0a17289a3b1dc2d92126dd38d40772d5e399845c
tree5bdbc63431576daed6fdb832a40f035cbfed833f
parent99a723e5a8b3f0b874e55156b21eaebaa9bb0c82
vtysh, lib: fix 'show ip[v6] prefix-list ... json' formatting by moving it to vtysh

Json output is not valid for 'show ip[v6] prefix-list ... json' commands,
as it goes through all the running daemons and for each one it calls
'vty_show_prefix_list' creating a new json object. To aggreagate the output
and create a valid json that can be parsed, the commands were moved to vtysh.

Before:
{
  "ZEBRA":{
    "DEFAULT":{
      "addressFamily":"IPv4",
      "entries":[
        {
          "sequenceNumber":10,
          "type":"permit",
          "prefix":"0.0.0.0/0"
        }
      ]
    }
  }
}
{
  "OSPF":{
    "DEFAULT":{
      "addressFamily":"IPv4",
      "entries":[
        {
          "sequenceNumber":10,
          "type":"permit",
          "prefix":"0.0.0.0/0"
        }
      ]
    }
  }
}
{
  "BGP":{
    "DEFAULT":{
      "addressFamily":"IPv4",
      "entries":[
        {
          "sequenceNumber":10,
          "type":"permit",
          "prefix":"0.0.0.0/0"
        }
      ]
    }
  }
}

After:
{"zebra":{
  "DEFAULT":{
    "addressFamily":"IPv4",
    "entries":[
      {
        "sequenceNumber":10,
        "type":"permit",
        "prefix":"0.0.0.0/0"
      }
    ]
  }
}
,"ospfd":{
  "DEFAULT":{
    "addressFamily":"IPv4",
    "entries":[
      {
        "sequenceNumber":10,
        "type":"permit",
        "prefix":"0.0.0.0/0"
      }
    ]
  }
}
,"bgpd":{
  "DEFAULT":{
    "addressFamily":"IPv4",
    "entries":[
      {
        "sequenceNumber":10,
        "type":"permit",
        "prefix":"0.0.0.0/0"
      }
    ]
  }
}
}

Signed-off-by: Piotr Suchy <piotrsuchy@proton.me>
lib/plist.c
vtysh/vtysh.c
vtysh/vtysh.h