]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Added more convient interface for ea_find.
authorPavel Machek <pavel@ucw.cz>
Wed, 10 May 2000 06:54:40 +0000 (06:54 +0000)
committerPavel Machek <pavel@ucw.cz>
Wed, 10 May 2000 06:54:40 +0000 (06:54 +0000)
What is special about int default;? Compiler chokes on that!

nest/route.h
nest/rt-attr.c

index d15ffae682a35c10712dc0cbafa1964765e2d5bd..523d3905bd87a83c7e8ca29cbc871143b7ad2e3a 100644 (file)
@@ -324,6 +324,7 @@ typedef struct ea_list {
 #define EALF_CACHED 4                  /* Attributes belonging to cached rta */
 
 eattr *ea_find(ea_list *, unsigned ea);
+int ea_get_int(ea_list *, unsigned ea, int def);
 void ea_dump(ea_list *);
 void ea_sort(ea_list *);               /* Sort entries in all sub-lists */
 unsigned ea_scan(ea_list *);           /* How many bytes do we need for merged ea_list */
index d2e5ae914bb1d23095162336c3adb1a5224b4dda..53e85a6a571ea4f5080fefafdbcb0a27f3e54344 100644 (file)
@@ -70,6 +70,15 @@ ea_find(ea_list *e, unsigned id)
   return a;
 }
 
+int
+ea_get_int(ea_list *e, unsigned id, int def)
+{
+  eattr *a = ea_find(e, id);
+  if (!a)
+    return def;
+  return a->u.data;
+}
+
 static inline void
 ea_do_sort(ea_list *e)
 {