aboutsummaryrefslogtreecommitdiff
path: root/sys/netatm
Commit message (Collapse)AuthorAgeFilesLines
* Avoid casts as lvalues.Alexander Kabaev2004-07-281-4/+4
| | | | Notes: svn path=/head/; revision=132780
* Fix a typo that could provoke a panic or access to random memory.Hartmut Brandt2004-07-191-1/+1
| | | | | | | | PR: kern/67012 Submitted by: Zhenmin <zli4@cs.uiuc.edu> Notes: svn path=/head/; revision=132403
* The socket field so_state is used to hold a variety of socket relatedRobert Watson2004-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | flags relating to several aspects of socket functionality. This change breaks out several bits relating to send and receive operation into a new per-socket buffer field, sb_state, in order to facilitate locking. This is required because, in order to provide more granular locking of sockets, different state fields have different locking properties. The following fields are moved to sb_state: SS_CANTRCVMORE (so_state) SS_CANTSENDMORE (so_state) SS_RCVATMARK (so_state) Rename respectively to: SBS_CANTRCVMORE (so_rcv.sb_state) SBS_CANTSENDMORE (so_snd.sb_state) SBS_RCVATMARK (so_rcv.sb_state) This facilitates locking by isolating fields to be located with other identically locked fields, and permits greater granularity in socket locking by avoiding storing fields with different locking semantics in the same short (avoiding locking conflicts). In the future, we may wish to coallesce sb_state and sb_flags; for the time being I leave them separate and there is no additional memory overhead due to the packing/alignment of shorts in the socket buffer structure. Notes: svn path=/head/; revision=130480
* Extend coverage of SOCK_LOCK(so) to include so_count, the socketRobert Watson2004-06-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove an #if section originally written for Sun compilers.Stefan Farfeleder2004-06-081-8/+0
| | | | Notes: svn path=/head/; revision=130248
* These are changes to allow to use the Intel C/C++ compiler (lang/icc)Tom Rhodes2004-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to build the kernel. It doesn't affect the operation if gcc. Most of the changes are just adding __INTEL_COMPILER to #ifdef's, as icc v8 may define __GNUC__ some parts may look strange but are necessary. Additional changes: - in_cksum.[ch]: * use a generic C version instead of the assembly version in the !gcc case (ASM code breaks with the optimizations icc does) -> no bad checksums with an icc compiled kernel Help from: andre, grehan, das Stolen from: alpha version via ppc version The entire checksum code should IMHO be replaced with the DragonFly version (because it isn't guaranteed future revisions of gcc will include similar optimizations) as in: ---snip--- Revision Changes Path 1.12 +1 -0 src/sys/conf/files.i386 1.4 +142 -558 src/sys/i386/i386/in_cksum.c 1.5 +33 -69 src/sys/i386/include/in_cksum.h 1.5 +2 -0 src/sys/netinet/igmp.c 1.6 +0 -1 src/sys/netinet/in.h 1.6 +2 -0 src/sys/netinet/ip_icmp.c 1.4 +3 -4 src/contrib/ipfilter/ip_compat.h 1.3 +1 -2 src/sbin/natd/icmp.c 1.4 +0 -1 src/sbin/natd/natd.c 1.48 +1 -0 src/sys/conf/files 1.2 +0 -1 src/sys/conf/files.amd64 1.13 +0 -1 src/sys/conf/files.i386 1.5 +0 -1 src/sys/conf/files.pc98 1.7 +1 -1 src/sys/contrib/ipfilter/netinet/fil.c 1.10 +2 -3 src/sys/contrib/ipfilter/netinet/ip_compat.h 1.10 +1 -1 src/sys/contrib/ipfilter/netinet/ip_fil.c 1.7 +1 -1 src/sys/dev/netif/txp/if_txp.c 1.7 +1 -1 src/sys/net/ip_mroute/ip_mroute.c 1.7 +1 -2 src/sys/net/ipfw/ip_fw2.c 1.6 +1 -2 src/sys/netinet/igmp.c 1.4 +158 -116 src/sys/netinet/in_cksum.c 1.6 +1 -1 src/sys/netinet/ip_gre.c 1.7 +1 -2 src/sys/netinet/ip_icmp.c 1.10 +1 -1 src/sys/netinet/ip_input.c 1.10 +1 -2 src/sys/netinet/ip_output.c 1.13 +1 -2 src/sys/netinet/tcp_input.c 1.9 +1 -2 src/sys/netinet/tcp_output.c 1.10 +1 -1 src/sys/netinet/tcp_subr.c 1.10 +1 -1 src/sys/netinet/tcp_syncache.c 1.9 +1 -2 src/sys/netinet/udp_usrreq.c 1.5 +1 -2 src/sys/netinet6/ipsec.c 1.5 +1 -2 src/sys/netproto/ipsec/ipsec.c 1.5 +1 -1 src/sys/netproto/ipsec/ipsec_input.c 1.4 +1 -2 src/sys/netproto/ipsec/ipsec_output.c and finally remove sys/i386/i386 in_cksum.c sys/i386/include in_cksum.h ---snip--- - endian.h: * DTRT in C++ mode - quad.h: * we don't use gcc v1 anymore, remove support for it Suggested by: bde (long ago) - assym.h: * avoid zero-length arrays (remove dependency on a gcc specific feature) This change changes the contents of the object file, but as it's only used to generate some values for a header, and the generator knows how to handle this, there's no impact in the gcc case. Explained by: bde Submitted by: Marius Strobl <marius@alchemy.franken.de> - aicasm.c: * minor change to teach it about the way icc spells "-nostdinc" Not approved by: gibbs (no reply to my mail) - bump __FreeBSD_version (lang/icc needs to know about the changes) Incarnations of this patch survive gcc compiles since a loooong time, I use it on my desktop. An icc compiled kernel works since Nov. 2003 (exceptions: snd_* if used as modules), it survives a build of the entire ports collection with icc. Parts of this commit contains suggestions or submissions from Marius Strobl <marius@alchemy.franken.de>. Reviewed by: -arch Submitted by: netchild Notes: svn path=/head/; revision=126891
* Don't remove the first mbuf in the chain if it got empty.Hartmut Brandt2004-02-211-7/+6
| | | | | | | | | | | This removes the packet header in certain cases which later on will give panic. Clarify what the atm_intr expects in the comment and de-obscurify the code a little bit by replacing the portability macros with the BSD names. The code isn't maintained externally anymore so there's no point in keeping the extra level of obscurity. Notes: svn path=/head/; revision=126063
* Introduce a MAC label reference in 'struct inpcb', which cachesRobert Watson2003-11-182-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Include <sys/malloc.h> for the declaration of malloc(), etc. insteadBruce Evans2003-11-141-3/+5
| | | | | | | | | of depending on namespace pollution 2 layers deep in <vm/uma.h>. Fixed most nearby include messes (another like this, several the opposite of this, and some formatting). Notes: svn path=/head/; revision=122701
* o add a flags parameter to netisr_register that is used to specifySam Leffler2003-11-081-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-318-30/+22
| | | | | | | | | | | | | | | | 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
* The number of prefixes can never be negative so use an u_int for this.Hartmut Brandt2003-07-291-1/+1
| | | | Notes: svn path=/head/; revision=118165
* Make the ioctl() interface cleaner with regard to types: use size_tHartmut Brandt2003-07-2911-46/+54
| | | | | | | | | instead of int where the variable has to hold buffer lengths, use u_int for things like number of network interfaces which in principle can never be negative. Notes: svn path=/head/; revision=118160
* Silence a gcc-warning. Do this by inlining the macro-call. This isHartmut Brandt2003-07-261-2/+1
| | | | | | | | not very nice - the compiler should just silently optimize away the unused else clause. Notes: svn path=/head/; revision=118060
* Print the offending SPANS message only if printing is enabled.Hartmut Brandt2003-07-251-1/+2
| | | | Notes: svn path=/head/; revision=118012
* Add support for VBR and CBR PVCs for IP over ATM.Hartmut Brandt2003-07-255-6/+205
| | | | | | | | Submitted by: Vincent Jardin <vjardin@wanadoo.fr> MFC after: 2 weeks Notes: svn path=/head/; revision=118004
* Set the interface type of the network interfaces to IFT_IPOVERATM(114).Hartmut Brandt2003-07-251-1/+1
| | | | | | | This is specified by RFC2320. Notes: svn path=/head/; revision=117996
* Hand the packet to bpf not only in the LLC/SNAP case, but for allHartmut Brandt2003-07-252-13/+13
| | | | | | | | | | connections. While this confuses tcpdump, it enables other applications to see and analyze non-IP traffic (signalling, for example). Pointed out by: Vincent Jardin <vjardin@wanadoo.fr> Notes: svn path=/head/; revision=117995
* Make the debugging variable that controls printing of UNI messagesHartmut Brandt2003-07-255-15/+29
| | | | | | | | | | accessible as a sysctl and move the debugging stuff out of DIAGNOSTICS. Submitted by: Vincent Jardin <vjardin@wanadoo.fr> MFC after: 2 weeks Notes: svn path=/head/; revision=117994
* Make the debugging variable that controls dumping of IP over ATM packetsHartmut Brandt2003-07-244-10/+19
| | | | | | | | | | accessible as a sysctl. Submitted by: Vincent Jardin <vjardin@wanadoo.fr> MFC after: 2 weeks Notes: svn path=/head/; revision=117971
* Create a sysctl that allows to enable/disable printing of SPANS messages.Hartmut Brandt2003-07-243-17/+15
| | | | | | | | | | While here delete to sys/types.h includes when sys/param.h is also included. Submitted by: Vincent Jardin <vjardin@wanadoo.fr> MFC after: 2 weeks Notes: svn path=/head/; revision=117970
* Free the UNI vcc to the same zone from where it was allocated from.Hartmut Brandt2003-07-242-3/+3
| | | | | | | This resulted in a panic when detaching the uni31 signalling manager. Notes: svn path=/head/; revision=117968
* Now that we have if_detach() don't try to get rid of all the interfaceHartmut Brandt2003-07-241-95/+5
| | | | | | | | | | stuff (routes, ...) by hand - simply use if_detach(). Submitted by: Vincent Jardin <vjardin@wanadoo.fr> MFC after: 2 week Notes: svn path=/head/; revision=117967
* Create a subtree 'harp' of the net sysctl tree. This uses a fixedHartmut Brandt2003-07-243-3/+31
| | | | | | | | | | | | OID as the other protocol family sub-trees do, that is equal to the protocol family identifier. Make the ATM layer debugging flags available under this tree. Submitted by: Vincent Jardin <vjardin@wanadoo.fr> MFC after: 2 weeks Notes: svn path=/head/; revision=117965
* Constify the arguments to several pdu_print functions.Hartmut Brandt2003-07-249-33/+18
| | | | Notes: svn path=/head/; revision=117963
* Add BPF support to HARP network interfaces. This allows one to seeHartmut Brandt2003-07-243-0/+37
| | | | | | | | | | | the traffic on LLC multiplexed connections (like CLIP). PR: kern/51831 Submitted by: Vincent Jardin <vjardin@wanadoo.fr> MFC after: 2 weeks Notes: svn path=/head/; revision=117960
* Handle the new MEDIA definitions.Hartmut Brandt2003-07-231-0/+9
| | | | Notes: svn path=/head/; revision=117924
* Convert a lot of uma_zalloc() calls to be NOWAIT instead of WAITOK. AllHartmut Brandt2003-07-239-30/+48
| | | | | | | | these may be called from contexts where we cannot sleep (callout handlers for example). Notes: svn path=/head/; revision=117922
* Get rid of the zone for network interfaces. We have converted this toHartmut Brandt2003-07-231-7/+0
| | | | | | | use malloc(9). Notes: svn path=/head/; revision=117921
* Allocate network interfaces from malloc() instead of using a zone.Hartmut Brandt2003-07-221-6/+6
| | | | | | | | Usually one needs only a couple of them so using a zone is waste of memory (esp. on multi-cpu systems). Notes: svn path=/head/; revision=117892
* Remove the zone limits for all the zones used in the ATM code.Hartmut Brandt2003-07-2213-21/+14
| | | | | | | | | | | | | | These were a left over from when the private memory pools were converted to use uma zones. The limit of UMA zones, however, works differently. When a zone is limited to only one or two pages than, on multi-cpu systems, processes can get stuck on the zonelimit, because all remaining free items are in caches of other CPUs. Also add rudimentary error handling in some places (panic) when a zone cannot be created. Notes: svn path=/head/; revision=117886
* Add several vendor, API and media definitions. This has beenHartmut Brandt2003-07-221-5/+27
| | | | | | | forgotten in the previous commit to harp and should unbreak world. Notes: svn path=/head/; revision=117861
* Fix a number of occurences of calling uma_zalloc() with neitherHartmut Brandt2003-07-182-13/+13
| | | | | | | M_WAITOK nor M_NOWAIT. Notes: svn path=/head/; revision=117740
* Use __FBSDID().David E. O'Brien2003-06-1136-355/+108
| | | | Notes: svn path=/head/; revision=116200
* Use __FBSDID().David E. O'Brien2003-06-119-81/+26
| | | | Notes: svn path=/head/; revision=116199
* Use __FBSDID().David E. O'Brien2003-06-112-19/+6
| | | | Notes: svn path=/head/; revision=116198
* Use __FBSDID().David E. O'Brien2003-06-1116-155/+48
| | | | Notes: svn path=/head/; revision=116197
* Use __FBSDID rather than rcsid[].David E. O'Brien2003-04-031-9/+3
| | | | Notes: svn path=/head/; revision=113038
* Update netisr handling; Each SWI now registers its queue, and all queueJonathan Lemon2003-03-044-49/+30
| | | | | | | | | | | | | 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
* There is no reason to be cute with ntohl(). Just call it directly ratherDavid E. O'Brien2003-02-235-22/+8
| | | | | | | | | than use a macro that tries to do conversions in place. Compile tested on: sparc64 Notes: svn path=/head/; revision=111376
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-1922-71/+71
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Band-XXX-aid an easy to provoke panic.Poul-Henning Kamp2003-01-281-0/+7
| | | | | | | MFC: 2 weeks Notes: svn path=/head/; revision=109981
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-2123-83/+83
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,Jens Schweikhardt2003-01-013-3/+3
| | | | | | | especially in troff files. Notes: svn path=/head/; revision=108533
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/Jens Schweikhardt2002-12-303-5/+5
| | | | | | | Add FreeBSD Id tag where missing. Notes: svn path=/head/; revision=108470
* Correct mbuf packet header propagation. Previously, packet headersSam Leffler2002-12-301-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | were sometimes propagated using M_COPY_PKTHDR which actually did something between a "move" and a "copy" operation. This is replaced by M_MOVE_PKTHDR (which copies the pkthdr contents and "removes" it from the source mbuf) and m_dup_pkthdr which copies the packet header contents including any m_tag chain. This corrects numerous problems whereby mbuf tags could be lost during packet manipulations. These changes also introduce arguments to m_tag_copy and m_tag_copy_chain to specify if the tag copy work should potentially block. This introduces an incompatibility with openbsd which we may want to revisit. Note that move/dup of packet headers does not handle target mbufs that have a cluster bound to them. We may want to support this; for now we watch for it with an assert. Finally, M_COPYFLAGS was updated to include M_FIRSTFRAG|M_LASTFRAG. Supported by: Vernier Networks Reviewed by: Robert Watson <rwatson@FreeBSD.org> Notes: svn path=/head/; revision=108466
* Indirectly pull in declaration for M_IFADDR.Jeffrey Hsu2002-12-281-0/+1
| | | | Notes: svn path=/head/; revision=108359
* SMP locking for radix nodes.Jeffrey Hsu2002-12-241-0/+2
| | | | Notes: svn path=/head/; revision=108250
* SMP locking for ifnet list.Jeffrey Hsu2002-12-222-0/+5
| | | | Notes: svn path=/head/; revision=108172
* - Change the ATM stack functions to use intptr_t instead of int for opaqueJohn Baldwin2002-11-0831-202/+205
| | | | | | | | | | arguments. - Fix a few other places that assumed that sizeof(int) == sizeof(void *). Reviewed by: mdodd Notes: svn path=/head/; revision=106651