<commit_before>open Lwt

let src =
  let src = Logs.Src.create "usernet" ~doc:"Mirage TCP/IP <-> socket proxy" in
  Logs.Src.set_level src (Some Logs.Info);
  src

module Log = (val Logs.src_log src : Logs.LOG)

module IPMap = Map.Make(Ipaddr.V4)

let client_macaddr = Macaddr.of_string_exn "C0:FF:EE:C0:FF:EE"
(* random MAC from https://www.hellion.org.uk/cgi-bin/randmac.pl *)
let server_macaddr = Macaddr.of_string_exn "F6:16:36:BC:F9:C6"

let default_peer = "192.168.65.2"
let default_host = "192.168.65.1"
let default_dns_extra = []

(* When forwarding TCP, the connection is proxied so the MTU/MSS is link-local.
   When forwarding UDP, the datagram on the internal link is the same size as
   the corresponding datagram on the external link, so we have to be careful
   to respect the Do Not Fragment bit. *)
let safe_outgoing_mtu = 1452 (* packets above this size with DNF set will get ICMP errors *)

let default_mtu = 1500 (* used for the virtual ethernet link *)

let log_exception_continue description f =
  Lwt.catch
    (fun () -> f ())
    (fun e ->
       Log.debug (fun f -> f "%s: caught %s" description (Printexc.to_string e));
       Lwt.return ()
    )

module Infix = struct
  let ( >>= ) m f = m >>= function
    | `Ok x -> f x<commit_msg>Bump the default MTU to 8000 bytes<commit_after>open Lwt

let src =
  let src = Logs.Src.create "usernet" ~doc:"Mirage TCP/IP <-> socket proxy" in
  Logs.Src.set_level src (Some Logs.Info);
  src

module Log = (val Logs.src_log src : Logs.LOG)

module IPMap = Map.Make(Ipaddr.V4)

let client_macaddr = Macaddr.of_string_exn "C0:FF:EE:C0:FF:EE"
(* random MAC from https://www.hellion.org.uk/cgi-bin/randmac.pl *)
let server_macaddr = Macaddr.of_string_exn "F6:16:36:BC:F9:C6"

let default_peer = "192.168.65.2"
let default_host = "192.168.65.1"
let default_dns_extra = []

(* When forwarding TCP, the connection is proxied so the MTU/MSS is link-local.
   When forwarding UDP, the datagram on the internal link is the same size as
   the corresponding datagram on the external link, so we have to be careful
   to respect the Do Not Fragment bit. *)
let safe_outgoing_mtu = 1452 (* packets above this size with DNF set will get ICMP errors *)

(* The default MTU is limited by the maximum message size on a Hyper-V socket.
   On currently available windows versions, we need to stay below 8192 bytes *)
let default_mtu = 8000 (* used for the virtual ethernet link *)

let log_exception_continue description f =
  Lwt.catch
    (fun () -> f ())
    (fun e ->
       Log.debug (fun f -> f "%s: caught %s" description (Printexc.to_string e));
       Lwt.return ()
    )

module Infix = struct
  let ( >>= ) m f = m >>= function
    | `Ok x -> f x
{'fraction_non_alphanumeric': 0.11131656804733728, 'fraction_numerical': 0.029585798816568046, 'mean_word_length': 3.463696369636964, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2090068', 'n_tokens_mistral': 1004, 'n_tokens_neox': 943, 'n_words': 327}