1/* $NetBSD: if_arcsubr.c,v 1.36 2001/06/14 05:44:23 itojun Exp $ */ |
2/* $FreeBSD: head/sys/net/if_arcsubr.c 111888 2003-03-04 23:19:55Z jlemon $ */ |
3 4/* 5 * Copyright (c) 1994, 1995 Ignatios Souvatzis 6 * Copyright (c) 1982, 1989, 1993 7 * The Regents of the University of California. All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions --- 491 unchanged lines hidden (view full) --- 502 * the ARCnet header. 503 */ 504void 505arc_input(ifp, m) 506 struct ifnet *ifp; 507 struct mbuf *m; 508{ 509 struct arc_header *ah; |
510 int isr; |
511 u_int8_t atype; 512 513 if ((ifp->if_flags & IFF_UP) == 0) { 514 m_freem(m); 515 return; 516 } 517 518 /* possibly defragment: */ --- 21 unchanged lines hidden (view full) --- 540 541 atype = ah->arc_type; 542 switch (atype) { 543#ifdef INET 544 case ARCTYPE_IP: 545 m_adj(m, ARC_HDRNEWLEN); 546 if (ipflow_fastforward(m)) 547 return; |
548 isr = NETISR_IP; |
549 break; 550 551 case ARCTYPE_IP_OLD: 552 m_adj(m, ARC_HDRLEN); 553 if (ipflow_fastforward(m)) 554 return; |
555 isr = NETISR_IP; |
556 break; 557 558 case ARCTYPE_ARP: 559 if (ifp->if_flags & IFF_NOARP) { 560 /* Discard packet if ARP is disabled on interface */ 561 m_freem(m); 562 return; 563 } 564 m_adj(m, ARC_HDRNEWLEN); |
565 isr = NETISR_ARP; |
566#ifdef ARCNET_ALLOW_BROKEN_ARP 567 mtod(m, struct arphdr *)->ar_pro = htons(ETHERTYPE_IP); 568#endif 569 break; 570 571 case ARCTYPE_ARP_OLD: 572 if (ifp->if_flags & IFF_NOARP) { 573 /* Discard packet if ARP is disabled on interface */ 574 m_freem(m); 575 return; 576 } 577 m_adj(m, ARC_HDRLEN); |
578 isr = NETISR_ARP; |
579#ifdef ARCNET_ALLOW_BROKEN_ARP 580 mtod(m, struct arphdr *)->ar_pro = htons(ETHERTYPE_IP); 581#endif 582 break; 583#endif 584#ifdef INET6 585 case ARCTYPE_INET6: 586 m_adj(m, ARC_HDRNEWLEN); |
587 isr = NETISR_IPV6; |
588 break; 589#endif 590#ifdef IPX 591 case ARCTYPE_IPX: 592 m_adj(m, ARC_HDRNEWLEN); |
593 isr = NETISR_IPX; |
594 break; 595#endif 596 default: 597 m_freem(m); 598 return; 599 } |
600 netisr_dispatch(isr, m); |
601} 602 603/* 604 * Register (new) link level address. 605 */ 606void 607arc_storelladdr(ifp, lla) 608 struct ifnet *ifp; --- 223 unchanged lines hidden --- |