sig
  module type T =
    sig
      module P :
        sig
          module AF : Cf_socket.AF
          module ST :
            sig
              type tag = [ `SOCK_DGRAM ]
              val socktype : tag Cf_socket.socktype
            end
          val protocol : Cf_socket.protocol
        end
      type t = (P.AF.tag, P.ST.tag) Cf_socket.t
      type address = P.AF.address
      val create : unit -> t
      val createpair : unit -> t * t
      class basic :
        ?sock:t ->
        unit ->
        object
          val socket_ : t
          method private bind : address -> unit
          method close : unit
          method dup : t
          method dup2 : t -> unit
          method fd : Unix.file_descr
          method private getpeername : address
          method private getsockname : address
          method getsockopt :
            ('a, P.AF.tag, P.ST.tag) Cf_socket.sockopt -> 'a
          method setsockopt :
            ('b, P.AF.tag, P.ST.tag) Cf_socket.sockopt -> '-> unit
          method private shutdown : Unix.shutdown_command -> unit
          method socket : t
        end
      class endpoint :
        t ->
        object
          val socket_ : t
          method private bind : address -> unit
          method close : unit
          method connect : address -> unit
          method dup : t
          method dup2 : t -> unit
          method fd : Unix.file_descr
          method getpeername : address
          method getsockname : address
          method getsockopt :
            ('a, P.AF.tag, P.ST.tag) Cf_socket.sockopt -> 'a
          method recv :
            ?flags:Cf_socket.msg_flags -> string -> int -> int -> int
          method recvfrom :
            ?flags:Cf_socket.msg_flags ->
            string -> int -> int -> int * address
          method send :
            ?flags:Cf_socket.msg_flags -> string -> int -> int -> int
          method sendto :
            ?flags:Cf_socket.msg_flags ->
            string -> int -> int -> address -> int
          method setsockopt :
            ('b, P.AF.tag, P.ST.tag) Cf_socket.sockopt -> '-> unit
          method shutdown : Unix.shutdown_command -> unit
          method socket : t
        end
    end
  module Create :
    functor
      (P : sig
             module AF : Cf_socket.AF
             module ST :
               sig
                 type tag = [ `SOCK_DGRAM ]
                 val socktype : tag Cf_socket.socktype
               end
             val protocol : Cf_socket.protocol
           end->
      sig
        module P :
          sig
            module AF :
              sig
                type tag = P.AF.tag
                type address = P.AF.address
                val domain : tag Cf_socket.domain
                val to_sockaddr : address -> tag Cf_socket.sockaddr
                val of_sockaddr : tag Cf_socket.sockaddr -> address
                val unspecified : tag Cf_socket.sockaddr
              end
            module ST :
              sig
                type tag = [ `SOCK_DGRAM ]
                val socktype : tag Cf_socket.socktype
              end
            val protocol : Cf_socket.protocol
          end
        type t = (P.AF.tag, P.ST.tag) Cf_socket.t
        type address = P.AF.address
        val create : unit -> t
        val createpair : unit -> t * t
        class basic :
          ?sock:t ->
          unit ->
          object
            val socket_ : t
            method private bind : address -> unit
            method close : unit
            method dup : t
            method dup2 : t -> unit
            method fd : Unix.file_descr
            method private getpeername : address
            method private getsockname : address
            method getsockopt :
              ('a, P.AF.tag, P.ST.tag) Cf_socket.sockopt -> 'a
            method setsockopt :
              ('b, P.AF.tag, P.ST.tag) Cf_socket.sockopt -> '-> unit
            method private shutdown : Unix.shutdown_command -> unit
            method socket : t
          end
        class endpoint :
          t ->
          object
            val socket_ : t
            method private bind : address -> unit
            method close : unit
            method connect : address -> unit
            method dup : t
            method dup2 : t -> unit
            method fd : Unix.file_descr
            method getpeername : address
            method getsockname : address
            method getsockopt :
              ('a, P.AF.tag, P.ST.tag) Cf_socket.sockopt -> 'a
            method recv :
              ?flags:Cf_socket.msg_flags -> string -> int -> int -> int
            method recvfrom :
              ?flags:Cf_socket.msg_flags ->
              string -> int -> int -> int * address
            method send :
              ?flags:Cf_socket.msg_flags -> string -> int -> int -> int
            method sendto :
              ?flags:Cf_socket.msg_flags ->
              string -> int -> int -> address -> int
            method setsockopt :
              ('b, P.AF.tag, P.ST.tag) Cf_socket.sockopt -> '-> unit
            method shutdown : Unix.shutdown_command -> unit
            method socket : t
          end
      end
end