package posix-socket

  1. Overview
  2. Docs

network/host byte order conversion functions.

type socket_type

Socket types.

val socket_type_t : socket_type Ctypes.typ
val sock_dgram : socket_type
val sock_stream : socket_type
val sock_seqpacket : socket_type
module Sa_family = Posix_socket_types.Sa_family

Type of the sa_family field.

type sa_family_t = Sa_family.t
val sa_family_t : sa_family_t Ctypes.typ
val af_inet : sa_family_t

Socket types constants.

val af_inet6 : sa_family_t
val af_unspec : sa_family_t

Ctypes routines for C type socklen_t.

type socklen_t
val socklen_t : socklen_t Ctypes.typ
module SockaddrStorage : sig ... end

Storage-safe overall structure. Used to allocate a structure large enough for any of the sub-types below.

type sockaddr_storage = SockaddrStorage.t Ctypes.structure
val sockaddr_storage_t : sockaddr_storage Ctypes.typ
module Sockaddr : sig ... end

Generic sockaddr_t structure.

val sockaddr_t : sockaddr Ctypes.typ
type in_port = Unsigned.uint16

Type for inet/inet6 socket port.

val in_port_t : Unsigned.uint16 Ctypes.typ
module SockaddrInet : sig ... end

INET (ipv4) socket_in structure.

type sockaddr_in = SockaddrInet.t Ctypes.structure
val sockaddr_in_t : sockaddr_in Ctypes.typ
module SockaddrInet6 : sig ... end

INET6 (ipv6) socket_in6 structure.

type sockaddr_in6 = SockaddrInet6.t Ctypes.structure
val sockaddr_in6_t : sockaddr_in6 Ctypes.typ
val getnameinfo : sockaddr Ctypes.ptr -> string * int

IP address conversion functions.

val getaddrinfo : string -> int -> sockaddr Ctypes.ptr Ctypes.ptr
val strnlen : char Ctypes.ptr -> Unsigned.size_t -> Unsigned.size_t

Misc

val from_unix_sockaddr : Unix.sockaddr -> sockaddr Ctypes.ptr

Interface with the Unix module.

val to_unix_sockaddr : sockaddr Ctypes.ptr -> Unix.sockaddr
OCaml

Innovation. Community. Security.