From e6d7d054d9b787c597319ec528ea8f64a7f949f6 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Thu, 30 Mar 2006 13:32:09 +0000 Subject: [zebra] arrange structs in padding-efficient manner and remove unused field 2006-02-09 Paul Jakma * rib.h: (struct {rib,nexthop}) Rearrange fields to avoid needless padding. (struct rib) Remove the indirect pointer, not used anywhere! --- zebra/rib.h | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'zebra/rib.h') 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. */ -- cgit v1.2.1