Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet ANSIfy function declarations



details:   https://anonhg.NetBSD.org/src/rev/a08fcb38b813
branches:  trunk
changeset: 573640:a08fcb38b813
user:      perry <perry%NetBSD.org@localhost>
date:      Thu Feb 03 22:51:50 2005 +0000

description:
ANSIfy function declarations

diffstat:

 sys/netinet/ip_icmp.c  |  49 +++++++++++++++--------------------------------
 sys/netinet/ip_input.c |  51 +++++++++++++++++--------------------------------
 2 files changed, 34 insertions(+), 66 deletions(-)

diffs (truncated from 317 to 300 lines):

diff -r 48ad0fb2e671 -r a08fcb38b813 sys/netinet/ip_icmp.c
--- a/sys/netinet/ip_icmp.c     Thu Feb 03 22:45:28 2005 +0000
+++ b/sys/netinet/ip_icmp.c     Thu Feb 03 22:51:50 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_icmp.c,v 1.89 2005/02/02 21:41:55 perry Exp $       */
+/*     $NetBSD: ip_icmp.c,v 1.90 2005/02/03 22:51:50 perry Exp $       */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -101,7 +101,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.89 2005/02/02 21:41:55 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.90 2005/02/03 22:51:50 perry Exp $");
 
 #include "opt_ipsec.h"
 
@@ -185,7 +185,7 @@
 
 
 void
