X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-bsd-sockets%2Fconstants.lisp;h=19aa609a43b38b782e48563ebd0244b4f1b0fc0b;hb=a987d443ea0935bfdfa2eb8547218fef9730a14f;hp=ab29f6641263ee70ad89d55b4439c29d293ab454;hpb=78fa16bf55be44cc16845be84d98023e83fb14bc;p=sbcl.git diff --git a/contrib/sb-bsd-sockets/constants.lisp b/contrib/sb-bsd-sockets/constants.lisp index ab29f66..19aa609 100644 --- a/contrib/sb-bsd-sockets/constants.lisp +++ b/contrib/sb-bsd-sockets/constants.lisp @@ -12,12 +12,12 @@ ((:integer af-inet "AF_INET" "IP Protocol family") (: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).") + #+(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-route "AF_NETLINK" "Alias to emulate 4.4BSD ") - + (:integer sock-stream "SOCK_STREAM" "Sequenced, reliable, connection-based byte streams.") (:integer sock-dgram "SOCK_DGRAM" @@ -60,7 +60,7 @@ (:integer tcp-nodelay "TCP_NODELAY") #+linux (:integer so-bindtodevice "SO_BINDTODEVICE") (:integer ifnamsiz "IFNAMSIZ") - + (:integer EADDRINUSE "EADDRINUSE") (:integer EAGAIN "EAGAIN") (:integer EBADF "EBADF") @@ -75,6 +75,7 @@ (:integer EPROTONOSUPPORT "EPROTONOSUPPORT") (:integer ESOCKTNOSUPPORT "ESOCKTNOSUPPORT") (:integer ENETUNREACH "ENETUNREACH") + (:integer ENOTCONN "ENOTCONN") (:integer NETDB-INTERNAL "NETDB_INTERNAL" "See errno.") (:integer NETDB-SUCCESS "NETDB_SUCCESS" "No problem.") @@ -93,9 +94,17 @@ (:integer msg-peek "MSG_PEEK") (:integer msg-trunc "MSG_TRUNC") (:integer msg-waitall "MSG_WAITALL") + (:integer msg-eor "MSG_EOR") + (:integer msg-dontroute "MSG_DONTROUTE") + (:integer msg-dontwait "MSG_DONTWAIT") + (:integer msg-nosignal "MSG_NOSIGNAL") +#+linux (:integer msg-confirm "MSG_CONFIRM") +#+linux (:integer msg-more "MSG_MORE") ;; for socket-receive (:type socklen-t "socklen_t") + (:type size-t "size_t") + (:type ssize-t "ssize_t") #| ;;; stat is nothing to do with sockets, but I keep it around for testing @@ -110,18 +119,20 @@ (:structure protoent ("struct protoent" (c-string-pointer name "char *" "p_name") ((* (* t)) aliases "char **" "p_aliases") - (integer proto "int" "p_proto"))) + (integer proto "int" "p_proto"))) (:function getprotobyname ("getprotobyname" (* protoent) - (name c-string))) + (name c-string))) + (:function getprotobynumber ("getprotobynumber" (* protoent) + (proto int))) (:integer inaddr-any "INADDR_ANY") (:structure in-addr ("struct in_addr" - ((array (unsigned 8)) 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") - ;; 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. + ;; 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" @@ -133,6 +144,14 @@ (integer type "int" "h_addrtype") (integer length "int" "h_length") ((* (* (unsigned 8))) addresses "char **" "h_addr_list"))) + (:structure msghdr ("struct msghdr" + (c-string-pointer name "void *" "msg_name") + (integer namelen "socklen_t" "msg_namelen") + ((* t) iov "struct iovec" "msg_iov") + (integer iovlen "size_t" "msg_iovlen") + ((* t) control "void *" "msg_control") + (integer controllen "socklen_t" "msg_controllen") + (integer flags "int" "msg_flags"))) (:function socket ("socket" int (domain int) (type int) @@ -140,47 +159,67 @@ (:function bind ("bind" int (sockfd int) (my-addr (* t)) ; KLUDGE: sockaddr-in or sockaddr-un? - (addrlen int))) + (addrlen socklen-t))) (:function listen ("listen" int (socket int) (backlog int))) (:function accept ("accept" int (socket int) (my-addr (* t)) ; KLUDGE: sockaddr-in or sockaddr-un? - (addrlen int :in-out))) + (addrlen socklen-t :in-out))) (:function getpeername ("getpeername" int (socket int) (her-addr (* t)) ; KLUDGE: sockaddr-in or sockaddr-un? - (addrlen int :in-out))) + (addrlen socklen-t :in-out))) (:function getsockname ("getsockname" int (socket int) (my-addr (* t)) ; KLUDGE: sockaddr-in or sockaddr-un? - (addrlen int :in-out))) + (addrlen socklen-t :in-out))) (:function connect ("connect" int (socket int) (his-addr (* t)) ; KLUDGE: sockaddr-in or sockaddr-un? - (addrlen int ))) - + (addrlen socklen-t))) (:function close ("close" int (fd int))) - (:function recvfrom ("recvfrom" int - (socket int) - (buf (* t)) - (len integer) - (flags int) - (sockaddr (* t)) ; KLUDGE: sockaddr-in or sockaddr-un? - (socklen (* socklen-t)))) + (:function recvfrom ("recvfrom" ssize-t + (socket int) + (buf (* t)) + (len integer) + (flags int) + (sockaddr (* t)) ; KLUDGE: sockaddr-in or sockaddr-un? + (socklen (* socklen-t)))) + (:function recvmsg ("recvmsg" ssize-t + (socket int) + (msg (* msghdr)) + (flags int))) + (:function send ("send" ssize-t + (socket int) + (buf (* t)) + (len size-t) + (flags int))) + (:function sendto ("sendto" int + (socket int) + (buf (* t)) + (len size-t) + (flags int) + (sockaddr (* t)) ; KLUDGE: sockaddr-in or sockaddr-un? + (socklen socklen-t))) + (:function sendmsg ("sendmsg" int + (socket int) + (msg (* msghdr)) + (flags int))) (:function gethostbyname ("gethostbyname" (* hostent) (name c-string))) (:function gethostbyaddr ("gethostbyaddr" (* hostent) - (addr (* t)) - (len int) - (af int))) + (addr (* t)) + (len int) + (af int))) +;;; should be using getaddrinfo instead? (:function setsockopt ("setsockopt" int (socket int) (level int) (optname int) (optval (* t)) - (optlen int))) + (optlen int))) ;;; should be socklen-t! (:function fcntl ("fcntl" int (fd int) (cmd int) @@ -190,5 +229,5 @@ (level int) (optname int) (optval (* t)) - (optlen (* int))))) + (optlen (* int))))) ;;; should be socklen-t! )