From 3991d84e8fa9118a43149d4d3304726eb786bd46 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 1 Apr 2000 10:19:47 +0000 Subject: Changed initialization of protocol list -- now we call proto_build() instead of calling the protocols manually. Implemented printing of dynamic attributes in `show route all'. Each protocol can now register its own attribute class (protocol->attr_class, set to EAP_xxx) and also a callback for naming and formatting of attributes. The callback can return one of the following results: GA_UNKNOWN Attribute not recognized. GA_NAME Attribute name recognized and put to the buffer, generic code should format the value. GA_FULL Both attribute name and value put to the buffer. Please update protocols generating dynamic attributes to provide the attr_class and formatting hook. --- nest/route.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'nest/route.h') diff --git a/nest/route.h b/nest/route.h index f180d5e..96ee580 100644 --- a/nest/route.h +++ b/nest/route.h @@ -283,6 +283,7 @@ typedef struct eattr { #define EAP_GENERIC 0 /* Generic attributes */ #define EAP_BGP 1 /* BGP attributes */ #define EAP_RIP 2 /* RIP */ +#define EAP_MAX 3 #define EA_CODE(proto,id) (((proto) << 8) | (id)) #define EA_PROTO(ea) ((ea) >> 8) @@ -336,6 +337,8 @@ void rta_dump_all(void); static inline eattr * rta_find(rta *a, unsigned ea) { return ea_find(a->eattrs, ea); } void rta_show(struct cli *, rta *); +extern struct protocol *attr_class_to_protocol[EAP_MAX]; + /* * Default protocol preferences */ -- cgit v1.2.3