def parse(fname):
            conf = Configuration()
            conf.register(SectionBGP, ['bgp'])
            conf.register(SectionFamily, ['bgp', 'family'])
            conf.register(SectionCapability, ['bgp', 'capability'])
            conf.register(SectionSession, ['bgp', 'session'])
            conf.register(SectionProcess, ['bgp', 'process'])
            conf.register(SectionNeighbor, ['bgp', 'neighbor'])
            conf.register(SectionBMP, ['bmp'])

            return conf.parse_file(fname)
Beispiel #2
0
def parse (command):
	conf = Configuration()
	conf.register(SectionShow,['show'])
	return conf.parse_string(command)