summaryrefslogtreecommitdiffstats
path: root/sys/net/if.h
Commit message (Collapse)AuthorAgeFilesLines
* Link state change notification of ethernet media to the routing socket.andre2004-05-031-0/+8
| | | | | | | | | | | | | | | o Extend the if_data structure with an ifi_link_state field and provide the corresponding defines for the valid states. o The mii_linkchg() callback updates the ifi_link_state field and calls rt_ifmsg() to notify listeners on the routing socket in addition to the kqueue KNOTE. o If vlans are configured on a physical interface notify and update all vlan pseudo devices as well with the vlan_link_state() callback. No objections by: sam, wpaul, ru, bms Brucification by: bde
* Added the new interface capability option for drivers that implementru2004-04-111-0/+1
| | | | | | user-configurable polling(4) support. Make ifconfig(8) aware of it. Suggested by: luigi
* Remove advertising clause from University of California Regent'simp2004-04-071-4/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-1/+1
| | | | | | | | | | | | | 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)
* By popular demand, added the "static ARP" per-interface option.ru2003-10-011-0/+1
|
* o add IF_*bps macros for netbsd compatibilitysam2002-11-141-0/+11
| | | | | | | o add interface capabilities for vlan use and to signal jumbo frame support Reviewed by: many Approved by: re
* style(9):mike2002-10-021-5/+5
| | | | | o Align members of struct if_nameindex. o Align and sort function prototypes.
* Use standards visibility conditionals to conditionalize most of thismike2002-10-021-5/+15
| | | | | | | header (details on how the visibility conditionals work are available in <sys/cdefs.h>). Use standard types instead of BSD specific ones, so that this header compiles in the standards case (specifically this means changing `u_int' to `unsigned int').
* Add the "Monitor" interface flag.phk2002-09-271-0/+1
| | | | | | | | | | Setting this flag on an ethernet interface blocks transmission of packets and discards incoming packets after BPF processing. This is useful if you want to monitor network trafic but not interact with the network in question. Sponsored by: http://www.babeltech.dk
* Add IFF_POLLING into the list of flags which are protected from changing viasobomax2002-08-281-1/+2
| | | | | | ioctl(SIOCSIFFLAGS). MFC after: 1 day
* Implement user-setable promiscuous mode (a new `promisc' flag for ifconfig(8)).sobomax2002-08-191-1/+2
| | | | | | | | | Also, for all interfaces in this mode pass all ethernet frames to upper layer, even those not addressed to our own MAC, which allows packets encapsulated in those frames be processed with packet filters (ipfw(8) et al). Emphatically requested by: Anton Turygin <pa3op@ukr-link.net> Valuable suggestions by: fenner
* Increase size of ifnet.if_flags from 16 bits (short) to 32 bits (int). To avoidsobomax2002-08-181-10/+2
| | | | | | | breaking application ABI use unused ifreq.ifru_flags[1] for upper 16 bits in SIOCSIFFLAGS and SIOCGIFFLAGS ioctl's. Reviewed by: -hackers, -net
* Move all unit number management cloned interfaces into the cloningbrooks2002-05-251-3/+4
| | | | | | | | code. The reverts the API change which made the <if>_clone_destory() functions return an int instead of void bringing us into closer alignment with NetBSD. Reviewed by: net (a long time ago)
* Avoid exposing struct if_clone and the sys/queue.h macros to userlandiedowse2002-05-201-0/+4
| | | | | | programs by restricting these to the case where _KERNEL is defined. Reviewed by: brooks (ages ago)
* Remove __P.alfred2002-03-191-4/+4
|
* Simplify the interface cloning framework by handling unitmux2002-03-111-3/+7
| | | | | | | | | unit allocation with a bitmap in the generic layer. This allows us to get rid of the duplicated rman code in every clonable interface. Reviewed by: brooks Approved by: phk
* Change the network interface cloning API so the destroy function returnsbrooks2002-03-041-1/+1
| | | | | | | | an int errorcode instead of void in preperation for merging cloning of the loopback device. Submitted by: mux MFC after: 2 weeks
* Introduce an interface announcement message for the routingru2002-01-181-0/+15
| | | | | | | | | 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
* Device Polling code for -current.luigi2001-12-141-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Non-SMP, i386-only, no polling in the idle loop at the moment. To use this code you must compile a kernel with options DEVICE_POLLING and at runtime enable polling with sysctl kern.polling.enable=1 The percentage of CPU reserved to userland can be set with sysctl kern.polling.user_frac=NN (default is 50) while the remainder is used by polling device drivers and netisr's. These are the only two variables that you should need to touch. There are a few more parameters in kern.polling but the default values are adequate for all purposes. See the code in kern_poll.c for more details on them. Polling in the idle loop will be implemented shortly by introducing a kernel thread which does the job. Until then, the amount of CPU dedicated to polling will never exceed (100-user_frac). The equivalent (actually, better) code for -stable is at http://info.iet.unipi.it/~luigi/polling/ and also supports polling in the idle loop. NOTE to Alpha developers: There is really nothing in this code that is i386-specific. If you move the 2 lines supporting the new option from sys/conf/{files,options}.i386 to sys/conf/{files,options} I am pretty sure that this should work on the Alpha as well, just that I do not have a suitable test box to try it. If someone feels like trying it, I would appreciate it. NOTE to other developers: sure some things could be done better, and as always I am open to constructive criticism, which a few of you have already given and I greatly appreciated. However, before proposing radical architectural changes, please take some time to possibly try out this code, or at the very least read the comments in kern_poll.c, especially re. the reason why I am using a soft netisr and cannot (I believe) replace it with a simple timeout. Quick description of files touched by this commit: sys/conf/files.i386 new file kern/kern_poll.c sys/conf/options.i386 new option sys/i386/i386/trap.c poll in trap (disabled by default) sys/kern/kern_clock.c initialization and hardclock hooks. sys/kern/kern_intr.c minor swi_net changes sys/kern/kern_poll.c the bulk of the code. sys/net/if.h new flag sys/net/if_var.h declaration for functions used in device drivers. sys/net/netisr.h NETISR_POLL sys/dev/fxp/if_fxp.c sys/dev/fxp/if_fxpvar.h sys/pci/if_dc.c sys/pci/if_dcreg.h sys/pci/if_sis.c sys/pci/if_sisreg.h device driver modifications
* Add a SIOCGIFINDEX ioctl, which returns the index of a named interface.jlemon2001-10-171-0/+2
| | | | This will be used to more efficiently support if_nametoindex(3).
* Split HWCSUM into two components: RX and TX, for the benefit of driversjlemon2001-09-181-2/+5
| | | | which can only do checksum offloading in one direction.
* Add two fields to the ifnet structure indicating what extra capabilitiesjlemon2001-09-181-0/+7
| | | | a network device has, and which ones are enabled.
* KSE Milestone 2julian2001-09-121-1/+1
| | | | | | | | | | | | | | 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
* Add kernel infrastructure for network device cloning.brooks2001-07-021-2/+36
| | | | | | Reviewed by: ru, ume Obtained from: NetBSD MFC after: 1 week
* o Move per-process jail pointer (p->pr_prison) to inside of the subjectrwatson2001-02-211-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | credential structure, ucred (cr->cr_prison). o Allow jail inheritence to be a function of credential inheritence. o Abstract prison structure reference counting behind pr_hold() and pr_free(), invoked by the similarly named credential reference management functions, removing this code from per-ABI fork/exit code. o Modify various jail() functions to use struct ucred arguments instead of struct proc arguments. o Introduce jailed() function to determine if a credential is jailed, rather than directly checking pointers all over the place. o Convert PRISON_CHECK() macro to prison_check() function. o Move jail() function prototypes to jail.h. o Emulate the P_JAILED flag in fill_kinfo_proc() and no longer set the flag in the process flags field itself. o Eliminate that "const" qualifier from suser/p_can/etc to reflect mutex use. Notes: o Some further cleanup of the linux/jail code is still required. o It's now possible to consider resolving some of the process vs credential based permission checking confusion in the socket code. o Mutex protection of struct prison is still not present, and is required to protect the reference count plus some fields in the structure. Reviewed by: freebsd-arch Obtained from: TrustedBSD Project
* Fix typo: compatability -> compatibility.asmodai2001-02-061-4/+4
| | | | Compatability is not an existing english word.
* Add support for offloading IP/TCP/UDP checksums to NIC hardware whichjlemon2000-03-271-2/+2
| | | | supports them.
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-291-4/+4
| | | | | | 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.
* KAME related header files additions and merges.shin1999-11-051-0/+28
| | | | | | | (only those which don't affect c source files so much) Reviewed by: cvs-committers Obtained from: KAME project
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Fixed English errors, spelling errors and formatting errors in rev.1.51bde1999-07-051-7/+9
| | | | and rev.1.53.
* Add a new interface ioctl, to return "aux status".phk1999-06-191-1/+15
| | | | | | | | | | | | | | | | | | | This is inteded for to allow ifconfig to print various unstructured information from an interface. The data is returned from the kernel in ASCII form, see the comment in if.h for some technicalities. Canonical cut&paste example to be found in if_tun.c Initial use: Now tun* interfaces tell the PID of the process which opened them. Future uses could be (volounteers welcome!): Have ppp/slip interfaces tell which tty they use. Make sync interfaces return their media state: red/yellow/blue alarm, timeslot assignment and so on. Make ethernets warn about missing heartbeats and/or cables
* Introduce IFF_SMART bit.phk1999-06-061-2/+3
| | | | | | | | This means that the driver will add/delete routes when it knows it is up/down, rather than have the generic code belive it is up if configured. This is probably most useful for serial lines, although many PHY chips could probably tell us if we're connected to the cable/hub as well.
* Fix some disordering I introduced with the jail code.phk1999-05-081-2/+3
|
* This Implements the mumbled about "Jail" feature.phk1999-04-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a seriously beefed up chroot kind of thing. The process is jailed along the same lines as a chroot does it, but with additional tough restrictions imposed on what the superuser can do. For all I know, it is safe to hand over the root bit inside a prison to the customer living in that prison, this is what it was developed for in fact: "real virtual servers". Each prison has an ip number associated with it, which all IP communications will be coerced to use and each prison has its own hostname. Needless to say, you need more RAM this way, but the advantage is that each customer can run their own particular version of apache and not stomp on the toes of their neighbors. It generally does what one would expect, but setting up a jail still takes a little knowledge. A few notes: I have no scripts for setting up a jail, don't ask me for them. The IP number should be an alias on one of the interfaces. mount a /proc in each jail, it will make ps more useable. /proc/<pid>/status tells the hostname of the prison for jailed processes. Quotas are only sensible if you have a mountpoint per prison. There are no privisions for stopping resource-hogging. Some "#ifdef INET" and similar may be missing (send patches!) If somebody wants to take it from here and develop it into more of a "virtual machine" they should be most welcome! Tools, comments, patches & documentation most welcome. Have fun... Sponsored by: http://www.rndassociates.com/ Run for almost a year by: http://www.servetheweb.com/
* Since ifru_flags is a short, we can fit in a copy of the flagsphk1999-02-191-4/+4
| | | | | | | before they got changed. This can help eliminate much of the gymnastics drivers do in their ioctl routines to figure this out. Remove commented out IFF_NOTRAILERS
* On most other systems "out there", <net/if.h> does not require the callerpeter1998-03-211-1/+9
| | | | | | | to #include <sys/time.h> first. I've lost count of the number of times I've had to patch this in porting code. The problem is the "struct timeval ifi_lastchange" in the mib stats. (most other systems don't have this, until 4.4bsd anyway).
* Add a macro to accurately calculate the length of a struct ifreq whenwollman1998-01-131-1/+6
| | | | | | | | | it contains an address. This can replace all the myriad (wrong) ways in which this task is performed in the current system. As an added bonus, since it's a macro, then third-party software vendors have an easy way to tell whether it's there or not. (This will become necessary when sizeof(struct sockaddr) is increaased, and also when additional fields are added to struct ifreq.)
* Last major round (Unless Bruce thinks of somthing :-) of malloc changes.phk1997-10-121-1/+8
| | | | | | | | 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
* add SIOC{S,G}IFMEDIA ioctl supportpeter1997-05-031-1/+12
|
* 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/+14
| | | | | | | 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).
* Separate kernel-internal data structures from exposed user interfacewollman1997-01-031-272/+3
| | | | | | to interfaces. (Amazing nobody had done this!) More commits to fix up user-land to follow.
* Convert the interface address and IP interface address structureswollman1996-12-131-13/+7
| | | | | | to TAILQs. Fix places which referenced these for no good reason that I can see (the references remain, but were fixed to compile again; they are still questionable).
* Use queue macros for the list of interfaces. Next stop: ifaddrs!wollman1996-12-111-7/+18
|
* Include <net/if_arp.h> in the one header that requires it,wollman1996-12-111-3/+1
| | | | | | | <netinet/if_ether.h>, rather than in <net/if.h>, most of whose callers have no need of it. Pointed-out-by: bde
* Finally, after six years, remove the ``quick hack for SNMP'' that waswollman1996-12-101-5/+1
| | | | ``going away soon''.
* 1) Implement SIOCSIFMTU in ether_ioctl(), and change ether_ioctl's returndg1996-12-101-2/+2
| | | | | | | | | type to be int so that errors can be returned. 2) Use the new SIOCSIFMTU ether_ioctl support in the few drivers that are using ether_ioctl(). 3) In if_fxp.c: treat if_bpf as a token, not as a pointer. Don't bother testing for FXP_NTXSEG being reached in fxp_start()...just check for non-NULL 'm'. Change fxp_ioctl() to use ether_ioctl().
* Fix comments, which appear to have been mangled long ago and far away.fenner1996-10-211-6/+8
|
OpenPOWER on IntegriCloud