예제 #1
0
        /// <summary>
        /// Switches Serial control from System serial port to Bmc to close console redirection
        /// </summary>
        public virtual SerialMuxSwitch ResetSerialMux()
        {
            //Sent an Ipmi Command
            ChannelAuthenticationCapabilities auth = GetAuthenticationCapabilities(PrivilegeLevel.Administrator, false);

            // try 1 more time, as serial console snooping my not have detected the 1st request
            if (auth.CompletionCode != 0)
            {
                auth = GetAuthenticationCapabilities(PrivilegeLevel.Administrator, false);
            }

            // create response package
            SerialMuxSwitch response = new SerialMuxSwitch(auth.CompletionCode);

            if (auth.CompletionCode == 0)
            {
                response.SetParamaters(true, true, true,
                                       true, true, true);
            }
            else
            {
                response.SetParamaters(true, false, true,
                                       true, false, true);
            }

            return(response);
        }
예제 #2
0
        /// <summary>
        /// Set Serial Mux Switch to System for Console Redirection.
        /// </summary>
        public virtual SerialMuxSwitch SetSerialMuxSwitch()
        {
            ChannelAuthenticationCapabilities auth =
                this.GetAuthenticationCapabilities(PrivilegeLevel.Administrator, false);

            if (auth.CompletionCode == 0x00)
            {
                byte channel = auth.ChannelNumber;

                return(this.SetSerialMuxSwitch(channel, MuxSwtich.ForceSystem));
            }
            else
            {
                return(new SerialMuxSwitch(auth.CompletionCode));
            }
        }
        /// <summary>
        /// Negotiates the ipmi version and sets client accordingly. Also sets the authentication type for V1.5
        /// </summary>
        public virtual ChannelAuthenticationCapabilities GetAuthenticationCapabilities(PrivilegeLevel privilegeLevel, bool retry = false)
        {
            // Get Channel Authentication Capabilities
            GetChannelAuthenticationCapabilitiesResponse response =
                (GetChannelAuthenticationCapabilitiesResponse)this.IpmiSendReceive(
                    new GetChannelAuthenticationCapabilitiesRequest(0x0E, privilegeLevel),
                    typeof(GetChannelAuthenticationCapabilitiesResponse), retry);

            ChannelAuthenticationCapabilities authCapabilities = new ChannelAuthenticationCapabilities(response.CompletionCode);

            if (response.CompletionCode == 0)
            {
                authCapabilities.SetParamaters(response.ChannelNumber,
                                               response.AuthenticationTypeSupport1,
                                               response.AuthenticationTypeSupport2,
                                               response.ExtendedCapabilities,
                                               response.OemId, response.OemData);
            }

            return(authCapabilities);
        }