This repository has been archived by the owner on May 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from hannesm/deprecated
Deprecated
- Loading branch information
Showing
3 changed files
with
8 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(library | ||
(name mirage_stack) | ||
(public_name mirage-stack) | ||
(libraries mirage-protocols fmt lwt)) | ||
(libraries tcpip)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,156 +1,8 @@ | ||
module type V4 = sig | ||
module type V4 = Tcpip.Stack.V4 | ||
[@@ocaml.deprecated "Please use 'Tcpip.Stack.V4' directly (and depend on tcpip >= 7.0.0)"] | ||
|
||
type t | ||
(** The type representing the internal state of the IPv4 stack. *) | ||
module type V6 = Tcpip.Stack.V6 | ||
[@@ocaml.deprecated "Please use 'Tcpip.Stack.V6' directly (and depend on tcpip >= 7.0.0)"] | ||
|
||
val disconnect: t -> unit Lwt.t | ||
(** Disconnect from the IPv4 stack. While this might take some time to | ||
complete, it can never result in an error. *) | ||
|
||
module UDPV4: Mirage_protocols.UDPV4 | ||
|
||
module TCPV4: Mirage_protocols.TCPV4 | ||
|
||
module IPV4: Mirage_protocols.IPV4 | ||
|
||
val udpv4: t -> UDPV4.t | ||
(** [udpv4 t] obtains a descriptor for use with the [UDPV4] module, | ||
usually to transmit traffic. *) | ||
|
||
val tcpv4: t -> TCPV4.t | ||
(** [tcpv4 t] obtains a descriptor for use with the [TCPV4] module, | ||
usually to initiate outgoing connections. *) | ||
|
||
val ipv4: t -> IPV4.t | ||
(** [ipv4 t] obtains a descriptor for use with the [IPV4] module, | ||
which can handle raw IPv4 frames, or manipulate IP address | ||
configuration on the stack interface. *) | ||
|
||
val listen_udpv4: t -> port:int -> UDPV4.callback -> unit | ||
[@@ocaml.deprecated "use UDPV4.listen instead (since mirage-protocols 6.0.0)."] | ||
(** [listen_udpv4 t ~port cb] registers the [cb] callback on the | ||
UDPv4 [port] and immediately return. If [port] is invalid (not | ||
between 0 and 65535 inclusive), it raises [Invalid_argument]. | ||
Multiple bindings to the same port will overwrite previous | ||
bindings, so callbacks will not chain if ports clash. *) | ||
|
||
val listen_tcpv4: ?keepalive:Mirage_protocols.Keepalive.t | ||
-> t -> port:int -> (TCPV4.flow -> unit Lwt.t) -> unit | ||
[@@ocaml.deprecated "use TCPV4.listen instead (since mirage-protocols 6.0.0)."] | ||
(** [listen_tcpv4 ~keepalive t ~port cb] registers the [cb] callback | ||
on the TCPv4 [port] and immediately return. If [port] is invalid (not | ||
between 0 and 65535 inclusive), it raises [Invalid_argument]. | ||
Multiple bindings to the same port will overwrite previous | ||
bindings, so callbacks will not chain if ports clash. | ||
If [~keepalive] is provided then these keepalive settings will be | ||
applied to the accepted connections before the callback is called. *) | ||
|
||
val listen: t -> unit Lwt.t | ||
(** [listen t] requests that the stack listen for traffic on the | ||
network interface associated with the stack, and demultiplex | ||
traffic to the appropriate callbacks. *) | ||
end | ||
|
||
module type V6 = sig | ||
type t | ||
(** The type representing the internal state of the IPv6 stack. *) | ||
|
||
val disconnect: t -> unit Lwt.t | ||
(** Disconnect from the IPv6 stack. While this might take some time to | ||
complete, it can never result in an error. *) | ||
|
||
module UDP: Mirage_protocols.UDPV6 | ||
|
||
module TCP: Mirage_protocols.TCPV6 | ||
|
||
module IP: Mirage_protocols.IPV6 | ||
|
||
val udp: t -> UDP.t | ||
(** [udp t] obtains a descriptor for use with the [UDPV6] module, | ||
usually to transmit traffic. *) | ||
|
||
val tcp: t -> TCP.t | ||
(** [tcp t] obtains a descriptor for use with the [TCPV6] module, | ||
usually to initiate outgoing connections. *) | ||
|
||
val ip: t -> IP.t | ||
(** [ip t] obtains a descriptor for use with the [IPV6] module, | ||
which can handle raw IPv6 frames, or manipulate IP address | ||
configuration on the stack interface. *) | ||
|
||
val listen_udp: t -> port:int -> UDP.callback -> unit | ||
[@@ocaml.deprecated "use UDP.listen instead (since mirage-protocols 6.0.0)."] | ||
(** [listen_udp t ~port cb] registers the [cb] callback on the | ||
UDPv6 [port] and immediately return. If [port] is invalid (not | ||
between 0 and 65535 inclusive), it raises [Invalid_argument]. | ||
Multiple bindings to the same port will overwrite previous | ||
bindings, so callbacks will not chain if ports clash. *) | ||
|
||
val listen_tcp: ?keepalive:Mirage_protocols.Keepalive.t | ||
-> t -> port:int -> (TCP.flow -> unit Lwt.t) -> unit | ||
[@@ocaml.deprecated "use TCP.listen instead (since mirage-protocols 6.0.0)."] | ||
(** [listen_tcp ~keepalive t ~port cb] registers the [cb] callback | ||
on the TCPv6 [port] and immediately return. If [port] is invalid (not | ||
between 0 and 65535 inclusive), it raises [Invalid_argument]. | ||
Multiple bindings to the same port will overwrite previous | ||
bindings, so callbacks will not chain if ports clash. | ||
If [~keepalive] is provided then these keepalive settings will be | ||
applied to the accepted connections before the callback is called. *) | ||
|
||
val listen: t -> unit Lwt.t | ||
(** [listen t] requests that the stack listen for traffic on the | ||
network interface associated with the stack, and demultiplex | ||
traffic to the appropriate callbacks. *) | ||
end | ||
|
||
module type V4V6 = sig | ||
type t | ||
(** The type representing the internal state of the dual IPv4 and IPv6 stack. *) | ||
|
||
val disconnect: t -> unit Lwt.t | ||
(** Disconnect from the dual IPv4 and IPv6 stack. While this might take some | ||
time to complete, it can never result in an error. *) | ||
|
||
module UDP: Mirage_protocols.UDP with type ipaddr = Ipaddr.t | ||
|
||
module TCP: Mirage_protocols.TCP with type ipaddr = Ipaddr.t | ||
|
||
module IP: Mirage_protocols.IP with type ipaddr = Ipaddr.t | ||
|
||
val udp: t -> UDP.t | ||
(** [udp t] obtains a descriptor for use with the [UDP] module, | ||
usually to transmit traffic. *) | ||
|
||
val tcp: t -> TCP.t | ||
(** [tcp t] obtains a descriptor for use with the [TCP] module, | ||
usually to initiate outgoing connections. *) | ||
|
||
val ip: t -> IP.t | ||
(** [ip t] obtains a descriptor for use with the [IP] module, | ||
which can handle raw IPv4 and IPv6 frames, or manipulate IP address | ||
configuration on the stack interface. *) | ||
|
||
val listen_udp: t -> port:int -> UDP.callback -> unit | ||
[@@ocaml.deprecated "use UDP.listen instead (since mirage-protocols 6.0.0)."] | ||
(** [listen_udp t ~port cb] registers the [cb] callback on the | ||
UDP [port] and immediately return. If [port] is invalid (not | ||
between 0 and 65535 inclusive), it raises [Invalid_argument]. | ||
Multiple bindings to the same port will overwrite previous | ||
bindings, so callbacks will not chain if ports clash. *) | ||
|
||
val listen_tcp: ?keepalive:Mirage_protocols.Keepalive.t | ||
-> t -> port:int -> (TCP.flow -> unit Lwt.t) -> unit | ||
[@@ocaml.deprecated "use TCP.listen instead (since mirage-protocols 6.0.0)."] | ||
(** [listen_tcp ~keepalive t ~port cb] registers the [cb] callback | ||
on the TCP [port] and immediately return. If [port] is invalid (not | ||
between 0 and 65535 inclusive), it raises [Invalid_argument]. | ||
Multiple bindings to the same port will overwrite previous | ||
bindings, so callbacks will not chain if ports clash. | ||
If [~keepalive] is provided then these keepalive settings will be | ||
applied to the accepted connections before the callback is called. *) | ||
|
||
val listen: t -> unit Lwt.t | ||
(** [listen t] requests that the stack listen for traffic on the | ||
network interface associated with the stack, and demultiplex | ||
traffic to the appropriate callbacks. *) | ||
end | ||
module type V4V6 = Tcpip.Stack.V4V6 | ||
[@@ocaml.deprecated "Please use 'Tcpip.Stack.V4V6' directly (and depend on tcpip >= 7.0.0)"] |