0.7.12.24
[sbcl.git] / contrib / bsd-sockets / constants.lisp-temp
1 (in-package :BSD-SOCKETS-INTERNAL)
2 (defconstant size-of-int 4)
3 (defconstant size-of-char 1)
4 (defconstant size-of-long 4)
5 (defconstant AF-INET 2 "IP Protocol family")
6 (defconstant AF-UNSPEC 0 "Unspecified.")
7 (defconstant AF-LOCAL 1 "Local to host (pipes and file-domain).")
8 (defconstant AF-UNIX 1 "Old BSD name for af-local. ")
9 (defconstant AF-FILE 1 "POSIX name for af-local. ")
10 (defconstant AF-INET6 10 "IP version 6. ")
11 (defconstant AF-ROUTE 16 "Alias to emulate 4.4BSD ")
12 (defconstant SOCK-STREAM 1 "Sequenced, reliable, connection-based byte streams.")
13 (defconstant SOCK-DGRAM 2 "Connectionless, unreliable datagrams of fixed maximum length.")
14 (defconstant SOCK-RAW 3 "Raw protocol interface.")
15 (defconstant SOCK-RDM 4 "Reliably-delivered messages.")
16 (defconstant SOCK-SEQPACKET 5 "Sequenced, reliable, connection-based, datagrams of fixed maximum length.")
17 (defconstant SOL-SOCKET 1 "NIL")
18 (defconstant SO-DEBUG 1 "Enable debugging in underlying protocol modules")
19 (defconstant SO-REUSEADDR 2 "Enable local address reuse")
20 (defconstant SO-TYPE 3 "NIL")
21 (defconstant SO-ERROR 4 "NIL")
22 (defconstant SO-DONTROUTE 5 "Bypass routing facilities: instead send direct to appropriate network interface for the network portion of the destination address")
23 (defconstant SO-BROADCAST 6 "Request permission to send broadcast datagrams")
24 (defconstant SO-SNDBUF 7 "NIL")
25 (defconstant SO-PASSCRED 16 "NIL")
26 (defconstant SO-RCVBUF 8 "NIL")
27 (defconstant SO-KEEPALIVE 9 "Send periodic keepalives: if peer does not respond, we get SIGPIPE")
28 (defconstant SO-OOBINLINE 10 "Put out-of-band data into the normal input queue when received")
29 (defconstant SO-NO-CHECK 11 "NIL")
30 (defconstant SO-PRIORITY 12 "NIL")
31 (defconstant SO-LINGER 13 "For reliable streams, pause a while on closing when unsent messages are queued")
32 (defconstant SO-BSDCOMPAT 14 "NIL")
33 (defconstant SO-SNDLOWAT 19 "NIL")
34 (defconstant SO-RCVLOWAT 18 "NIL")
35 (defconstant SO-SNDTIMEO 21 "NIL")
36 (defconstant SO-RCVTIMEO 20 "NIL")
37 (defconstant TCP-NODELAY 1 "NIL")
38 (defconstant SO-BINDTODEVICE 25 "NIL")
39 (defconstant IFNAMSIZ 16 "NIL")
40 (defconstant EADDRINUSE 98 "NIL")
41 (defconstant EAGAIN 11 "NIL")
42 (defconstant EBADF 9 "NIL")
43 (defconstant ECONNREFUSED 111 "NIL")
44 (defconstant EINTR 4 "NIL")
45 (defconstant EINVAL 22 "NIL")
46 (defconstant ENOBUFS 105 "NIL")
47 (defconstant ENOMEM 12 "NIL")
48 (defconstant EOPNOTSUPP 95 "NIL")
49 (defconstant EPERM 1 "NIL")
50 (defconstant EPROTONOSUPPORT 93 "NIL")
51 (defconstant ESOCKTNOSUPPORT 94 "NIL")
52 (defconstant ENETUNREACH 101 "NIL")
53 (defconstant NETDB-INTERNAL -1 "See errno.")
54 (defconstant NETDB-SUCCESS 0 "No problem.")
55 (defconstant HOST-NOT-FOUND 1 "Authoritative Answer Host not found.")
56 (defconstant TRY-AGAIN 2 "Non-Authoritative Host not found, or SERVERFAIL.")
57 (defconstant NO-RECOVERY 3 "Non recoverable errors, FORMERR, REFUSED, NOTIMP.")
58 (defconstant NO-DATA 4 "Valid name, no data record of requested type.")
59 (defconstant NO-ADDRESS 4 "No address, look for MX record.")
60 (defconstant O-NONBLOCK 2048 "NIL")
61 (defconstant F-GETFL 3 "NIL")
62 (defconstant F-SETFL 4 "NIL")
63 (defconstant MSG-NOSIGNAL 16384 "NIL")
64 (defconstant MSG-OOB 1 "NIL")
65 (defconstant MSG-PEEK 2 "NIL")
66 (defconstant MSG-TRUNC 32 "NIL")
67 (defconstant MSG-WAITALL 256 "NIL")
68 (define-c-struct PROTOENT 12)
69 (define-c-accessor PROTOENT-NAME PROTOENT (* T) 0 4)
70 (define-c-accessor PROTOENT-ALIASES PROTOENT (* (* T)) 4 4)
71 (define-c-accessor PROTOENT-PROTO PROTOENT INTEGER 8 4)
72 (declaim (inline GETPROTOBYNAME))
73 (def-foreign-routine ("getprotobyname" GETPROTOBYNAME ) (* T) (NAME
74                                                                          C-STRING) )
75 (defconstant INADDR-ANY 0 "NIL")
76 (define-c-struct IN-ADDR 4)
77 (define-c-accessor IN-ADDR-ADDR IN-ADDR (ARRAY (UNSIGNED 8) 4) 0 4)
78 (define-c-struct SOCKADDR-IN 16)
79 (define-c-accessor SOCKADDR-IN-FAMILY SOCKADDR-IN INTEGER 0 2)
80 (define-c-accessor SOCKADDR-IN-PORT SOCKADDR-IN (ARRAY (UNSIGNED 8) 2) 2 2)
81 (define-c-accessor SOCKADDR-IN-ADDR SOCKADDR-IN (ARRAY (UNSIGNED 8) 4) 4 4)
82 (define-c-struct SOCKADDR-UN 110)
83 (define-c-accessor SOCKADDR-UN-FAMILY SOCKADDR-UN INTEGER 0 2)
84 (define-c-accessor SOCKADDR-UN-PATH SOCKADDR-UN (ARRAY (UNSIGNED 8) 108) 2 108)
85 (define-c-struct HOSTENT 20)
86 (define-c-accessor HOSTENT-NAME HOSTENT (* T) 0 4)
87 (define-c-accessor HOSTENT-ALIASES HOSTENT (* C-STRING) 4 4)
88 (define-c-accessor HOSTENT-TYPE HOSTENT INTEGER 8 4)
89 (define-c-accessor HOSTENT-LENGTH HOSTENT INTEGER 12 4)
90 (define-c-accessor HOSTENT-ADDRESSES HOSTENT (* (* (UNSIGNED 8))) 16 4)
91 (declaim (inline SOCKET))
92 (def-foreign-routine ("socket" SOCKET ) INTEGER (DOMAIN INTEGER) (TYPE
93                                                                             INTEGER) (PROTOCOL
94                                                                                       INTEGER) )
95 (declaim (inline BIND))
96 (def-foreign-routine ("bind" BIND ) INTEGER (SOCKFD INTEGER) (MY-ADDR
97                                                                         (* T)) (ADDRLEN
98                                                                                 INTEGER) )
99 (declaim (inline LISTEN))
100 (def-foreign-routine ("listen" LISTEN ) INTEGER (SOCKET INTEGER) (BACKLOG
101                                                                             INTEGER) )
102 (declaim (inline ACCEPT))
103 (def-foreign-routine ("accept" ACCEPT ) INTEGER (SOCKET INTEGER) (MY-ADDR
104                                                                             (*
105                                                                              T)) (ADDRLEN
106                                                                                   INTEGER
107                                                                                   :IN-OUT) )
108 (declaim (inline GETPEERNAME))
109 (def-foreign-routine ("getpeername" GETPEERNAME ) INTEGER (SOCKET
110                                                                      INTEGER) (HER-ADDR
111                                                                                (*
112                                                                                 T)) (ADDRLEN
113                                                                                      INTEGER
114                                                                                      :IN-OUT) )
115 (declaim (inline GETSOCKNAME))
116 (def-foreign-routine ("getsockname" GETSOCKNAME ) INTEGER (SOCKET
117                                                                      INTEGER) (MY-ADDR
118                                                                                (*
119                                                                                 T)) (ADDRLEN
120                                                                                      INTEGER
121                                                                                      :IN-OUT) )
122 (declaim (inline CONNECT))
123 (def-foreign-routine ("connect" CONNECT ) INTEGER (SOCKET INTEGER) (HIS-ADDR
124                                                                               (*
125                                                                                T)) (ADDRLEN
126                                                                                     INTEGER) )
127 (declaim (inline CLOSE))
128 (def-foreign-routine ("close" CLOSE ) INTEGER (FD INTEGER) )
129 (declaim (inline RECVFROM))
130 (def-foreign-routine ("recvfrom" RECVFROM ) INTEGER (SOCKET INTEGER) (BUF
131                                                                                 (*
132                                                                                  T)) (LEN
133                                                                                       INTEGER) (FLAGS
134                                                                                                 INTEGER) (SOCKADDR
135                                                                                                           (*
136                                                                                                            T)) (SOCKLEN
137                                                                                                                 (*
138                                                                                                                  INTEGER)) )
139 (declaim (inline GETHOSTBYNAME))
140 (def-foreign-routine ("gethostbyname" GETHOSTBYNAME ) (* T) (NAME
141                                                                        C-STRING) )
142 (declaim (inline GETHOSTBYADDR))
143 (def-foreign-routine ("gethostbyaddr" GETHOSTBYADDR ) (* T) (ADDR
144                                                                        (* T)) (LEN
145                                                                                INTEGER) (AF
146                                                                                          INTEGER) )
147 (define-c-struct HOSTENT 20)
148 (define-c-accessor HOSTENT-NAME HOSTENT (* T) 0 4)
149 (define-c-accessor HOSTENT-LENGTH HOSTENT INTEGER 12 4)
150 (declaim (inline SETSOCKOPT))
151 (def-foreign-routine ("setsockopt" SETSOCKOPT ) INTEGER (SOCKET
152                                                                    INTEGER) (LEVEL
153                                                                              INTEGER) (OPTNAME
154                                                                                        INTEGER) (OPTVAL
155                                                                                                  (*
156                                                                                                   T)) (OPTLEN
157                                                                                                        INTEGER) )
158 (declaim (inline FCNTL))
159 (def-foreign-routine ("fcntl" FCNTL ) INTEGER (FD INTEGER) (CMD
160                                                                       INTEGER) (ARG
161                                                                                 INTEGER) )
162 (declaim (inline GETSOCKOPT))
163 (def-foreign-routine ("getsockopt" GETSOCKOPT ) INTEGER (SOCKET
164                                                                    INTEGER) (LEVEL
165                                                                              INTEGER) (OPTNAME
166                                                                                        INTEGER) (OPTVAL
167                                                                                                  (*
168                                                                                                   T)) (OPTLEN
169                                                                                                        INTEGER
170                                                                                                        :IN-OUT) )