Ejemplo n.º 1
0
        internal void UpdateFromProxy(Proxy_PIF proxy)
        {
            this.uuid    = (proxy.uuid == null) ? null : proxy.uuid;
            this.device  = (proxy.device == null) ? null : proxy.device;
            this.network = (proxy.network == null) ? null : XenRef <Network> .Create(proxy.network);

            this.host = (proxy.host == null) ? null : XenRef <Host> .Create(proxy.host);

            this.MAC     = (proxy.MAC == null) ? null : proxy.MAC;
            this.MTU     = (proxy.MTU == null) ? 0L : long.Parse(proxy.MTU);
            this.VLAN    = (proxy.VLAN == null) ? 0L : long.Parse(proxy.VLAN);
            this.metrics = (proxy.metrics == null) ? null : XenRef <PIF_metrics> .Create(proxy.metrics);

            this.physical              = proxy.physical;
            this.currently_attached    = proxy.currently_attached;
            this.ip_configuration_mode = (proxy.ip_configuration_mode == null) ? WinAPI.ip_configuration_mode.None : ((WinAPI.ip_configuration_mode)Helper.EnumParseDefault(typeof(WinAPI.ip_configuration_mode), proxy.ip_configuration_mode));
            this.IP            = (proxy.IP == null) ? null : proxy.IP;
            this.netmask       = (proxy.netmask == null) ? null : proxy.netmask;
            this.gateway       = (proxy.gateway == null) ? null : proxy.gateway;
            this.DNS           = (proxy.DNS == null) ? null : proxy.DNS;
            this.bond_slave_of = (proxy.bond_slave_of == null) ? null : XenRef <Bond> .Create(proxy.bond_slave_of);

            this.bond_master_of = (proxy.bond_master_of == null) ? null : XenRef <Bond> .Create(proxy.bond_master_of);

            this.VLAN_master_of = (proxy.VLAN_master_of == null) ? null : XenRef <WinAPI.VLAN> .Create(proxy.VLAN_master_of);

            this.VLAN_slave_of = (proxy.VLAN_slave_of == null) ? null : XenRef <WinAPI.VLAN> .Create(proxy.VLAN_slave_of);

            this.management           = proxy.management;
            this.other_config         = (proxy.other_config == null) ? null : Maps.convert_from_proxy_string_string(proxy.other_config);
            this.disallow_unplug      = proxy.disallow_unplug;
            this.tunnel_access_PIF_of = (proxy.tunnel_access_PIF_of == null) ? null : XenRef <Tunnel> .Create(proxy.tunnel_access_PIF_of);

            this.tunnel_transport_PIF_of = (proxy.tunnel_transport_PIF_of == null) ? null : XenRef <Tunnel> .Create(proxy.tunnel_transport_PIF_of);

            this.ipv6_configuration_mode = (proxy.ipv6_configuration_mode == null) ? WinAPI.ipv6_configuration_mode.None : ((WinAPI.ipv6_configuration_mode)Helper.EnumParseDefault(typeof(WinAPI.ipv6_configuration_mode), proxy.ipv6_configuration_mode));
            this.IPv6                 = (proxy.IPv6 == null) ? new string[0] : proxy.IPv6;
            this.ipv6_gateway         = (proxy.ipv6_gateway == null) ? null : proxy.ipv6_gateway;
            this.primary_address_type = (proxy.primary_address_type == null) ? WinAPI.primary_address_type.IPv4 : ((WinAPI.primary_address_type)Helper.EnumParseDefault(typeof(WinAPI.primary_address_type), proxy.primary_address_type));
        }
Ejemplo n.º 2
0
 public PIF(Proxy_PIF proxy)
 {
     this.UpdateFromProxy(proxy);
 }