ip6_gre.c (274246) | ip6_gre.c (284066) |
---|---|
1/*- 2 * Copyright (c) 2014 Andrey V. Elsukov <ae@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2014 Andrey V. Elsukov <ae@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/netinet6/ip6_gre.c 274246 2014-11-07 19:13:19Z ae $"); | 28__FBSDID("$FreeBSD: stable/10/sys/netinet6/ip6_gre.c 284066 2015-06-06 12:44:42Z ae $"); |
29 30#include "opt_inet.h" 31#include "opt_inet6.h" 32 33#include <sys/param.h> 34#include <sys/lock.h> 35#include <sys/rmlock.h> 36#include <sys/systm.h> --- 15 unchanged lines hidden (view full) --- 52#include <netinet/in.h> 53#include <netinet/in_systm.h> 54#ifdef INET 55#include <net/ethernet.h> 56#include <netinet/ip.h> 57#endif 58#include <netinet/ip_encap.h> 59#include <netinet/ip6.h> | 29 30#include "opt_inet.h" 31#include "opt_inet6.h" 32 33#include <sys/param.h> 34#include <sys/lock.h> 35#include <sys/rmlock.h> 36#include <sys/systm.h> --- 15 unchanged lines hidden (view full) --- 52#include <netinet/in.h> 53#include <netinet/in_systm.h> 54#ifdef INET 55#include <net/ethernet.h> 56#include <netinet/ip.h> 57#endif 58#include <netinet/ip_encap.h> 59#include <netinet/ip6.h> |
60#include <netinet6/ip6protosw.h> |
|
60#include <netinet6/ip6_var.h> 61#include <netinet6/in6_var.h> 62#include <net/if_gre.h> 63 64extern struct domain inet6domain; 65extern int gre_input(struct mbuf **, int *, int); 66 67int in6_gre_attach(struct gre_softc *); 68int in6_gre_output(struct mbuf *, int, int); 69 | 61#include <netinet6/ip6_var.h> 62#include <netinet6/in6_var.h> 63#include <net/if_gre.h> 64 65extern struct domain inet6domain; 66extern int gre_input(struct mbuf **, int *, int); 67 68int in6_gre_attach(struct gre_softc *); 69int in6_gre_output(struct mbuf *, int, int); 70 |
70struct protosw in6_gre_protosw = { | 71struct ip6protosw in6_gre_protosw = { |
71 .pr_type = SOCK_RAW, 72 .pr_domain = &inet6domain, 73 .pr_protocol = IPPROTO_GRE, 74 .pr_flags = PR_ATOMIC|PR_ADDR, 75 .pr_input = gre_input, 76 .pr_output = rip6_output, 77 .pr_ctloutput = rip6_ctloutput, 78 .pr_usrreqs = &rip6_usrreqs --- 60 unchanged lines hidden (view full) --- 139} 140 141int 142in6_gre_attach(struct gre_softc *sc) 143{ 144 145 KASSERT(sc->gre_ecookie == NULL, ("gre_ecookie isn't NULL")); 146 sc->gre_ecookie = encap_attach_func(AF_INET6, IPPROTO_GRE, | 72 .pr_type = SOCK_RAW, 73 .pr_domain = &inet6domain, 74 .pr_protocol = IPPROTO_GRE, 75 .pr_flags = PR_ATOMIC|PR_ADDR, 76 .pr_input = gre_input, 77 .pr_output = rip6_output, 78 .pr_ctloutput = rip6_ctloutput, 79 .pr_usrreqs = &rip6_usrreqs --- 60 unchanged lines hidden (view full) --- 140} 141 142int 143in6_gre_attach(struct gre_softc *sc) 144{ 145 146 KASSERT(sc->gre_ecookie == NULL, ("gre_ecookie isn't NULL")); 147 sc->gre_ecookie = encap_attach_func(AF_INET6, IPPROTO_GRE, |
147 in6_gre_encapcheck, &in6_gre_protosw, sc); | 148 in6_gre_encapcheck, (void *)&in6_gre_protosw, sc); |
148 if (sc->gre_ecookie == NULL) 149 return (EEXIST); 150 return (0); 151} | 149 if (sc->gre_ecookie == NULL) 150 return (EEXIST); 151 return (0); 152} |