Ejemplo n.º 1
0
 /// <summary>
 /// Set the protocol field of the given tunnel.
 /// First published in Unreleased.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_tunnel">The opaque_ref of the given tunnel</param>
 /// <param name="_protocol">New value to set</param>
 public static void set_protocol(Session session, string _tunnel, tunnel_protocol _protocol)
 {
     if (session.JsonRpcClient != null)
     {
         session.JsonRpcClient.tunnel_set_protocol(session.opaque_ref, _tunnel, _protocol);
     }
     else
     {
         session.XmlRpcProxy.tunnel_set_protocol(session.opaque_ref, _tunnel ?? "", tunnel_protocol_helper.ToString(_protocol)).parse();
     }
 }
Ejemplo n.º 2
0
        public static string StringOf(this tunnel_protocol x)
        {
            switch (x)
            {
            case tunnel_protocol.gre:
                return("gre");

            case tunnel_protocol.vxlan:
                return("vxlan");

            default:
                return("unknown");
            }
        }
Ejemplo n.º 3
0
 public Tunnel(string uuid,
               XenRef <PIF> access_PIF,
               XenRef <PIF> transport_PIF,
               Dictionary <string, string> status,
               Dictionary <string, string> other_config,
               tunnel_protocol protocol)
 {
     this.uuid          = uuid;
     this.access_PIF    = access_PIF;
     this.transport_PIF = transport_PIF;
     this.status        = status;
     this.other_config  = other_config;
     this.protocol      = protocol;
 }
Ejemplo n.º 4
0
 public static string ToString(tunnel_protocol x)
 {
     return(x.StringOf());
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Create a tunnel
 /// First published in XenServer 5.6 FP1.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_transport_pif">PIF which receives the tagged traffic First published in XenServer 7.0.</param>
 /// <param name="_network">Network to receive the tunnelled traffic First published in XenServer 7.0.</param>
 /// <param name="_protocol">Protocol used for the tunnel (GRE or VxLAN) First published in Unreleased.</param>
 public static XenRef <Task> async_create(Session session, string _transport_pif, string _network, tunnel_protocol _protocol)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.async_tunnel_create(session.opaque_ref, _transport_pif, _network, _protocol));
     }
     else
     {
         return(XenRef <Task> .Create(session.XmlRpcProxy.async_tunnel_create(session.opaque_ref, _transport_pif ?? "", _network ?? "", tunnel_protocol_helper.ToString(_protocol)).parse()));
     }
 }