Skip to content

Instantly share code, notes, and snippets.

@toots
Last active December 1, 2019 16:56
Show Gist options
  • Save toots/1a22fe8cf5783721f010f7fb377c324a to your computer and use it in GitHub Desktop.
Save toots/1a22fe8cf5783721f010f7fb377c324a to your computer and use it in GitHub Desktop.
open Ctypes
(** Ctypes routines for C type socklen_t. *)
type socklen
val socklen_t : socklen typ
val int_of_socklen : socklen -> int
val socklen_of_int : int -> socklen
(** Generic sockaddr_t structure. *)
module Sockaddr : sig
type t
val t : t structure typ
val sa_family : (sa_family, t structure) field
val sa_data : (char carray, t structure) field
val sa_data_len : int
val from_sockaddr_storage : SockaddrStorage.t structure ptr -> t structure ptr
end
(** IP address conversion functions. *)
val getnameinfo : sockaddr ptr -> string * int
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment