def __init__(self, authdata, port=623, bmcuuid=None, address='::'):
        """Create a new ipmi bmc instance.

        :param authdata: A dict or object with .get() to provide password
                        lookup by username.  This does not support the full
                        complexity of what IPMI can support, only a
                        reasonable subset.
        :param port: The default port number to bind to.  Defaults to the
                     standard 623
        :param address: The IP address to bind to. Defaults to '::' (all
                        zeroes)
        """
        self.revision = 0
        self.deviceid = 0
        self.firmwaremajor = 1
        self.firmwareminor = 0
        self.ipmiversion = 2
        self.additionaldevices = 0
        self.mfgid = 0
        self.prodid = 0
        self.pktqueue = collections.deque([])
        if bmcuuid is None:
            self.uuid = uuid.uuid4()
        else:
            self.uuid = bmcuuid
        lanchannel = 1
        authtype = 0b10000000  # ipmi2 only
        authstatus = 0b00000100  # change based on authdata/kg
        chancap = 0b00000010  # ipmi2 only
        oemdata = (0, 0, 0, 0)
        self.authdata = authdata
        self.authcap = struct.pack('BBBBBBBBB', 0, lanchannel, authtype,
                                   authstatus, chancap, *oemdata)
        self.kg = None
        self.timeout = 60
        self.port = port
        addrinfo = socket.getaddrinfo(address, port, 0,
                                      socket.SOCK_DGRAM)[0]
        self.serversocket = ipmisession.Session._assignsocket(addrinfo)
        ipmisession.Session.bmc_handlers[self.serversocket] = {0: self}
def __init__ ( self , authdata , port = 623 , bmcuuid = None , address = '::' ) : self . revision = 0 self . deviceid = 0 self . firmwaremajor = 1 self . firmwareminor = 0 self . ipmiversion = 2 self . additionaldevices = 0 self . mfgid = 0 self . prodid = 0 self . pktqueue = collections . deque ( [ ] ) if bmcuuid is None : self . uuid = uuid . uuid4 ( ) else : self . uuid = bmcuuid lanchannel = 1 authtype = 0b10000000 authstatus = 0b00000100 chancap = 0b00000010 oemdata = ( 0 , 0 , 0 , 0 ) self . authdata = authdata self . authcap = struct . pack ( 'BBBBBBBBB' , 0 , lanchannel , authtype , authstatus , chancap , * oemdata ) self . kg = None self . timeout = 60 self . port = port addrinfo = socket . getaddrinfo ( address , port , 0 , socket . SOCK_DGRAM ) [ 0 ] self . serversocket = ipmisession . Session . _assignsocket ( addrinfo ) ipmisession . Session . bmc_handlers [ self . serversocket ] = { 0 : self }
Create a new ipmi bmc instance.

        :param authdata: A dict or object with .get() to provide password
                        lookup by username.  This does not support the full
                        complexity of what IPMI can support, only a
                        reasonable subset.
        :param port: The default port number to bind to.  Defaults to the
                     standard 623
        :param address: The IP address to bind to. Defaults to '::' (all
                        zeroes)