Author: ae
Date: Sat Jun  6 13:26:13 2015
New Revision: 284072
URL: https://svnweb.freebsd.org/changeset/base/284072

Log:
  MFC r276148:
    Remove in_gif.h and in6_gif.h files. They only contain function
    declarations used by gif(4). Instead declare these functions in C files.
    Also make some variables static.
  
  MFC r276215:
    Extern declarations in C files loses compile-time checking that
    the functions' calls match their definitions. Move them to header files.

Deleted:
  stable/10/sys/netinet/in_gif.h
  stable/10/sys/netinet6/in6_gif.h
Modified:
  stable/10/ObsoleteFiles.inc
  stable/10/sys/net/if_gif.c
  stable/10/sys/net/if_gif.h
  stable/10/sys/net/if_gre.c
  stable/10/sys/net/if_gre.h
  stable/10/sys/netinet/in_gif.c
  stable/10/sys/netinet/ip_gre.c
  stable/10/sys/netinet6/in6_gif.c
  stable/10/sys/netinet6/ip6_gre.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/ObsoleteFiles.inc
==============================================================================
--- stable/10/ObsoleteFiles.inc Sat Jun  6 13:20:02 2015        (r284071)
+++ stable/10/ObsoleteFiles.inc Sat Jun  6 13:26:13 2015        (r284072)
@@ -40,6 +40,9 @@
 
 # 20150506
 OLD_FILES+=usr/share/man/man9/NDHASGIANT.9.gz
+# 20141223: remove in6_gif.h and in_gif.h
+OLD_FILES+=usr/include/netinet/in_gif.h
+OLD_FILES+=usr/include/netinet6/in6_gif.h
 # 20141205: convert sbin/mdconfig/tests to ATF format tests
 OLD_FILES+=usr/tests/sbin/mdconfig/legacy_test
 OLD_FILES+=usr/tests/sbin/mdconfig/mdconfig.test

Modified: stable/10/sys/net/if_gif.c
==============================================================================
--- stable/10/sys/net/if_gif.c  Sat Jun  6 13:20:02 2015        (r284071)
+++ stable/10/sys/net/if_gif.c  Sat Jun  6 13:26:13 2015        (r284072)
@@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$");
 #include <netinet/ip_ecn.h>
 #ifdef INET
 #include <netinet/in_var.h>
-#include <netinet/in_gif.h>
 #include <netinet/ip_var.h>
 #endif /* INET */
 
@@ -85,7 +84,6 @@ __FBSDID("$FreeBSD$");
 #include <netinet6/ip6_ecn.h>
 #include <netinet6/ip6_var.h>
 #include <netinet6/scope6_var.h>
-#include <netinet6/in6_gif.h>
 #include <netinet6/ip6protosw.h>
 #endif /* INET6 */
 

Modified: stable/10/sys/net/if_gif.h
==============================================================================
--- stable/10/sys/net/if_gif.h  Sat Jun  6 13:20:02 2015        (r284071)
+++ stable/10/sys/net/if_gif.h  Sat Jun  6 13:26:13 2015        (r284072)
@@ -111,6 +111,16 @@ void gif_input(struct mbuf *, struct ifn
 int gif_output(struct ifnet *, struct mbuf *, const struct sockaddr *,
               struct route *);
 int gif_encapcheck(const struct mbuf *, int, int, void *);
+#ifdef INET
+int in_gif_output(struct ifnet *, struct mbuf *, int, uint8_t);
+int in_gif_encapcheck(const struct mbuf *, int, int, void *);
+int in_gif_attach(struct gif_softc *);
+#endif
+#ifdef INET6
+int in6_gif_output(struct ifnet *, struct mbuf *, int, uint8_t);
+int in6_gif_encapcheck(const struct mbuf *, int, int, void *);
+int in6_gif_attach(struct gif_softc *);
+#endif
 #endif /* _KERNEL */
 
 #define GIFGOPTS       _IOWR('i', 150, struct ifreq)

Modified: stable/10/sys/net/if_gre.c
==============================================================================
--- stable/10/sys/net/if_gre.c  Sat Jun  6 13:20:02 2015        (r284071)
+++ stable/10/sys/net/if_gre.c  Sat Jun  6 13:26:13 2015        (r284072)
@@ -119,16 +119,6 @@ static int gre_set_tunnel(struct ifnet *
     struct sockaddr *);
 static void    gre_delete_tunnel(struct ifnet *);
 
-int            gre_input(struct mbuf **, int *, int);
-#ifdef INET
-extern int     in_gre_attach(struct gre_softc *);
-extern int     in_gre_output(struct mbuf *, int, int);
-#endif
-#ifdef INET6
-extern int     in6_gre_attach(struct gre_softc *);
-extern int     in6_gre_output(struct mbuf *, int, int);
-#endif
-
 SYSCTL_DECL(_net_link);
 static SYSCTL_NODE(_net_link, IFT_TUNNEL, gre, CTLFLAG_RW, 0,
     "Generic Routing Encapsulation");

Modified: stable/10/sys/net/if_gre.h
==============================================================================
--- stable/10/sys/net/if_gre.h  Sat Jun  6 13:20:02 2015        (r284071)
+++ stable/10/sys/net/if_gre.h  Sat Jun  6 13:26:13 2015        (r284072)
@@ -100,6 +100,15 @@ struct gre_softc {
 #define        gre_oip                 gre_gihdr->gi_ip
 #define        gre_oip6                gre_gi6hdr->gi6_ip6
 
+int    gre_input(struct mbuf **, int *, int);
+#ifdef INET
+int    in_gre_attach(struct gre_softc *);
+int    in_gre_output(struct mbuf *, int, int);
+#endif
+#ifdef INET6
+int    in6_gre_attach(struct gre_softc *);
+int    in6_gre_output(struct mbuf *, int, int);
+#endif
 /*
  * CISCO uses special type for GRE tunnel created as part of WCCP
  * connection, while in fact those packets are just IPv4 encapsulated

Modified: stable/10/sys/netinet/in_gif.c
==============================================================================
--- stable/10/sys/netinet/in_gif.c      Sat Jun  6 13:20:02 2015        
(r284071)
+++ stable/10/sys/netinet/in_gif.c      Sat Jun  6 13:26:13 2015        
(r284072)
@@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$");
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
 #include <netinet/ip_var.h>
-#include <netinet/in_gif.h>
 #include <netinet/in_var.h>
 #include <netinet/ip_encap.h>
 #include <netinet/ip_ecn.h>
@@ -70,10 +69,11 @@ __FBSDID("$FreeBSD$");
 
 static int gif_validate4(const struct ip *, struct gif_softc *,
        struct ifnet *);
+static int in_gif_input(struct mbuf **, int *, int);
 
 static void in_gif_input10(struct mbuf *, int);
 extern  struct domain inetdomain;
-struct protosw in_gif_protosw = {
+static struct protosw in_gif_protosw = {
        .pr_type =              SOCK_RAW,
        .pr_domain =            &inetdomain,
        .pr_protocol =          0/* IPPROTO_IPV[46] */,
@@ -84,7 +84,8 @@ struct protosw in_gif_protosw = {
        .pr_usrreqs =           &rip_usrreqs
 };
 
-VNET_DEFINE(int, ip_gif_ttl) = GIF_TTL;
+#define GIF_TTL                30
+static VNET_DEFINE(int, ip_gif_ttl) = GIF_TTL;
 #define        V_ip_gif_ttl            VNET(ip_gif_ttl)
 SYSCTL_VNET_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_RW,
        &VNET_NAME(ip_gif_ttl), 0, "");
@@ -143,7 +144,7 @@ in_gif_input10(struct mbuf *m, int off)
        in_gif_input(&m, &off, proto);
 }
 
