((: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"
(:integer tcp-nodelay "TCP_NODELAY")
#+linux (:integer so-bindtodevice "SO_BINDTODEVICE")
(:integer ifnamsiz "IFNAMSIZ")
-
+
(:integer EADDRINUSE "EADDRINUSE")
(:integer EAGAIN "EAGAIN")
(:integer EBADF "EBADF")
(: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
(: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"
(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)
(: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)
(level int)
(optname int)
(optval (* t))
- (optlen (* int)))))
+ (optlen (* int))))) ;;; should be socklen-t!
)