summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2010-02-08 12:04:35 +0000
committerjsing <jsing@openbsd.org>2010-02-08 12:04:35 +0000
commit525dbc5a13519f398f6b2929f9cc902b205ab818 (patch)
tree804ab181e291a9cea937e8ef051dbf5cebd69005
parentDestatic and ansify. (diff)
downloadwireguard-openbsd-525dbc5a13519f398f6b2929f9cc902b205ab818.tar.xz
wireguard-openbsd-525dbc5a13519f398f6b2929f9cc902b205ab818.zip
More destatic and ansification.
ok claudio@ naddy@
-rw-r--r--sys/netinet6/in6.c39
-rw-r--r--sys/netinet6/in6_ifattach.c20
-rw-r--r--sys/netinet6/in6_src.c54
3 files changed, 48 insertions, 65 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 5c0eb087d1f..6fc39b55ddc 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.c,v 1.85 2010/01/13 02:13:12 henning Exp $ */
+/* $OpenBSD: in6.c,v 1.86 2010/02/08 12:04:35 jsing Exp $ */
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
/*
@@ -113,13 +113,15 @@ const struct in6_addr in6mask64 = IN6MASK64;
const struct in6_addr in6mask96 = IN6MASK96;
const struct in6_addr in6mask128 = IN6MASK128;
-static int in6_lifaddr_ioctl(struct socket *, u_long, caddr_t,
- struct ifnet *, struct proc *);
-static int in6_ifinit(struct ifnet *, struct in6_ifaddr *, int);
-static void in6_unlink_ifa(struct in6_ifaddr *, struct ifnet *);
+int in6_lifaddr_ioctl(struct socket *, u_long, caddr_t, struct ifnet *,
+ struct proc *);
+int in6_ifinit(struct ifnet *, struct in6_ifaddr *, int);
+void in6_unlink_ifa(struct in6_ifaddr *, struct ifnet *);
+void in6_ifloop_request(int, struct ifaddr *);
-const struct sockaddr_in6 sa6_any = {sizeof(sa6_any), AF_INET6,
- 0, 0, IN6ADDR_ANY_INIT, 0};
+const struct sockaddr_in6 sa6_any = {
+ sizeof(sa6_any), AF_INET6, 0, 0, IN6ADDR_ANY_INIT, 0
+};
/*
* This structure is used to keep track of in6_multi chains which belong to
@@ -137,7 +139,7 @@ struct multi6_kludge {
* Subroutine for in6_ifaddloop() and in6_ifremloop().
* This routine does actual work.
*/
-static void
+void
in6_ifloop_request(int cmd, struct ifaddr *ifa)
{
struct rt_addrinfo info;
@@ -324,8 +326,8 @@ in6_mask2len(struct in6_addr *mask, u_char *lim0)
#define ia62ifa(ia6) (&((ia6)->ia_ifa))
int
-in6_control(struct socket *so, u_long cmd, caddr_t data,
- struct ifnet *ifp, struct proc *p)
+in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
+ struct proc *p)
{
struct in6_ifreq *ifr = (struct in6_ifreq *)data;
struct in6_ifaddr *ia = NULL;
@@ -770,8 +772,8 @@ in6_control(struct socket *so, u_long cmd, caddr_t data,
* This function is separated from in6_control().
*/
int
-in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
- struct in6_ifaddr *ia)
+in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
+ struct in6_ifaddr *ia)
{
int error = 0, hostIsNew = 0, plen = -1;
struct in6_ifaddr *oia;
@@ -1270,7 +1272,7 @@ in6_purgeaddr(struct ifaddr *ifa)
in6_unlink_ifa(ia, ifp);
}
-static void
+void
in6_unlink_ifa(struct in6_ifaddr *ia, struct ifnet *ifp)
{
struct in6_ifaddr *oia;
@@ -1363,9 +1365,9 @@ in6_purgeif(struct ifnet *ifp)
* RFC2373 defines interface id to be 64bit, but it allows non-RFC2374
* address encoding scheme. (see figure on page 8)
*/
-static int
+int
in6_lifaddr_ioctl(struct socket *so, u_long cmd, caddr_t data,
- struct ifnet *ifp, struct proc *p)
+ struct ifnet *ifp, struct proc *p)
{
struct if_laddrreq *iflr = (struct if_laddrreq *)data;
struct ifaddr *ifa;
@@ -1580,7 +1582,7 @@ in6_lifaddr_ioctl(struct socket *so, u_long cmd, caddr_t data,
* Initialize an interface's intetnet6 address
* and routing table entry.
*/
-static int
+int
in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia, int newhost)
{
int error = 0, plen, ifacount = 0;
@@ -1894,8 +1896,7 @@ in6_joingroup(struct ifnet *ifp, struct in6_addr *addr, int *errorp)
}
int
-in6_leavegroup(imm)
- struct in6_multi_mship *imm;
+in6_leavegroup(struct in6_multi_mship *imm)
{
if (imm->i6mm_maddr)
@@ -2587,7 +2588,7 @@ in6if_do_dad(struct ifnet *ifp)
* to in6_maxmtu.
*/
void
-in6_setmaxmtu()
+in6_setmaxmtu(void)
{
unsigned long maxmtu = 0;
struct ifnet *ifp;
diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c
index 6d0321d9b47..c24a1bb9c0f 100644
--- a/sys/netinet6/in6_ifattach.c
+++ b/sys/netinet6/in6_ifattach.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_ifattach.c,v 1.49 2010/01/13 02:13:12 henning Exp $ */
+/* $OpenBSD: in6_ifattach.c,v 1.50 2010/02/08 12:04:35 jsing Exp $ */
/* $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $ */
/*
@@ -62,10 +62,10 @@ unsigned long in6_maxmtu = 0;
int ip6_auto_linklocal = 1; /* enable by default */
-static int get_rand_ifid(struct ifnet *, struct in6_addr *);
-static int get_hw_ifid(struct ifnet *, struct in6_addr *);
-static int get_ifid(struct ifnet *, struct ifnet *, struct in6_addr *);
-static int in6_ifattach_loopback(struct ifnet *);
+int get_rand_ifid(struct ifnet *, struct in6_addr *);
+int get_hw_ifid(struct ifnet *, struct in6_addr *);
+int get_ifid(struct ifnet *, struct ifnet *, struct in6_addr *);
+int in6_ifattach_loopback(struct ifnet *);
#define EUI64_GBIT 0x01
#define EUI64_UBIT 0x02
@@ -87,7 +87,7 @@ static int in6_ifattach_loopback(struct ifnet *);
*
* in6 - upper 64bits are preserved
*/
-static int
+int
get_rand_ifid(struct ifnet *ifp, struct in6_addr *in6)
{
MD5_CTX ctxt;
@@ -124,7 +124,7 @@ get_rand_ifid(struct ifnet *ifp, struct in6_addr *in6)
*
* in6 - upper 64bits are preserved
*/
-static int
+int
get_hw_ifid(struct ifnet *ifp, struct in6_addr *in6)
{
struct ifaddr *ifa;
@@ -241,7 +241,7 @@ found:
*
* altifp - secondary EUI64 source
*/
-static int
+int
get_ifid(struct ifnet *ifp0, struct ifnet *altifp, struct in6_addr *in6)
{
struct ifnet *ifp;
@@ -439,7 +439,7 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet *altifp)
* ifp - must be IFT_LOOP
*/
-static int
+int
in6_ifattach_loopback(struct ifnet *ifp)
{
struct in6_aliasreq ifra;
@@ -498,7 +498,7 @@ in6_ifattach_loopback(struct ifnet *ifp)
*/
int
in6_nigroup(struct ifnet *ifp, const char *name, int namelen,
- struct sockaddr_in6 *sa6)
+ struct sockaddr_in6 *sa6)
{
const char *p;
u_int8_t *q;
diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c
index 8dbd1817864..dc172a904f0 100644
--- a/sys/netinet6/in6_src.c
+++ b/sys/netinet6/in6_src.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_src.c,v 1.23 2008/11/23 13:30:59 claudio Exp $ */
+/* $OpenBSD: in6_src.c,v 1.24 2010/02/08 12:04:35 jsing Exp $ */
/* $KAME: in6_src.c,v 1.36 2001/02/06 04:08:17 itojun Exp $ */
/*
@@ -86,9 +86,9 @@
#include <netinet6/ip6_var.h>
#include <netinet6/nd6.h>
-static int selectroute(struct sockaddr_in6 *, struct ip6_pktopts *,
- struct ip6_moptions *, struct route_in6 *, struct ifnet **,
- struct rtentry **, int);
+int selectroute(struct sockaddr_in6 *, struct ip6_pktopts *,
+ struct ip6_moptions *, struct route_in6 *, struct ifnet **,
+ struct rtentry **, int);
/*
* Return an IPv6 address, which is the most appropriate for a given
@@ -97,13 +97,9 @@ static int selectroute(struct sockaddr_in6 *, struct ip6_pktopts *,
* an entry to the caller for later use.
*/
struct in6_addr *
-in6_selectsrc(dstsock, opts, mopts, ro, laddr, errorp)
- struct sockaddr_in6 *dstsock;
- struct ip6_pktopts *opts;
- struct ip6_moptions *mopts;
- struct route_in6 *ro;
- struct in6_addr *laddr;
- int *errorp;
+in6_selectsrc(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
+ struct ip6_moptions *mopts, struct route_in6 *ro, struct in6_addr *laddr,
+ int *errorp)
{
struct in6_addr *dst;
struct in6_ifaddr *ia6 = 0;
@@ -292,15 +288,10 @@ in6_selectsrc(dstsock, opts, mopts, ro, laddr, errorp)
return (0);
}
-static int
-selectroute(dstsock, opts, mopts, ro, retifp, retrt, norouteok)
- struct sockaddr_in6 *dstsock;
- struct ip6_pktopts *opts;
- struct ip6_moptions *mopts;
- struct route_in6 *ro;
- struct ifnet **retifp;
- struct rtentry **retrt;
- int norouteok;
+int
+selectroute(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
+ struct ip6_moptions *mopts, struct route_in6 *ro, struct ifnet **retifp,
+ struct rtentry **retrt, int norouteok)
{
int error = 0;
struct ifnet *ifp = NULL;
@@ -492,13 +483,9 @@ selectroute(dstsock, opts, mopts, ro, retifp, retrt, norouteok)
}
int
-in6_selectroute(dstsock, opts, mopts, ro, retifp, retrt)
- struct sockaddr_in6 *dstsock;
- struct ip6_pktopts *opts;
- struct ip6_moptions *mopts;
- struct route_in6 *ro;
- struct ifnet **retifp;
- struct rtentry **retrt;
+in6_selectroute(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
+ struct ip6_moptions *mopts, struct route_in6 *ro, struct ifnet **retifp,
+ struct rtentry **retrt)
{
return (selectroute(dstsock, opts, mopts, ro, retifp, retrt, 0));
@@ -514,9 +501,7 @@ in6_selectroute(dstsock, opts, mopts, ro, retifp, retrt)
#define in6pcb inpcb
#define in6p_hops inp_hops
int
-in6_selecthlim(in6p, ifp)
- struct in6pcb *in6p;
- struct ifnet *ifp;
+in6_selecthlim(struct in6pcb *in6p, struct ifnet *ifp)
{
if (in6p && in6p->in6p_hops >= 0)
return (in6p->in6p_hops);
@@ -609,10 +594,8 @@ in6_embedscope(in6, sin6, in6p, ifpp)
* embedded scopeid thing.
*/
int
-in6_recoverscope(sin6, in6, ifp)
- struct sockaddr_in6 *sin6;
- const struct in6_addr *in6;
- struct ifnet *ifp;
+in6_recoverscope(struct sockaddr_in6 *sin6, const struct in6_addr *in6,
+ struct ifnet *ifp)
{
u_int32_t scopeid;
@@ -648,8 +631,7 @@ in6_recoverscope(sin6, in6, ifp)
* just clear the embedded scope identifer.
*/
void
-in6_clearscope(addr)
- struct in6_addr *addr;
+in6_clearscope(struct in6_addr *addr)
{
if (IN6_IS_SCOPE_EMBED(addr))
addr->s6_addr16[1] = 0;