From owner-svn-src-head@FreeBSD.ORG Thu Dec 25 21:32:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7BDDC4; Thu, 25 Dec 2014 21:32:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3B5236C8; Thu, 25 Dec 2014 21:32:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBPLWeLm060381; Thu, 25 Dec 2014 21:32:40 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBPLWcV3060371; Thu, 25 Dec 2014 21:32:38 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412252132.sBPLWcV3060371@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 25 Dec 2014 21:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r276215 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Dec 2014 21:32:41 -0000 Author: ae Date: Thu Dec 25 21:32:37 2014 New Revision: 276215 URL: https://svnweb.freebsd.org/changeset/base/276215 Log: Extern declarations in C files loses compile-time checking that the functions' calls match their definitions. Move them to header files. Reviewed by: jilles (previous version) Modified: head/sys/net/if_gif.c head/sys/net/if_gif.h head/sys/net/if_gre.c head/sys/net/if_gre.h head/sys/netinet/in_gif.c head/sys/netinet/ip_gre.c head/sys/netinet6/in6_gif.c head/sys/netinet6/ip6_gre.c Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Thu Dec 25 20:15:13 2014 (r276214) +++ head/sys/net/if_gif.c Thu Dec 25 21:32:37 2014 (r276215) @@ -118,16 +118,6 @@ void (*ng_gif_input_orphan_p)(struct ifn void (*ng_gif_attach_p)(struct ifnet *ifp); void (*ng_gif_detach_p)(struct ifnet *ifp); -#ifdef INET -extern int in_gif_output(struct ifnet *, struct mbuf *, int, uint8_t); -extern int in_gif_encapcheck(const struct mbuf *, int, int, void *); -extern int in_gif_attach(struct gif_softc *); -#endif -#ifdef INET6 -extern int in6_gif_output(struct ifnet *, struct mbuf *, int, uint8_t); -extern int in6_gif_encapcheck(const struct mbuf *, int, int, void *); -extern int in6_gif_attach(struct gif_softc *); -#endif static int gif_set_tunnel(struct ifnet *, struct sockaddr *, struct sockaddr *); static void gif_delete_tunnel(struct ifnet *); Modified: head/sys/net/if_gif.h ============================================================================== --- head/sys/net/if_gif.h Thu Dec 25 20:15:13 2014 (r276214) +++ head/sys/net/if_gif.h Thu Dec 25 21:32:37 2014 (r276215) @@ -114,6 +114,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: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Thu Dec 25 20:15:13 2014 (r276214) +++ head/sys/net/if_gre.c Thu Dec 25 21:32:37 2014 (r276215) @@ -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: head/sys/net/if_gre.h ============================================================================== --- head/sys/net/if_gre.h Thu Dec 25 20:15:13 2014 (r276214) +++ head/sys/net/if_gre.h Thu Dec 25 21:32:37 2014 (r276215) @@ -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: head/sys/netinet/in_gif.c ============================================================================== --- head/sys/netinet/in_gif.c Thu Dec 25 20:15:13 2014 (r276214) +++ head/sys/netinet/in_gif.c Thu Dec 25 21:32:37 2014 (r276215) @@ -67,10 +67,6 @@ __FBSDID("$FreeBSD$"); #include -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 *); - static int gif_validate4(const struct ip *, struct gif_softc *, struct ifnet *); static int in_gif_input(struct mbuf **, int *, int); Modified: head/sys/netinet/ip_gre.c ============================================================================== --- head/sys/netinet/ip_gre.c Thu Dec 25 20:15:13 2014 (r276214) +++ head/sys/netinet/ip_gre.c Thu Dec 25 21:32:37 2014 (r276215) @@ -68,11 +68,6 @@ __FBSDID("$FreeBSD$"); #include 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 const struct protosw in_gre_protosw = { .pr_type = SOCK_RAW, .pr_domain = &inetdomain, Modified: head/sys/netinet6/in6_gif.c ============================================================================== --- head/sys/netinet6/in6_gif.c Thu Dec 25 20:15:13 2014 (r276214) +++ head/sys/netinet6/in6_gif.c Thu Dec 25 21:32:37 2014 (r276215) @@ -81,10 +81,6 @@ SYSCTL_DECL(_net_inet6_ip6); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM, gifhlim, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_gif_hlim), 0, ""); -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 *); - static int gif_validate6(const struct ip6_hdr *, struct gif_softc *, struct ifnet *); static int in6_gif_input(struct mbuf **, int *, int); Modified: head/sys/netinet6/ip6_gre.c ============================================================================== --- head/sys/netinet6/ip6_gre.c Thu Dec 25 20:15:13 2014 (r276214) +++ head/sys/netinet6/ip6_gre.c Thu Dec 25 21:32:37 2014 (r276215) @@ -62,11 +62,6 @@ __FBSDID("$FreeBSD$"); #include 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 protosw in6_gre_protosw = { .pr_type = SOCK_RAW, .pr_domain = &inet6domain,