Deleted Added
full compact
if_fddisubr.c (93369) if_fddisubr.c (93371)
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 93369 2002-03-29 08:04:36Z mdodd $
36 * $FreeBSD: head/sys/net/if_fddisubr.c 93371 2002-03-29 08:14:29Z 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>

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

78#include <netdnet/dn.h>
79#endif
80
81#ifdef NETATALK
82#include <netatalk/at.h>
83#include <netatalk/at_var.h>
84#include <netatalk/at_extern.h>
85
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>

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

78#include <netdnet/dn.h>
79#endif
80
81#ifdef NETATALK
82#include <netatalk/at.h>
83#include <netatalk/at_var.h>
84#include <netatalk/at_extern.h>
85
86#define llc_snap_org_code llc_un.type_snap.org_code
87#define llc_snap_ether_type llc_un.type_snap.ether_type
88
89extern u_char at_org_code[ 3 ];
90extern u_char aarp_org_code[ 3 ];
91#endif /* NETATALK */
92
93static int fddi_resolvemulti(struct ifnet *, struct sockaddr **,
94 struct sockaddr *);
95
86extern u_char at_org_code[ 3 ];
87extern u_char aarp_org_code[ 3 ];
88#endif /* NETATALK */
89
90static int fddi_resolvemulti(struct ifnet *, struct sockaddr **,
91 struct sockaddr *);
92
96/*
97 * This really should be defined in if_llc.h but in case it isn't.
98 */
99#ifndef llc_snap
100#define llc_snap llc_un.type_snap
101#endif
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.

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

194 if (aa->aa_flags & AFA_PHASE2) {
195 struct llc llc;
196
197 M_PREPEND(m, sizeof(struct llc), M_TRYWAIT);
198 if (m == 0)
199 senderr(ENOBUFS);
200 llc.llc_dsap = llc.llc_ssap = LLC_SNAP_LSAP;
201 llc.llc_control = LLC_UI;
93#define IFP2AC(IFP) ((struct arpcom *)IFP)
94#define senderr(e) { error = (e); goto bad; }
95
96/*
97 * FDDI output routine.
98 * Encapsulate a packet of type family for the local net.
99 * Use trailer local net encapsulation if enough data in first
100 * packet leaves a multiple of 512 bytes of data in remainder.

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

184 if (aa->aa_flags & AFA_PHASE2) {
185 struct llc llc;
186
187 M_PREPEND(m, sizeof(struct llc), M_TRYWAIT);
188 if (m == 0)
189 senderr(ENOBUFS);
190 llc.llc_dsap = llc.llc_ssap = LLC_SNAP_LSAP;
191 llc.llc_control = LLC_UI;
202 bcopy(at_org_code, llc.llc_snap_org_code, sizeof(at_org_code));
203 llc.llc_snap_ether_type = htons(ETHERTYPE_AT);
192 bcopy(at_org_code, llc.llc_snap.org_code, sizeof(at_org_code));
193 llc.llc_snap.ether_type = htons(ETHERTYPE_AT);
204 bcopy(&llc, mtod(m, caddr_t), sizeof(struct llc));
205 type = 0;
206 } else {
207 type = htons(ETHERTYPE_AT);
208 }
209 break;
210 }
211#endif /* NETATALK */

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

389 switch (l->llc_dsap) {
390#if defined(INET) || defined(INET6) || defined(NS) || defined(DECNET) || defined(IPX) || defined(NETATALK)
391 case LLC_SNAP_LSAP:
392 {
393 u_int16_t type;
394 if (l->llc_control != LLC_UI || l->llc_ssap != LLC_SNAP_LSAP)
395 goto dropanyway;
396#ifdef NETATALK
194 bcopy(&llc, mtod(m, caddr_t), sizeof(struct llc));
195 type = 0;
196 } else {
197 type = htons(ETHERTYPE_AT);
198 }
199 break;
200 }
201#endif /* NETATALK */

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

379 switch (l->llc_dsap) {
380#if defined(INET) || defined(INET6) || defined(NS) || defined(DECNET) || defined(IPX) || defined(NETATALK)
381 case LLC_SNAP_LSAP:
382 {
383 u_int16_t type;
384 if (l->llc_control != LLC_UI || l->llc_ssap != LLC_SNAP_LSAP)
385 goto dropanyway;
386#ifdef NETATALK
397 if (Bcmp(&(l->llc_snap_org_code)[0], at_org_code,
387 if (Bcmp(&(l->llc_snap.org_code)[0], at_org_code,
398 sizeof(at_org_code)) == 0 &&
388 sizeof(at_org_code)) == 0 &&
399 ntohs(l->llc_snap_ether_type) == ETHERTYPE_AT) {
389 ntohs(l->llc_snap.ether_type) == ETHERTYPE_AT) {
400 inq = &atintrq2;
401 m_adj( m, sizeof( struct llc ));
402 schednetisr(NETISR_ATALK);
403 break;
404 }
405
390 inq = &atintrq2;
391 m_adj( m, sizeof( struct llc ));
392 schednetisr(NETISR_ATALK);
393 break;
394 }
395
406 if (Bcmp(&(l->llc_snap_org_code)[0], aarp_org_code,
396 if (Bcmp(&(l->llc_snap.org_code)[0], aarp_org_code,
407 sizeof(aarp_org_code)) == 0 &&
397 sizeof(aarp_org_code)) == 0 &&
408 ntohs(l->llc_snap_ether_type) == ETHERTYPE_AARP) {
398 ntohs(l->llc_snap.ether_type) == ETHERTYPE_AARP) {
409 m_adj( m, sizeof( struct llc ));
410 aarpinput(IFP2AC(ifp), m); /* XXX */
411 return;
412 }
413#endif /* NETATALK */
414 if (l->llc_snap.org_code[0] != 0 || l->llc_snap.org_code[1] != 0|| l->llc_snap.org_code[2] != 0)
415 goto dropanyway;
416 type = ntohs(l->llc_snap.ether_type);

--- 180 unchanged lines hidden ---
399 m_adj( m, sizeof( struct llc ));
400 aarpinput(IFP2AC(ifp), m); /* XXX */
401 return;
402 }
403#endif /* NETATALK */
404 if (l->llc_snap.org_code[0] != 0 || l->llc_snap.org_code[1] != 0|| l->llc_snap.org_code[2] != 0)
405 goto dropanyway;
406 type = ntohs(l->llc_snap.ether_type);

--- 180 unchanged lines hidden ---