1/* $NetBSD: if_gre.c,v 1.49 2003/12/11 00:22:29 itojun Exp $ */ |
2/* $FreeBSD: head/sys/net/if_gre.c 241686 2012-10-18 13:57:24Z andre $ */ |
3 4/*- 5 * Copyright (c) 1998 The NetBSD Foundation, Inc. 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to The NetBSD Foundation 9 * by Heiko W.Rupp <hwr@pilhuhn.de> 10 * --- 502 unchanged lines hidden (view full) --- 513 514static int 515gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) 516{ 517 struct ifreq *ifr = (struct ifreq *)data; 518 struct if_laddrreq *lifr = (struct if_laddrreq *)data; 519 struct in_aliasreq *aifr = (struct in_aliasreq *)data; 520 struct gre_softc *sc = ifp->if_softc; |
521 struct sockaddr_in si; 522 struct sockaddr *sa = NULL; 523 int error, adj; 524 struct sockaddr_in sp, sm, dp, dm; 525 uint32_t key; 526 527 error = 0; 528 adj = 0; 529 |
530 switch (cmd) { 531 case SIOCSIFADDR: 532 ifp->if_flags |= IFF_UP; 533 break; 534 case SIOCSIFDSTADDR: 535 break; 536 case SIOCSIFFLAGS: 537 /* --- 303 unchanged lines hidden (view full) --- 841 error = copyout(&sc->key, ifr->ifr_data, sizeof(sc->key)); 842 break; 843 844 default: 845 error = EINVAL; 846 break; 847 } 848 |
849 return (error); 850} 851 852/* 853 * computes a route to our destination that is not the one 854 * which would be taken by ip_output(), as this one will loop back to 855 * us. If the interface is p2p as a--->b, then a routing entry exists 856 * If we now send a packet to b (e.g. ping b), this will come down here --- 121 unchanged lines hidden --- |