summaryrefslogtreecommitdiffstats
path: root/sys/net/route.h
Commit message (Collapse)AuthorAgeFilesLines
* Introduce tcp_hostcache and remove the tcp specific metrics fromandre2003-11-201-2/+8
| | | | | | | | | | | | | | | | | | | | | | | the routing table. Move all usage and references in the tcp stack from the routing table metrics to the tcp hostcache. It caches measured parameters of past tcp sessions to provide better initial start values for following connections from or to the same source or destination. Depending on the network parameters to/from the remote host this can lead to significant speedups for new tcp connections after the first one because they inherit and shortcut the learning curve. tcp_hostcache is designed for multiple concurrent access in SMP environments with high contention and is hash indexed by remote ip address. It removes significant locking requirements from the tcp stack with regard to the routing table. Reviewed by: sam (mentor), bms Reviewed by: -net, -current, core@kame.net (IPv6 parts) Approved by: re (scottl)
* Remove RTF_PRCLONING from routing table and adjust users of itandre2003-11-201-1/+5
| | | | | | | | | | | | accordingly. The define is left intact for ABI compatibility with userland. This is a pre-step for the introduction of tcp_hostcache. The network stack remains fully useable with this change. Reviewed by: sam (mentor), bms Reviewed by: -net, -current, core@kame.net (IPv6 parts) Approved by: re (scottl)
* replace explicit changes to rt_refcnt by RT_ADDREF and RT_REMREFsam2003-11-081-12/+25
| | | | | | | macros that expand to include assertions when the system is built with INVARIANTS Supported by: FreeBSD Foundation
* Overhaul routing table entry cleanup by introducing a new rtexpungesam2003-10-301-0/+1
| | | | | | | | | | | | routine that takes a locked routing table reference and removes all references to the entry in the various data structures. This eliminates instances of recursive locking and also closes races where the lock on the entry had to be dropped prior to calling rtrequest(RTM_DELETE). This also cleans up confusion where the caller held a reference to an entry that might have been reclaimed (and in some cases used that reference). Supported by: FreeBSD Foundation
* Locking for updates to routing table entries. Each rtentry gets a mutexsam2003-10-041-16/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that covers updates to the contents. Note this is separate from holding a reference and/or locking the routing table itself. Other/related changes: o rtredirect loses the final parameter by which an rtentry reference may be returned; this was never used and added unwarranted complexity for locking. o minor style cleanups to routing code (e.g. ansi-fy function decls) o remove the logic to bump the refcnt on the parent of cloned routes, we assume the parent will remain as long as the clone; doing this avoids a circularity in locking during delete o convert some timeouts to MPSAFE callouts Notes: 1. rt_mtx in struct rtentry is guarded by #ifdef _KERNEL as user-level applications cannot/do-no know about mutex's. Doing this requires that the mutex be the last element in the structure. A better solution is to introduce an externalized version of struct rtentry but this is a major task because of the intertwining of rtentry and other data structures that are visible to user applications. 2. There are known LOR's that are expected to go away with forthcoming work to eliminate many held references. If not these will be resolved prior to release. 3. ATM changes are untested. Sponsored by: FreeBSD Foundation Obtained from: BSD/OS (partly)
* cleanups prior to adding locking (and in some cases to eliminate locking):sam2003-10-031-8/+0
| | | | | | | | | | | | | o move route_cb to be private to rtsock.c o replace global static route_proto by locals o eliminate global #define shorthands for info references o remove some register decls o ansi-fy function decls o move items to be close in scope to their usage o add rt_dispatch function for dispatching the actual message o cleanup tangled logic for doing all-but-me msg send Support by: FreeBSD Foundation
* Add mutex for routing entries.hsu2003-07-191-1/+8
| | | | Reviewed by: bmilekic, silby
* Finish driving a stake through the heart of netns and the associatedpeter2003-03-051-1/+0
| | | | | | ifdefs scattered around the place - its dead Jim! The SMB stuff had stolen AF_NS, make it official.
* Reduce code duplication. This adds the function rt_check() to route.c.mdodd2003-03-021-0/+1
| | | | Approved by: sam (in principle)
* Fixed some style bugs in the removal of __P(()). The main ones werebde2002-03-241-2/+2
| | | | | | not removing tabs before "__P((", and not outdenting continuation lines to preserve non-KNF lining up of code with parentheses. Switch to KNF formatting and/or rewrap the whole prototype in some cases.
* Remove __P.alfred2002-03-191-22/+21
|
* Introduce an interface announcement message for the routingru2002-01-181-0/+2
| | | | | | | | | socket so that routing daemons and other interested parties know when an interface is attached/detached. PR: kern/33747 Obtained from: NetBSD MFC after: 2 weeks
* Introduce a syncache, which enables FreeBSD to withstand a SYN floodjlemon2001-11-221-1/+1
| | | | | | | DoS in an improved fashion over the existing code. Reviewed by: silby (in a previous iteration) Sponsored by: DARPA, NAI Labs
* Pull post-4.4BSD change to sys/net/route.c from BSD/OS 4.2.ru2001-10-171-0/+5
| | | | | | | | | | | | | | | | | | | | Have sys/net/route.c:rtrequest1(), which takes ``rt_addrinfo *'' as the argument. Pass rt_addrinfo all the way down to rtrequest1 and ifa->ifa_rtrequest. 3rd argument of ifa->ifa_rtrequest is now ``rt_addrinfo *'' instead of ``sockaddr *'' (almost noone is using it anyways). Benefit: the following command now works. Previously we needed two route(8) invocations, "add" then "change". # route add -inet6 default ::1 -ifp gif0 Remove unsafe typecast in rtrequest(), from ``rtentry *'' to ``sockaddr *''. It was introduced by 4.3BSD-Reno and never corrected. Obtained from: BSD/OS, NetBSD MFC after: 1 month PR: kern/28360
* 64-bit fixes from CSRG.ru2001-10-171-2/+2
|
* KSE Milestone 2julian2001-09-121-1/+0
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Don't bother passing p to rtioctl just so it can fail to pass it to mrt_ioctlfenner2001-07-251-1/+1
|
* When a connection is being dropped due to a listen queue overflow,jayanth2000-07-211-1/+1
| | | | | | | | | delete the cloned route that is associated with the connection. This does not exhaust the routing table memory when the system is under a SYN flood attack. The route entry is not deleted if there is any prior information cached in it. Reviewed by: Peter Wemm,asmodai
* Clean up some loose ends in the network code, including the X.25 and ISOpeter2000-02-131-1/+0
| | | | | | | #ifdefs. Clean out unused netisr's and leftover netisr linker set gunk. Tested on x86 and alpha, including world. Approved by: jkh
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-291-1/+1
| | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
* rtcalloc() is removed because it turned out not to be necessary for FreeBSD.shin1999-12-091-1/+0
| | | | | | (It was added as a part of KAME patch) Specified by: jdp@polstra.com
* KAME related header files additions and merges.shin1999-11-051-2/+4
| | | | | | | (only those which don't affect c source files so much) Reviewed by: cvs-committers Obtained from: KAME project
* Add comments, fix typos.ru1999-09-141-2/+8
| | | | Reviewed by: wollman
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Increase the size of the route reference count from 15 bits to 31 bits.msmith1999-06-301-3/+2
| | | | | | | | This doesn't change the size or alignment of the structure on either i386 or Alpha, and thus should be binary-compatible (modulo problems with old applications and routes with more than 2^15 references). Reviewed by: peter
* Add sufficient braces to keep egcs happy about potentially ambiguouspeter1999-05-061-5/+7
| | | | if/else nesting.
* Added a forward struct declaration so that this file is lessbde1998-03-231-2/+2
| | | | self-insufficient.
* Some staticized variables were still declared to be extern.bde1997-09-071-2/+1
|
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Use the new if_multiaddrs list for multicast addresses rather than thewollman1997-01-131-1/+7
| | | | | | | previous hackery involving struct in_ifaddr and arpcom. Get rid of the abominable multi_kludge. Update all network interfaces to use the new machanism. Distressingly few Ethernet drivers program the multicast filter properly (assuming the hardware has one, which it usually does).
* Get rid of obsolete RTF_MASK and RTF_CHAINDELETE flags.wollman1996-10-091-3/+3
|
* change a comment to match what the BSD4.4 book says.julian1996-08-261-2/+2
|
* Add three new route flags to help determine what sort of addresswollman1996-05-061-2/+5
| | | | | | | | | | | | | | | | | | | | | | the destination represents. For IP: - Iff it is a host route, RTF_LOCAL and RTF_BROADCAST indicate local (belongs to this host) and broadcast addresses, respectively. - For all routes, RTF_MULTICAST is set if the destination is multicast. The RTF_BROADCAST flag is used by ip_output() to eliminate a call to in_broadcast() in a common case; this gives about 1% in our packet-generation experiments. All three flags might be used (although they aren't now) to determine whether a packet can be forwarded; a given host route can represent a forwardable address if: (rt->rt_flags & (RTF_HOST | RTF_LOCAL | RTF_BROADCAST | RTF_MULTICAST)) == RTF_HOST Obviously, one still has to do all the work if a host route is not present, but this code allows one to cache the results of such a lookup if rtalloc1() is called without masking RTF_PRCLONING.
* Fix a bunch of spelling errors in the comment fields ofmpp1996-01-301-3/+3
| | | | a bunch of system include files.
* Another mega commit to staticize things.phk1995-12-141-4/+1
|
* All net.* sysctl converted now.phk1995-11-161-5/+1
|
* Reviewed by: julian and jhay@mikom.csir.co.zajulian1995-10-261-1/+2
| | | | | | | | | | | | | | | | | | | | | Submitted by: Mike Mitchell, supervisor@alb.asctmd.com This is a bulk mport of Mike's IPX/SPX protocol stacks and all the related gunf that goes with it.. it is not guaranteed to work 100% correctly at this time but as we had several people trying to work on it I figured it would be better to get it checked in so they could all get teh same thing to work on.. Mikes been using it for a year or so but on 2.0 more changes and stuff will be merged in from other developers now that this is in. Mike Mitchell, Network Engineer AMTECH Systems Corporation, Technology and Manufacturing 8600 Jefferson Street, Albuquerque, New Mexico 87113 (505) 856-8000 supervisor@alb.asctmd.com
* Change signature of rt->rt_output() so that it is compatible withwollman1995-10-161-3/+3
| | | | | | ifp->if_output() functions. This way, initial implementations of rt_output functionality can just lazily use if_output until customized versions are written.
* Eliminate sloppy common-style declarations. There should be none left forbde1995-07-291-4/+4
| | | | the LINT configuation.
* Remove trailing whitespace.rgrimes1995-05-301-2/+2
|
* Better fix for the deletion of parents of cloned routes problem,wollman1995-03-201-5/+4
| | | | | superseding the `nextchild' hack. This also provides a way forward to fix RTM_CHANGE and RTM_ADD as well.
* Define RTF_PINNED for future use.wollman1995-02-081-2/+3
|
* Correct fix for merge conflicts: RTM_VERSION is always 5. Header fileswollman1995-02-071-5/+1
| | | | included by user code must never depend on kernel compile options.
* Fixed unresolved CVS conflict on RTM_VERSION.dg1995-02-071-8/+2
|
* Merge in the socket-level support for Transaction TCP from the OLAH_TTCPwollman1995-02-071-1/+11
| | | | | | branch. Submitted by: Andras Olah <olah@cs.utwente.nl>
* Declare `struct mbuf' with the correct scope to avoid lots of warningsbde1995-01-241-1/+6
| | | | | | for compiling routed... Previously a kernel function pointer that is bogusly visible to applications was incompletely declared to hide the problem.
* route.c: keep track of where cloned routes come from, and make sure towollman1995-01-231-6/+10
| | | | | | | | | | | delete them when the ``parent'' goes away route.h: add glue to track this to rtentry structure. WARNING WILL ROBINSON! This will be yet another incompatible change in your route-using binaries. I apologize, but this was the only way to do it. I took this opportunity to increase the size of the metrics to what I believe will be the final length for 2.1, so that when the T/TCP stuff is done, this won't happen again.
* Add support for two separate cloning flags, one set by the lower layers,wollman1994-12-131-6/+13
| | | | | | | | | | | | | | | | | and one set by the protocol family. Also add another parameter to rtalloc1() to allow for any interface flags to be ignored; currently this is only useful for RTF_PRCLONING. Get rid of rt_prflags and re-unite with rt_flags. Add T/TCP ``route metrics''. NB: YOU MUST RECOMPILE `route' AND OTHER RELATED PROGRAMS AS A RESULT OF THIS CHANGE. This also adds a new interface parameter, `ifi_physical', which will eventually replace IFF_ALTPHYS as the mechanism for specifying the particular physical connection desired on a multiple-connection card. NB: YOU MUST RECOMPILE `ifconfig' AND OTHER RELATED PROGRAMS AS A RESULT OF THIS CHANGE.
* Collapse two fields so that we have space for another 32 flags.wollman1994-11-031-2/+6
| | | | | | NB: You will have to recompile programs which use the `rt_use' member in order to get the correct values. This should not cause incorrect operation, but the statistics may look a little confusing.
OpenPOWER on IntegriCloud