Deleted Added
full compact
if_fddisubr.c (93381) if_fddisubr.c (93382)
1/*
2 * Copyright (c) 1995, 1996
3 * Matt Thomas <matt@3am-software.com>. All rights reserved.
4 * Copyright (c) 1982, 1989, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 19 unchanged lines hidden (view full) ---

28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * from: if_ethersubr.c,v 1.5 1994/12/13 22:31:45 wollman Exp
1/*
2 * Copyright (c) 1995, 1996
3 * Matt Thomas <matt@3am-software.com>. All rights reserved.
4 * Copyright (c) 1982, 1989, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 19 unchanged lines hidden (view full) ---

28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * from: if_ethersubr.c,v 1.5 1994/12/13 22:31:45 wollman Exp
36 * $FreeBSD: head/sys/net/if_fddisubr.c 93381 2002-03-29 10:29:10Z mdodd $
36 * $FreeBSD: head/sys/net/if_fddisubr.c 93382 2002-03-29 10:40:35Z mdodd $
37 */
38
39#include "opt_atalk.h"
40#include "opt_inet.h"
41#include "opt_inet6.h"
42#include "opt_ipx.h"
43
44#include <sys/param.h>

--- 41 unchanged lines hidden (view full) ---

86#include <netatalk/at.h>
87#include <netatalk/at_var.h>
88#include <netatalk/at_extern.h>
89
90extern u_char at_org_code[ 3 ];
91extern u_char aarp_org_code[ 3 ];
92#endif /* NETATALK */
93
37 */
38
39#include "opt_atalk.h"
40#include "opt_inet.h"
41#include "opt_inet6.h"
42#include "opt_ipx.h"
43
44#include <sys/param.h>

--- 41 unchanged lines hidden (view full) ---

86#include <netatalk/at.h>
87#include <netatalk/at_var.h>
88#include <netatalk/at_extern.h>
89
90extern u_char at_org_code[ 3 ];
91extern u_char aarp_org_code[ 3 ];
92#endif /* NETATALK */
93
94static u_char fddibroadcastaddr[FDDI_ADDR_LEN] =
95 { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
96
94static int fddi_resolvemulti(struct ifnet *, struct sockaddr **,
95 struct sockaddr *);
96
97#define IFP2AC(IFP) ((struct arpcom *)IFP)
98#define senderr(e) { error = (e); goto bad; }
99
100/*
101 * FDDI output routine.

--- 444 unchanged lines hidden (view full) ---

546 sdl = (struct sockaddr_dl *)ifa->ifa_addr;
547 sdl->sdl_type = IFT_FDDI;
548 sdl->sdl_alen = ifp->if_addrlen;
549 bcopy(IFP2AC(ifp)->ac_enaddr, LLADDR(sdl), ifp->if_addrlen);
550
551 return;
552}
553
97static int fddi_resolvemulti(struct ifnet *, struct sockaddr **,
98 struct sockaddr *);
99
100#define IFP2AC(IFP) ((struct arpcom *)IFP)
101#define senderr(e) { error = (e); goto bad; }
102
103/*
104 * FDDI output routine.

--- 444 unchanged lines hidden (view full) ---

549 sdl = (struct sockaddr_dl *)ifa->ifa_addr;
550 sdl->sdl_type = IFT_FDDI;
551 sdl->sdl_alen = ifp->if_addrlen;
552 bcopy(IFP2AC(ifp)->ac_enaddr, LLADDR(sdl), ifp->if_addrlen);
553
554 return;
555}
556
557void
558fddi_ifdetach(ifp, bpf)
559 struct ifnet *ifp;
560 int bpf;
561{
562
563 if (bpf)
564 bpfdetach(ifp);
565
566 if_detach(ifp);
567
568 return;
569}
570
571int
572fddi_ioctl (ifp, command, data)
573 struct ifnet *ifp;
574 int command;
575 caddr_t data;
576{
577 struct ifaddr *ifa;
578 struct ifreq *ifr;
579 int error;
580
581 ifa = (struct ifaddr *) data;
582 ifr = (struct ifreq *) data;
583 error = 0;
584
585 switch (command) {
586 case SIOCSIFADDR:
587 ifp->if_flags |= IFF_UP;
588
589 switch (ifa->ifa_addr->sa_family) {
590#ifdef INET
591 case AF_INET: /* before arpwhohas */
592 ifp->if_init(ifp->if_softc);
593 arp_ifinit(ifp, ifa);
594 break;
595#endif
596#ifdef IPX
597 /*
598 * XXX - This code is probably wrong
599 */
600 case AF_IPX: {
601 struct ipx_addr *ina;
602 struct arpcom *ac;
603
604 ina = &(IA_SIPX(ifa)->sipx_addr);
605 ac = IFP2AC(ifp);
606
607 if (ipx_nullhost(*ina)) {
608 ina->x_host = *(union ipx_host *)
609 ac->ac_enaddr;
610 } else {
611 bcopy((caddr_t) ina->x_host.c_host,
612 (caddr_t) ac->ac_enaddr,
613 sizeof(ac->ac_enaddr));
614 }
615
616 /*
617 * Set new address
618 */
619 ifp->if_init(ifp->if_softc);
620 }
621 break;
622#endif
623 default:
624 ifp->if_init(ifp->if_softc);
625 break;
626 }
627 case SIOCGIFADDR: {
628 struct sockaddr *sa;
629
630 sa = (struct sockaddr *) & ifr->ifr_data;
631 bcopy(IFP2AC(ifp)->ac_enaddr,
632 (caddr_t) sa->sa_data, FDDI_ADDR_LEN);
633
634 }
635 break;
636 case SIOCSIFMTU:
637 /*
638 * Set the interface MTU.
639 */
640 if (ifr->ifr_mtu > FDDIMTU) {
641 error = EINVAL;
642 } else {
643 ifp->if_mtu = ifr->ifr_mtu;
644 }
645 break;
646 default:
647 break;
648 }
649
650 return (error);
651}
652
554static int
555fddi_resolvemulti(ifp, llsa, sa)
556 struct ifnet *ifp;
557 struct sockaddr **llsa;
558 struct sockaddr *sa;
559{
560 struct sockaddr_dl *sdl;
561 struct sockaddr_in *sin;

--- 85 unchanged lines hidden ---
653static int
654fddi_resolvemulti(ifp, llsa, sa)
655 struct ifnet *ifp;
656 struct sockaddr **llsa;
657 struct sockaddr *sa;
658{
659 struct sockaddr_dl *sdl;
660 struct sockaddr_in *sin;

--- 85 unchanged lines hidden ---