diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-05-06 20:29:05 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-05-06 20:29:05 +0000 |
commit | 4f937ab6a47b65def7997fcb4e0124b0007ccb67 (patch) | |
tree | 5916f169437a1ca056a9ff36dc34b9084c2605c1 /usr.sbin/pppoe/client.c | |
parent | 27319b38759f64153abc447f73a3032f41f57f27 (diff) |
knf and other cleanups
Diffstat (limited to 'usr.sbin/pppoe/client.c')
-rw-r--r-- | usr.sbin/pppoe/client.c | 67 |
1 files changed, 20 insertions, 47 deletions
diff --git a/usr.sbin/pppoe/client.c b/usr.sbin/pppoe/client.c index 78bb91a8e51..99442e649fd 100644 --- a/usr.sbin/pppoe/client.c +++ b/usr.sbin/pppoe/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.17 2003/06/04 04:46:13 jason Exp $ */ +/* $OpenBSD: client.c,v 1.18 2004/05/06 20:29:03 deraadt Exp $ */ /* * Copyright (c) 2000 Network Security Technologies, Inc. http://www.netsec.net @@ -77,10 +77,7 @@ int timer_clr(void); int timer_hit(void); int -client_mode(bfd, sysname, srvname, myea) - int bfd; - u_int8_t *sysname, *srvname; - struct ether_addr *myea; +client_mode(int bfd, u_int8_t *sysname, u_int8_t *srvname, struct ether_addr *myea) { struct ether_addr rmea; fd_set *fdsp = NULL; @@ -151,10 +148,7 @@ client_mode(bfd, sysname, srvname, myea) } static int -send_padi(fd, ea, srv) - int fd; - struct ether_addr *ea; - u_int8_t *srv; +send_padi(int fd, struct ether_addr *ea, u_int8_t *srv) { struct iovec iov[10]; struct pppoe_header ph = { @@ -210,13 +204,9 @@ send_padi(fd, ea, srv) } static int -send_padr(bfd, srv, myea, rmea, eh, ph, tl) - int bfd; - u_int8_t *srv; - struct ether_addr *myea, *rmea; - struct ether_header *eh; - struct pppoe_header *ph; - struct tag_list *tl; +send_padr(int bfd, u_int8_t *srv, struct ether_addr *myea, + struct ether_addr *rmea, struct ether_header *eh, + struct pppoe_header *ph, struct tag_list *tl) { struct iovec iov[12]; u_int16_t etype = htons(ETHERTYPE_PPPOEDISC); @@ -291,10 +281,8 @@ send_padr(bfd, srv, myea, rmea, eh, ph, tl) } static int -getpackets(bfd, srv, sysname, myea, rmea) - int bfd; - u_int8_t *srv, *sysname; - struct ether_addr *myea, *rmea; +getpackets(int bfd, u_int8_t *srv, u_int8_t *sysname, + struct ether_addr *myea, struct ether_addr *rmea) { static u_int8_t *pktbuf; u_int8_t *mpkt, *pkt, *epkt; @@ -391,14 +379,9 @@ next: static int -recv_pado(bfd, srv, myea, rmea, eh, ph, len, pkt) - int bfd; - u_int8_t *srv; - struct ether_addr *myea, *rmea; - struct ether_header *eh; - struct pppoe_header *ph; - u_long len; - u_int8_t *pkt; +recv_pado(int bfd, u_int8_t *srv, struct ether_addr *myea, + struct ether_addr *rmea, struct ether_header *eh, + struct pppoe_header *ph, u_long len, u_int8_t *pkt) { struct tag_list tl; struct tag_node *n; @@ -455,14 +438,10 @@ out: } static int -recv_pads(bfd, srv, sysname, myea, rmea, eh, ph, len, pkt) - int bfd; - u_int8_t *srv, *sysname; - struct ether_addr *myea, *rmea; - struct ether_header *eh; - struct pppoe_header *ph; - u_long len; - u_int8_t *pkt; +recv_pads(int bfd, u_int8_t *srv, u_int8_t *sysname, + struct ether_addr *myea, struct ether_addr *rmea, + struct ether_header *eh, struct pppoe_header *ph, + u_long len, u_int8_t *pkt) { struct tag_node *n; struct tag_list tl; @@ -510,13 +489,9 @@ out: } static int -recv_padt(bfd, myea, rmea, eh, ph, len, pkt) - int bfd; - struct ether_addr *myea, *rmea; - struct ether_header *eh; - struct pppoe_header *ph; - u_long len; - u_int8_t *pkt; +recv_padt(int bfd, struct ether_addr *myea, struct ether_addr *rmea, + struct ether_header *eh, struct pppoe_header *ph, + u_long len, u_int8_t *pkt) { if (bcmp(&eh->ether_shost[0], rmea, ETHER_ADDR_LEN)) return (0); @@ -531,15 +506,13 @@ volatile sig_atomic_t timer_alarm; static struct sigaction timer_oact; void -timer_handler(sig) - int sig; +timer_handler(int sig) { timer_alarm = 1; } int -timer_set(sec) - u_int sec; +timer_set(u_int sec) { struct sigaction act; struct itimerval it; |