nanog mailing list archives
Re: JunOS config yacc grammar?
From: Joe Snyder <joseph.snyder () gmail com>
Date: Tue, 22 Aug 2023 10:17:40 -0400
I agree with the yang approach. I would probably convert to using Yang and download the yang files for whatever code version you are running. For every code version you can download the yang files. Then you have a choice to decide, either right a yang to yacc conversion tool or find one, or think about switching to a netconf approach or ODL/restconf -> netconf style approach depending on how you are using the yacc files today as that will auto check and verify basics and reject non compliant configs to some level. On Tue, Aug 22, 2023 at 9:36 AM Diogo Montagner <diogo.montagner () gmail com> wrote:
I would first try to understand what you are trying to achieve. JUNOS is very flexible on this front and I am wondering why you think yacc is the right way to achieve what you are trying to do. If no one (or very few) these days is using yacc grammar for parsing router configs, that should be a good indication whether you are on the right path or not. As already pointed out, navigating the XML trees or JSON structures would be much easier than writing a yacc grammar parser. Alternatively, I would look into the YANG files: https://github.com/Juniper/yang But without understanding what you are trying to do, this is just another suggestion. ./diogo -montagner JNCIE-SP 0x41A On Tue, 22 Aug 2023 at 09:53, Lyndon Nerenberg (VE7TFX/VE6BBM) < lyndon () orthanc ca> wrote:Nick Hilliard writes:No need to reinvent that wheel: root@foo> show configuration | display xml root@foo> show configuration | display jsonThat doesn't quite work for this scenario. It would mean ssh-ing to the switch to grab it, and that's pretty locked down. We already have cron jobs running on the switches that tftp the config file to a server, and I'd prefer to leverage off that. Also, the yacc parser would let me do some validation checks before we push new configs. --lyndon
Current thread:
- JunOS config yacc grammar? Lyndon Nerenberg (VE7TFX/VE6BBM) (Aug 21)
- Re: JunOS config yacc grammar? Nick Hilliard (Aug 21)
- Re: JunOS config yacc grammar? Lyndon Nerenberg (VE7TFX/VE6BBM) (Aug 21)
- Re: JunOS config yacc grammar? Tom Beecher (Aug 21)
- Re: JunOS config yacc grammar? Diogo Montagner (Aug 22)
- Re: JunOS config yacc grammar? Lyndon Nerenberg (VE7TFX/VE6BBM) (Aug 21)
- Re: JunOS config yacc grammar? Saku Ytti (Aug 21)
- Re: JunOS config yacc grammar? Nick Hilliard (Aug 22)
- Message not available
- Re: JunOS config yacc grammar? Lyndon Nerenberg (VE7TFX/VE6BBM) (Aug 22)
- Re: JunOS config yacc grammar? Brent Jones (Aug 22)
- Re: JunOS config yacc grammar? Lyndon Nerenberg (VE7TFX/VE6BBM) (Aug 21)
- Re: JunOS config yacc grammar? Nick Hilliard (Aug 21)
- Re: JunOS config yacc grammar? Joe Snyder (Aug 22)
- Re: JunOS config yacc grammar? Grant Taylor via NANOG (Aug 22)
- Re: JunOS config yacc grammar? Christopher Morrow (Aug 24)
- Re: JunOS config yacc grammar? Justin H. (Aug 24)
- Re: JunOS config yacc grammar? Christopher Morrow (Aug 24)
- Re: JunOS config yacc grammar? Owen DeLong via NANOG (Aug 24)
- Re: JunOS config yacc grammar? Warren Kumari (Aug 24)
- Re: JunOS config yacc grammar? Yan Filyurin (Aug 24)
- Re: JunOS config yacc grammar? Christopher Morrow (Aug 24)
- Re: JunOS config yacc grammar? Mark Prosser (Aug 22)