summaryrefslogtreecommitdiff
path: root/zebra/rib.h
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2006-03-30 13:32:09 +0000
committerPaul Jakma <paul.jakma@sun.com>2006-03-30 13:32:09 +0000
commite6d7d054d9b787c597319ec528ea8f64a7f949f6 (patch)
treeb03a71897e0baa854dd8db04841ba70143bd6f01 /zebra/rib.h
parent924f9d32d9c42d6861f19bae795c48b48c83af23 (diff)
[zebra] arrange structs in padding-efficient manner and remove unused field
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!
Diffstat (limited to 'zebra/rib.h')
-rw-r--r--zebra/rib.h35
1 files changed, 17 insertions, 18 deletions
diff --git a/zebra/rib.h b/zebra/rib.h
index a1a9e1db..3827b6e7 100644
--- a/zebra/rib.h
+++ b/zebra/rib.h
@@ -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. */