diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2011-07-03 06:24:14 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2011-07-03 06:24:14 +0000 |
commit | 1e60d459a5a427c88c2bed73d3bc7ea23a3618cf (patch) | |
tree | a5a8a3ecab517a6642c11edd25891a761d05c59b /sys/netinet | |
parent | 0ea1c1dbec66b254acf093fab88c0144c84a16d5 (diff) |
slight knf (particularly the function decls) so i dont get too distracted
while reading.
ok henning@ jsing@ tedu@ marco@ bluhm@ krw@
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/in.c | 57 |
1 files changed, 17 insertions, 40 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 17f19a5dbfe..5ac859edea9 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in.c,v 1.66 2011/07/02 04:37:04 dlg Exp $ */ +/* $OpenBSD: in.c,v 1.67 2011/07/03 06:24:13 dlg Exp $ */ /* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */ /* @@ -117,8 +117,7 @@ in_localaddr(struct in_addr in, u_int rdomain) * may be forwarded. */ int -in_canforward(in) - struct in_addr in; +in_canforward(struct in_addr in) { u_int32_t net; @@ -126,7 +125,8 @@ in_canforward(in) return (0); if (IN_CLASSA(in.s_addr)) { net = in.s_addr & IN_CLASSA_NET; - if (net == 0 || net == htonl(IN_LOOPBACKNET << IN_CLASSA_NSHIFT)) + if (net == 0 || + net == htonl(IN_LOOPBACKNET << IN_CLASSA_NSHIFT)) return (0); } return (1); @@ -136,8 +136,7 @@ in_canforward(in) * Trim a mask in a sockaddr */ void -in_socktrim(ap) - struct sockaddr_in *ap; +in_socktrim(struct sockaddr_in *ap) { char *cplim = (char *) &ap->sin_addr; char *cp = (char *) (&ap->sin_addr + 1); @@ -151,8 +150,7 @@ in_socktrim(ap) } int -in_mask2len(mask) - struct in_addr *mask; +in_mask2len(struct in_addr *mask) { int x, y; u_char *p; @@ -173,9 +171,7 @@ in_mask2len(mask) } void -in_len2mask(mask, len) - struct in_addr *mask; - int len; +in_len2mask(struct in_addr *mask, int len) { int i; u_char *p; @@ -194,11 +190,7 @@ in_len2mask(mask, len) */ /* ARGSUSED */ int -in_control(so, cmd, data, ifp) - struct socket *so; - u_long cmd; - caddr_t data; - struct ifnet *ifp; +in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) { struct ifreq *ifr = (struct ifreq *)data; struct in_ifaddr *ia = 0; @@ -474,11 +466,8 @@ cleanup: * other values may be returned from in_ioctl() */ int -in_lifaddr_ioctl(so, cmd, data, ifp) - struct socket *so; - u_long cmd; - caddr_t data; - struct ifnet *ifp; +in_lifaddr_ioctl(struct socket *so, u_long cmd, caddr_t data, + struct ifnet *ifp) { struct if_laddrreq *iflr = (struct if_laddrreq *)data; struct ifaddr *ifa; @@ -645,9 +634,7 @@ in_lifaddr_ioctl(so, cmd, data, ifp) * Delete any existing route for an interface. */ void -in_ifscrub(ifp, ia) - struct ifnet *ifp; - struct in_ifaddr *ia; +in_ifscrub(struct ifnet *ifp, struct in_ifaddr *ia) { in_scrubprefix(ia); } @@ -657,12 +644,8 @@ in_ifscrub(ifp, ia) * and routing table entry. */ int -in_ifinit(ifp, ia, sin, scrub, newaddr) - struct ifnet *ifp; - struct in_ifaddr *ia; - struct sockaddr_in *sin; - int scrub; - int newaddr; +in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin, + int scrub, int newaddr) { u_int32_t i = sin->sin_addr.s_addr; struct sockaddr_in oldaddr; @@ -757,9 +740,7 @@ in_ifinit(ifp, ia, sin, scrub, newaddr) * does nothing if there's some interface address with the same prefix already. */ int -in_addprefix(target, flags) - struct in_ifaddr *target; - int flags; +in_addprefix(struct in_ifaddr *target, int flags) { struct in_ifaddr *ia; struct in_addr prefix, mask, p; @@ -821,8 +802,7 @@ in_addprefix(target, flags) * with the same prefix (otherwise we lose the route mistakenly). */ int -in_scrubprefix(target) - struct in_ifaddr *target; +in_scrubprefix(struct in_ifaddr *target) { struct in_ifaddr *ia; struct in_addr prefix, mask, p; @@ -927,9 +907,7 @@ in_broadcast(struct in_addr in, struct ifnet *ifp, u_int rtableid) * Add an address to the list of IP multicast addresses for a given interface. */ struct in_multi * -in_addmulti(ap, ifp) - struct in_addr *ap; - struct ifnet *ifp; +in_addmulti(struct in_addr *ap, struct ifnet *ifp) { struct in_multi *inm; struct ifreq ifr; @@ -995,8 +973,7 @@ in_addmulti(ap, ifp) * Delete a multicast address record. */ void -in_delmulti(inm) - struct in_multi *inm; +in_delmulti(struct in_multi *inm) { struct ifreq ifr; struct ifnet *ifp; |