(version 1000) (serializator "networking" (define "auto" 0u ["metric"]) (procedure "address" (arg "a_addr" (string)) ) ;(struct "NetAddr" "address" ; (field "net_addr" (f/string ["a_addr"])) ;) ; -- MACHINE (procedure "machine" (proc "p_address" ["address"] (proc-allow [collection])) ) (struct "NetMachine" "machine" ;(field "nm_addrs" (f/vector (f/struct ["p_address"]))) (field "nm_addrs" (f/vector (f/string ["p_address" "a_addr"]))) ) ; -- COMMON (procedure "phys-location" (arg "a_phys_loc" (string)) ) (procedure "mtu" (arg "a_mtu" (uint)) ) (procedure "address-mask" (arg "a_addr_mask" (string)) ) ; -- INTERFACE (procedure "interface" (arg "a_if_alias" (string)) (proc "p_phys_loc" ["phys-location"]) (proc "p_addr" ["address"]) (proc "p_mtu" ["mtu"] (proc-allow [optional])) (proc "p_address_mask" ["address-mask"]) ) (struct "NetInterface" "interface" (field "ni_ifalias" (f/string ["a_if_alias"])) (field "ni_ifloc" (f/string ["p_phys_loc" "a_phys_loc"])) (field "ni_addr" (f/string ["p_addr" "a_addr"])) (field "ni_ifmtu" (f/optional (f/uint64 ["p_mtu" "a_mtu"]))) (field "ni_ifaddr_mask" (f/string ["p_address_mask" "a_addr_mask"])) ) ; -- ROUTE-TABLE (procedure "via" (arg "a_via" (string)) ) (procedure "metric" (arg "a_metric" (symbol (uint))) ) (procedure "route-to" (arg "a_route_addr" (string)) (proc "p_via" ["via"] (proc-allow [optional])) (proc "p_metric" ["metric"]) ) (struct "NetRouteTo" "route-to" (field "rt_dest" (f/string ["a_route_addr"])) (field "rt_via" (f/optional (f/string ["p_via" "a_via"]))) (field "rt_metric" (f/uint64 ["p_metric" "a_metric"])) ) (procedure "interface-alias" (arg "a_route_title" (string)) (proc "p_route_to" ["route-to"] (proc-allow [collection])) ) (struct "NetInterfaceAlias" "interface-alias" (field "if_alias" (f/string ["a_route_title"])) (field "if_routes_to" (f/vector (f/struct ["p_route_to"]))) ) (procedure "route-table" (arg "a_route_title" (string)) (proc "p_route_tables" ["interface-alias"] (proc-allow [collection optional])) ) (struct "NetRouteTable" "route-table" (comment "A network routing table for the router") (field "rt_title" (f/string ["a_route_title"])) (field "rt_tbls" (f/optional (f/vector (f/struct ["p_route_tables"])))) ) ; -- ROOT (rootprocedure (proc "p_machine" ["machine"]) (proc "p_interface" ["interface"] (proc-allow [collection])) (proc "p_route_tables" ["route-table"] (proc-allow [collection])) ) (rootstruct "Network" (comment "Test root comment!") (field "net_machine" (f/struct ["p_machine"])) (field "net_ifs" (f/vector (f/struct ["p_interface"]))) (field "net_rt_tbls" (f/vector (f/struct ["p_route_tables"]))) ) )