Refactor protosw codes in gif(4). No functional change.

- remove unnecessary include
    - reduce scopes
This commit is contained in:
knakahara 2016-01-18 06:08:26 +00:00
parent 73eb2fb364
commit d7b9bb29c0
3 changed files with 9 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_gif.c,v 1.104 2016/01/08 03:55:39 knakahara Exp $ */
/* $NetBSD: if_gif.c,v 1.105 2016/01/18 06:08:26 knakahara Exp $ */
/* $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $ */
/*
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.104 2016/01/08 03:55:39 knakahara Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.105 2016/01/18 06:08:26 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -49,7 +49,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.104 2016/01/08 03:55:39 knakahara Exp $
#include <sys/socketvar.h>
#include <sys/syslog.h>
#include <sys/proc.h>
#include <sys/protosw.h>
#include <sys/cpu.h>
#include <sys/intr.h>
#include <sys/kmem.h>
@ -77,7 +76,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.104 2016/01/08 03:55:39 knakahara Exp $
#include <netinet/ip6.h>
#include <netinet6/ip6_var.h>
#include <netinet6/in6_gif.h>
#include <netinet6/ip6protosw.h>
#endif /* INET6 */
#include <netinet/ip_encap.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: in_gif.c,v 1.67 2015/12/25 06:47:56 knakahara Exp $ */
/* $NetBSD: in_gif.c,v 1.68 2016/01/18 06:08:26 knakahara Exp $ */
/* $KAME: in_gif.c,v 1.66 2001/07/29 04:46:09 itojun Exp $ */
/*
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.67 2015/12/25 06:47:56 knakahara Exp $");
__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.68 2016/01/18 06:08:26 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -79,7 +79,7 @@ int ip_gif_ttl = GIF_TTL;
int ip_gif_ttl = 0;
#endif
const struct protosw in_gif_protosw = {
static const struct protosw in_gif_protosw = {
.pr_type = SOCK_RAW,
.pr_domain = &inetdomain,
.pr_protocol = 0 /* IPPROTO_IPV[46] */,

View File

@ -1,4 +1,4 @@
/* $NetBSD: in6_gif.c,v 1.64 2015/12/25 06:47:57 knakahara Exp $ */
/* $NetBSD: in6_gif.c,v 1.65 2016/01/18 06:08:26 knakahara Exp $ */
/* $KAME: in6_gif.c,v 1.62 2001/07/29 04:27:25 itojun Exp $ */
/*
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.64 2015/12/25 06:47:57 knakahara Exp $");
__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.65 2016/01/18 06:08:26 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -79,7 +79,7 @@ int ip6_gif_hlim = GIF_HLIM;
extern LIST_HEAD(, gif_softc) gif_softc_list;
extern const struct ip6protosw in6_gif_protosw;
static const struct ip6protosw in6_gif_protosw;
/*
* family - family of the packet to be encapsulate.
@ -458,7 +458,7 @@ PR_WRAP_CTLOUTPUT(rip6_ctloutput)
extern struct domain inet6domain;
const struct ip6protosw in6_gif_protosw = {
static const struct ip6protosw in6_gif_protosw = {
.pr_type = SOCK_RAW,
.pr_domain = &inet6domain,
.pr_protocol = 0 /* IPPROTO_IPV[46] */,