summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in.h
Commit message (Collapse)AuthorAgeFilesLines
* Add INADDR_ALLRPTS_GROUP define for 224.0.0.22 for future IGMPv3 support.bms2007-02-271-0/+1
| | | | Obtained from: OpenSolaris
* Import macros IN_LINKLOCAL(), IN_PRIVATE(), IN_LOCAL_GROUP(), IN_ANY_LOCAL().bms2007-01-311-0/+10
| | | | | | | | | | | | | | | | | This is not a functional change. IN_LINKLOCAL() tests if an address falls within the IPv4 link-local prefix. IN_PRIVATE() tests if an address falls within an RFC 1918 private prefix. IN_LOCAL_GROUP() tests if an address falls within the statically assigned link-local multicast scope specified in RFC 2365. IN_ANY_LOCAL() tests for either of IN_LINKLOCAL() or IN_LOCAL_GROUP(). As with the existing macros in the FreeBSD netinet stack, comparisons are performed in host-byte order. See also: RFC 1918, RFC 2365, RFC 3927 Obtained from: NetBSD (dyoung@) MFC after: 2 weeks
* Summer of Code 2005: improve libalias - part 2 of 2piso2006-12-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With the second (and last) part of my previous Summer of Code work, we get: -ipfw's in kernel nat -redirect_* and LSNAT support General information about nat syntax and some examples are available in the ipfw (8) man page. The redirect and LSNAT syntax are identical to natd, so please refer to natd (8) man page. To enable in kernel nat in rc.conf, two options were added: o firewall_nat_enable: equivalent to natd_enable o firewall_nat_interface: equivalent to natd_interface Remember to set net.inet.ip.fw.one_pass to 0, if you want the packet to continue being checked by the firewall ruleset after being (de)aliased. NOTA BENE: due to some problems with libalias architecture, in kernel nat won't work with TSO enabled nic, thus you have to disable TSO via ifconfig (ifconfig foo0 -tso). Approved by: glebius (mentor)
* Fix a long-standing limitation in IPv4 multicast group membership.bms2006-05-141-1/+8
| | | | | | | | | | | | | | By making the imo_membership array a dynamically allocated vector, this minimizes disruption to existing IPv4 multicast code. This change breaks the ABI for the kernel module ip_mroute.ko, and may cause a small amount of churn for folks working on the IGMPv3 merge. Previously, sockets were subject to a compile-time limitation on the number of IPv4 group memberships, which was hard-coded to 20. The imo_membership relationship, however, is 1:1 with regards to a tuple of multicast group address and interface address. Users who ran routing protocols such as OSPF ran into this limitation on machines with a large system interface tree.
* Use consistent indent character as other IPPROTO_* lines did.delphij2005-12-201-1/+1
|
* Add protocol number for SCTP.gnn2005-12-201-0/+1
| | | | | Submitted by: Randall Stewart rrs at cisco.com MFC after: 1 week
* Implement IP_DONTFRAG IP socket option enabling the Don't Fragmentandre2005-09-261-0/+1
| | | | | | | | | | | | flag on IP packets. Currently this option is only repected on udp and raw ip sockets. On tcp sockets the DF flag is controlled by the path MTU discovery option. Sending a packet larger than the MTU size of the egress interface returns an EMSGSIZE error. Discussed with: rwatson Sponsored by: TCP/IP Optimization Fundraise 2005
* Take a first cut at cleaning up ifnet removal and multicast socketrwatson2005-09-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | panics, which occur when stale ifnet pointers are left in struct moptions hung off of inpcbs: - Add in_ifdetach(), which matches in6_ifdetach(), and allows the protocol to perform early tear-down on the interface early in if_detach(). - Annotate that if_detach() needs careful consideration. - Remove calls to in_pcbpurgeif0() in the handling of SIOCDIFADDR -- this is not the place to detect interface removal! This also removes what is basically a nasty (and now unnecessary) hack. - Invoke in_pcbpurgeif0() from in_ifdetach(), in both raw and UDP IPv4 sockets. It is now possible to run the msocket_ifnet_remove regression test using HEAD without panicking. MFC after: 3 days
* Add socketoption IP_MINTTL. May be used to set the minimum acceptableandre2005-08-221-0/+1
| | | | | | | | | | | | | | | | | TTL a packet must have when received on a socket. All packets with a lower TTL are silently dropped. Works on already connected/connecting and listening sockets for RAW/UDP/TCP. This option is only really useful when set to 255 preventing packets from outside the directly connected networks reaching local listeners on sockets. Allows userland implementation of 'The Generalized TTL Security Mechanism (GTSM)' according to RFC3682. Examples of such use include the Cisco IOS BGP implementation command "neighbor ttl-security". MFC after: 2 weeks Sponsored by: TCP/IP Optimization Fundraise 2005
* Add CARP (Common Address Redundancy Protocol), which allows multipleglebius2005-02-221-0/+2
| | | | | | | | | | | | | hosts to share an IP address, providing high availability and load balancing. Original work on CARP done by Michael Shalayeff, with many additions by Marco Pfatschbacher and Ryan McBride. FreeBSD port done solely by Max Laier. Patch by: mlaier Obtained from: OpenBSD (mickey, mcbride)
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+1
|
* Pre-emptively define IPPROTO_SPACER to 32767, the same value as PROTO_SPACERandre2004-10-191-0/+6
| | | | | to document that this value is globally assigned for a special purpose and may not be reused within the IPPROTO number space.
* White space cleanup for netinet before branch:rwatson2004-08-161-30/+30
| | | | | | | | | | | - Trailing tab/space cleanup - Remove spurious spaces between or before tabs This change avoids touching files that Andre likely has in his working set for PFIL hooks changes for IPFW/DUMMYNET. Approved by: re (scottl) Submitted by: Xin LI <delphij@frontfree.net>
* Add the function in_localip() which returns 1 if an internet address is forandre2004-08-111-0/+1
| | | | the local host and configured on one of its interfaces.
* Prepare for pf 3.5 import:mlaier2004-06-161-0/+2
| | | | | | | | | | - Remove pflog and pfsync modules. Things will change in such a fashion that there will be one module with pf+pflog that can be loaded into GENERIC without problems (which is what most people want). pfsync is no longer possible as a module. - Add multicast address for in-kernel multicast pfsync protocol. Protocol glue will follow once the import is done. - Add one more mbuf tag
* Introduce a new feature to IPFW2: lookup tables. These are usefulru2004-06-091-0/+6
| | | | | | | for handling large sparse address sets. Initial implementation by Vsevolod Lobko <seva@ip.net.ua>, refined by me. MFC after: 1 week
* 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
* correct namespace pollution.ume2003-10-251-2/+1
| | | | Submitted by: bde
* Switch Advanced Sockets API for IPv6 from RFC2292 to RFC3542ume2003-10-241-0/+1
| | | | | | | | | | (aka RFC2292bis). Though I believe this commit doesn't break backward compatibility againt existing binaries, it breaks backward compatibility of API. Now, the applications which use Advanced Sockets API such as telnet, ping6, mld6query and traceroute6 use RFC3542 API. Obtained from: KAME
* Add the IP_ONESBCAST option, to enable undirected IP broadcasts to be sent onbms2003-08-201-0/+2
| | | | | | | | | | specific interfaces. This is required by aodvd, and may in future help us in getting rid of the requirement for BPF from our import of isc-dhcp. Suggested by: fenestro Obtained from: BSD/OS Reviewed by: mini, sam Approved by: jake (mentor)
* 1. Basic PIM kernel supporthsu2003-08-071-0/+16
| | | | | | | | | | | | | | | | | | Disabled by default. To enable it, the new "options PIM" must be added to the kernel configuration file (in addition to MROUTING): options MROUTING # Multicast routing options PIM # Protocol Independent Multicast 2. Add support for advanced multicast API setup/configuration and extensibility. 3. Add support for kernel-level PIM Register encapsulation. Disabled by default. Can be enabled by the advanced multicast API. 4. Implement a mechanism for "multicast bandwidth monitoring and upcalls". Submitted by: Pavlin Radoslavov <pavlin@icir.org>
* Add definitions for IN6ADDR_LINKLOCAL_ALLMDNS_INIT and INADDR_ALLMDNS_GROUP.mdodd2003-04-291-0/+1
|
* IP_RECVTTL socket option.mdodd2003-04-291-0/+2
| | | | Reviewed by: Stuart Cheshire <cheshire@apple.com>
* Back out support for RFC3514.mdodd2003-04-021-2/+0
| | | | RFC3514 poses an unacceptale risk to compliant systems.
* Implement support for RFC 3514 (The Security Flag in the IPv4 Header).mdodd2003-04-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (See: ftp://ftp.rfc-editor.org/in-notes/rfc3514.txt) This fulfills the host requirements for userland support by way of the setsockopt() IP_EVIL_INTENT message. There are three sysctl tunables provided to govern system behavior. net.inet.ip.rfc3514: Enables support for rfc3514. As this is an Informational RFC and support is not yet widespread this option is disabled by default. net.inet.ip.hear_no_evil If set the host will discard all received evil packets. net.inet.ip.speak_no_evil If set the host will discard all transmitted evil packets. The IP statistics counter 'ips_evil' (available via 'netstat') provides information on the number of 'evil' packets recieved. For reference, the '-E' option to 'ping' has been provided to demonstrate and test the implementation.
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-011-1/+1
| | | | especially in troff files.
* Renumber IPPROTO_DIVERT out of the range of valid IP protocol numbers.fenner2002-10-291-2/+5
| | | | | | | | | | | This allows socket() to return an error when the kernel is not built with IPDIVERT, and doesn't prevent future applications from using the "borrowed" IP protocol number. The sysctl net.inet.raw.olddiverterror controls whether opening a socket with the "borrowed" IP protocol fails with an accompanying kernel printf; this code should last only a couple of releases. Approved by: re
* Implement a new IP_SENDSRCADDR ancillary message type that permitsiedowse2002-10-211-0/+1
| | | | | | | | | | | | a server process bound to a wildcard UDP socket to select the IP address from which outgoing packets are sent on a per-datagram basis. When combined with IP_RECVDSTADDR, such a server process can guarantee to reply to an incoming request using the same source IP address as the destination IP address of the request, without having to open one socket per server IP address. Discussed on: -net Approved by: re
* Add in_hosteq() and in_nullhost() macros to make life of developerssobomax2002-09-041-0/+3
| | | | | | porting NetBSD code a little bit easier. Obtained from: NetBSD
* o Merge <machine/ansi.h> and <machine/types.h> into a new headermike2002-08-211-3/+3
| | | | | | | | | | | | | | | | | | | | | called <machine/_types.h>. o <machine/ansi.h> will continue to live so it can define MD clock macros, which are only MD because of gratuitous differences between architectures. o Change all headers to make use of this. This mainly involves changing: #ifdef _BSD_FOO_T_ typedef _BSD_FOO_T_ foo_t; #undef _BSD_FOO_T_ #endif to: #ifndef _FOO_T_DECLARED typedef __foo_t foo_t; #define _FOO_T_DECLARED #endif Concept by: bde Reviewed by: jake, obrien
* Remove some duplicate types that should have been removed as part ofmike2002-05-111-40/+0
| | | | | | the rearranging in the previous revision. Pointy hat to: cvs update (merging), mike (for not noticing)
* Rearrange <netinet/in.h> so that it is easier to conditionalizemike2002-04-241-48/+96
| | | | | | sections for various standards. Conditionalize sections for various standards. Use standards conforming spelling for types in the sockaddr_in structure.
* Add sa_family_t type to <sys/_types.h> and typedefs to <netinet/in.h>mike2002-04-201-0/+5
| | | | | and <sys/socket.h>. Previously, sa_family_t was only typedef'd in <sys/socket.h>.
* Totally nuke IPPORT_USERRESERVED, it is no longer used anywhere, updatesilby2002-04-101-4/+2
| | | | | | | remaining comments to reflect new ephemeral port range. Reminded by: Maxim Konovalov <maxim@macomnet.ru> MFC after: 3 days
* Unconditionalize the definition of INET_ADDRSTRLEN andmike2002-04-101-2/+0
| | | | | INET6_ADDRSTRLEN. Doing this helps expose bogus redefinitions in 3rd party software.
* Update comments to reflect the recent ephemeral port rangesilby2002-04-091-3/+4
| | | | | | | change. Noticed by: ru MFC After: 1 day
* o Implement <sys/_types.h>, a new header for storing types that aremike2002-04-011-10/+27
| | | | | | | | | | | | | | | MI, not required to be a fixed size, and used in multiple headers. This will grow in time, as more things move here from <sys/types.h> and <machine/ansi.h>. o Add missing type definitions (uint16_t and uint32_t) to <arpa/inet.h> and <netinet/in.h>. o Reduce pollution in <sys/types.h> by using `#if _FOO_T_DECLARED' widgets to avoid including <sys/stdint.h>. o Add some missing type definitions to <unistd.h> and note the ones that still need to be added. o Make use of <sys/_types.h> primitives in <grp.h> and <sys/types.h>. Reviewed by: bde
* Remove __P.alfred2002-03-191-9/+9
|
* o Add INET_ADDRSTRLEN and INET6_ADDRSTRLEN defines to <arpa/inet.h>mike2002-03-101-0/+2
| | | | | | | for POSIX.1-2001 conformance. o Add magic to <netinet/in.h> and <netinet6/in6.h> to prevent redefining INET_ADDRSTRLEN and INET6_ADDRSTRLEN. o Add a note about missing typedefs in <arpa/inet.h>.
* o Don't require long long support in bswap64() functions.mike2002-03-091-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | o In i386's <machine/endian.h>, macros have some advantages over inlines, so change some inlines to macros. o In i386's <machine/endian.h>, ungarbage collect word_swap_int() (previously __uint16_swap_uint32), it has some uses on i386's with PDP endianness. Submitted by: bde o Move a comment up in <machine/endian.h> that was accidentially moved down a few revisions ago. o Reenable userland's use of optimized inline-asm versions of byteorder(3) functions. o Fix ordering of prototypes vs. redefinition of byteorder(3) functions, so that the non-GCC (libc asm) case has proper prototypes. o Add proper prototypes for byteorder(3) functions in <sys/param.h>. o Prevent redundant duplicate prototypes by making use of the _BYTEORDER_PROTOTYPED define. o Move the bswap16(), bswap32(), bswap64() C functions into MD space for platforms in which asm versions don't exist. This significantly reduces the complexity of some things at the cost of duplicate code. Reviewed by: bde
* o Move NTOHL() and associated macros into <sys/param.h>. These aremike2002-02-181-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | deprecated in favor of the POSIX-defined lowercase variants. o Change all occurrences of NTOHL() and associated marcros in the source tree to use the lowercase function variants. o Add missing license bits to sparc64's <machine/endian.h>. Approved by: jake o Clean up <machine/endian.h> files. o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>. o Remove prototypes for non-existent bswapXX() functions. o Include <machine/endian.h> in <arpa/inet.h> to define the POSIX-required ntohl() family of functions. o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>, and <sys/param.h>. o Prepend underscores to the ntohl() family to help deal with complexities associated with having MD (asm and inline) versions, and having to prevent exposure of these functions in other headers that happen to make use of endian-specific defines. o Create weak aliases to the canonical function name to help deal with third-party software forgetting to include an appropriate header. o Remove some now unneeded pollution from <sys/types.h>. o Add missing <arpa/inet.h> includes in userland. Tested on: alpha, i386 Reviewed by: bde, jake, tmm
* o Stop abusing MD headers with non-MD types.mike2001-12-011-0/+15
| | | | | | | | | | | | | | | o Hide nonstandard functions and types in <netinet/in.h> when _POSIX_SOURCE is defined. o Add some missing types (required by POSIX.1-200x) to <netinet/in.h>. o Restore vendor ID from Rev 1.1 in <netinet/in.h> and make use of new __FBSDID() macro. o Fix some miscellaneous issues in <arpa/inet.h>. o Correct final argument for the inet_ntop() function (POSIX.1-200x). o Get rid of the namespace pollution from <sys/types.h> in <arpa/inet.h>. Reviewed by: fenner Partially submitted by: bde
* Centralize satosin(), sintosa() and ifatoia() macros in <netinet/in.h>jlemon2001-09-291-0/+4
| | | | Remove local definitions.
* Remove unused (and duplicate) struct ip_opts which is never used,luigi2001-09-271-12/+0
| | | | | | | | | | | | | | | not referenced in Stevens, and does not compile with g++. There is an equivalent structure, struct ipoption in ip_var.h which is actually used in various parts of the kernel, and also referenced in Stevens. Bill Fenner also says: ... if you want the trivia, struct ip_opts was introduced in in.h SCCS revision 7.9, on 6/28/1990, by Mike Karels. struct ipoption was introduced in ip_var.h SCCS revision 6.5, on 9/16/1985, by... Mike Karels. MFC-after: 3 days
* Fix a stack of KAME netinet6/in6.h warnings:peter2001-06-151-2/+4
| | | | | 592: warning: `struct mbuf' declared inside parameter list 595: warning: `struct ifnet' declared inside parameter list
* IPv4 address is not unsigned int. This change introduces in_addr_t.ume2001-03-231-1/+1
| | | | | | | PR: 9982 Adviced by: des Reviewed by: -alpha and -net (no objection) Obtained from: OpenBSD
* o Move per-process jail pointer (p->pr_prison) to inside of the subjectrwatson2001-02-211-3/+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
* Add definitions for IPPROTO numbers 55-57.asmodai2001-02-141-1/+3
|
* Prototype inet_ntoa_r and thereby silence a warning from GCC. The functionbmilekic2001-01-121-0/+1
| | | | is prototyped immediately under inet_ntoa, which is also from libkern.
* sync with kame tree as of july00. tons of bug fixes/improvements.itojun2000-07-041-1/+30
| | | | | | | API changes: - additional IPv6 ioctls - IPsec PF_KEY API was changed, it is mandatory to upgrade setkey(8). (also syntax change)
OpenPOWER on IntegriCloud