Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/ipf/netinet apply our changes.



details:   https://anonhg.NetBSD.org/src/rev/02a27500de63
branches:  trunk
changeset: 778371:02a27500de63
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Mar 23 20:39:49 2012 +0000

description:
apply our changes.
- prototypes
- ip_h323_pxy.c is missing from the distribution
- original tar distribution is missing <$>Id values in most files

diffstat:

 sys/external/bsd/ipf/netinet/fil.c            |  832 ++++++++-----------------
 sys/external/bsd/ipf/netinet/ip_auth.c        |  110 +--
 sys/external/bsd/ipf/netinet/ip_auth.h        |   48 +-
 sys/external/bsd/ipf/netinet/ip_compat.h      |  151 ++--
 sys/external/bsd/ipf/netinet/ip_dns_pxy.c     |   76 +-
 sys/external/bsd/ipf/netinet/ip_dstlist.c     |  196 ++----
 sys/external/bsd/ipf/netinet/ip_dstlist.h     |    7 +-
 sys/external/bsd/ipf/netinet/ip_fil.h         |  439 ++++++------
 sys/external/bsd/ipf/netinet/ip_fil_compat.c  |  399 ++++--------
 sys/external/bsd/ipf/netinet/ip_fil_netbsd.c  |  253 +++----
 sys/external/bsd/ipf/netinet/ip_frag.c        |  181 ++---
 sys/external/bsd/ipf/netinet/ip_frag.h        |   64 +-
 sys/external/bsd/ipf/netinet/ip_ftp_pxy.c     |  230 ++----
 sys/external/bsd/ipf/netinet/ip_h323_pxy.c    |  290 +++++++++
 sys/external/bsd/ipf/netinet/ip_htable.c      |  243 ++----
 sys/external/bsd/ipf/netinet/ip_htable.h      |    8 +-
 sys/external/bsd/ipf/netinet/ip_ipsec_pxy.c   |   64 +-
 sys/external/bsd/ipf/netinet/ip_irc_pxy.c     |   50 +-
 sys/external/bsd/ipf/netinet/ip_log.c         |   77 +-
 sys/external/bsd/ipf/netinet/ip_lookup.c      |  129 +--
 sys/external/bsd/ipf/netinet/ip_lookup.h      |   96 +-
 sys/external/bsd/ipf/netinet/ip_nat.c         |  686 ++++++++------------
 sys/external/bsd/ipf/netinet/ip_nat.h         |  186 ++--
 sys/external/bsd/ipf/netinet/ip_nat6.c        |  247 ++-----
 sys/external/bsd/ipf/netinet/ip_netbios_pxy.c |   25 +-
 sys/external/bsd/ipf/netinet/ip_pool.c        |  223 ++----
 sys/external/bsd/ipf/netinet/ip_pool.h        |    6 +-
 sys/external/bsd/ipf/netinet/ip_pptp_pxy.c    |   71 +-
 sys/external/bsd/ipf/netinet/ip_proxy.c       |  119 +--
 sys/external/bsd/ipf/netinet/ip_proxy.h       |   82 +-
 sys/external/bsd/ipf/netinet/ip_raudio_pxy.c  |   39 +-
 sys/external/bsd/ipf/netinet/ip_rcmd_pxy.c    |   69 +-
 sys/external/bsd/ipf/netinet/ip_rpcb_pxy.c    |  213 ++----
 sys/external/bsd/ipf/netinet/ip_scan.c        |   29 +-
 sys/external/bsd/ipf/netinet/ip_scan.h        |   20 +-
 sys/external/bsd/ipf/netinet/ip_state.c       |  336 +++-------
 sys/external/bsd/ipf/netinet/ip_state.h       |   78 +-
 sys/external/bsd/ipf/netinet/ip_sync.c        |  131 +--
 sys/external/bsd/ipf/netinet/ip_sync.h        |   38 +-
 sys/external/bsd/ipf/netinet/ip_tftp_pxy.c    |   57 +-
 sys/external/bsd/ipf/netinet/ipf_rb.h         |    4 +-
 sys/external/bsd/ipf/netinet/ipl.h            |    4 +-
 sys/external/bsd/ipf/netinet/radix_ipf.c      |   83 +-
 sys/external/bsd/ipf/netinet/radix_ipf.h      |   24 +-
 44 files changed, 2789 insertions(+), 3924 deletions(-)

