示例#1
0
 def send_auth_cap(self, myaddr, mylun, clientaddr, clientlun, sockaddr):
     header = '\x06\x00\xff\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10'
     headerdata = (clientaddr, clientlun | (7 << 2))
     headersum = ipmisession._checksum(*headerdata)
     header += struct.pack('BBBBBB',
                           *(headerdata + (headersum, myaddr, mylun, 0x38)))
     header += self.authcap
     bodydata = struct.unpack('B' * len(header[17:]), header[17:])
     header += chr(ipmisession._checksum(*bodydata))
     ipmisession._io_sendto(self.serversocket, header, sockaddr)
示例#2
0
 def send_auth_cap(self, myaddr, mylun, clientaddr, clientlun, sockaddr):
     header = '\x06\x00\xff\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10'
     headerdata = (clientaddr, clientlun | (7 << 2))
     headersum = ipmisession._checksum(*headerdata)
     header += struct.pack('BBBBBB',
                           *(headerdata + (headersum, myaddr, mylun, 0x38)))
     header += self.authcap
     bodydata = struct.unpack('B' * len(header[17:]), header[17:])
     header += chr(ipmisession._checksum(*bodydata))
     ipmisession._io_sendto(self.serversocket, header, sockaddr)
示例#3
0
 def send_auth_cap(self, myaddr, mylun, clientaddr, clientlun, sockaddr):
     header = bytearray(
         b'\x06\x00\xff\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10')
     headerdata = [clientaddr, clientlun | (7 << 2)]
     headersum = ipmisession._checksum(*headerdata)
     header += bytearray(headerdata + [headersum, myaddr, mylun, 0x38])
     header += self.authcap
     bodydata = struct.unpack('B' * len(header[17:]), header[17:])
     header.append(ipmisession._checksum(*bodydata))
     ipmisession._io_sendto(self.serversocket, header, sockaddr)
示例#4
0
 def send_auth_cap(self, myaddr, mylun, clientaddr, clientlun, clientseq,
                   sockaddr):
     header = bytearray(
         b'\x06\x00\xff\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10')
     headerdata = [clientaddr, clientlun | (7 << 2)]
     headersum = ipmisession._checksum(*headerdata)
     header += bytearray(
         headerdata + [headersum, myaddr, mylun | (clientseq << 2), 0x38])
     header += self.authcap
     bodydata = struct.unpack('B' * len(header[17:]), bytes(header[17:]))
     header.append(ipmisession._checksum(*bodydata))
     ipmisession._io_sendto(self.serversocket, header, sockaddr)
示例#5
0
def send_auth_cap_v2(self, myaddr, mylun, clientaddr, clientlun, clientseq,
                     sockaddr):
    """Send response to "get channel auth cap (0x38)" command with IPMI 2.0 headers.

    Copied from send_auth_cap function and modified to send response
    in the form of IPMI 2.0.
    Based on pyghmi 1.5.16, Apache License 2.0
    https://opendev.org/x/pyghmi/src/branch/master/pyghmi/ipmi/private/serversession.py
    """
    header = bytearray(
        b"\x06\x00\xff\x07\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00")
    headerdata = [clientaddr, clientlun | (7 << 2)]
    headersum = ipmisession._checksum(*headerdata)
    header += bytearray(headerdata +
                        [headersum, myaddr, mylun | (clientseq << 2), 0x38])
    header += self.authcap
    bodydata = struct.unpack("B" * len(header[19:]), bytes(header[19:]))

    header.append(ipmisession._checksum(*bodydata))
    ipmisession._io_sendto(self.serversocket, header, sockaddr)