コード例 #1
0
        private void WriteIPConfiguration(IpAddress ipAddress, NetworkInterface networkInterface)
        {
            var interfaceDto = InterfaceDtoUtil.ConvertToDto(networkInterface.Index, _interfaces);

            var ipConfigurationDto = new IpConfigurationDto
            {
                Address    = ipAddress.Address,
                SubnetMask = ipAddress.Netmask,
                Interface  = interfaceDto
            };

            WriteObject(ipConfigurationDto);
        }
コード例 #2
0
        private void WriteRoute(Route route)
        {
            RouteDto routeDto = new RouteDto
            {
                Destination  = route.Destination,
                Gateway      = route.Gateway,
                Interface    = InterfaceDtoUtil.ConvertToDto(route.Nic, _interfaces),
                Protocol     = route.Protocol,
                RoutingTable = route.RoutingTable,
                Scope        = route.Scope,
                Priority     = route.Priority
            };

            WriteObject(routeDto);
        }