diffs (truncated from 13863 to 300 lines):

diff -r b60d64af3403 -r 02a27500de63 sys/external/bsd/ipf/netinet/fil.c
--- a/sys/external/bsd/ipf/netinet/fil.c        Fri Mar 23 20:36:52 2012 +0000
+++ b/sys/external/bsd/ipf/netinet/fil.c        Fri Mar 23 20:39:49 2012 +0000
@@ -1,13 +1,11 @@
-/*     $NetBSD: fil.c,v 1.1.1.1 2012/03/23 20:36:52 christos Exp $     */
+/*     $NetBSD: fil.c,v 1.2 2012/03/23 20:39:49 christos Exp $ */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
  *
  * See the IPFILTER.LICENCE file for details on licencing.
  *
- * Copyright 2008 Sun Microsystems.
- *
- * Id
+ * Id: fil.c,v 2.443.2.36 2012/01/29 05:30:35 darrenr Exp
  *
  */
 #if defined(KERNEL) || defined(_KERNEL)
@@ -138,8 +136,13 @@
 /* END OF INCLUDES */
 
 #if !defined(lint)
+#if defined(__NetBSD__)
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.2 2012/03/23 20:39:49 christos Exp $");
+#else
 static const char sccsid[] = "@(#)fil.c        1.36 6/5/96 (C) 1993-2000 Darren Reed";
-static const char rcsid[] = "@(#)Id";
+static const char rcsid[] = "@(#)Id: fil.c,v 2.443.2.36 2012/01/29 05:30:35 darrenr Exp";
+#endif
 #endif
 
 #ifndef        _KERNEL
@@ -152,60 +155,53 @@
 #define        LBUMP(x)        softc->x++
 #define        LBUMPD(x, y)    do { softc->x.y++; DT(y); } while (0)
 
