summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/icmp6.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet6/icmp6.c')
-rw-r--r--sys/netinet6/icmp6.c97
1 files changed, 32 insertions, 65 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index f2e56ef..c58afa4 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -131,15 +131,14 @@ static int icmp6_notify_error __P((struct mbuf **, int, int, int));
void
-icmp6_init()
+icmp6_init(void)
{
+
mld6_init();
}
static void
-icmp6_errcount(stat, type, code)
- struct icmp6errstat *stat;
- int type, code;
+icmp6_errcount(struct icmp6errstat *stat, int type, int code)
{
switch (type) {
case ICMP6_DST_UNREACH:
@@ -199,10 +198,8 @@ icmp6_errcount(stat, type, code)
* may not contain enough scope zone information.
*/
void
-icmp6_error2(m, type, code, param, ifp)
- struct mbuf *m;
- int type, code, param;
- struct ifnet *ifp;
+icmp6_error2(struct mbuf *m, int type, int code, int param,
+ struct ifnet *ifp)
{
struct ip6_hdr *ip6;
@@ -233,9 +230,7 @@ icmp6_error2(m, type, code, param, ifp)
* Generate an error packet of type error in response to bad IP6 packet.
*/
void
-icmp6_error(m, type, code, param)
- struct mbuf *m;
- int type, code, param;
+icmp6_error(struct mbuf *m, int type, int code, int param)
{
struct ip6_hdr *oip6, *nip6;
struct icmp6_hdr *icmp6;
@@ -389,9 +384,7 @@ icmp6_error(m, type, code, param)
* Process a received ICMP6 message.
*/
int
-icmp6_input(mp, offp, proto)
- struct mbuf **mp;
- int *offp, proto;
+icmp6_input(struct mbuf **mp, int *offp, int proto)
{
struct mbuf *m = *mp, *n;
struct ip6_hdr *ip6, *nip6;
@@ -862,9 +855,7 @@ icmp6_input(mp, offp, proto)
}
static int
-icmp6_notify_error(mp, off, icmp6len, code)
- struct mbuf **mp;
- int off, icmp6len, code;
+icmp6_notify_error(struct mbuf **mp, int off, int icmp6len, int code)
{
struct mbuf *m = *mp;
struct icmp6_hdr *icmp6;
@@ -1095,9 +1086,7 @@ icmp6_notify_error(mp, off, icmp6len, code)
}
void
-icmp6_mtudisc_update(ip6cp, validated)
- struct ip6ctlparam *ip6cp;
- int validated;
+icmp6_mtudisc_update(struct ip6ctlparam *ip6cp, int validated)
{
struct in6_addr *dst = ip6cp->ip6c_finaldst;
struct icmp6_hdr *icmp6 = ip6cp->ip6c_icmp6;
@@ -1153,9 +1142,7 @@ icmp6_mtudisc_update(ip6cp, validated)
*/
#define hostnamelen strlen(hostname)
static struct mbuf *
-ni6_input(m, off)
- struct mbuf *m;
- int off;
+ni6_input(struct mbuf *m, int off)
{
struct icmp6_nodeinfo *ni6, *nni6;
struct mbuf *n = NULL;
@@ -1474,12 +1461,11 @@ ni6_input(m, off)
*
* XXX names with less than 2 dots (like "foo" or "foo.section") will be
* treated as truncated name (two \0 at the end). this is a wild guess.
+ *
+ * old - return pascal string if non-zero
*/
static struct mbuf *
-ni6_nametodns(name, namelen, old)
- const char *name;
- int namelen;
- int old; /* return pascal string if non-zero */
+ni6_nametodns(const char *name, int namelen, int old)
{
struct mbuf *m;
char *cp, *ep;
@@ -1576,11 +1562,7 @@ ni6_nametodns(name, namelen, old)
* XXX upper/lowercase match (see RFC2065)
*/
static int
-ni6_dnsmatch(a, alen, b, blen)
- const char *a;
- int alen;
- const char *b;
- int blen;
+ni6_dnsmatch(const char *a, int alen, const char *b, int blen)
{
const char *a0, *b0;
int l;
@@ -1640,11 +1622,8 @@ ni6_dnsmatch(a, alen, b, blen)
* calculate the number of addresses to be returned in the node info reply.
*/
static int
-ni6_addrs(ni6, m, ifpp, subj)
- struct icmp6_nodeinfo *ni6;
- struct mbuf *m;
- struct ifnet **ifpp;
- struct in6_addr *subj;
+ni6_addrs(struct icmp6_nodeinfo *ni6, struct mbuf *m, struct ifnet **ifpp,
+ struct in6_addr *subj)
{
struct ifnet *ifp;
struct in6_ifaddr *ifa6;
@@ -1734,10 +1713,8 @@ ni6_addrs(ni6, m, ifpp, subj)
}
static int
-ni6_store_addrs(ni6, nni6, ifp0, resid)
- struct icmp6_nodeinfo *ni6, *nni6;
- struct ifnet *ifp0;
- int resid;
+ni6_store_addrs(struct icmp6_nodeinfo *ni6, struct icmp6_nodeinfo *nni6,
+ struct ifnet *ifp0, int resid)
{
struct ifnet *ifp = ifp0 ? ifp0 : TAILQ_FIRST(&ifnet);
struct in6_ifaddr *ifa6;
@@ -1876,9 +1853,7 @@ ni6_store_addrs(ni6, nni6, ifp0, resid)
* XXX almost dup'ed code with rip6_input.
*/
static int
-icmp6_rip6_input(mp, off)
- struct mbuf **mp;
- int off;
+icmp6_rip6_input(struct mbuf **mp, int off)
{
struct mbuf *m = *mp;
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
@@ -2040,9 +2015,7 @@ icmp6_rip6_input(mp, off)
* OFF points to the icmp6 header, counted from the top of the mbuf.
*/
void
-icmp6_reflect(m, off)
- struct mbuf *m;
- size_t off;
+icmp6_reflect(struct mbuf *m, size_t off)
{
struct ip6_hdr *ip6;
struct icmp6_hdr *icmp6;
@@ -2200,17 +2173,15 @@ icmp6_reflect(m, off)
}
void
-icmp6_fasttimo()
+icmp6_fasttimo(void)
{
return;
}
static const char *
-icmp6_redirect_diag(src6, dst6, tgt6)
- struct in6_addr *src6;
- struct in6_addr *dst6;
- struct in6_addr *tgt6;
+icmp6_redirect_diag(struct in6_addr *src6, struct in6_addr *dst6,
+ struct in6_addr *tgt6)
{
static char buf[1024];
char ip6bufs[INET6_ADDRSTRLEN];
@@ -2223,9 +2194,7 @@ icmp6_redirect_diag(src6, dst6, tgt6)
}
void
-icmp6_redirect_input(m, off)
- struct mbuf *m;
- int off;
+icmp6_redirect_input(struct mbuf *m, int off)
{
struct ifnet *ifp;
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
@@ -2432,9 +2401,7 @@ icmp6_redirect_input(m, off)
}
void
-icmp6_redirect_output(m0, rt)
- struct mbuf *m0;
- struct rtentry *rt;
+icmp6_redirect_output(struct mbuf *m0, struct rtentry *rt)
{
struct ifnet *ifp; /* my outgoing interface */
struct in6_addr *ifp_ll6;
@@ -2718,9 +2685,7 @@ fail:
* ICMPv6 socket option processing.
*/
int
-icmp6_ctloutput(so, sopt)
- struct socket *so;
- struct sockopt *sopt;
+icmp6_ctloutput(struct socket *so, struct sockopt *sopt)
{
int error = 0;
int optlen;
@@ -2795,12 +2760,14 @@ icmp6_ctloutput(so, sopt)
* limitation.
*
* XXX per-destination/type check necessary?
+ *
+ * dst - not used at this moment
+ * type - not used at this moment
+ * code - not used at this moment
*/
static int
-icmp6_ratelimit(dst, type, code)
- const struct in6_addr *dst; /* not used at this moment */
- const int type; /* not used at this moment */
- const int code; /* not used at this moment */
+icmp6_ratelimit(const struct in6_addr *dst, const int type,
+ const int code)
{
int ret;
OpenPOWER on IntegriCloud