2005-01-07 02:35:34 +00:00
|
|
|
/*-
|
|
|
|
* Copyright (c) 1990,1994 Regents of The University of Michigan.
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software and
|
|
|
|
* its documentation for any purpose and without fee is hereby granted,
|
|
|
|
* provided that the above copyright notice appears in all copies and
|
|
|
|
* that both that copyright notice and this permission notice appear
|
|
|
|
* in supporting documentation, and that the name of The University
|
|
|
|
* of Michigan not be used in advertising or publicity pertaining to
|
|
|
|
* distribution of the software without specific, written prior
|
|
|
|
* permission. This software is supplied as is without expressed or
|
|
|
|
* implied warranties of any kind.
|
|
|
|
*
|
|
|
|
* This product includes software developed by the University of
|
|
|
|
* California, Berkeley and its contributors.
|
|
|
|
*
|
|
|
|
* Research Systems Unix Group
|
|
|
|
* The University of Michigan
|
|
|
|
* c/o Wesley Craig
|
|
|
|
* 535 W. William Street
|
|
|
|
* Ann Arbor, Michigan
|
|
|
|
* +1-313-764-2278
|
|
|
|
* netatalk@umich.edu
|
|
|
|
*
|
2001-09-12 08:38:13 +00:00
|
|
|
* $FreeBSD$
|
|
|
|
*/
|
1998-02-03 21:52:02 +00:00
|
|
|
struct mbuf;
|
|
|
|
struct sockaddr_at;
|
1996-05-24 01:35:45 +00:00
|
|
|
|
1998-01-08 23:42:31 +00:00
|
|
|
#ifdef _NET_IF_ARP_H_
|
1997-04-20 15:36:12 +00:00
|
|
|
extern timeout_t aarpprobe;
|
This commit does two things:
1. rt_check() cleanup:
rt_check() is only necessary for some address families to gain access
to the corresponding arp entry, so call it only in/near the *resolve()
routines where it is actually used -- at the moment this is
arpresolve(), nd6_storelladdr() (the call is embedded here),
and atmresolve() (the call is just before atmresolve to reduce
the number of changes).
This change will make it a lot easier to decouple the arp table
from the routing table.
There is an extra call to rt_check() in if_iso88025subr.c to
determine the routing info length. I have left it alone for
the time being.
The interface of arpresolve() and nd6_storelladdr() now changes slightly:
+ the 'rtentry' parameter (really a hint from the upper level layer)
is now passed unchanged from *_output(), so it becomes the route
to the final destination and not to the gateway.
+ the routines will return 0 if resolution is possible, non-zero
otherwise.
+ arpresolve() returns EWOULDBLOCK in case the mbuf is being held
waiting for an arp reply -- in this case the error code is masked
in the caller so the upper layer protocol will not see a failure.
2. arpcom untangling
Where possible, use 'struct ifnet' instead of 'struct arpcom' variables,
and use the IFP2AC macro to access arpcom fields.
This mostly affects the netatalk code.
=== Detailed changes: ===
net/if_arcsubr.c
rt_check() cleanup, remove a useless variable
net/if_atmsubr.c
rt_check() cleanup
net/if_ethersubr.c
rt_check() cleanup, arpcom untangling
net/if_fddisubr.c
rt_check() cleanup, arpcom untangling
net/if_iso88025subr.c
rt_check() cleanup
netatalk/aarp.c
arpcom untangling, remove a block of duplicated code
netatalk/at_extern.h
arpcom untangling
netinet/if_ether.c
rt_check() cleanup (change arpresolve)
netinet6/nd6.c
rt_check() cleanup (change nd6_storelladdr)
2004-04-25 09:24:52 +00:00
|
|
|
extern int aarpresolve (struct ifnet *,
|
1996-05-24 01:35:45 +00:00
|
|
|
struct mbuf *,
|
|
|
|
struct sockaddr_at *,
|
2002-03-20 02:39:27 +00:00
|
|
|
u_char *);
|
|
|
|
extern int at_broadcast (struct sockaddr_at *);
|
2005-02-22 14:20:29 +00:00
|
|
|
|
|
|
|
extern struct mtx aarptab_mtx;
|
|
|
|
|
|
|
|
#define AARPTAB_LOCK() mtx_lock(&aarptab_mtx)
|
|
|
|
#define AARPTAB_UNLOCK() mtx_unlock(&aarptab_mtx)
|
|
|
|
#define AARPTAB_LOCK_ASSERT() mtx_assert(&aarptab_mtx, MA_OWNED)
|
|
|
|
#define AARPTAB_UNLOCK_ASSERT() mtx_assert(&aarptab_mtx, MA_NOTOWNED)
|
1996-05-24 01:35:45 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _NETATALK_AARP_H_
|
2002-03-20 02:39:27 +00:00
|
|
|
extern void aarptfree (struct aarptab *);
|
1996-05-24 01:35:45 +00:00
|
|
|
#endif
|
|
|
|
|
1998-02-03 21:52:02 +00:00
|
|
|
struct ifnet;
|
2001-09-12 08:38:13 +00:00
|
|
|
struct thread;
|
1998-02-03 21:52:02 +00:00
|
|
|
struct socket;
|
|
|
|
|
2003-03-04 23:19:55 +00:00
|
|
|
extern void aarpintr (struct mbuf *);
|
|
|
|
extern void at1intr (struct mbuf *);
|
|
|
|
extern void at2intr (struct mbuf *);
|
2002-03-20 02:39:27 +00:00
|
|
|
extern void aarp_clean (void);
|
|
|
|
extern int at_control (struct socket *so,
|
1998-06-07 17:13:14 +00:00
|
|
|
u_long cmd,
|
1996-05-24 01:35:45 +00:00
|
|
|
caddr_t data,
|
|
|
|
struct ifnet *ifp,
|
2002-03-20 02:39:27 +00:00
|
|
|
struct thread *td);
|
|
|
|
extern u_short at_cksum (struct mbuf *m, int skip);
|
|
|
|
extern void ddp_init (void);
|
|
|
|
extern struct at_ifaddr *at_ifawithnet (struct sockaddr_at *);
|
1996-05-24 01:35:45 +00:00
|
|
|
#ifdef _NETATALK_DDP_VAR_H_
|
2002-03-20 02:39:27 +00:00
|
|
|
extern int ddp_output (struct mbuf *m, struct socket *so);
|
1997-03-05 09:17:38 +00:00
|
|
|
|
1996-05-24 01:35:45 +00:00
|
|
|
#endif
|
|
|
|
#if defined (_NETATALK_DDP_VAR_H_) && defined(_NETATALK_AT_VAR_H_)
|
2002-03-20 02:39:27 +00:00
|
|
|
extern struct ddpcb *ddp_search(struct sockaddr_at *,
|
1996-05-24 01:35:45 +00:00
|
|
|
struct sockaddr_at *,
|
2002-03-20 02:39:27 +00:00
|
|
|
struct at_ifaddr *);
|
1996-05-24 01:35:45 +00:00
|
|
|
#endif
|
|
|
|
#ifdef _NET_ROUTE_H_
|
2002-03-20 02:39:27 +00:00
|
|
|
int ddp_route(struct mbuf *m, struct route *ro);
|
1996-05-24 01:35:45 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|