summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-12-23 15:08:44 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-12-23 15:08:44 +0000
commit45dcf3deef81b749cfb074b4ad1b77c0cf7ade0f (patch)
treead64dbee9e6934605cd905ab77aeb5679452e65f /usr.sbin
parentb2bc798929dc71b79003059f2fba9254e207aea1 (diff)
sort structs for most optimal alignment, help mickey, claudio ok
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/bgpd.h102
-rw-r--r--usr.sbin/bgpd/rde.h37
-rw-r--r--usr.sbin/bgpd/session.h28
3 files changed, 82 insertions, 85 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h
index 90c4f9972ac..2d9f47114c6 100644
--- a/usr.sbin/bgpd/bgpd.h
+++ b/usr.sbin/bgpd/bgpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.h,v 1.151 2004/11/23 13:07:01 claudio Exp $ */
+/* $OpenBSD: bgpd.h,v 1.152 2004/12/23 15:08:43 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -91,9 +91,9 @@ struct buf {
};
struct msgbuf {
+ TAILQ_HEAD(bufs, buf) bufs;
u_int32_t queued;
int fd;
- TAILQ_HEAD(bufs, buf) bufs;
};
struct bgpd_addr {
@@ -127,15 +127,15 @@ struct listen_addr {
TAILQ_HEAD(listen_addrs, listen_addr);
struct bgpd_config {
+ struct listen_addrs *listen_addrs;
int opts;
- u_int16_t as;
+ int flags;
+ int log;
u_int32_t bgpid;
u_int32_t clusterid;
+ u_int16_t as;
u_int16_t holdtime;
u_int16_t min_holdtime;
- int flags;
- int log;
- struct listen_addrs *listen_addrs;
};
struct buf_read {
@@ -168,21 +168,21 @@ enum auth_method {
};
struct peer_auth {
- enum auth_method method;
char md5key[TCP_MD5_KEY_LEN];
- u_int8_t md5key_len;
+ char auth_key_in[IPSEC_AUTH_KEY_LEN];
+ char auth_key_out[IPSEC_AUTH_KEY_LEN];
+ char enc_key_in[IPSEC_ENC_KEY_LEN];
+ char enc_key_out[IPSEC_ENC_KEY_LEN];
u_int32_t spi_in;
u_int32_t spi_out;
+ enum auth_method method;
+ u_int8_t md5key_len;
u_int8_t auth_alg_in;
u_int8_t auth_alg_out;
- char auth_key_in[IPSEC_AUTH_KEY_LEN];
- char auth_key_out[IPSEC_AUTH_KEY_LEN];
u_int8_t auth_keylen_in;
u_int8_t auth_keylen_out;
u_int8_t enc_alg_in;
u_int8_t enc_alg_out;
- char enc_key_in[IPSEC_ENC_KEY_LEN];
- char enc_key_out[IPSEC_ENC_KEY_LEN];
u_int8_t enc_keylen_in;
u_int8_t enc_keylen_out;
};
@@ -196,37 +196,37 @@ struct capabilities {
SIMPLEQ_HEAD(filter_set_head, filter_set);
struct peer_config {
- u_int32_t id;
- u_int32_t groupid;
- char group[PEER_DESCR_LEN];
- char descr[PEER_DESCR_LEN];
struct bgpd_addr remote_addr;
struct bgpd_addr local_addr;
- u_int8_t template;
- u_int8_t remote_masklen;
- u_int8_t cloned;
+ struct peer_auth auth;
+ struct capabilities capabilities;
+ struct filter_set_head attrset;
+ char group[PEER_DESCR_LEN];
+ char descr[PEER_DESCR_LEN];
+ char if_depend[IFNAMSIZ];
+ u_int32_t id;
+ u_int32_t groupid;
u_int32_t max_prefix;
u_int16_t remote_as;
- u_int8_t ebgp; /* 1 = ebgp, 0 = ibgp */
- u_int8_t distance; /* 1 = direct, >1 = multihop */
- u_int8_t passive;
u_int16_t holdtime;
u_int16_t min_holdtime;
- struct filter_set_head attrset;
enum announce_type announce_type;
enum enforce_as enforce_as;
- struct peer_auth auth;
+ enum reconf_action reconf_action;
+ u_int8_t template;
+ u_int8_t remote_masklen;
+ u_int8_t cloned;
+ u_int8_t ebgp; /* 1 = ebgp, 0 = ibgp */
+ u_int8_t distance; /* 1 = direct, >1 = multihop */
+ u_int8_t passive;
u_int8_t announce_capa;
- struct capabilities capabilities;
u_int8_t reflector_client;
- char if_depend[IFNAMSIZ];
- enum reconf_action reconf_action;
};
struct network_config {
struct bgpd_addr prefix;
- u_int8_t prefixlen;
struct filter_set_head attrset;
+ u_int8_t prefixlen;
};
TAILQ_HEAD(network_head, network);
@@ -247,11 +247,11 @@ struct imsg_fd {
};
struct imsgbuf {
- int fd;
- pid_t pid;
TAILQ_HEAD(fds, imsg_fd) fds;
struct buf_read r;
struct msgbuf w;
+ int fd;
+ pid_t pid;
};
enum imsg_type {
@@ -303,10 +303,10 @@ enum imsg_type {
};
struct imsg_hdr {
- enum imsg_type type;
- u_int16_t len;
u_int32_t peerid;
pid_t pid;
+ enum imsg_type type;
+ u_int16_t len;
};
struct imsg {
@@ -355,38 +355,38 @@ enum suberr_cease {
struct kroute {
struct in_addr prefix;
- u_int8_t prefixlen;
struct in_addr nexthop;
u_int16_t flags;
+ u_int8_t prefixlen;
u_short ifindex;
};
struct kroute6 {
struct in6_addr prefix;
- u_int8_t prefixlen;
struct in6_addr nexthop;
u_int16_t flags;
+ u_int8_t prefixlen;
u_short ifindex;
};
struct kroute_nexthop {
- struct bgpd_addr nexthop;
- u_int8_t valid;
- u_int8_t connected;
- struct bgpd_addr gateway;
union {
struct kroute kr4;
struct kroute6 kr6;
} kr;
+ struct bgpd_addr nexthop;
+ struct bgpd_addr gateway;
+ u_int8_t valid;
+ u_int8_t connected;
};
struct kif {
- u_short ifindex;
- int flags;
char ifname[IFNAMSIZ];
+ u_long baudrate;
+ int flags;
+ u_short ifindex;
u_int8_t media_type;
u_int8_t link_state;
- u_long baudrate;
u_int8_t nh_reachable; /* for nexthop verification */
};
@@ -399,8 +399,8 @@ struct session_up {
};
struct pftable_msg {
- char pftable[PFTABLE_LEN];
struct bgpd_addr addr;
+ char pftable[PFTABLE_LEN];
u_int8_t len;
};
@@ -415,23 +415,23 @@ struct ctl_show_nexthop {
#define F_RIB_ANNOUNCE 0x08
struct ctl_show_rib {
+ struct bgpd_addr nexthop;
+ struct bgpd_addr prefix;
time_t lastchange;
u_int32_t local_pref;
u_int32_t med;
u_int16_t prefix_cnt;
u_int16_t active_cnt;
- struct bgpd_addr nexthop;
- struct bgpd_addr prefix;
+ u_int16_t aspath_len;
u_int8_t prefixlen;
u_int8_t origin;
u_int8_t flags;
- u_int16_t aspath_len;
/* plus a aspath_len bytes long aspath */
};
struct ctl_show_rib_prefix {
- time_t lastchange;
struct bgpd_addr prefix;
+ time_t lastchange;
u_int8_t prefixlen;
u_int8_t flags;
};
@@ -501,8 +501,8 @@ struct filter_prefix {
};
struct filter_prefixlen {
- sa_family_t af;
enum comp_ops op;
+ sa_family_t af;
u_int8_t len_min;
u_int8_t len_max;
};
@@ -523,12 +523,12 @@ TAILQ_HEAD(filter_head, filter_rule);
struct filter_rule {
TAILQ_ENTRY(filter_rule) entry;
- enum filter_actions action;
- enum directions dir;
- u_int8_t quick;
struct filter_peers peer;
struct filter_match match;
struct filter_set_head set;
+ enum filter_actions action;
+ enum directions dir;
+ u_int8_t quick;
};
enum action_types {
@@ -546,7 +546,6 @@ enum action_types {
struct filter_set {
SIMPLEQ_ENTRY(filter_set) entry;
- enum action_types type;
union {
u_int8_t prepend;
u_int32_t metric;
@@ -554,6 +553,7 @@ struct filter_set {
struct filter_community community;
char pftable[PFTABLE_LEN];
} action;
+ enum action_types type;
};
struct rrefresh {
diff --git a/usr.sbin/bgpd/rde.h b/usr.sbin/bgpd/rde.h
index 5d5c8470660..827e8c7966e 100644
--- a/usr.sbin/bgpd/rde.h
+++ b/usr.sbin/bgpd/rde.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.h,v 1.61 2004/11/23 13:07:01 claudio Exp $ */
+/* $OpenBSD: rde.h,v 1.62 2004/12/23 15:08:43 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> and
@@ -50,22 +50,22 @@ struct rde_peer {
LIST_ENTRY(rde_peer) peer_l; /* list of all peers */
struct aspath_head path_h; /* list of all as paths */
struct peer_config conf;
- enum peer_state state;
- u_int32_t prefix_cnt;
- u_int32_t remote_bgpid;
struct bgpd_addr remote_addr;
struct bgpd_addr local_v4_addr;
struct bgpd_addr local_v6_addr;
- u_int32_t up_pcnt;
- u_int32_t up_acnt;
- u_int32_t up_nlricnt;
- u_int32_t up_wcnt;
struct uptree_prefix up_prefix;
struct uptree_attr up_attrs;
struct uplist_attr updates;
struct uplist_prefix withdraws;
struct uplist_attr updates6;
struct uplist_prefix withdraws6;
+ u_int32_t prefix_cnt;
+ u_int32_t remote_bgpid;
+ u_int32_t up_pcnt;
+ u_int32_t up_acnt;
+ u_int32_t up_nlricnt;
+ u_int32_t up_wcnt;
+ enum peer_state state;
};
#define AS_SET 1
@@ -109,16 +109,16 @@ enum attrtypes {
struct attr {
TAILQ_ENTRY(attr) entry;
+ u_char *data;
+ u_int16_t len;
u_int8_t flags;
u_int8_t type;
- u_int16_t len;
- u_char *data;
};
struct mpattr {
void *reach;
- u_int16_t reach_len;
void *unreach;
+ u_int16_t reach_len;
u_int16_t unreach_len;
};
@@ -153,20 +153,17 @@ LIST_HEAD(prefix_head, prefix);
struct rde_aspath {
LIST_ENTRY(rde_aspath) path_l, peer_l, nexthop_l;
struct prefix_head prefix_h;
+ struct attr_list others;
struct rde_peer *peer;
-
- /* path attributes */
struct aspath *aspath;
struct nexthop *nexthop; /* may be NULL */
- struct attr_list others;
+ char pftable[PFTABLE_LEN];
u_int32_t med; /* multi exit disc */
u_int32_t lpref; /* local pref */
- u_int8_t origin;
-
u_int16_t flags; /* internally used */
u_int16_t prefix_cnt; /* # of prefixes */
u_int16_t active_cnt; /* # of active prefixes */
- char pftable[PFTABLE_LEN];
+ u_int8_t origin;
};
enum nexthop_state {
@@ -178,6 +175,9 @@ enum nexthop_state {
struct nexthop {
LIST_ENTRY(nexthop) nexthop_l;
struct aspath_head path_h;
+ struct bgpd_addr exit_nexthop;
+ struct bgpd_addr true_nexthop;
+ struct bgpd_addr nexthop_net;
#if 0
/*
* currently we use the boolean nexthop state, this could be exchanged
@@ -186,9 +186,6 @@ struct nexthop {
u_int32_t costs;
#endif
enum nexthop_state state;
- struct bgpd_addr exit_nexthop;
- struct bgpd_addr true_nexthop;
- struct bgpd_addr nexthop_net;
u_int8_t nexthop_netlen;
u_int8_t flags;
#define NEXTHOP_CONNECTED 0x01
diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h
index c8183fbb892..9488f495af0 100644
--- a/usr.sbin/bgpd/session.h
+++ b/usr.sbin/bgpd/session.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.h,v 1.72 2004/11/18 17:07:38 henning Exp $ */
+/* $OpenBSD: session.h,v 1.73 2004/12/23 15:08:43 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -111,10 +111,10 @@ struct msg_header {
struct msg_open {
struct msg_header header;
- u_int8_t version;
+ u_int32_t bgpid;
u_int16_t myas;
u_int16_t holdtime;
- u_int32_t bgpid;
+ u_int8_t version;
u_int8_t optparamlen;
};
@@ -153,25 +153,25 @@ struct peer {
struct capabilities ann;
struct capabilities peer;
} capa;
- u_int32_t remote_bgpid;
- u_int16_t holdtime;
- enum session_state state;
- enum session_state prev_state;
+ struct sockaddr_storage sa_local;
+ struct sockaddr_storage sa_remote;
+ struct msgbuf wbuf;
+ struct buf_read *rbuf;
+ struct peer *next;
time_t ConnectRetryTimer;
time_t KeepaliveTimer;
time_t HoldTimer;
time_t IdleHoldTimer;
time_t IdleHoldResetTimer;
- u_int IdleHoldTime;
int fd;
- struct sockaddr_storage sa_local;
- struct sockaddr_storage sa_remote;
- struct msgbuf wbuf;
- struct buf_read *rbuf;
+ int lasterr;
+ u_int IdleHoldTime;
+ u_int32_t remote_bgpid;
+ enum session_state state;
+ enum session_state prev_state;
+ u_int16_t holdtime;
u_int8_t auth_established;
u_int8_t depend_ok;
- int lasterr;
- struct peer *next;
};
struct peer *peers;