--- /dev/null
+#include <bindings.dsl.h>
+#include <apr_network_io.h>
+
+module Bindings.APR.Network.IO where
+#strict_import
+import Bindings.APR
+import Bindings.APR.ErrNo
+import Bindings.APR.File.Types
+import Bindings.APR.Pools
+import Bindings.APR.Time
+import Bindings.APR.Want
+
+#num APR_MAX_SECS_TO_LINGER
+#num APRMAXHOSTLEN
+#pointer APR_ANYADDR
+
+#num APR_SO_LINGER
+#num APR_SO_KEEPALIVE
+#num APR_SO_DEBUG
+#num APR_SO_NONBLOCK
+#num APR_SO_REUSEADDR
+#num APR_SO_SNDBUF
+#num APR_SO_RCVBUF
+#num APR_SO_DISCONNECTED
+#num APR_TCP_NODELAY
+#num APR_TCP_NOPUSH
+#num APR_RESET_NODELAY
+#num APR_INCOMPLETE_READ
+#num APR_INCOMPLETE_WRITE
+#num APR_IPV6_V6ONLY
+#num APR_TCP_DEFER_ACCEPT
+
+#integral_t apr_shutdown_how_e
+#num APR_IPV4_ADDR_OK
+#num APR_IPV6_ADDR_OK
+
+#num APR_INADDR_NONE
+
+#num APR_INET
+#num APR_UNSPEC
+
+#if APR_HAVE_IPV6
+# num APR_INET6
+#endif
+
+#num APR_PROTO_TCP
+#num APR_PROTO_UDP
+#num APR_PROTO_SCTP
+
+#integral_t apr_interface_e
+#num APR_LOCAL
+#num APR_REMOTE
+
+-- FIXME: How should I wrap apr_inet_addr?
+
+#opaque_t apr_socket_t
+
+#starttype struct apr_hdtr_t
+# field headers , Ptr <iovec>
+# field numheaders , CInt
+# field trailers , Ptr <iovec>
+# field numtrailers, CInt
+#stoptype
+
+-- FIXME: How should I wrap apr_in_addr_t?
+
+#opaque_t apr_ipsubnet_t
+
+#integral_t apr_port_t
+
+#starttype struct apr_sockaddr_t
+# field pool , Ptr <apr_pool_t>
+# field hostname , Ptr CChar
+# field servname , Ptr CChar
+# field port , <apr_port_t>
+# field family , <apr_int32_t>
+# field salen , <apr_socklen_t>
+# field ipaddr_len , CInt
+# field addr_str_len, CInt
+# field ipaddr_ptr , Ptr ()
+# field next , Ptr <apr_sockaddr_t>
+-- FIXME: wrap around sa, sin, sin6, sas
+#stoptype
+
+#if APR_HAS_SENDFILE
+# num APR_SENDFILE_DISCONNECT_SOCKET
+#endif
+
+#ccall apr_socket_create , Ptr (Ptr <apr_socket_t>) -> CInt -> CInt -> CInt -> Ptr <apr_pool_t> -> IO <apr_status_t>
+#ccall apr_socket_shutdown , Ptr <apr_socket_t> -> <apr_shutdown_how_e> -> IO <apr_status_t>
+#ccall apr_socket_close , Ptr <apr_socket_t> -> IO <apr_status_t>
+#ccall apr_socket_bind , Ptr <apr_socket_t> -> Ptr <apr_sockaddr_t> -> IO <apr_status_t>
+#ccall apr_socket_listen , Ptr <apr_status_t> -> <apr_int32_t> -> IO <apr_status_t>
+#ccall apr_socket_accept , Ptr (Ptr <apr_socket_t>) -> Ptr <apr_socket_t> -> Ptr <apr_pool_t> -> IO <apr_status_t>
+#ccall apr_socket_connect , Ptr <apr_socket_t> -> Ptr <apr_sockaddr_t> -> IO <apr_status_t>
+#ccall apr_sockaddr_info_get, Ptr (Ptr <apr_sockaddr_t>) -> Ptr CChar -> <apr_int32_t> -> <apr_port_t> -> <apr_int32_t> -> Ptr <apr_port_t> -> IO <apr_status_t>
+#ccall apr_getnameinfo , Ptr (Ptr CChar) -> Ptr <apr_sockaddr_t> -> <apr_int32_t> -> IO <apr_status_t>
+#ccall apr_parse_addr_port , Ptr (Ptr CChar) -> Ptr (Ptr CChar) -> Ptr <apr_port_t> -> Ptr CChar -> Ptr <apr_pool_t> -> IO <apr_status_t>
+#ccall apr_gethostname , Ptr CChar -> CInt -> Ptr <apr_pool_t> -> IO <apr_status_t>
+#ccall apr_socket_data_get , Ptr (Ptr ()) -> Ptr CChar -> Ptr <apr_socket_t> -> IO <apr_status_t>
+#ccall apr_socket_data_set , Ptr <apr_socket_t> -> Ptr () -> Ptr CChar -> FunPtr (Ptr () -> IO <apr_status_t>) -> IO <apr_status_t>
+#ccall apr_socket_send , Ptr <apr_socket_t> -> Ptr CChar -> Ptr <apr_size_t> -> IO <apr_status_t>
+#ccall apr_socket_sendv , Ptr <apr_socket_t> -> Ptr <iovec> -> <apr_int32_t> -> Ptr <apr_size_t> -> IO <apr_status_t>
+#ccall apr_socket_sendto , Ptr <apr_socket_t> -> Ptr <apr_sockaddr_t> -> <apr_int32_t> -> Ptr CChar -> Ptr <apr_size_t> -> IO <apr_status_t>
+#ccall apr_socket_recvfrom , Ptr <apr_sockaddr_t> -> Ptr <apr_socket_t> -> <apr_int32_t> -> Ptr CChar -> Ptr <apr_size_t> -> IO <apr_status_t>
+
+#if APR_HAS_SENDFILE
+# ccall apr_socket_sendfile, Ptr <apr_socket_t> -> Ptr <apr_file_t> -> Ptr <apr_hdtr_t> -> Ptr <apr_off_t> -> Ptr <apr_size_t> -> <apr_int32_t> -> IO <apr_status_t>
+#endif
+
+#ccall apr_socket_recv , Ptr <apr_socket_t> -> Ptr CChar -> Ptr <apr_size_t> -> IO <apr_status_t>
+#ccall apr_socket_opt_set , Ptr <apr_socket_t> -> <apr_int32_t> -> <apr_int32_t> -> IO <apr_status_t>
+#ccall apr_socket_timeout_set, Ptr <apr_socket_t> -> <apr_interval_time_t> -> IO <apr_status_t>
+#ccall apr_socket_opt_get , Ptr <apr_socket_t> -> <apr_int32_t> -> <apr_int32_t> -> IO <apr_status_t>
+#ccall apr_socket_timeout_get, Ptr <apr_socket_t> -> Ptr <apr_interval_time_t> -> IO <apr_status_t>
+#ccall apr_socket_atmark , Ptr <apr_socket_t> -> Ptr CInt -> IO <apr_status_t>
+#ccall apr_socket_addr_get , Ptr (Ptr <apr_socket_t>) -> <apr_interface_e> -> Ptr <apr_socket_t> -> IO <apr_status_t>
+#ccall apr_sockaddr_ip_get , Ptr (Ptr CChar) -> Ptr <apr_sockaddr_t> -> IO <apr_status_t>
+#ccall apr_sockaddr_ip_getbuf, Ptr CChar -> <apr_size_t> -> Ptr <apr_sockaddr_t> -> IO <apr_status_t>
+#ccall apr_sockaddr_equal , Ptr <apr_sockaddr_t> -> Ptr <apr_sockaddr_t> -> IO CInt
+#ccall apr_socket_type_get , Ptr <apr_socket_t> -> Ptr CInt -> IO <apr_status_t>
+#ccall apr_getservbyname , Ptr <apr_sockaddr_t> -> Ptr CChar -> IO <apr_status_t>
+#ccall apr_ipsubnet_create , Ptr (Ptr <apr_ipsubnet_t>) -> Ptr CChar -> Ptr CChar -> Ptr <apr_pool_t> -> IO <apr_status_t>
+#ccall apr_ipsubnet_test , Ptr <apr_ipsubnet_t> -> Ptr <apr_sockaddr_t> -> IO CInt
+
+#if APR_HAS_SO_ACCEPTFILTER
+# ccall apr_socket_accept_filter, Ptr <apr_socket_t> -> Ptr CChar -> Ptr CChar -> IO <apr_status_t>
+#endif
+
+#ccall apr_socket_protocol_get, Ptr <apr_socket_t> -> Ptr CInt -> IO <apr_status_t>
+
+#ccall apr_socket_pool_get , Ptr <apr_socket_t> -> IO (Ptr <apr_pool_t>)
+#ccall apr_socket_inherit_set , Ptr <apr_socket_t> -> IO <apr_status_t>
+#ccall apr_socket_inherit_unset, Ptr <apr_socket_t> -> IO <apr_status_t>
+
+#ccall apr_mcast_join , Ptr <apr_socket_t> -> Ptr <apr_sockaddr_t> -> Ptr <apr_sockaddr_t> -> Ptr <apr_sockaddr_t> -> IO <apr_status_t>
+#ccall apr_mcast_leave , Ptr <apr_socket_t> -> Ptr <apr_sockaddr_t> -> Ptr <apr_sockaddr_t> -> Ptr <apr_sockaddr_t> -> IO <apr_status_t>
+#ccall apr_mcast_hops , Ptr <apr_socket_t> -> <apr_byte_t> -> IO <apr_status_t>
+#ccall apr_mcast_loopback , Ptr <apr_socket_t> -> <apr_byte_t> -> IO <apr_status_t>
+#ccall apr_mcast_interface, Ptr <apr_socket_t> -> Ptr <apr_sockaddr_t> -> IO <apr_status_t>