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

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

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

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

546 return;
547 }
548
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
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
554 return;
555}
556
557void
558fddi_ifdetach(ifp, bpf)
559 struct ifnet *ifp;
560 int bpf;
561{

--- 184 unchanged lines hidden ---
561 return;
562}
563
564void
565fddi_ifdetach(ifp, bpf)
566 struct ifnet *ifp;
567 int bpf;
568{

--- 184 unchanged lines hidden ---