Source-Changes-HG archive

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

[src/trunk]: src/crypto/dist/ipsec-tools/src/racoon Use strict p...



details:   https://anonhg.NetBSD.org/src/rev/639d3ace10e4
branches:  trunk
changeset: 319187:639d3ace10e4
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat May 19 20:14:56 2018 +0000

description:
Use strict prototypes, when they don't introduce more warnings than they fix.
Also localify a few functions.

diffstat:

 crypto/dist/ipsec-tools/src/racoon/admin.c        |   6 +---
 crypto/dist/ipsec-tools/src/racoon/cfparse.y      |   7 ++---
 crypto/dist/ipsec-tools/src/racoon/evt.c          |  17 +++---------
 crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c   |  29 +++++++---------------
 crypto/dist/ipsec-tools/src/racoon/handler.c      |   5 +--
 crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c    |  14 +++-------
 crypto/dist/ipsec-tools/src/racoon/isakmp.c       |  21 ++++-----------
 crypto/dist/ipsec-tools/src/racoon/isakmp_var.h   |   8 ++---
 crypto/dist/ipsec-tools/src/racoon/isakmp_xauth.c |   8 ++---
 crypto/dist/ipsec-tools/src/racoon/localconf.c    |   5 +--
 crypto/dist/ipsec-tools/src/racoon/oakley.c       |  12 +++------
 crypto/dist/ipsec-tools/src/racoon/pfkey.c        |  10 +++----
 crypto/dist/ipsec-tools/src/racoon/remoteconf.c   |  28 +++++++---------------
 crypto/dist/ipsec-tools/src/racoon/sainfo.c       |   6 ++--
 crypto/dist/ipsec-tools/src/racoon/session.c      |   5 ++-
 15 files changed, 62 insertions(+), 119 deletions(-)

diffs (truncated from 544 to 300 lines):

diff -r da795b7a10e4 -r 639d3ace10e4 crypto/dist/ipsec-tools/src/racoon/admin.c
--- a/crypto/dist/ipsec-tools/src/racoon/admin.c        Sat May 19 20:04:41 2018 +0000
+++ b/crypto/dist/ipsec-tools/src/racoon/admin.c        Sat May 19 20:14:56 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: admin.c,v 1.40 2018/05/19 19:23:15 maxv Exp $  */
+/*     $NetBSD: admin.c,v 1.41 2018/05/19 20:14:56 maxv Exp $  */
 
 /* Id: admin.c,v 1.25 2006/04/06 14:31:04 manubsd Exp */
 
@@ -97,9 +97,7 @@
 static int admin_reply __P((int, struct admin_com *, int, vchar_t *));
 
 static int
-admin_handler(ctx, fd)
-       void *ctx;
-       int fd;
+admin_handler(void *ctx, int fd)
 {
        int so2;
        struct sockaddr_storage from;
diff -r da795b7a10e4 -r 639d3ace10e4 crypto/dist/ipsec-tools/src/racoon/cfparse.y
--- a/crypto/dist/ipsec-tools/src/racoon/cfparse.y      Sat May 19 20:04:41 2018 +0000
+++ b/crypto/dist/ipsec-tools/src/racoon/cfparse.y      Sat May 19 20:14:56 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cfparse.y,v 1.50 2018/05/19 19:32:16 maxv Exp $        */
+/*     $NetBSD: cfparse.y,v 1.51 2018/05/19 20:14:56 maxv Exp $        */
 
 /* Id: cfparse.y,v 1.66 2006/08/22 18:17:17 manubsd Exp */
 
@@ -172,7 +172,7 @@
        return 0;
 }
 
-static int process_rmconf()
+static int process_rmconf(void)
 {
 
        /* check a exchange mode */
@@ -2611,8 +2611,7 @@
 }
 
 static struct secprotospec *
-dupspspec(spspec)
-       struct secprotospec *spspec;
+dupspspec(struct secprotospec *spspec)
 {
        struct secprotospec *new;
 
diff -r da795b7a10e4 -r 639d3ace10e4 crypto/dist/ipsec-tools/src/racoon/evt.c
--- a/crypto/dist/ipsec-tools/src/racoon/evt.c  Sat May 19 20:04:41 2018 +0000
+++ b/crypto/dist/ipsec-tools/src/racoon/evt.c  Sat May 19 20:14:56 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: evt.c,v 1.10 2010/10/21 06:15:28 tteras Exp $  */
+/*     $NetBSD: evt.c,v 1.11 2018/05/19 20:14:56 maxv Exp $    */
 
 /* Id: evt.c,v 1.5 2006/06/22 20:11:35 manubsd Exp */
 
@@ -216,9 +216,7 @@
 }
 
 static struct evt_message *
