package hvsock

  1. Overview
  2. Docs

Module Hvsock.Af_hypervSource

Low-level interface to the AF_HYPERV socket family available on Windows kernels.

Sourcetype vmid =
  1. | Wildcard
    (*

    Any partition

    *)
  2. | Children
    (*

    Any child partition

    *)
  3. | Loopback
    (*

    The same partition

    *)
  4. | Parent
    (*

    The parent partition

    *)
  5. | Id of Uuidm.t
    (*

    A specific VM id

    *)

A vmid identifies a VM, also known as a partition

Sourceval string_of_vmid : vmid -> string
Sourcetype serviceid = string

A serviceid identifies a service (like a port number)

Sourcetype sockaddr = {
  1. vmid : vmid;
    (*

    identifies a partition

    *)
  2. serviceid : serviceid;
    (*

    identifies a service

    *)
}

An AF_HVSOCK socket address

include Af_common.S with type sockaddr := sockaddr and type t = Unix.file_descr
Sourceval string_of_sockaddr : sockaddr -> string
Sourceval create : unit -> t

create () creates an unbound socket

Sourceval bind : t -> sockaddr -> unit

bind socket sockaddr binds socket to sockaddr

Sourceval listen : t -> int -> unit

listen socket queue_length sets the socket to listening mode with the given maximum queue length

Sourceval accept : t -> t * sockaddr

accept fd accepts a single connection

Sourceval connect : ?timeout_ms:int -> t -> sockaddr -> unit

connect ?timeout_ms fd sockaddr connects to a remote socket. On Windows the raw connect call can block forever if the server is not running when the call is executed (even if the server starts up afterwards) there is a default timeout of 300ms. On timeout this will raise Unix_error(Unix.ETIMEDOUT)

Sourceval writev : t -> Cstruct.t list -> int

Write a list of buffers

Sourceval read_into : t -> Cstruct.t -> int

Read into a buffer, returning the number of bytes written

Sourceval shutdown_read : t -> unit

Close the read half of the connection

Sourceval shutdown_write : t -> unit

Close the write half of the connection

Sourceval close : t -> unit

Close both halves of the connection

Sourceval vmid_of_name : string -> Uuidm.t

Look up a vmid given a VM's human-readable name. This function requires Administrator privileges.

Sourceval register_serviceid : string -> unit

Register the serviceid in the registry. This function requires Administrator privileges.

OCaml

Innovation. Community. Security.