-int
+static int
 in_gif_input(struct mbuf **mp, int *offp, int proto)
 {
        struct mbuf *m = *mp;

Modified: stable/10/sys/netinet/ip_gre.c
==============================================================================
--- stable/10/sys/netinet/ip_gre.c      Sat Jun  6 13:20:02 2015        
(r284071)
+++ stable/10/sys/netinet/ip_gre.c      Sat Jun  6 13:26:13 2015        
(r284072)
@@ -73,11 +73,6 @@ __FBSDID("$FreeBSD$");
 #include <machine/stdarg.h>
 
 extern struct domain inetdomain;
-extern int gre_input(struct mbuf **, int *, int);
-
-int in_gre_attach(struct gre_softc *);
-int in_gre_output(struct mbuf *, int, int);
-
 static void gre_input10(struct mbuf *, int);
 static const struct protosw in_gre_protosw = {
        .pr_type =              SOCK_RAW,

Modified: stable/10/sys/netinet6/in6_gif.c
==============================================================================
--- stable/10/sys/netinet6/in6_gif.c    Sat Jun  6 13:20:02 2015        
(r284071)
+++ stable/10/sys/netinet6/in6_gif.c    Sat Jun  6 13:26:13 2015        
(r284072)
@@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$");
 #ifdef INET6
 #include <netinet/ip6.h>
 #include <netinet6/ip6_var.h>
-#include <netinet6/in6_gif.h>
 #include <netinet6/in6_var.h>
 #endif
 #include <netinet6/ip6protosw.h>
@@ -75,7 +74,8 @@ __FBSDID("$FreeBSD$");
 
 #include <net/if_gif.h>
 
-VNET_DEFINE(int, ip6_gif_hlim) = GIF_HLIM;
+#define GIF_HLIM       30
+static VNET_DEFINE(int, ip6_gif_hlim) = GIF_HLIM;
 #define        V_ip6_gif_hlim                  VNET(ip6_gif_hlim)
 
 SYSCTL_DECL(_net_inet6_ip6);
@@ -84,9 +84,10 @@ SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_
 
 static int gif_validate6(const struct ip6_hdr *, struct gif_softc *,
                         struct ifnet *);
+static int in6_gif_input(struct mbuf **, int *, int);
 
 extern  struct domain inet6domain;
-struct ip6protosw in6_gif_protosw = {
+static struct ip6protosw in6_gif_protosw = {
        .pr_type =      SOCK_RAW,
        .pr_domain =    &inet6domain,
        .pr_protocol =  0,                      /* IPPROTO_IPV[46] */
@@ -145,7 +146,7 @@ in6_gif_output(struct ifnet *ifp, struct
        return (ip6_output(m, 0, NULL, IPV6_MINMTU, 0, NULL, NULL));
 }
 
-int
+static int
 in6_gif_input(struct mbuf **mp, int *offp, int proto)
 {
        struct mbuf *m = *mp;

Modified: stable/10/sys/netinet6/ip6_gre.c
==============================================================================
--- stable/10/sys/netinet6/ip6_gre.c    Sat Jun  6 13:20:02 2015        
(r284071)
+++ stable/10/sys/netinet6/ip6_gre.c    Sat Jun  6 13:26:13 2015        
(r284072)
@@ -63,11 +63,6 @@ __FBSDID("$FreeBSD$");
 #include <net/if_gre.h>
 
 extern  struct domain inet6domain;
-extern int gre_input(struct mbuf **, int *, int);
-
-int in6_gre_attach(struct gre_softc *);
-int in6_gre_output(struct mbuf *, int, int);
-
 struct ip6protosw in6_gre_protosw = {
        .pr_type =      SOCK_RAW,
        .pr_domain =    &inet6domain,
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to