Identify empty community list?

Lars-Johan Liman liman at netnod.se
Tue Dec 21 12:15:45 CET 2010


Hi!

I'm trying to get a grip on BIRD, and I'm slowly getting there.

One thing that puzzles me, though, is how to catch a BGP route entry
that has no community list at all. What is the appropriate syntax?
I'm runnig out of character combinations to try ... ;-)

Non-realistic, but short, example: Accept only routes with empty
community.

protocol pipe foo {
	table tbl1;
	peer table tbl2;
	mode transparent;
	import filter {
		if bgp_community = [] then    # <-- WHAT TO WRITE HERE?!
			accept;
		reject;
	};
        export all;
}

I'm looking for something along the lines of a boolean method

	bgp_community.isEmpty

or a way to simulate that.

I suppose one could also turn it all around and try to say:

		if bgp_community ~ [(*,*)] then
			reject;
		accept;

doesn't work either. You can't say set A is member of set B. I
understand that.

				Cheers,
				  /Lars-Johan Liman
#----------------------------------------------------------------------
# Lars-Johan Liman, M.Sc.               !  E-mail: liman at netnod.se
# Senior Systems Specialist             !  Tel: +46 8 - 562 860 12
# Netnod Internet Exchange, Stockholm   !  http://www.netnod.se/
#----------------------------------------------------------------------



More information about the Bird-users mailing list