Deleted Added
sdiff udiff text old ( 93382 ) new ( 93383 )
full compact
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 93383 2002-03-29 11:22:22Z 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>

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

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
97static int fddi_resolvemulti(struct ifnet *, struct sockaddr **,
98 struct sockaddr *);
99static int fddi_output(struct ifnet *, struct mbuf *, struct sockaddr *,
100 struct rtentry *);
101
102
103#define IFP2AC(IFP) ((struct arpcom *)IFP)
104#define senderr(e) { error = (e); goto bad; }
105
106/*
107 * FDDI output routine.
108 * Encapsulate a packet of type family for the local net.
109 * Use trailer local net encapsulation if enough data in first
110 * packet leaves a multiple of 512 bytes of data in remainder.
111 * Assumes that ifp is actually pointer to arpcom structure.
112 */
113static int
114fddi_output(ifp, m, dst, rt0)
115 struct ifnet *ifp;
116 struct mbuf *m;
117 struct sockaddr *dst;
118 struct rtentry *rt0;
119{
120 u_int16_t type;
121 int loop_copy = 0, error = 0, hdrcmplt = 0;

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

517 m_freem(m);
518 return;
519}
520
521/*
522 * Perform common duties while attaching to interface list
523 */
524void
525fddi_ifattach(ifp, bpf)
526 struct ifnet *ifp;
527 int bpf;
528{
529 struct ifaddr *ifa;
530 struct sockaddr_dl *sdl;
531
532 ifp->if_type = IFT_FDDI;
533 ifp->if_addrlen = FDDI_ADDR_LEN;
534 ifp->if_hdrlen = 21;
535

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

550 return;
551 }
552
553 sdl = (struct sockaddr_dl *)ifa->ifa_addr;
554 sdl->sdl_type = IFT_FDDI;
555 sdl->sdl_alen = ifp->if_addrlen;
556 bcopy(IFP2AC(ifp)->ac_enaddr, LLADDR(sdl), ifp->if_addrlen);
557
558 if (bpf)
559 bpfattach(ifp, DLT_FDDI, FDDI_HDR_LEN);
560
561 return;
562}
563
564void
565fddi_ifdetach(ifp, bpf)
566 struct ifnet *ifp;
567 int bpf;
568{

--- 184 unchanged lines hidden ---