aboutsummaryrefslogtreecommitdiff
path: root/sys/netnatm
Commit message (Collapse)AuthorAgeFilesLines
* Constify send and receive space constants in natm.Robert Watson2004-06-241-4/+4
| | | | Notes: svn path=/head/; revision=131020
* Extend coverage of SOCK_LOCK(so) to include so_count, the socketRobert Watson2004-06-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | reference count: - Assert SOCK_LOCK(so) macros that directly manipulate so_count: soref(), sorele(). - Assert SOCK_LOCK(so) in macros/functions that rely on the state of so_count: sofree(), sotryfree(). - Acquire SOCK_LOCK(so) before calling these functions or macros in various contexts in the stack, both at the socket and protocol layers. - In some cases, perform soisdisconnected() before sotryfree(), as this could result in frobbing of a non-present socket if sotryfree() actually frees the socket. - Note that sofree()/sotryfree() will release the socket lock even if they don't free the socket. Submitted by: sam Sponsored by: FreeBSD Foundation Obtained from: BSD/OS Notes: svn path=/head/; revision=130387
* Rename dup_sockaddr() to sodupsockaddr() for consistency with otherRobert Watson2004-03-011-1/+1
| | | | | | | | | | | | | | | functions in kern_socket.c. Rename the "canwait" field to "mflags" and pass M_WAITOK and M_NOWAIT in from the caller context rather than "1" or "0". Correct mflags pass into mac_init_socket() from previous commit to not include M_ZERO. Submitted by: sam Notes: svn path=/head/; revision=126425
* Introduce a MAC label reference in 'struct inpcb', which cachesRobert Watson2003-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the MAC label referenced from 'struct socket' in the IPv4 and IPv6-based protocols. This permits MAC labels to be checked during network delivery operations without dereferencing inp->inp_socket to get to so->so_label, which will eventually avoid our having to grab the socket lock during delivery at the network layer. This change introduces 'struct inpcb' as a labeled object to the MAC Framework, along with the normal circus of entry points: initialization, creation from socket, destruction, as well as a delivery access control check. For most policies, the inpcb label will simply be a cache of the socket label, so a new protocol switch method is introduced, pr_sosetlabel() to notify protocols that the socket layer label has been updated so that the cache can be updated while holding appropriate locks. Most protocols implement this using pru_sosetlabel_null(), but IPv4/IPv6 protocols using inpcbs use the the worker function in_pcbsosetlabel(), which calls into the MAC Framework to perform a cache update. Biba, LOMAC, and MLS implement these entry points, as do the stub policy, and test policy. Reviewed by: sam, bms Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=122875
* o add a flags parameter to netisr_register that is used to specifySam Leffler2003-11-082-1/+3
| | | | | | | | | | | | | | | | | | | whether or not the isr needs to hold Giant when running; Giant-less operation is also controlled by the setting of debug_mpsafenet o mark all netisr's except NETISR_IP as needing Giant o add a GIANT_REQUIRED assertion to the top of netisr's that need Giant o pickup Giant (when debug_mpsafenet is 1) inside ip_input before calling up with a packet o change netisr handling so swi_net runs w/o Giant; instead we grab Giant before invoking handlers based on whether the handler needs Giant o change netisr handling so that netisr's that are marked MPSAFE may have multiple instances active at a time o add netisr statistics for packets dropped because the isr is inactive Supported by: FreeBSD Foundation Notes: svn path=/head/; revision=122320
* Replace the if_name and if_unit members of struct ifnet with new membersBrooks Davis2003-10-311-2/+2
| | | | | | | | | | | | | | | | if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname) Notes: svn path=/head/; revision=121816
* Remove the last vestiges of ATM raw mode. This has not been useful for aHartmut Brandt2003-08-062-45/+6
| | | | | | | | long time and has already been removed from the only driver that supported it (en(4)) and from the man page. Notes: svn path=/head/; revision=118547
* Use the new OPENVCC and CLOSEVCC ioctls to open and close the NATMHartmut Brandt2003-08-061-13/+16
| | | | | | | channel. These have been the last consumers of the old ioctls. Notes: svn path=/head/; revision=118543
* Style(9): remove unneccesary space and blank lines, indentation,Hartmut Brandt2003-08-064-241/+193
| | | | | | | | | | function prototypes. Use LIST_FOREACH instead of explicit loops. The indentation of functions indendet by 4 space have been left alone. 2-space indented functions have been re-indented. Notes: svn path=/head/; revision=118541
* Instead of returning an error call the ioctl() handler of the interfaceHartmut Brandt2003-07-151-2/+5
| | | | | | | | when we get request that we cannot handle ourself. This allows userland to reach the ATM interfaces for ioctls. Notes: svn path=/head/; revision=117643
* Use __FBSDID().David E. O'Brien2003-06-113-7/+9
| | | | Notes: svn path=/head/; revision=116189
* Introduce an M_ASSERTPKTHDR() macro which performs the very common taskDag-Erling Smørgrav2003-04-081-2/+1
| | | | | | | | | | of asserting that an mbuf has a packet header. Use it instead of hand- rolled versions wherever applicable. Submitted by: Hiten Pandya <hiten@unixdaemons.com> Notes: svn path=/head/; revision=113255
* Update netisr handling; Each SWI now registers its queue, and all queueJonathan Lemon2003-03-043-30/+7
| | | | | | | | | | | | | drain routines are done by swi_net, which allows for better queue control at some future point. Packets may also be directly dispatched to a netisr instead of queued, this may be of interest at some installations, but currently defaults to off. Reviewed by: hsu, silby, jayanth, sam Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=111888
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-192-5/+5
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-212-5/+5
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Be consistent about functions being static.Poul-Henning Kamp2002-10-161-1/+1
| | | | | | | Spotted by: FlexeLint. Notes: svn path=/head/; revision=105222
* Back out my lats commit of locking down a socket, it conflicts with hsu's work.Seigo Tanimura2002-05-311-12/+0
| | | | | | | Requested by: hsu Notes: svn path=/head/; revision=97658
* Lock down a socket, milestone 1.Seigo Tanimura2002-05-201-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Add a mutex (sb_mtx) to struct sockbuf. This protects the data in a socket buffer. The mutex in the receive buffer also protects the data in struct socket. o Determine the lock strategy for each members in struct socket. o Lock down the following members: - so_count - so_options - so_linger - so_state o Remove *_locked() socket APIs. Make the following socket APIs touching the members above now require a locked socket: - sodisconnect() - soisconnected() - soisconnecting() - soisdisconnected() - soisdisconnecting() - sofree() - soref() - sorele() - sorwakeup() - sotryfree() - sowakeup() - sowwakeup() Reviewed by: alfred Notes: svn path=/head/; revision=96972
* Revert the change of #includes in sys/filedesc.h and sys/socketvar.h.Seigo Tanimura2002-04-301-4/+7
| | | | | | | | | | | | | Requested by: bde Since locking sigio_lock is usually followed by calling pgsigio(), move the declaration of sigio_lock and the definitions of SIGIO_*() to sys/signalvar.h. While I am here, sort include files alphabetically, where possible. Notes: svn path=/head/; revision=95759
* Change callers of mtx_init() to pass in an appropriate lock type name. InJohn Baldwin2002-04-041-1/+1
| | | | | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64 Notes: svn path=/head/; revision=93818
* Remove __P.Alfred Perlstein2002-03-204-28/+25
| | | | Notes: svn path=/head/; revision=92745
* Fix warningsPeter Wemm2002-02-281-10/+11
| | | | Notes: svn path=/head/; revision=91458
* Initialise the intrq_present fields at runtime, not link time. This allowsMike Smith2002-01-081-2/+1
| | | | | | | | | us to load protocols at runtime, and avoids the use of common variables. Also fix the ip6_intrq assignment so that it works at all. Notes: svn path=/head/; revision=89069
* Give struct socket structures a ref counting interface similar toMatthew Dillon2001-11-171-2/+2
| | | | | | | | | | vnodes. This will hopefully serve as a base from which we can expand the MP code. We currently do not attempt to obtain any mutex or SX locks, but the door is open to add them when we nail down exactly how that part of it is going to work. Notes: svn path=/head/; revision=86487
* Change a couple of M_WAITOKs used in M_PREPEND() to M_TRYWAITs, whichBosko Milekic2001-04-051-2/+2
| | | | | | | | | is what they should be. As the returned mbuf is already checked for failure of M_PREPEND even in the wait case, nothing more to be done here. Notes: svn path=/head/; revision=75217
* Mechanical change to use <sys/queue.h> macro API instead ofPoul-Henning Kamp2001-02-041-4/+4
| | | | | | | | | | fondling implementation details. Created with: sed(1) Reviewed by: md5(1) Notes: svn path=/head/; revision=71999
* Convert more malloc+bzero to malloc+M_ZERO.David Malone2000-12-081-4/+3
| | | | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Notes: svn path=/head/; revision=69781
* Lock down the network interface queues. The queue mutex must be obtainedJonathan Lemon2000-11-251-0/+2
| | | | | | | | | | | | | | | | | before adding/removing packets from the queue. Also, the if_obytes and if_omcasts fields should only be manipulated under protection of the mutex. IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on the queue. An IF_LOCK macro is provided, as well as the old (mutex-less) versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which needs them, but their use is discouraged. Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF, which takes care of locking/enqueue, and also statistics updating/start if necessary. Notes: svn path=/head/; revision=69152
* Back out the previous change to the queue(3) interface.Jake Burkholder2000-05-261-2/+2
| | | | | | | | | It was not discussed and should probably not happen. Requested by: msmith and others Notes: svn path=/head/; revision=60938
* Change the way that the queue(3) structures are declared; don't assume thatJake Burkholder2000-05-231-2/+2
| | | | | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd Notes: svn path=/head/; revision=60833
* Add $FreeBSD$Peter Wemm2000-05-011-0/+1
| | | | Notes: svn path=/head/; revision=59874
* Clean up some loose ends in the network code, including the X.25 and ISOPeter Wemm2000-02-131-1/+8
| | | | | | | | | | #ifdefs. Clean out unused netisr's and leftover netisr linker set gunk. Tested on x86 and alpha, including world. Approved by: jkh Notes: svn path=/head/; revision=57178
* Move the *intrq variables into net/intrq.c and unconditionallyBrian Somers2000-01-241-1/+4
| | | | | | | | | | | | | | include this in all kernels. Declare some const *intrq_present variables that can be checked by a module prior to using *intrq to queue data. Make the if_tun module capable of processing atm, ip, ip6, ipx, natm and netatalk packets when TUNSIFHEAD is ioctl()d on. Review not required by: freebsd-hackers Notes: svn path=/head/; revision=56555
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"Peter Wemm1999-12-291-5/+2
| | | | | | | | | 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. Notes: svn path=/head/; revision=55205
* Examine all occurrences of sprintf(), strcat(), and str[n]cpy()Archie Cobbs1998-12-041-4/+4
| | | | | | | | | | | | | | | | | for possible buffer overflow problems. Replaced most sprintf()'s with snprintf(); for others cases, added terminating NUL bytes where appropriate, replaced constants like "16" with sizeof(), etc. These changes include several bug fixes, but most changes are for maintainability's sake. Any instance where it wasn't "immediately obvious" that a buffer overflow could not occur was made safer. Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Reviewed by: Mike Spengler <mks@networkcs.com> Notes: svn path=/head/; revision=41514
* Nitpicking and dusting performed on a train. Removes trivial warningsPoul-Henning Kamp1998-10-251-4/+0
| | | | | | | about unused variables, labels and other lint. Notes: svn path=/head/; revision=40648
* This commit fixes various 64bit portability problems required forDoug Rabson1998-06-071-2/+2
| | | | | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time. Notes: svn path=/head/; revision=36735
* Staticize.Eivind Eklund1998-02-092-7/+7
| | | | Notes: svn path=/head/; revision=33181
* Back out DIAGNOSTIC changes.Eivind Eklund1998-02-062-4/+0
| | | | Notes: svn path=/head/; revision=33134
* Turn DIAGNOSTIC into a new-style option.Eivind Eklund1998-02-042-0/+4
| | | | Notes: svn path=/head/; revision=33108
* Fixed a sloppy common-style declaration.Bruce Evans1997-12-202-1/+4
| | | | | | | | | natm_pcb.c: Include <sys/socketvar.h> which will be used when M_PCB is declared in the right place. Notes: svn path=/head/; revision=31885
* Removed unused #includes.Bruce Evans1997-10-281-8/+0
| | | | Notes: svn path=/head/; revision=30813
* Last major round (Unless Bruce thinks of somthing :-) of malloc changes.Poul-Henning Kamp1997-10-121-1/+1
| | | | | | | | | | | Distribute all but the most fundamental malloc types. This time I also remembered the trick to making things static: Put "static" in front of them. A couple of finer points by: bde Notes: svn path=/head/; revision=30354
* Update network code to use poll support.Peter Wemm1997-09-141-1/+1
| | | | Notes: svn path=/head/; revision=29366
* Added used #include - don't depend on <sys/mbuf.h> includingBruce Evans1997-09-021-0/+1
| | | | | | | <sys/malloc.h> (unless we only use the bogusly shared M*WAIT flags). Notes: svn path=/head/; revision=29024
* Fix all areas of the system (or at least all those in LINT) to avoid storingGarrett Wollman1997-08-161-19/+18
| | | | | | | | | | | socket addresses in mbufs. (Socket buffers are the one exception.) A number of kernel APIs needed to get fixed in order to make this happen. Also, fix three protocol families which kept PCBs in mbufs to not malloc them instead. Delete some old compatibility cruft while we're at it, and add some new routines in the in_cksum family. Notes: svn path=/head/; revision=28270
* Removed unused #includes.Bruce Evans1997-08-022-10/+0
| | | | Notes: svn path=/head/; revision=27845
* import Chuck Cranor's ATM driverKenjiro Cho1997-05-091-0/+822
| | | | Notes: svn path=/cvs2svn/branches/CRANOR/; revision=25605
* import Chuck Cranor's ATM driverKenjiro Cho1997-05-093-0/+486
Notes: svn path=/cvs2svn/branches/CRANOR/; revision=25603