[Xorp-cvs] XORP cvs commit: xorp/bgp

Andrea Bittau a.bittau@cs.ucl.ac.uk
Fri, 11 Nov 2005 20:31:34 +0000


On Fri, Nov 11, 2005 at 09:56:28AM -0800, Pavlin Radoslavov wrote:
> On second thought, I think you are right. Initially I had brain
> failure on trying to understand how exactly the policy code matches
> a policy variable like "aggregate_prefix_len" introduced by some of
> the rtrmgr templates with its corresponding read_aggr_pref_len() and
> write_aggr_pref_len() methods. I simply overlooked the fact that the

Yea originally it would just do string matching.  So it would do

read("aggregate_prefix_len");

If read called another method, the method name could be anything.  In fact I
don't think there is a way to call a specific method based on a variable in C++
[something like java reflect =D].

Currently, it uses numerical ids for performance issues.  So you get read(1) for
variable X, read(2) for variable Y etc etc.  This way there is no longer the
need to construct strings and perform any string matching.