-icmp_init()
+icmp_init(void)
 {
        /*
         * This is only useful if the user initializes redirtimeout to
@@ -201,8 +201,7 @@
  * Register a Path MTU Discovery callback.
  */
 void
-icmp_mtudisc_callback_register(func)
-       void (*func)(struct in_addr);
+icmp_mtudisc_callback_register(void (*func)(struct in_addr))
 {
        struct icmp_mtudisc_callback *mc;
 
@@ -225,11 +224,8 @@
  * in response to bad packet ip.
  */
 void
-icmp_error(n, type, code, dest, destifp)
-       struct mbuf *n;
-       int type, code;
-       n_long dest;
-       struct ifnet *destifp;
+icmp_error(struct mbuf *n, int type, int code, n_long dest,
+    struct ifnet *destifp)
 {
        struct ip *oip = mtod(n, struct ip *), *nip;
        unsigned oiplen = oip->ip_hl << 2;
@@ -636,8 +632,7 @@
  * Reflect the ip packet back to the source
  */
 void
-icmp_reflect(m)
-       struct mbuf *m;
+icmp_reflect(struct mbuf *m)
 {
        struct ip *ip = mtod(m, struct ip *);
        struct in_ifaddr *ia;
@@ -852,9 +847,7 @@
  * after supplying a checksum.
  */
 void
-icmp_send(m, opts)
-       struct mbuf *m;
-       struct mbuf *opts;
+icmp_send(struct mbuf *m, struct mbuf *opts)
 {
        struct ip *ip = mtod(m, struct ip *);
        int hlen;
@@ -877,7 +870,7 @@
 }
 
 n_time
-iptime()
+iptime(void)
 {
        struct timeval atv;
        u_long t;
@@ -1023,9 +1016,7 @@
 };
 
 void
-icmp_mtudisc(icp, faddr)
-       struct icmp *icp;
-       struct in_addr faddr;
+icmp_mtudisc(struct icmp *icp, struct in_addr faddr)
 {
        struct icmp_mtudisc_callback *mc;
        struct sockaddr *dst = sintosa(&icmpsrc);
@@ -1122,9 +1113,7 @@
  * is returned; otherwise, a smaller value is returned.
  */
 int
-ip_next_mtu(mtu, dir)  /* XXX */
-       int mtu;
-       int dir;
+ip_next_mtu(int mtu, int dir)  /* XXX */
 {
        int i;
 
@@ -1151,9 +1140,7 @@
 }
 
 static void
-icmp_mtudisc_timeout(rt, r)
-       struct rtentry *rt;
-       struct rttimer *r;
+icmp_mtudisc_timeout(struct rtentry *rt, struct rttimer *r)
 {
        if (rt == NULL)
                panic("icmp_mtudisc_timeout:  bad route to timeout");
@@ -1169,9 +1156,7 @@
 }
 
 static void
-icmp_redirect_timeout(rt, r)
-       struct rtentry *rt;
-       struct rttimer *r;
+icmp_redirect_timeout(struct rtentry *rt, struct rttimer *r)
 {
        if (rt == NULL)
                panic("icmp_redirect_timeout:  bad route to timeout");
@@ -1190,11 +1175,9 @@
  *
  * XXX per-destination/type check necessary?
  */
+/* "type" and "code" are not used at this moment */
 static int
-icmp_ratelimit(dst, type, code)
-       const struct in_addr *dst;
-       const int type;                 /* not used at this moment */
-       const int code;                 /* not used at this moment */
+icmp_ratelimit(const struct in_addr *dst, const int type, const int code)
 {
 
        /* PPS limit */
@@ -1204,6 +1187,6 @@
                return 1;
        }
 
-       /*okay to send*/
+       /* okay to send */
        return 0;
 }
diff -r 48ad0fb2e671 -r a08fcb38b813 sys/netinet/ip_input.c
--- a/sys/netinet/ip_input.c    Thu Feb 03 22:45:28 2005 +0000
+++ b/sys/netinet/ip_input.c    Thu Feb 03 22:51:50 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_input.c,v 1.210 2005/02/02 21:41:55 perry Exp $     */
+/*     $NetBSD: ip_input.c,v 1.211 2005/02/03 22:56:42 perry Exp $     */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -98,7 +98,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.210 2005/02/02 21:41:55 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.211 2005/02/03 22:56:42 perry Exp $");
 
 #include "opt_inet.h"
 #include "opt_gateway.h"
@@ -283,7 +283,7 @@
 static __inline void ipq_unlock(void);
 
 static __inline int
-ipq_lock_try()
+ipq_lock_try(void)
 {
        int s;
 
@@ -302,7 +302,7 @@
 }
 
 static __inline void
-ipq_unlock()
+ipq_unlock(void)
 {
        int s;
 
@@ -395,7 +395,7 @@
  * All protocols not implemented in kernel go to raw IP protocol handler.
  */
 void
-ip_init()
+ip_init(void)
 {
        const struct protosw *pr;
        int i;
@@ -452,7 +452,7 @@
  * IP software interrupt routine
  */
 void
-ipintr()
+ipintr(void)
 {
        int s;
        struct mbuf *m;
@@ -1044,10 +1044,7 @@
  * is given as fp; otherwise have to make a chain.
  */
 struct mbuf *
-ip_reass(ipqe, fp, ipqhead)
-       struct ipqent *ipqe;
-       struct ipq *fp;
-       struct ipqhead *ipqhead;
+ip_reass(struct ipqent *ipqe, struct ipq *fp, struct ipqhead *ipqhead)
 {
        struct mbuf *m = ipqe->ipqe_m;
        struct ipqent *nq, *p, *q;
@@ -1247,8 +1244,7 @@
  * associated datagrams.
  */
 void
-ip_freef(fp)
-       struct ipq *fp;
+ip_freef(struct ipq *fp)
 {
        struct ipqent *q, *p;
        u_int nfrags = 0;
@@ -1345,7 +1341,7 @@
  * queue, discard it.
  */
 void
-ip_slowtimo()
+ip_slowtimo(void)
 {
        static u_int dropscanidx = 0;
        u_int i;
@@ -1402,7 +1398,7 @@
  * Drain off all datagram fragments.
  */
 void
-ip_drain()
+ip_drain(void)
 {
 
        /*
@@ -1429,8 +1425,7 @@
  * 0 if the packet should be processed further.
  */
 int
-ip_dooptions(m)
-       struct mbuf *m;
+ip_dooptions(struct mbuf *m)
 {
        struct ip *ip = mtod(m, struct ip *);
        u_char *cp, *cp0;
@@ -1659,8 +1654,7 @@
  * return internet address info of interface to be used to get there.
  */
 struct in_ifaddr *
-ip_rtaddr(dst)
-        struct in_addr dst;
+ip_rtaddr(struct in_addr dst)
 {
        struct sockaddr_in *sin;
 
@@ -1687,9 +1681,7 @@
  * to be picked up later by ip_srcroute if the receiver is interested.
  */
 void
-save_rte(option, dst)
-       u_char *option;
-       struct in_addr dst;
+save_rte(u_char *option, struct in_addr dst)
 {
        unsigned olen;
 
@@ -1711,7 +1703,7 @@
  * The first hop is placed before the options, will be removed later.
  */
 struct mbuf *
-ip_srcroute()
+ip_srcroute(void)
 {
        struct in_addr *p, *q;
        struct mbuf *m;
@@ -1783,9 +1775,7 @@
  * XXX should be deleted; last arg currently ignored.
  */
 void
-ip_stripoptions(m, mopt)
-       struct mbuf *m;
-       struct mbuf *mopt;
+ip_stripoptions(struct mbuf *m, struct mbuf *mopt)
 {
        int i;
        struct ip *ip = mtod(m, struct ip *);
@@ -1827,9 +1817,7 @@
  * via a source route.
  */
 void
-ip_forward(m, srcrt)
-       struct mbuf *m;
-       int srcrt;
+ip_forward(struct mbuf *m, int srcrt)



Home | Main Index | Thread Index | Old Index