* Fixes all constant declarations according to sys/socket.h and netinet/in.h.

git-svn-id: trunk@15102 -
This commit is contained in:
olivier 2010-03-31 23:25:10 +00:00
parent 4833867826
commit a2d41bbdb9

View File

@ -2,6 +2,7 @@
This file is part of the Free Pascal run time library. This file is part of the Free Pascal run time library.
(c) 2000-2003 by Marco van de Voort (c) 2000-2003 by Marco van de Voort
member of the Free Pascal development team. member of the Free Pascal development team.
(c) 2010 by Olivier Coursière.
See the file COPYING.FPC, included in this distribution, See the file COPYING.FPC, included in this distribution,
for details about the copyright. for details about the copyright.
@ -18,9 +19,20 @@ Const
* Address families. * Address families.
*} *}
AF_UNSPEC = 0; { unspecified } AF_UNSPEC = 0; { unspecified }
AF_UNIX = 1; { standardized name for AF_LOCAL } AF_INET = 1; { internetwork: UDP, TCP, etc. }
AF_LOCAL = AF_UNIX; { local to host (pipes, portals) } AF_APPLETALK = 2; { Apple Talk }
AF_INET = 2; { internetwork: UDP, TCP, etc. } AF_ROUTE = 3; { Internal Routing Protocol }
AF_LINK = 4; { Link layer interface }
AF_INET6 = 5; { IPv6 }
AF_DLI = 6; { DEC Direct data link interface }
AF_IPX = 7; { Novell Internet Protocol }
AF_NOTIFY = 8; { ??? }
AF_LOCAL = 9; { local to host (pipes, portals) }
AF_UNIX = AF_LOCAL; { standardized name for AF_LOCAL }
AF_BLUETOOTH = 10; { Bluetooth sockets }
AF_MAX = 11;
(* Values not yet defined under Haiku (see sys/socket.h)
AF_IMPLINK = 3; { arpanet imp addresses } AF_IMPLINK = 3; { arpanet imp addresses }
AF_PUP = 4; { pup protocols: e.g. BSP } AF_PUP = 4; { pup protocols: e.g. BSP }
AF_CHAOS = 5; { mit CHAOS protocols } AF_CHAOS = 5; { mit CHAOS protocols }
@ -32,23 +44,17 @@ Const
AF_CCITT = 10; { CCITT protocols, X.25 etc } AF_CCITT = 10; { CCITT protocols, X.25 etc }
AF_SNA = 11; { IBM SNA } AF_SNA = 11; { IBM SNA }
AF_DECnet = 12; { DECnet } AF_DECnet = 12; { DECnet }
AF_DLI = 13; { DEC Direct data link interface }
AF_LAT = 14; { LAT } AF_LAT = 14; { LAT }
AF_HYLINK = 15; { NSC Hyperchannel } AF_HYLINK = 15; { NSC Hyperchannel }
AF_APPLETALK = 16; { Apple Talk }
AF_ROUTE = 17; { Internal Routing Protocol }
AF_LINK = 18; { Link layer interface }
pseudo_AF_XTP = 19; { eXpress Transfer Protocol (no AF) } pseudo_AF_XTP = 19; { eXpress Transfer Protocol (no AF) }
AF_COIP = 20; { connection-oriented IP, aka ST II } AF_COIP = 20; { connection-oriented IP, aka ST II }
AF_CNT = 21; { Computer Network Technology } AF_CNT = 21; { Computer Network Technology }
pseudo_AF_RTIP = 22; { Help Identify RTIP packets } pseudo_AF_RTIP = 22; { Help Identify RTIP packets }
AF_IPX = 23; { Novell Internet Protocol }
AF_SIP = 24; { Simple Internet Protocol } AF_SIP = 24; { Simple Internet Protocol }
pseudo_AF_PIP = 25; { Help Identify PIP packets } pseudo_AF_PIP = 25; { Help Identify PIP packets }
AF_ISDN = 26; { Integrated Services Digital Network} AF_ISDN = 26; { Integrated Services Digital Network}
AF_E164 = AF_ISDN; { CCITT E.164 recommendation } AF_E164 = AF_ISDN; { CCITT E.164 recommendation }
pseudo_AF_KEY = 27; { Internal key-management function } pseudo_AF_KEY = 27; { Internal key-management function }
AF_INET6 = 28; { IPv6 }
AF_NATM = 29; { native ATM access } AF_NATM = 29; { native ATM access }
AF_ATM = 30; { ATM } AF_ATM = 30; { ATM }
pseudo_AF_HDRCMPLT = 31; { Used by BPF to not rewrite headers pseudo_AF_HDRCMPLT = 31; { Used by BPF to not rewrite headers
@ -58,9 +64,8 @@ Const
AF_SLOW = 33; { 802.3ad slow protocol } AF_SLOW = 33; { 802.3ad slow protocol }
AF_SCLUSTER = 34; { Sitara cluster protocol } AF_SCLUSTER = 34; { Sitara cluster protocol }
AF_ARP = 35; AF_ARP = 35;
AF_BLUETOOTH = 36; { Bluetooth sockets }
AF_IEEE80211 = 37; { IEEE 802.11 protocol } AF_IEEE80211 = 37; { IEEE 802.11 protocol }
AF_MAX = 38; *)
{ {
* Protocol families, same as address families for now. * Protocol families, same as address families for now.
@ -68,10 +73,17 @@ Const
const const
PF_UNSPEC = AF_UNSPEC; PF_UNSPEC = AF_UNSPEC;
PF_INET = AF_INET;
PF_ROUTE = AF_ROUTE;
PF_LINK = AF_LINK;
PF_INET6 = AF_INET6;
PF_LOCAL = AF_LOCAL; PF_LOCAL = AF_LOCAL;
{ backward compatibility } { backward compatibility }
PF_UNIX = PF_LOCAL; PF_UNIX = PF_LOCAL;
PF_INET = AF_INET; PF_BLUETOOTH = AF_BLUETOOTH;
PF_MAX = AF_MAX;
(* Values not yet defined under Haiku (see sys/socket.h)
PF_IMPLINK = AF_IMPLINK; PF_IMPLINK = AF_IMPLINK;
PF_PUP = AF_PUP; PF_PUP = AF_PUP;
PF_CHAOS = AF_CHAOS; PF_CHAOS = AF_CHAOS;
@ -87,8 +99,6 @@ Const
PF_LAT = AF_LAT; PF_LAT = AF_LAT;
PF_HYLINK = AF_HYLINK; PF_HYLINK = AF_HYLINK;
PF_APPLETALK = AF_APPLETALK; PF_APPLETALK = AF_APPLETALK;
PF_ROUTE = AF_ROUTE;
PF_LINK = AF_LINK;
{ really just proto family, no AF } { really just proto family, no AF }
PF_XTP = pseudo_AF_XTP; PF_XTP = pseudo_AF_XTP;
PF_COIP = AF_COIP; PF_COIP = AF_COIP;
@ -100,47 +110,51 @@ Const
PF_PIP = pseudo_AF_PIP; PF_PIP = pseudo_AF_PIP;
PF_ISDN = AF_ISDN; PF_ISDN = AF_ISDN;
PF_KEY = pseudo_AF_KEY; PF_KEY = pseudo_AF_KEY;
PF_INET6 = AF_INET6;
PF_NATM = AF_NATM; PF_NATM = AF_NATM;
PF_ATM = AF_ATM; PF_ATM = AF_ATM;
PF_NETGRAPH = AF_NETGRAPH; PF_NETGRAPH = AF_NETGRAPH;
PF_SLOW = AF_SLOW; PF_SLOW = AF_SLOW;
PF_SCLUSTER = AF_SCLUSTER; PF_SCLUSTER = AF_SCLUSTER;
PF_ARP = AF_ARP; PF_ARP = AF_ARP;
PF_BLUETOOTH = AF_BLUETOOTH; *)
PF_MAX = AF_MAX;
SOCK_PACKET = 10; SOCK_PACKET = 10;
{ Maximum queue length specifiable by listen. } { Maximum queue length specifiable by listen. }
SOMAXCONN = 128; SOMAXCONN = 32;
SOL_SOCKET = $FFFF; SOL_SOCKET = -1;
SO_DEBUG = $0001; { turn on debugging info recording }
SO_ACCEPTCONN = $0002; { socket has had listen() } SO_ACCEPTCONN = $00000001; { socket has had listen() }
SO_REUSEADDR = $0004; { allow local address reuse } SO_BROADCAST = $00000002; { permit sending of broadcast msgs }
SO_KEEPALIVE = $0008; { keep connections alive } SO_DEBUG = $00000004; { turn on debugging info recording }
SO_DONTROUTE = $0010; { just use interface addresses } SO_DONTROUTE = $00000008; { just use interface addresses }
SO_BROADCAST = $0020; { permit sending of broadcast msgs } SO_KEEPALIVE = $00000010; { keep connections alive }
SO_USELOOPBACK = $0040; { bypass hardware when possible } SO_OOBINLINE = $00000020; { leave received OOB data in line }
SO_LINGER = $0080; { linger on close if data present } SO_REUSEADDR = $00000040; { allow local address reuse }
SO_OOBINLINE = $0100; { leave received OOB data in line } SO_REUSEPORT = $00000080; { allow local address & port reuse }
SO_REUSEPORT = $0200; { allow local address & port reuse } SO_USELOOPBACK = $00000100; { bypass hardware when possible }
SO_LINGER = $00000200; { linger on close if data present }
(* Values not yet defined under Haiku (see sys/socket.h)
SO_TIMESTAMP = $0400; { timestamp received dgram traffic } SO_TIMESTAMP = $0400; { timestamp received dgram traffic }
*)
{ {
* Additional options, not kept in so_options. * Additional options, not kept in so_options.
} }
SO_SNDBUF =$1001; { send buffer size } SO_SNDBUF = $40000001; { send buffer size }
SO_RCVBUF =$1002; { receive buffer size } SO_SNDLOWAT = $40000003; { send low-water mark }
SO_SNDLOWAT =$1003; { send low-water mark } SO_SNDTIMEO = $40000005; { send timeout }
SO_RCVLOWAT =$1004; { receive low-water mark } SO_RCVBUF = $40000002; { receive buffer size }
SO_SNDTIMEO =$1005; { send timeout } SO_RCVLOWAT = $40000004; { receive low-water mark }
SO_RCVTIMEO =$1006; { receive timeout } SO_RCVTIMEO = $40000006; { receive timeout }
SO_ERROR =$1007; { get error status and clear } SO_ERROR = $40000007; { get error status and clear }
SO_TYPE =$1008; { get socket type } SO_TYPE = $40000008; { get socket type }
SO_NONBLOCK = $40000009;
SO_BINDTODEVICE = $4000000a; { binds the socket to a specific device index }
SO_PEERCRED = $4000000b; { get peer credentials, param: ucred }
SHUT_RD =0; { shut down the reading side } SHUT_RD =0; { shut down the reading side }
@ -281,6 +295,19 @@ Const
IP_MULTICAST_LOOP = 11; { u_char; set/get IP multicast loopback } IP_MULTICAST_LOOP = 11; { u_char; set/get IP multicast loopback }
IP_ADD_MEMBERSHIP = 12; { ip_mreq; add an IP group membership } IP_ADD_MEMBERSHIP = 12; { ip_mreq; add an IP group membership }
IP_DROP_MEMBERSHIP = 13; { ip_mreq; drop an IP group membership } IP_DROP_MEMBERSHIP = 13; { ip_mreq; drop an IP group membership }
IP_BLOCK_SOURCE = 14; { ip_mreq_source }
IP_UNBLOCK_SOURCE = 15; { ip_mreq_source }
IP_ADD_SOURCE_MEMBERSHIP = 16; { ip_mreq_source }
IP_DROP_SOURCE_MEMBERSHIP = 17; { ip_mreq_source }
MCAST_JOIN_GROUP = 18; { group_req }
MCAST_BLOCK_SOURCE = 19; { group_source_req }
MCAST_UNBLOCK_SOURCE = 20; { group_source_req }
MCAST_LEAVE_GROUP = 21; { group_req }
MCAST_JOIN_SOURCE_GROUP = 22; { group_source_req }
MCAST_LEAVE_SOURCE_GROUP = 23; { group_source_req }
(* Values not yet defined under Haiku (see netinet/in.h)
IP_MULTICAST_VIF = 14; { set/get IP mcast virt. iface } IP_MULTICAST_VIF = 14; { set/get IP mcast virt. iface }
IP_RSVP_ON = 15; { enable RSVP in kernel } IP_RSVP_ON = 15; { enable RSVP in kernel }
IP_RSVP_OFF = 16; { disable RSVP in kernel } IP_RSVP_OFF = 16; { disable RSVP in kernel }
@ -317,9 +344,13 @@ Const
IPV6_SOCKOPT_RESERVED1 = 3 ; { reserved for future use } IPV6_SOCKOPT_RESERVED1 = 3 ; { reserved for future use }
IPV6_UNICAST_HOPS = 4 ; { int; IP6 hops } IPV6_UNICAST_HOPS = 4 ; { int; IP6 hops }
IPV6_MULTICAST_IF = 9 ; { u_int; setget IP6 multicast if } *)
IPV6_MULTICAST_HOPS = 10; { int; setget IP6 multicast hops }
IPV6_MULTICAST_LOOP = 11; { u_int; setget IP6 multicast loopback } IPV6_MULTICAST_IF = 24; { u_int; setget IP6 multicast if }
IPV6_MULTICAST_HOPS = 25; { int; setget IP6 multicast hops }
IPV6_MULTICAST_LOOP = 26; { u_int; setget IP6 multicast loopback }
(* Values not yet defined under Haiku (see netinet/in.h)
IPV6_JOIN_GROUP = 12; { ip6_mreq; join a group membership } IPV6_JOIN_GROUP = 12; { ip6_mreq; join a group membership }
IPV6_LEAVE_GROUP = 13; { ip6_mreq; leave a group membership } IPV6_LEAVE_GROUP = 13; { ip6_mreq; leave a group membership }
IPV6_PORTRANGE = 14; { int; range to choose for unspec port } IPV6_PORTRANGE = 14; { int; range to choose for unspec port }
@ -331,21 +362,30 @@ Const
IPV6_DSTOPTS = 50; { ip6_dest; send dst option befor rthdr } IPV6_DSTOPTS = 50; { ip6_dest; send dst option befor rthdr }
IPV6_RTHDR = 51; { ip6_rthdr; send routing header } IPV6_RTHDR = 51; { ip6_rthdr; send routing header }
IPV6_PKTOPTIONS = 52; { buf/cmsghdr; set/get IPv6 options } IPV6_PKTOPTIONS = 52; { buf/cmsghdr; set/get IPv6 options }
*)
{ Flags for send, recv etc. } { Flags for send, recv etc. }
MSG_OOB = $0001; { Process out-of-band data} MSG_OOB = $0001; { process out-of-band data}
MSG_PEEK = $0002; { Peek at incoming messages } MSG_PEEK = $0002; { peek at incoming messages }
MSG_DONTROUTE = $0004; { Don't use local routing } MSG_DONTROUTE = $0004; { send without using routing tables }
MSG_EOR = $0008; { End of record } MSG_EOR = $0008; { data completes record }
MSG_TRUNC = $0010; MSG_TRUNC = $0010; { data discarded before delivery }
MSG_CTRUNC = $0020; { Control data lost before delivery } MSG_CTRUNC = $0020; { control data lost before delivery }
MSG_WAITALL = $0040; { Wait for a full request } MSG_WAITALL = $0040; { wait for full request or error }
MSG_DONTWAIT = $0080; { Non-blocking I/O } MSG_DONTWAIT = $0080; { this message should be nonblocking }
MSG_EOF = $0100; MSG_BCAST = $0100; { this message rec'd as broadcast }
MSG_MCAST = $0200; { this message rec'd as multicast }
MSG_EOF = $0400; { data completes connection }
(* Values not yet defined under Haiku (see sys/socket.h)
MSG_NBIO = $4000; MSG_NBIO = $4000;
MSG_COMPAT = $8000; MSG_COMPAT = $8000;
MSG_SOCALLBCK = $10000; MSG_SOCALLBCK = $10000;
MSG_NOSIGNAL = $20000; { Do not generate SIGPIPE } MSG_NOSIGNAL = $20000; { Do not generate SIGPIPE }
*)
{ SOL_SOCKET control message types }
SCM_RIGHTS = $01;
INVALID_SOCKET = -1; INVALID_SOCKET = -1;
SOCKET_ERROR = -1; SOCKET_ERROR = -1;