open Sexplib.Std

type address = {
	domain: int;
	bus: int;
	dev: int;
	fn: int;
}
[@@deriving sexp, rpc, rpcty]

let address_of_string str =
	Scanf.sscanf str "%04x:%02x:%02x.%02x"
		(fun domain bus dev fn -> {domain; bus; dev; fn})

let string_of_address address =
	Printf.sprintf "%04x:%02x:%02x.%01x"
		address.domain address.bus address.dev address.fn

open Sexplib.Std

type address = {
	domain: int;
	bus: int;
	dev: int;
	fn: int;
}
[@@deriving sexp, rpc, rpcty]

let address_of_string str =
	Scanf.sscanf str "%04x:%02x:%02x.%02x"
		(fun domain bus dev fn -> {domain; bus; dev; fn})

let string_of_address address =
	Printf.sprintf "%04x:%02x:%02x.%01x"
		address.domain address.bus address.dev address.fn

Replace \r (DOS) by \n (Unix) line endings
Replace \r (DOS) by \n (Unix) line endings

Signed-off-by: Christian Lindig <4f88b50bc9dba63c9a7d9e208d4b3ac6f1a52800@citrix.com>
