X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-bsd-sockets%2Fconstants.lisp;h=e8004f442266bf5a93fddb6425f5bb755b0e3ae0;hb=ecae2f9323086c64d026d4ce719590907f486c63;hp=2629aef38522b76b3066279a92142d74cd84f34f;hpb=e511ed14d4a20cb9de2523f052b0f23a1dde1115;p=sbcl.git diff --git a/contrib/sb-bsd-sockets/constants.lisp b/contrib/sb-bsd-sockets/constants.lisp index 2629aef..e8004f4 100644 --- a/contrib/sb-bsd-sockets/constants.lisp +++ b/contrib/sb-bsd-sockets/constants.lisp @@ -10,12 +10,12 @@ ;;; then the stuff we're looking for ((:integer af-inet "AF_INET" "IP Protocol family") - (:integer af-unspec "AF_UNSPEC" "Unspecified.") + (:integer af-unspec "AF_UNSPEC" "Unspecified") (:integer af-local #+(or sunos solaris) "AF_UNIX" #-(or sunos solaris) "AF_LOCAL" "Local to host (pipes and file-domain).") - #+linux (:integer af-inet6 "AF_INET6" "IP version 6. ") + #+linux (:integer af-inet6 "AF_INET6" "IP version 6") #+linux (:integer af-route "AF_NETLINK" "Alias to emulate 4.4BSD ") (:integer sock-stream "SOCK_STREAM" @@ -47,8 +47,8 @@ "Send periodic keepalives: if peer does not respond, we get SIGPIPE") (:integer so-oobinline "SO_OOBINLINE" "Put out-of-band data into the normal input queue when received") - (:integer so-no-check 11) -#+linux (:integer so-priority "SO_PRIORITY") + (:integer so-no-check "SO_NO_CHECK") +#+linux (:integer so-priority "SO_PRIORITY") (:integer so-linger "SO_LINGER" "For reliable streams, pause a while on closing when unsent messages are queued") #+linux (:integer so-bsdcompat "SO_BSDCOMPAT") @@ -65,6 +65,7 @@ (:integer EAGAIN "EAGAIN") (:integer EBADF "EBADF") (:integer ECONNREFUSED "ECONNREFUSED") + (:integer ETIMEDOUT "ETIMEDOUT") (:integer EINTR "EINTR") (:integer EINVAL "EINVAL") (:integer ENOBUFS "ENOBUFS") @@ -104,23 +105,27 @@ (buf (* t)))) |# (:structure protoent ("struct protoent" - ((* t) name "char *" "p_name") + (c-string-pointer name "char *" "p_name") ((* (* t)) aliases "char **" "p_aliases") (integer proto "int" "p_proto"))) - (:function getprotobyname ("getprotobyname" (* t) + (:function getprotobyname ("getprotobyname" (* protoent) (name c-string))) (:integer inaddr-any "INADDR_ANY") (:structure in-addr ("struct in_addr" - ((array (unsigned 8) 4) addr "u_int32_t" "s_addr"))) + ((array (unsigned 8)) addr "u_int32_t" "s_addr"))) (:structure sockaddr-in ("struct sockaddr_in" (integer family "sa_family_t" "sin_family") - ((array (unsigned 8) 2) port "u_int16_t" "sin_port") - ((array (unsigned 8) 4) addr "struct in_addr" "sin_addr"))) + ;; These two could be in-port-t and + ;; in-addr-t, but then we'd throw away the + ;; convenience (and byte-order agnosticism) + ;; of the old sb-grovel scheme. + ((array (unsigned 8)) port "u_int16_t" "sin_port") + ((array (unsigned 8)) addr "struct in_addr" "sin_addr"))) (:structure sockaddr-un ("struct sockaddr_un" (integer family "sa_family_t" "sun_family") - ((array (unsigned 8) 108) path "char" "sun_path"))) + (c-string path "char" "sun_path"))) (:structure hostent ("struct hostent" - ((* t) name "char *" "h_name") + (c-string-pointer name "char *" "h_name") ((* c-string) aliases "char **" "h_aliases") (integer type "int" "h_addrtype") (integer length "int" "h_length") @@ -131,26 +136,26 @@ (protocol integer))) (:function bind ("bind" integer (sockfd integer) - (my-addr (* t)) + (my-addr (* t)) ; KLUDGE: sockaddr-in or sockaddr-un? (addrlen integer))) (:function listen ("listen" integer (socket integer) (backlog integer))) (:function accept ("accept" integer (socket integer) - (my-addr (* t)) + (my-addr (* t)) ; KLUDGE: sockaddr-in or sockaddr-un? (addrlen integer :in-out))) (:function getpeername ("getpeername" integer (socket integer) - (her-addr (* t)) + (her-addr (* t)) ; KLUDGE: sockaddr-in or sockaddr-un? (addrlen integer :in-out))) (:function getsockname ("getsockname" integer (socket integer) - (my-addr (* t)) + (my-addr (* t)) ; KLUDGE: sockaddr-in or sockaddr-un? (addrlen integer :in-out))) (:function connect ("connect" integer (socket integer) - (his-addr (* t)) + (his-addr (* t)) ; KLUDGE: sockaddr-in or sockaddr-un? (addrlen integer ))) (:function close ("close" integer @@ -160,10 +165,10 @@ (buf (* t)) (len integer) (flags integer) - (sockaddr (* t)) + (sockaddr (* t)) ; KLUDGE: sockaddr-in or sockaddr-un? (socklen (* integer)))) - (:function gethostbyname ("gethostbyname" (* t ) (name c-string))) - (:function gethostbyaddr ("gethostbyaddr" (* t ) + (:function gethostbyname ("gethostbyname" (* hostent) (name c-string))) + (:function gethostbyaddr ("gethostbyaddr" (* hostent) (addr (* t)) (len integer) (af integer))) @@ -182,5 +187,5 @@ (level integer) (optname integer) (optval (* t)) - (optlen integer :in-out)))) + (optlen (* integer))))) )