diff options
author | Maria Matejka <mq@ucw.cz> | 2022-03-19 16:23:42 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-05-04 15:39:19 +0200 |
commit | 17f91f9e6e70f7e3f29502e854823c0d48571eaa (patch) | |
tree | fab70e2115ce8d4e070382368df3eff4f3f44b97 /proto/ospf/rt.c | |
parent | 165156beeb2926472bbceca3c103aacc3f81a8cc (diff) |
Explicit definition structures of route attributes
Changes in internal API:
* Every route attribute must be defined as struct ea_class somewhere.
* Registration of route attributes known at startup must be done by
ea_register_init() from protocol build functions.
* Every attribute has now its symbol registered in a global symbol table
defined as SYM_ATTRIBUTE
* All attribute ID's are dynamically allocated.
* Attribute value custom formatting hook is defined in the ea_class.
* Attribute names are the same for display and filters, always prefixed
by protocol name.
Also added some unit testing code for filters with route attributes.
Diffstat (limited to 'proto/ospf/rt.c')
-rw-r--r-- | proto/ospf/rt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c index 5969b7c7..55bad599 100644 --- a/proto/ospf/rt.c +++ b/proto/ospf/rt.c @@ -2075,18 +2075,18 @@ again1: eattrs.l = (ea_list) {}; eattrs.a[eattrs.l.count++] = - EA_LITERAL_EMBEDDED(EA_OSPF_METRIC1, T_INT, 0, nf->n.metric1); + EA_LITERAL_EMBEDDED(&ea_ospf_metric1, 0, nf->n.metric1); if (nf->n.type == RTS_OSPF_EXT2) eattrs.a[eattrs.l.count++] = - EA_LITERAL_EMBEDDED(EA_OSPF_METRIC2, T_INT, 0, nf->n.metric2); + EA_LITERAL_EMBEDDED(&ea_ospf_metric2, 0, nf->n.metric2); if ((nf->n.type == RTS_OSPF_EXT1) || (nf->n.type == RTS_OSPF_EXT2)) eattrs.a[eattrs.l.count++] = - EA_LITERAL_EMBEDDED(EA_OSPF_TAG, T_INT, 0, nf->n.tag); + EA_LITERAL_EMBEDDED(&ea_ospf_tag, 0, nf->n.tag); eattrs.a[eattrs.l.count++] = - EA_LITERAL_EMBEDDED(EA_OSPF_ROUTER_ID, T_QUAD, 0, nf->n.rid); + EA_LITERAL_EMBEDDED(&ea_ospf_router_id, 0, nf->n.rid); a0.eattrs = &eattrs.l; |