-static INLINE int      ipf_check_ipf __P((fr_info_t *, frentry_t *, int));
-static u_32_t          ipf_checkcipso __P((fr_info_t *, u_char *, int));
-static u_32_t          ipf_checkripso __P((u_char *));
-static u_32_t          ipf_decaps __P((fr_info_t *, u_32_t, int));
-static frentry_t       *ipf_dolog __P((fr_info_t *, u_32_t *));
-static int             ipf_flushlist __P((ipf_main_softc_t *, int, minor_t,
-                                          int *, frentry_t **));
-static int             ipf_flush_groups __P((ipf_main_softc_t *,
-                                             int, int, int));
-static ipfunc_t        ipf_findfunc __P((ipfunc_t));
-static void            *ipf_findlookup __P((ipf_main_softc_t *, int,
-                                            frentry_t *,
-                                            i6addr_t *, i6addr_t *));
-static frentry_t       *ipf_firewall __P((fr_info_t *, u_32_t *));
-static int             ipf_fr_matcharray __P((fr_info_t *, int *));
-static int             ipf_frruleiter __P((ipf_main_softc_t *, void *, int,
-                                           void *));
-static void            ipf_funcfini __P((ipf_main_softc_t *, frentry_t *));;
-static int             ipf_funcinit __P((ipf_main_softc_t *, frentry_t *));
-static int             ipf_geniter __P((ipf_main_softc_t *, ipftoken_t *,
-                                        ipfgeniter_t *));
-static void            ipf_getstat __P((ipf_main_softc_t *,
-                                        struct friostat *, int));
-static int             ipf_grpmapfini __P((struct ipf_main_softc_s *,
-                                           frentry_t *));
-static int             ipf_grpmapinit __P((struct ipf_main_softc_s *,
-                                           frentry_t *));
-static int             ipf_portcheck __P((frpcmp_t *, u_32_t));
-static INLINE int      ipf_pr_ah __P((fr_info_t *));
-static INLINE void     ipf_pr_esp __P((fr_info_t *));
-static INLINE void     ipf_pr_gre __P((fr_info_t *));
-static INLINE void     ipf_pr_udp __P((fr_info_t *));
-static INLINE void     ipf_pr_tcp __P((fr_info_t *));
-static INLINE void     ipf_pr_icmp __P((fr_info_t *));
-static INLINE void     ipf_pr_ipv4hdr __P((fr_info_t *));
-static INLINE void     ipf_pr_short __P((fr_info_t *, int));
-static INLINE int      ipf_pr_tcpcommon __P((fr_info_t *));
-static INLINE int      ipf_pr_udpcommon __P((fr_info_t *));
-static void            ipf_rule_delete __P((ipf_main_softc_t *, frentry_t *f,
-                                            int, int));
-static void            ipf_rule_expire_insert __P((ipf_main_softc_t *,
-                                                   frentry_t *, int));
-static int             ipf_synclist __P((ipf_main_softc_t *, frentry_t *,
-                                         void *));
-static ipftuneable_t   *ipf_tune_findbyname __P((ipftuneable_t *,
-                                                 const char *));
-static ipftuneable_t   *ipf_tune_findbycookie __P((ipftuneable_t **, void *,
-                                                   void **));
-static void            ipf_token_unlink __P((ipf_main_softc_t *,
-                                             ipftoken_t *));
-static int             ipf_updateipid __P((fr_info_t *));
-static int             ipf_settimeout __P((struct ipf_main_softc_s *,
-                                           struct ipftuneable *,
-                                           ipftuneval_t *));
+static INLINE int      ipf_check_ipf(fr_info_t *, frentry_t *, int);
+static u_32_t          ipf_checkcipso(fr_info_t *, u_char *, int);
+static u_32_t          ipf_checkripso(u_char *);
+static u_32_t          ipf_decaps(fr_info_t *, u_32_t, int);
+#ifdef IPFILTER_LOG
+static frentry_t       *ipf_dolog(fr_info_t *, u_32_t *);
+#endif
+static int             ipf_flushlist(ipf_main_softc_t *, int, minor_t,
+                                     int *, frentry_t **);
+static int             ipf_flush_groups(ipf_main_softc_t *, int, int, int);
+static ipfunc_t        ipf_findfunc(ipfunc_t);
+static void            *ipf_findlookup(ipf_main_softc_t *, int, frentry_t *,
+                                       i6addr_t *, i6addr_t *);
+static frentry_t       *ipf_firewall(fr_info_t *, u_32_t *);
+static int             ipf_fr_matcharray(fr_info_t *, int *);
+static int             ipf_frruleiter(ipf_main_softc_t *, void *, int, void *);
+static void            ipf_funcfini(ipf_main_softc_t *, frentry_t *);;
+static int             ipf_funcinit(ipf_main_softc_t *, frentry_t *);
+static int             ipf_geniter(ipf_main_softc_t *, ipftoken_t *,
+                                   ipfgeniter_t *);
+static void            ipf_getstat(ipf_main_softc_t *,
+                                   struct friostat *, int);
+static int             ipf_grpmapfini(struct ipf_main_softc_s *, frentry_t *);
+static int             ipf_grpmapinit(struct ipf_main_softc_s *, frentry_t *);
+static int             ipf_portcheck(frpcmp_t *, u_32_t);
+static INLINE int      ipf_pr_ah(fr_info_t *);
+static INLINE void     ipf_pr_esp(fr_info_t *);
+static INLINE void     ipf_pr_gre(fr_info_t *);
+static INLINE void     ipf_pr_udp(fr_info_t *);
+static INLINE void     ipf_pr_tcp(fr_info_t *);
+static INLINE void     ipf_pr_icmp(fr_info_t *);
+static INLINE void     ipf_pr_ipv4hdr(fr_info_t *);
+static INLINE void     ipf_pr_short(fr_info_t *, int);
+static INLINE int      ipf_pr_tcpcommon(fr_info_t *);
+static INLINE int      ipf_pr_udpcommon(fr_info_t *);
+static void            ipf_rule_delete(ipf_main_softc_t *, frentry_t *f,
+                                       int, int);
+static void            ipf_rule_expire_insert(ipf_main_softc_t *,
+                                              frentry_t *, int);
+static int             ipf_synclist(ipf_main_softc_t *, frentry_t *, void *);
+static ipftuneable_t   *ipf_tune_findbyname(ipftuneable_t *, const char *);
+static ipftuneable_t   *ipf_tune_findbycookie(ipftuneable_t **, void *,
+                                              void **);
+static void            ipf_token_unlink(ipf_main_softc_t *, ipftoken_t *);
+static int             ipf_updateipid(fr_info_t *);
+static int             ipf_settimeout(struct ipf_main_softc_s *,
+                                      struct ipftuneable *, ipftuneval_t *);
 
 
 /*
@@ -301,7 +297,7 @@
 static ipfunc_resolve_t ipf_availfuncs[] = {
        { "srcgrpmap", ipf_srcgrpmap, ipf_grpmapinit, ipf_grpmapfini },
        { "dstgrpmap", ipf_dstgrpmap, ipf_grpmapinit, ipf_grpmapfini },
-       { "",         NULL,           NULL,           NULL }
+       { "",          NULL,          NULL,           NULL }
 };
 
 static ipftuneable_t ipf_main_tuneables[] = {
@@ -416,20 +412,20 @@
  * adding more code to a growing switch statement.
  */
 #ifdef USE_INET6
