本文整理汇总了Python中packet.Packet.length方法的典型用法代码示例。如果您正苦于以下问题:Python Packet.length方法的具体用法?Python Packet.length怎么用?Python Packet.length使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类packet.Packet
的用法示例。
在下文中一共展示了Packet.length方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sendAESKey
# 需要导入模块: from packet import Packet [as 别名]
# 或者: from packet.Packet import length [as 别名]
def sendAESKey(self):
pkt = Packet()
pkt.state = '100'
pkt.toIP = ''
pkt.returnIP = 'MRS'
pkt.data = self.key
pkt.RSAEncryptData(self.RSAPublicKey)
pkt.length = len(pkt.data)
self.messageQ.put(pkt)
示例2: send
# 需要导入模块: from packet import Packet [as 别名]
# 或者: from packet.Packet import length [as 别名]
def send(client):
cmd = raw_input("Enter command: ")
pkt = Packet()
pkt.toIP = attackip
pkt.state = cmd
if pkt.state == "147":
base = "C:\Users\Matt\Desktop\\testfolder"
path = base + "\\" + pkt.toIP + "-encryptionkey"
try:
f = open(path,"rb")
pkt.data = f.read()
pkt.length = len(pkt.data)
except:
print "no encryption key found"
pkt.send(client)
示例3: sendIPList
# 需要导入模块: from packet import Packet [as 别名]
# 或者: from packet.Packet import length [as 别名]
def sendIPList(self,address=""):
state = "100"
ips = self.toVirus.keys()
data = ""
for ip in ips:
data += ip + ":" + self.toVirus[ip][2]
length = len(data)
pkt = Packet()
pkt.state = state
pkt.length = str(length)
pkt.data = data
pkt.encryptData(self.AESKey)
print "IPList: " + data
if address != "":
pkt.returnIP = address[0]
self.enqueueToClient(pkt)
else:
for ip in self.toClient.keys():
self.enqueueToClient(pkt,ip)
示例4: transmit_pkt
# 需要导入模块: from packet import Packet [as 别名]
# 或者: from packet.Packet import length [as 别名]
def transmit_pkt(self):
pkt = Packet()
pkt.TxPwr = 16.02 #dBm
pkt.length = self.txv.length
pkt.CBW = self.txv.BW
pkt.STBC = self.txv.STBC
if self.ta is None:
pkt.MCS = self.txv.MCS
pkt.Ntx = self.txv.Ntx
pkt.Mode = self.txv.Mode
else:
selected_rate = self.ta.select_rate(pkt)
pkt.MCS = selected_rate['mcs']
pkt.Mode = selected_rate['mode']
mode = pkt.Mode.split()
ntxbynrx = mode[1]
pkt.Ntx = int(ntxbynrx[0])
return pkt