]> git.puffer.fish Git - mirror/frr.git/commitdiff
[zebra] arrange structs in padding-efficient manner and remove unused field
authorPaul Jakma <paul.jakma@sun.com>
Thu, 30 Mar 2006 13:32:09 +0000 (13:32 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Thu, 30 Mar 2006 13:32:09 +0000 (13:32 +0000)
2006-02-09 Paul Jakma <paul.jakma@sun.com>

* rib.h: (struct {rib,nexthop}) Rearrange fields to avoid
  needless padding.
  (struct rib) Remove the indirect pointer, not used anywhere!

zebra/ChangeLog
zebra/rib.h

index 3295be8319d2c273636767942963932575528f0b..06290010c02591c0f710c57b4a173b8ff6aed11a 100644 (file)
@@ -1,3 +1,9 @@
+2006-02-09 Paul Jakma <paul.jakma@sun.com>
+
+       * rib.h: (struct {rib,nexthop}) Rearrange fields to avoid
+         needless padding. 
+         (struct rib) Remove the indirect pointer, not used anywhere!
+
 2006-02-02 Paul Jakma <paul.jakma@sun.com>
 
        * interface.c: (if_dump_vty) move flags to their line, neater.
index a1a9e1dbc4fc1aae185b3f3a440162b17b8ce374..3827b6e78e2ae62453ad84d6bbb08569293d19bc 100644 (file)
@@ -33,16 +33,28 @@ struct rib
   /* Link list. */
   struct rib *next;
   struct rib *prev;
+  
+  /* Nexthop structure */
+  struct nexthop *nexthop;
+  
+  /* Refrence count. */
+  unsigned long refcnt;
+  
+  /* Uptime. */
+  time_t uptime;
 
   /* ref count */
   unsigned int lock;
-  
+
   /* Type fo this route. */
   int type;
 
   /* Which routing table */
   int table;                   
 
+  /* Metric */
+  u_int32_t metric;
+
   /* Distance. */
   u_char distance;
 
@@ -50,21 +62,10 @@ struct rib
      ZEBRA_FLAG_* */
   u_char flags;
 
-  /* Metric */
-  u_int32_t metric;
-
-  /* Uptime. */
-  time_t uptime;
-
-  /* Refrence count. */
-  unsigned long refcnt;
-
   /* Nexthop information. */
   u_char nexthop_num;
   u_char nexthop_active_num;
   u_char nexthop_fib_num;
-
-  struct nexthop *nexthop;
 };
 
 /* Static route information. */
@@ -147,6 +148,10 @@ struct nexthop
   struct nexthop *next;
   struct nexthop *prev;
 
+  /* Interface index. */
+  char *ifname;
+  unsigned int ifindex;
+  
   enum nexthop_types_t type;
 
   u_char flags;
@@ -154,10 +159,6 @@ struct nexthop
 #define NEXTHOP_FLAG_FIB        (1 << 1) /* FIB nexthop. */
 #define NEXTHOP_FLAG_RECURSIVE  (1 << 2) /* Recursive nexthop. */
 
-  /* Interface index. */
-  unsigned int ifindex;
-  char *ifname;
-
   /* Nexthop address or interface name. */
   union
   {
@@ -177,8 +178,6 @@ struct nexthop
     struct in6_addr ipv6;
 #endif /* HAVE_IPV6 */
   } rgate;
-
-  struct nexthop *indirect;
 };
 
 /* Routing table instance.  */