-static INLINE int      ipf_pr_ah6 __P((fr_info_t *));
-static INLINE void     ipf_pr_esp6 __P((fr_info_t *));
-static INLINE void     ipf_pr_gre6 __P((fr_info_t *));
-static INLINE void     ipf_pr_udp6 __P((fr_info_t *));
-static INLINE void     ipf_pr_tcp6 __P((fr_info_t *));
-static INLINE void     ipf_pr_icmp6 __P((fr_info_t *));
-static INLINE void     ipf_pr_ipv6hdr __P((fr_info_t *));
-static INLINE void     ipf_pr_short6 __P((fr_info_t *, int));
-static INLINE int      ipf_pr_hopopts6 __P((fr_info_t *));
-static INLINE int      ipf_pr_mobility6 __P((fr_info_t *));
-static INLINE int      ipf_pr_routing6 __P((fr_info_t *));
-static INLINE int      ipf_pr_dstopts6 __P((fr_info_t *));
-static INLINE int      ipf_pr_fragment6 __P((fr_info_t *));
-static INLINE struct ip6_ext *ipf_pr_ipv6exthdr __P((fr_info_t *, int, int));
+static INLINE int      ipf_pr_ah6(fr_info_t *);
+static INLINE void     ipf_pr_esp6(fr_info_t *);
+static INLINE void     ipf_pr_gre6(fr_info_t *);
+static INLINE void     ipf_pr_udp6(fr_info_t *);
+static INLINE void     ipf_pr_tcp6(fr_info_t *);
+static INLINE void     ipf_pr_icmp6(fr_info_t *);
+static INLINE void     ipf_pr_ipv6hdr(fr_info_t *);
+static INLINE void     ipf_pr_short6(fr_info_t *, int);
+static INLINE int      ipf_pr_hopopts6(fr_info_t *);
+static INLINE int      ipf_pr_mobility6(fr_info_t *);
+static INLINE int      ipf_pr_routing6(fr_info_t *);
+static INLINE int      ipf_pr_dstopts6(fr_info_t *);
+static INLINE int      ipf_pr_fragment6(fr_info_t *);
+static INLINE struct ip6_ext *ipf_pr_ipv6exthdr(fr_info_t *, int, int);
 
 
 /* ------------------------------------------------------------------------ */
@@ -444,9 +440,7 @@
 /* for ipf_pr_short() for more details.                                     */
 /* ------------------------------------------------------------------------ */
 static INLINE void
