[j-nsp] certain commands executed on CLI provide additional information over corresponding RPCs

Phil Shafer phil at juniper.net
Fri Mar 9 13:32:43 EST 2018


Martin T writes:
>However, the actual point of my question was, that where do "show ipv6
>neighbors" and similar commands take the column names and the answer
>seems to be, that this is hard-coded in the binary. For example
>nd6info in case of "show ipv6 neighbors".

No, this isn't true.  The CLI uses descriptions provided by the
developer to turn XML into human-readable text.  Use "show ipv6
neighbors | display xml" to see the raw XML.  The nd6info utility
can generate it's own text version, but the UI plumbing invokes it
with the "-X" option to make XML content instead.  The two are
likely similar, but the CLI doesn't use the text from nh6info.  The
idea is to push all UI content into a single consistent code path.

FYI: You might want to take a look at libxo which allows binaries
to generate both XML and text (and HTML and JSON) from the same
source code path.

    http://juniper.github.io/libxo/libxo-manual.html

This is now part of FreeBSD, so one can say "df --libxo:XP" and get
pretty-printed XML output on a stock BSD system.

(And no, we haven't moved nd6info over to libxo yet, but we should.)

Thanks,
 Phil


More information about the juniper-nsp mailing list