-evtmsg_create(type, optdata)
-       int type;
-       vchar_t *optdata;
+evtmsg_create(int type, vchar_t *optdata)
 {
        struct evt_message *e;
        size_t len;
@@ -247,8 +245,7 @@
 }
 
 static void
-evt_unsubscribe(l)
-       struct evt_listener *l;
+evt_unsubscribe(struct evt_listener *l)
 {
        plog(LLV_DEBUG, LOCATION, NULL,
             "[%d] admin connection released\n", l->fd);
@@ -260,18 +257,14 @@
 }
 
 static int
-evt_unsubscribe_cb(ctx, fd)
-       void *ctx;
-       int fd;
+evt_unsubscribe_cb(void *ctx, int fd)
 {
        evt_unsubscribe((struct evt_listener *) ctx);
        return 0;
 }
 
 static void
-evtmsg_broadcast(ll, e)
-       const struct evt_listener_list *ll;
-       struct evt_message *e;
+evtmsg_broadcast(const struct evt_listener_list *ll, struct evt_message *e)
 {
        struct evt_listener *l, *nl;
 
diff -r da795b7a10e4 -r 639d3ace10e4 crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
--- a/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c   Sat May 19 20:04:41 2018 +0000
+++ b/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c   Sat May 19 20:14:56 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: grabmyaddr.c,v 1.36 2018/05/19 19:23:15 maxv Exp $     */
+/*     $NetBSD: grabmyaddr.c,v 1.37 2018/05/19 20:14:56 maxv Exp $     */
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
  * Copyright (C) 2008 Timo Teras <timo.teras%iki.fi@localhost>.
@@ -81,8 +81,7 @@
 static LIST_HEAD(_myaddr_list_, myaddr) configured, opened;
 
 static void
-myaddr_delete(my)
-       struct myaddr *my;
+myaddr_delete(struct myaddr *my)
 {
        if (my->fd != -1)
                isakmp_close(my->fd);
@@ -91,8 +90,7 @@
 }
 
 static int
-myaddr_configured(addr)
-       struct sockaddr *addr;
+myaddr_configured(struct sockaddr *addr)
 {
        struct myaddr *cfg;
 
@@ -108,9 +106,7 @@
 }
 
 static int
-myaddr_open(addr, udp_encap)
-       struct sockaddr *addr;
-       int udp_encap;
+myaddr_open(struct sockaddr *addr, int udp_encap)
 {
        struct myaddr *my;
 
@@ -136,8 +132,7 @@
 }
 
 static int
-myaddr_open_all_configured(addr)
-       struct sockaddr *addr;
+myaddr_open_all_configured(struct sockaddr *addr)
 {
        /* create all configured, not already opened addresses */
        struct myaddr *cfg;
@@ -178,8 +173,7 @@
 }
 
 static void
-myaddr_close_all_open(addr)
-       struct sockaddr *addr;
+myaddr_close_all_open(struct sockaddr *addr)
 {
        /* delete all matching open sockets */
        struct myaddr *my, *next;
@@ -195,8 +189,7 @@
 }
 
 static void
-myaddr_flush_list(list)
-       struct _myaddr_list_ *list;
+myaddr_flush_list(struct _myaddr_list_ *list)
 {
        struct myaddr *my, *next;
 
@@ -696,10 +689,7 @@
 #define SAROUNDUP(X)   ROUNDUP(((struct sockaddr *)(X))->sa_len)
 
 static size_t
-parse_address(start, end, dest)
-       caddr_t start;
-       caddr_t end;
-       struct sockaddr_storage *dest;
+parse_address(caddr_t start, caddr_t end, struct sockaddr_storage *dest)
 {
        int len;
 
@@ -743,8 +733,7 @@
 }
 
 static void
-kernel_handle_message(msg)
-       caddr_t msg;
+kernel_handle_message(caddr_t msg)
 {
        struct rt_msghdr *rtm = (struct rt_msghdr *) msg;
        struct ifa_msghdr *ifa = (struct ifa_msghdr *) msg;
diff -r da795b7a10e4 -r 639d3ace10e4 crypto/dist/ipsec-tools/src/racoon/handler.c
--- a/crypto/dist/ipsec-tools/src/racoon/handler.c      Sat May 19 20:04:41 2018 +0000
+++ b/crypto/dist/ipsec-tools/src/racoon/handler.c      Sat May 19 20:14:56 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: handler.c,v 1.41 2012/01/01 15:57:31 tteras Exp $      */
+/*     $NetBSD: handler.c,v 1.42 2018/05/19 20:14:56 maxv Exp $        */
 
 /* Id: handler.c,v 1.28 2006/05/26 12:17:29 manubsd Exp */
 
@@ -1173,8 +1173,7 @@
 }
 
 static void
-sweep_recvdpkt(dummy)
-       struct sched *dummy;
+sweep_recvdpkt(struct sched *dummy)
 {
        struct recvdpkt *r, *next;
        struct timeval now, diff, sweep;
diff -r da795b7a10e4 -r 639d3ace10e4 crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c
--- a/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c    Sat May 19 20:04:41 2018 +0000
+++ b/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c    Sat May 19 20:14:56 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipsec_doi.c,v 1.50 2018/05/19 19:23:15 maxv Exp $      */
+/*     $NetBSD: ipsec_doi.c,v 1.51 2018/05/19 20:14:56 maxv Exp $      */
 
 /* Id: ipsec_doi.c,v 1.55 2006/08/17 09:20:41 vanhu Exp */
 
@@ -197,9 +197,7 @@
 }
 
 static void
-print_ph1proposal(pair, s)
-       struct prop_pair *pair;
-       struct isakmpsa *s;
+print_ph1proposal(struct prop_pair *pair, struct isakmpsa *s)
 {
        struct isakmp_pl_p *prop = pair->prop;
        struct isakmp_pl_t *trns = pair->trns;
@@ -3302,9 +3300,7 @@
  */
 
 int
-ipsecdoi_subnetisaddr_v4( subnet, address )
-       const vchar_t *subnet;
-       const vchar_t *address;
+ipsecdoi_subnetisaddr_v4(const vchar_t *subnet, const vchar_t *address)
 {
        struct in_addr *mask;
 
@@ -3325,9 +3321,7 @@
 #ifdef INET6
 
 int
-ipsecdoi_subnetisaddr_v6( subnet, address )
-       const vchar_t *subnet;
-       const vchar_t *address;
+ipsecdoi_subnetisaddr_v6(const vchar_t *subnet, const vchar_t *address)
 {
        struct in6_addr *mask;
        int i;
diff -r da795b7a10e4 -r 639d3ace10e4 crypto/dist/ipsec-tools/src/racoon/isakmp.c
--- a/crypto/dist/ipsec-tools/src/racoon/isakmp.c       Sat May 19 20:04:41 2018 +0000
+++ b/crypto/dist/ipsec-tools/src/racoon/isakmp.c       Sat May 19 20:14:56 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: isakmp.c,v 1.77 2018/05/19 19:23:15 maxv Exp $ */
+/*     $NetBSD: isakmp.c,v 1.78 2018/05/19 20:14:56 maxv Exp $ */
 
 /* Id: isakmp.c,v 1.74 2006/05/07 21:32:59 manubsd Exp */
 
@@ -198,9 +198,7 @@
  * isakmp packet handler
  */
 static int
-isakmp_handler(ctx, so_isakmp)
-        void *ctx;
-       int so_isakmp;
+isakmp_handler(void *ctx, int so_isakmp)
 {
        struct isakmp isakmp;
        union {
@@ -1829,8 +1827,7 @@
 
 /* called from scheduler */
 static void
-isakmp_ph1resend_stub(p)
-       struct sched *p;
+isakmp_ph1resend_stub(struct sched *p)
 {
        struct ph1handle *iph1 = container_of(p, struct ph1handle, scr);
 
@@ -1887,8 +1884,7 @@
 
 /* called from scheduler */
 static void
-isakmp_ph2resend_stub(p)
-       struct sched *p;
+isakmp_ph2resend_stub(struct sched *p)
 {
        struct ph2handle *iph2 = container_of(p, struct ph2handle, scr);
 
@@ -2654,13 +2650,8 @@
  * set values into allocated buffer of isakmp header for phase 1
  */
 static caddr_t
-set_isakmp_header(vbuf, iph1, nptype, etype, flags, msgid)
-       vchar_t *vbuf;
-       struct ph1handle *iph1;
-       int nptype;



Home | Main Index | Thread Index | Old Index