summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-10-18 17:01:00 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-10-18 17:01:00 +0000
commitb190e65fd18284efd3361cee55aba4d8d04d55a4 (patch)
treed57e1ce0d5915b4910c41f4cdcdfa791a4179349 /usr.sbin
parentae647d82e4b6735021bcb2964503fb3fb2c76985 (diff)
spacing
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ripd/auth.c6
-rw-r--r--usr.sbin/ripd/interface.c18
-rw-r--r--usr.sbin/ripd/kroute.c4
-rw-r--r--usr.sbin/ripd/message.c24
-rw-r--r--usr.sbin/ripd/neighbor.c6
-rw-r--r--usr.sbin/ripd/parse.y18
-rw-r--r--usr.sbin/ripd/rde.c13
-rw-r--r--usr.sbin/ripd/rde.h12
-rw-r--r--usr.sbin/ripd/rde_rib.c4
-rw-r--r--usr.sbin/ripd/rip.h4
-rw-r--r--usr.sbin/ripd/ripd.c40
-rw-r--r--usr.sbin/ripd/ripd.h12
12 files changed, 81 insertions, 80 deletions
diff --git a/usr.sbin/ripd/auth.c b/usr.sbin/ripd/auth.c
index c429db7e452..ec58fbe42bf 100644
--- a/usr.sbin/ripd/auth.c
+++ b/usr.sbin/ripd/auth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth.c,v 1.7 2007/10/18 09:47:57 claudio Exp $ */
+/* $OpenBSD: auth.c,v 1.8 2007/10/18 17:00:59 deraadt Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -29,13 +29,13 @@
#include "log.h"
#include "ripe.h"
-u_int32_t auth_calc_modulator(struct auth_md *md);
+u_int32_t auth_calc_modulator(struct auth_md *md);
struct auth_md *md_list_find(struct auth_md_head *, u_int8_t);
void auth_trailer_header_gen(struct buf *);
u_int32_t auth_get_seq_num(struct auth_md*);
u_int32_t
-auth_calc_modulator(struct auth_md *md)
+auth_calc_modulator(struct auth_md *md)
{
u_int32_t r;
MD5_CTX md5ctx;
diff --git a/usr.sbin/ripd/interface.c b/usr.sbin/ripd/interface.c
index 36153e476a7..4605f911d95 100644
--- a/usr.sbin/ripd/interface.c
+++ b/usr.sbin/ripd/interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interface.c,v 1.3 2007/09/11 18:05:36 claudio Exp $ */
+/* $OpenBSD: interface.c,v 1.4 2007/10/18 17:00:59 deraadt Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -134,7 +134,7 @@ if_fsm(struct iface *iface, enum iface_event event)
struct iface *
if_find_index(u_short ifindex)
{
- struct iface *iface;
+ struct iface *iface;
LIST_FOREACH(iface, &conf->iface_list, entry) {
if (iface->ifindex == ifindex)
@@ -296,7 +296,7 @@ if_set_mcast(struct iface *iface)
int
if_set_mcast_loop(int fd)
{
- u_int8_t loop = 0;
+ u_int8_t loop = 0;
if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP,
(char *)&loop, sizeof(loop)) < 0) {
@@ -310,7 +310,7 @@ if_set_mcast_loop(int fd)
void
if_set_recvbuf(int fd)
{
- int bsize;
+ int bsize;
bsize = 65535;
while (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &bsize,
@@ -343,7 +343,7 @@ if_join_group(struct iface *iface, struct in_addr *addr)
int
if_leave_group(struct iface *iface, struct in_addr *addr)
{
- struct ip_mreq mreq;
+ struct ip_mreq mreq;
switch (iface->type) {
case IF_TYPE_POINTOPOINT:
@@ -365,10 +365,10 @@ if_leave_group(struct iface *iface, struct in_addr *addr)
struct iface *
if_new(struct kif *kif)
{
- struct sockaddr_in *sain;
- struct iface *iface;
- struct ifreq *ifr;
- int s;
+ struct sockaddr_in *sain;
+ struct iface *iface;
+ struct ifreq *ifr;
+ int s;
if ((iface = calloc(1, sizeof(*iface))) == NULL)
err(1, "if_new: calloc");
diff --git a/usr.sbin/ripd/kroute.c b/usr.sbin/ripd/kroute.c
index aab2452c4d4..a1355f2ce1a 100644
--- a/usr.sbin/ripd/kroute.c
+++ b/usr.sbin/ripd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.10 2007/10/17 20:18:11 claudio Exp $ */
+/* $OpenBSD: kroute.c,v 1.11 2007/10/18 17:00:59 deraadt Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -929,7 +929,7 @@ fetchtable(void)
break;
}
- if (rtm->rtm_flags & RTF_PROTO3) {
+ if (rtm->rtm_flags & RTF_PROTO3) {
send_rtmsg(kr_state.fd, RTM_DELETE, &kr->r);
free(kr);
} else {
diff --git a/usr.sbin/ripd/message.c b/usr.sbin/ripd/message.c
index acc50e2fd3a..b73cc6d81a0 100644
--- a/usr.sbin/ripd/message.c
+++ b/usr.sbin/ripd/message.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: message.c,v 1.7 2007/03/31 09:49:20 michele Exp $ */
+/* $OpenBSD: message.c,v 1.8 2007/10/18 17:00:59 deraadt Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -41,7 +41,7 @@ void delete_entry(struct rip_route *);
void
report_timer(int fd, short event, void *arg)
{
- struct timeval tv;
+ struct timeval tv;
ripe_imsg_compose_rde(IMSG_FULL_RESPONSE, 0, 0, NULL, 0);
@@ -54,7 +54,7 @@ report_timer(int fd, short event, void *arg)
int
start_report_timer(void)
{
- struct timeval tv;
+ struct timeval tv;
timerclear(&tv);
tv.tv_sec = KEEPALIVE + arc4random() % OFFSET;
@@ -89,7 +89,7 @@ void
clear_list(struct packet_head *r_list)
{
struct packet_entry *re;
-
+
while ((re = TAILQ_FIRST(r_list)) != NULL) {
TAILQ_REMOVE(r_list, re, entry);
delete_entry(re->rr);
@@ -115,8 +115,8 @@ send_triggered_update(struct iface *iface, struct rip_route *rr)
if (iface->passive)
return (0);
- if ((buf = buf_open(iface->mtu - sizeof(struct ip)
- - sizeof(struct udphdr))) == NULL)
+ if ((buf = buf_open(iface->mtu - sizeof(struct ip) -
+ sizeof(struct udphdr))) == NULL)
fatal("send_triggered_update");
gen_rip_hdr(buf, COMMAND_RESPONSE);
@@ -175,8 +175,8 @@ send_request(struct packet_head *r_list, struct iface *i, struct nbr *nbr)
return (0);
while (!TAILQ_EMPTY(r_list)) {
- if ((buf = buf_open(iface->mtu - sizeof(struct ip)
- - sizeof(struct udphdr))) == NULL)
+ if ((buf = buf_open(iface->mtu - sizeof(struct ip) -
+ sizeof(struct udphdr))) == NULL)
fatal("send_request");
gen_rip_hdr(buf, COMMAND_REQUEST);
@@ -220,7 +220,7 @@ send_request(struct packet_head *r_list, struct iface *i, struct nbr *nbr)
int
send_response(struct packet_head *r_list, struct iface *i, struct nbr *nbr)
{
- struct buf *buf;
+ struct buf *buf;
struct iface *iface;
struct packet_entry *entry;
struct sockaddr_in dst;
@@ -249,8 +249,8 @@ send_response(struct packet_head *r_list, struct iface *i, struct nbr *nbr)
return (0);
while (!TAILQ_EMPTY(r_list)) {
- if ((buf = buf_open(iface->mtu - sizeof(struct ip)
- - sizeof(struct udphdr))) == NULL)
+ if ((buf = buf_open(iface->mtu - sizeof(struct ip) -
+ sizeof(struct udphdr))) == NULL)
fatal("send_response");
gen_rip_hdr(buf, COMMAND_RESPONSE);
@@ -338,7 +338,7 @@ recv_request(struct iface *i, struct nbr *nbr, char *buf, u_int16_t len)
l -= RIP_ENTRY_LEN;
- /*
+ /*
* If there is exactly one entry in the request, and it has
* an address family identifier of zero and a metric of
* infinity (i.e., 16), then this is a request to send the
diff --git a/usr.sbin/ripd/neighbor.c b/usr.sbin/ripd/neighbor.c
index 9ceb8709eaf..0be04473890 100644
--- a/usr.sbin/ripd/neighbor.c
+++ b/usr.sbin/ripd/neighbor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: neighbor.c,v 1.7 2007/03/27 20:19:04 michele Exp $ */
+/* $OpenBSD: neighbor.c,v 1.8 2007/10/18 17:00:59 deraadt Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -154,7 +154,7 @@ nbr_fsm(struct nbr *nbr, enum nbr_event event)
void
nbr_init(u_int32_t hashsize)
{
- u_int32_t hs, i;
+ u_int32_t hs, i;
for (hs = 1; hs < hashsize; hs <<= 1)
;
@@ -274,7 +274,7 @@ nbr_failed_new(struct nbr *nbr)
iface = nbr->iface;
timerclear(&tv);
- tv.tv_sec = FAILED_NBR_TIMEOUT;
+ tv.tv_sec = FAILED_NBR_TIMEOUT;
evtimer_set(&nbr_failed->timeout_timer, nbr_failed_timeout,
nbr_failed);
diff --git a/usr.sbin/ripd/parse.y b/usr.sbin/ripd/parse.y
index 651c65e374b..a8fc49dc955 100644
--- a/usr.sbin/ripd/parse.y
+++ b/usr.sbin/ripd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.13 2007/10/18 09:47:57 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.14 2007/10/18 17:00:59 deraadt Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -102,16 +102,16 @@ typedef struct {
%}
-%token SPLIT_HORIZON TRIGGERED_UPDATES FIBUPDATE REDISTRIBUTE
+%token SPLIT_HORIZON TRIGGERED_UPDATES FIBUPDATE REDISTRIBUTE
%token AUTHKEY AUTHTYPE AUTHMD AUTHMDKEYID
-%token INTERFACE RTLABEL
+%token INTERFACE RTLABEL
%token COST PASSIVE
%token YES NO
-%token ERROR
-%token <v.string> STRING
-%token <v.number> NUMBER
-%type <v.number> yesno no
-%type <v.string> string
+%token ERROR
+%token <v.string> STRING
+%token <v.number> NUMBER
+%type <v.number> yesno no
+%type <v.string> string
%%
@@ -156,7 +156,7 @@ varset : STRING '=' string {
conf_main : SPLIT_HORIZON STRING {
/* clean flags first */
conf->options &= ~(OPT_SPLIT_HORIZON |
- OPT_SPLIT_POISONED);
+ OPT_SPLIT_POISONED);
if (!strcmp($2, "none"))
/* nothing */ ;
else if (!strcmp($2, "default"))
diff --git a/usr.sbin/ripd/rde.c b/usr.sbin/ripd/rde.c
index 408bc97731e..b7152bf7ec1 100644
--- a/usr.sbin/ripd/rde.c
+++ b/usr.sbin/ripd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.6 2007/04/09 20:45:52 michele Exp $ */
+/* $OpenBSD: rde.c,v 1.7 2007/10/18 17:00:59 deraadt Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -221,8 +221,9 @@ rde_dispatch_imsg(int fd, short event, void *bula)
break;
case IMSG_FULL_REQUEST:
bzero(&rr, sizeof(rr));
- /* AFI == 0 && metric == INFINITY request the
- whole routing table
+ /*
+ * AFI == 0 && metric == INFINITY request the
+ * whole routing table
*/
rr.metric = INFINITY;
rde_imsg_compose_ripe(IMSG_REQUEST_ADD, 0,
@@ -351,7 +352,7 @@ rde_dispatch_parent(int fd, short event, void *bula)
void
rde_send_change_kroute(struct rt_node *r)
{
- struct kroute kr;
+ struct kroute kr;
bzero(&kr, sizeof(kr));
kr.prefix.s_addr = r->prefix.s_addr;
@@ -367,7 +368,7 @@ rde_send_change_kroute(struct rt_node *r)
void
rde_send_delete_kroute(struct rt_node *r)
{
- struct kroute kr;
+ struct kroute kr;
bzero(&kr, sizeof(kr));
kr.prefix.s_addr = r->prefix.s_addr;
@@ -425,7 +426,7 @@ rde_check_route(struct rip_route *e)
rde_send_change_kroute(rn);
triggered_update(rn);
} else if (e->nexthop.s_addr == rn->nexthop.s_addr &&
- metric > rn->metric) {
+ metric > rn->metric) {
rn->metric = metric;
rde_send_change_kroute(rn);
triggered_update(rn);
diff --git a/usr.sbin/ripd/rde.h b/usr.sbin/ripd/rde.h
index 429c5a91055..13c4db63f34 100644
--- a/usr.sbin/ripd/rde.h
+++ b/usr.sbin/ripd/rde.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.h,v 1.2 2007/04/09 20:45:52 michele Exp $ */
+/* $OpenBSD: rde.h,v 1.3 2007/10/18 17:00:59 deraadt Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -28,12 +28,12 @@
#include <limits.h>
struct rt_node {
- RB_ENTRY(rt_node) entry;
+ RB_ENTRY(rt_node) entry;
struct event timeout_timer;
struct event garbage_timer;
- struct in_addr prefix;
+ struct in_addr prefix;
struct in_addr netmask;
- struct in_addr nexthop;
+ struct in_addr nexthop;
u_short ifindex;
u_int16_t flags;
u_int8_t metric;
@@ -43,7 +43,7 @@ struct rt_node {
pid_t rde(struct ripd_conf *, int [2], int [2], int [2]);
void rde_send_change_kroute(struct rt_node *);
void rde_send_delete_kroute(struct rt_node *);
-int rde_imsg_compose_ripe(int, u_int32_t, pid_t, void *,
+int rde_imsg_compose_ripe(int, u_int32_t, pid_t, void *,
u_int16_t);
/* rde_rib.c */
@@ -56,7 +56,7 @@ int rt_insert(struct rt_node *);
int rt_remove(struct rt_node *);
void rt_complete(struct rip_route *);
void rt_snap(u_int32_t);
-void rt_clear(void);
+void rt_clear(void);
void route_reset_timers(struct rt_node *);
int route_start_timeout(struct rt_node *);
void route_start_garbage(struct rt_node *);
diff --git a/usr.sbin/ripd/rde_rib.c b/usr.sbin/ripd/rde_rib.c
index ce10a480f73..47a79920249 100644
--- a/usr.sbin/ripd/rde_rib.c
+++ b/usr.sbin/ripd/rde_rib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_rib.c,v 1.2 2007/04/09 20:45:52 michele Exp $ */
+/* $OpenBSD: rde_rib.c,v 1.3 2007/10/18 17:00:59 deraadt Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -265,7 +265,7 @@ rt_complete(struct rip_route *rr)
void
rt_clear(void)
{
- struct rt_node *r;
+ struct rt_node *r;
while ((r = RB_MIN(rt_tree, &rt)) != NULL)
rt_remove(r);
diff --git a/usr.sbin/ripd/rip.h b/usr.sbin/ripd/rip.h
index 2eea491fa2b..8a90a9ccdf0 100644
--- a/usr.sbin/ripd/rip.h
+++ b/usr.sbin/ripd/rip.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rip.h,v 1.3 2007/01/23 21:10:10 michele Exp $ */
+/* $OpenBSD: rip.h,v 1.4 2007/10/18 17:00:59 deraadt Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -63,7 +63,7 @@ struct rip_entry {
};
/* auth */
-#define AUTH 0xFFFF
+#define AUTH 0xFFFF
#define AUTH_TRLR_HDR_LEN 4
/* auth general struct */
diff --git a/usr.sbin/ripd/ripd.c b/usr.sbin/ripd/ripd.c
index 0ff9f2b4741..60b5c7cf5be 100644
--- a/usr.sbin/ripd/ripd.c
+++ b/usr.sbin/ripd/ripd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ripd.c,v 1.4 2007/10/13 16:35:22 deraadt Exp $ */
+/* $OpenBSD: ripd.c,v 1.5 2007/10/18 17:00:59 deraadt Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -48,17 +48,17 @@
#include "control.h"
#include "rde.h"
-__dead void usage(void);
-int check_child(pid_t, const char *);
-void main_sig_handler(int, short, void *);
-void ripd_shutdown(void);
-void main_dispatch_ripe(int, short, void *);
-void main_dispatch_rde(int, short, void *);
-void ripd_redistribute_default(int);
+__dead void usage(void);
+int check_child(pid_t, const char *);
+void main_sig_handler(int, short, void *);
+void ripd_shutdown(void);
+void main_dispatch_ripe(int, short, void *);
+void main_dispatch_rde(int, short, void *);
+void ripd_redistribute_default(int);
-int pipe_parent2ripe[2];
-int pipe_parent2rde[2];
-int pipe_ripe2rde[2];
+int pipe_parent2ripe[2];
+int pipe_parent2rde[2];
+int pipe_ripe2rde[2];
struct ripd_conf *conf = NULL;
struct imsgbuf *ibuf_ripe;
@@ -179,7 +179,7 @@ main(int argc, char *argv[])
exit(0);
}
- /* check for root privileges */
+ /* check for root privileges */
if (geteuid())
errx(1, "need root privileges");
@@ -323,15 +323,15 @@ check_child(pid_t pid, const char *pname)
void
main_dispatch_ripe(int fd, short event, void *bula)
{
- struct imsgbuf *ibuf = bula;
- struct imsg imsg;
- ssize_t n;
+ struct imsgbuf *ibuf = bula;
+ struct imsg imsg;
+ ssize_t n;
switch (event) {
case EV_READ:
if ((n = imsg_read(ibuf)) == -1)
fatal("imsg_read error");
- if (n == 0) /* connection closed */
+ if (n == 0) /* connection closed */
fatalx("pipe closed");
break;
case EV_WRITE:
@@ -386,15 +386,15 @@ main_dispatch_ripe(int fd, short event, void *bula)
void
main_dispatch_rde(int fd, short event, void *bula)
{
- struct imsgbuf *ibuf = bula;
- struct imsg imsg;
- ssize_t n;
+ struct imsgbuf *ibuf = bula;
+ struct imsg imsg;
+ ssize_t n;
switch (event) {
case EV_READ:
if ((n = imsg_read(ibuf)) == -1)
fatal("imsg_read error");
- if (n == 0) /* connection closed */
+ if (n == 0) /* connection closed */
fatalx("pipe closed");
break;
case EV_WRITE:
diff --git a/usr.sbin/ripd/ripd.h b/usr.sbin/ripd/ripd.h
index 8571010c28c..2aee1756c23 100644
--- a/usr.sbin/ripd/ripd.h
+++ b/usr.sbin/ripd/ripd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ripd.h,v 1.8 2007/10/18 09:47:57 claudio Exp $ */
+/* $OpenBSD: ripd.h,v 1.9 2007/10/18 17:00:59 deraadt Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -202,13 +202,13 @@ TAILQ_HEAD(packet_head, packet_entry);
struct iface {
LIST_ENTRY(iface) entry;
- LIST_HEAD(, nbr) nbr_list;
+ LIST_HEAD(, nbr) nbr_list;
LIST_HEAD(, nbr_failed) failed_nbr_list;
- char name[IF_NAMESIZE];
+ char name[IF_NAMESIZE];
u_int8_t auth_key[MAX_SIMPLE_AUTH_LEN];
- struct in_addr addr;
- struct in_addr dst;
- struct in_addr mask;
+ struct in_addr addr;
+ struct in_addr dst;
+ struct in_addr mask;
struct packet_head rq_list;
struct packet_head rp_list;
struct auth_md_head auth_md_list;