123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200(*
* Copyright (c) 2023 Thomas Gazagnaire <thomas@gazagnaire.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)openFunctoriaincludeRuntime_arg(** {2 OCaml runtime} *)letruntime_arg~posname=Runtime_arg.create~pos~packages:[package"mirage-runtime"](Fmt.str"Mirage_runtime.%s"name)letruntime_network_key~posfmt=Fmt.kstr(Runtime_arg.create~pos~packages:[package"mirage-runtime"~sublibs:["network"]])("Mirage_runtime_network."^^fmt)letdelay=runtime_arg~pos:__POS__"delay"letpp_groupppf=function|None|Some""->()|Someg->Fmt.pfppf"~group:%S "gletpp_docsppf=function|None|Some""->()|Someg->Fmt.pfppf"~docs:%S "gletpp_optionppppf=function|None->Fmt.pfppf"None"|Somed->Fmt.pfppf"(Some %a)"ppdletescapeppppf=Fmt.kstr(funstr->Fmt.Dump.stringppfstr)"%a"pp(** {3 Network keys} *)letinterface?group?docsdefault=runtime_network_key~pos:__POS__"interface %a%a%S"pp_groupgrouppp_docsdocsdefaultmoduleV4=structopenIpaddr.V4letpp_prefixppfp=Fmt.pfppf"(Ipaddr.V4.Prefix.of_string_exn %a)"(escapePrefix.pp)pletppppfp=Fmt.pfppf"(Ipaddr.V4.of_string_exn %a)"(escapepp)pletnetwork?group?docsdefault=runtime_network_key~pos:__POS__"V4.network %a%a%a"pp_groupgrouppp_docsdocspp_prefixdefaultletgateway?group?docsdefault=runtime_network_key~pos:__POS__"V4.gateway %a%a%a"pp_groupgrouppp_docsdocs(pp_optionpp)defaultendmoduleV6=structopenIpaddr.V6letpp_prefixppfp=Fmt.pfppf"(Ipaddr.V6.Prefix.of_string_exn %a)"(escapePrefix.pp)pletppppfp=Fmt.pfppf"(Ipaddr.V6.of_string_exn %a)"(escapepp)pletnetwork?group?docsdefault=runtime_network_key~pos:__POS__"V6.network %a%a%a"pp_groupgrouppp_docsdocs(pp_optionpp_prefix)defaultletgateway?group?docsdefault=runtime_network_key~pos:__POS__"V6.gateway %a%a%a"pp_groupgrouppp_docsdocs(pp_optionpp)defaultletaccept_router_advertisements?group?docs()=runtime_network_key~pos:__POS__"V6.accept_router_advertisements %a%a()"pp_groupgrouppp_docsdocsendletipv4_only?group?docs()=runtime_network_key~pos:__POS__"ipv4_only %a%a()"pp_groupgrouppp_docsdocsletipv6_only?group?docs()=runtime_network_key~pos:__POS__"ipv6_only %a%a()"pp_groupgrouppp_docsdocsletresolver?group?docs?(default=[])()=letpp_defaultppf=function|[]->()|l->Fmt.pfppf"~default:%a "Fmt.Dump.(liststring)linruntime_network_key~pos:__POS__"resolver %a%a%a()"pp_groupgrouppp_docsdocspp_defaultdefaultletdns_servers?group?docsdefault=runtime_network_key~pos:__POS__"dns_servers %a%a%a"pp_groupgrouppp_docsdocs(pp_optionFmt.Dump.(liststring))defaultletdns_timeout?group?docsdefault=runtime_network_key~pos:__POS__"dns_timeout %a%a%a"pp_groupgrouppp_docsdocs(pp_optionFmt.int64)defaultletdns_cache_size?group?docsdefault=runtime_network_key~pos:__POS__"dns_cache_size %a%a%a"pp_groupgrouppp_docsdocs(pp_optionFmt.int)defaultlethe_aaaa_timeout?group?docsdefault=runtime_network_key~pos:__POS__"he_aaaa_timeout %a%a%a"pp_groupgrouppp_docsdocs(pp_optionFmt.int64)defaultlethe_connect_delay?group?docsdefault=runtime_network_key~pos:__POS__"he_connect_delay %a%a%a"pp_groupgrouppp_docsdocs(pp_optionFmt.int64)defaultlethe_connect_timeout?group?docsdefault=runtime_network_key~pos:__POS__"he_connect_timeout %a%a%a"pp_groupgrouppp_docsdocs(pp_optionFmt.int64)defaultlethe_resolve_timeout?group?docsdefault=runtime_network_key~pos:__POS__"he_resolve_timeout %a%a%a"pp_groupgrouppp_docsdocs(pp_optionFmt.int64)defaultlethe_resolve_retries?group?docsdefault=runtime_network_key~pos:__POS__"he_resolve_retries %a%a%a"pp_groupgrouppp_docsdocs(pp_optionFmt.int)defaultlethe_timer_interval?group?docsdefault=runtime_network_key~pos:__POS__"he_timer_interval %a%a%a"pp_groupgrouppp_docsdocs(pp_optionFmt.int64)defaultletssh_key?group?docsdefault=runtime_network_key~pos:__POS__"ssh_key %a%a%a"pp_groupgrouppp_docsdocs(pp_optionFmt.Dump.string)defaultletssh_password?group?docsdefault=runtime_network_key~pos:__POS__"ssh_password %a%a%a"pp_groupgrouppp_docsdocs(pp_optionFmt.Dump.string)defaultletssh_authenticator?group?docsdefault=runtime_network_key~pos:__POS__"ssh_authenticator %a%a%a"pp_groupgrouppp_docsdocs(pp_optionFmt.Dump.string)defaultlettls_authenticator?group?docsdefault=runtime_network_key~pos:__POS__"tls_authenticator %a%a%a"pp_groupgrouppp_docsdocs(pp_optionFmt.Dump.string)defaultlethttp_headers?group?docsdefault=runtime_network_key~pos:__POS__"http_headers %a%a%a"pp_groupgrouppp_docsdocs(pp_optionFmt.Dump.(list(pairstringstring)))defaultletpp_ipaddrppfp=Fmt.pfppf"Ipaddr.of_string %a"(escapeIpaddr.pp)pletsyslog?group?docsdefault=runtime_network_key~pos:__POS__"syslog %a%a%a"pp_groupgrouppp_docsdocs(pp_optionpp_ipaddr)defaultletsyslog_port?group?docsdefault=runtime_network_key~pos:__POS__"syslog_port %a%a%a"pp_groupgrouppp_docsdocs(pp_optionFmt.int)defaultletsyslog_truncate?group?docsdefault=runtime_network_key~pos:__POS__"syslog_truncate %a%a%a"pp_groupgrouppp_docsdocs(pp_optionFmt.int)defaultletsyslog_keyname?group?docsdefault=runtime_network_key~pos:__POS__"syslog_keyname %a%a%a"pp_groupgrouppp_docsdocs(pp_optionFmt.string)defaultletmonitor?group?docsdefault=runtime_network_key~pos:__POS__"monitor %a%a%a"pp_groupgrouppp_docsdocs(pp_optionpp_ipaddr)defaulttypelog_threshold=[`All|`Srcofstring]*Logs.leveloptionletlogs=runtime_arg~pos:__POS__"logs"