-ipf_pr_short6(fin, xmin)
-       fr_info_t *fin;
-       int xmin;
+ipf_pr_short6(fr_info_t *fin, int xmin)
 {
 
        if (fin->fin_dlen < xmin)
@@ -466,8 +460,7 @@
 /* of that possibility arising.                                             */
 /* ------------------------------------------------------------------------ */
 static INLINE void
-ipf_pr_ipv6hdr(fin)
-       fr_info_t *fin;
+ipf_pr_ipv6hdr(fr_info_t *fin)
 {
        ip6_t *ip6 = (ip6_t *)fin->fin_ip;
        int p, go = 1, i, hdrcount;
@@ -637,9 +630,7 @@
 /* flag to indicate its presence.                                           */
 /* ------------------------------------------------------------------------ */
 static INLINE struct ip6_ext *
-ipf_pr_ipv6exthdr(fin, multiple, proto)
-       fr_info_t *fin;
-       int multiple, proto;
+ipf_pr_ipv6exthdr(fr_info_t *fin, int multiple, int proto)
 {
        ipf_main_softc_t *softc = fin->fin_main_soft;
        struct ip6_ext *hdr;
@@ -714,8 +705,7 @@
 /* This is function checks pending hop by hop options extension header      */
 /* ------------------------------------------------------------------------ */
 static INLINE int
-ipf_pr_hopopts6(fin)
-       fr_info_t *fin;
+ipf_pr_hopopts6(fr_info_t *fin)
 {
        struct ip6_ext *hdr;
 
@@ -735,8 +725,7 @@
 /* This is function checks the IPv6 mobility extension header               */
 /* ------------------------------------------------------------------------ */
 static INLINE int
-ipf_pr_mobility6(fin)
-       fr_info_t *fin;
+ipf_pr_mobility6(fr_info_t *fin)
 {
        struct ip6_ext *hdr;
 
@@ -756,8 +745,7 @@
 /* This is function checks pending routing extension header                 */
 /* ------------------------------------------------------------------------ */
 static INLINE int
-ipf_pr_routing6(fin)
-       fr_info_t *fin;
+ipf_pr_routing6(fr_info_t *fin)
 {
        struct ip6_routing *hdr;
 
@@ -819,8 +807,7 @@
 /* and no packet is allowed to overlay that where offset = 0.               */
 /* ------------------------------------------------------------------------ */
 static INLINE int
-ipf_pr_fragment6(fin)
-       fr_info_t *fin;
+ipf_pr_fragment6(fr_info_t *fin)
 {
        ipf_main_softc_t *softc = fin->fin_main_soft;
        struct ip6_frag *frag;
@@ -874,8 +861,7 @@
 /* This is function checks pending destination options extension header     */
 /* ------------------------------------------------------------------------ */
 static INLINE int
-ipf_pr_dstopts6(fin)
-       fr_info_t *fin;
+ipf_pr_dstopts6(fr_info_t *fin)
 {
        ipf_main_softc_t *softc = fin->fin_main_soft;
        struct ip6_ext *hdr;
@@ -899,8 +885,7 @@
 /* for an ICMPv6 packet.                                                    */
 /* ------------------------------------------------------------------------ */
 static INLINE void
-ipf_pr_icmp6(fin)
-       fr_info_t *fin;
+ipf_pr_icmp6(fr_info_t *fin)
 {
        int minicmpsz = sizeof(struct icmp6_hdr);
        struct icmp6_hdr *icmp6;
@@ -956,7 +941,7 @@
                        icmp6 = fin->fin_dp;
                        ip6 = (ip6_t *)((char *)icmp6 + ICMPERR_ICMPHLEN);
                        if (IP6_NEQ(&fin->fin_fi.fi_dst,
-                                   (i6addr_t *)&ip6->ip6_src))
+                                   &ip6->ip6_src))
                                fin->fin_flx |= FI_BAD;
                        break;
                default :
@@ -978,8 +963,7 @@
 /* Is not expected to be called for fragmented packets.                     */
 /* ------------------------------------------------------------------------ */
 static INLINE void
-ipf_pr_udp6(fin)
-       fr_info_t *fin;
+ipf_pr_udp6(fr_info_t *fin)
 {
 
        if (ipf_pr_udpcommon(fin) == 0) {
@@ -1002,8 +986,7 @@
 /* Is not expected to be called for fragmented packets.                     */
 /* ------------------------------------------------------------------------ */



Home | Main Index | Thread Index | Old Index