コード例 #1
0
ファイル: common.py プロジェクト: dtalayco/oftest
 def pack(self):
     packed = []
     packed.append(struct.pack("!L", self.queue_id))
     packed.append(struct.pack("!H", 0))  # placeholder for len at index 1
     packed.append("\x00" * 2)
     packed.append(util.pack_list(self.properties))
     length = sum([len(x) for x in packed])
     packed[1] = struct.pack("!H", length)
     return "".join(packed)
コード例 #2
0
 def pack(self):
     packed = []
     packed.append(struct.pack("!H", self.type))
     packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
     packed.append('\x00' * 4)
     packed.append(util.pack_list(self.actions))
     length = sum([len(x) for x in packed])
     packed[1] = struct.pack("!H", length)
     return ''.join(packed)
コード例 #3
0
 def pack(self):
     packed = []
     packed.append(struct.pack("!H", self.type))
     packed.append(struct.pack("!H", 0))  # placeholder for len at index 1
     packed.append('\x00' * 4)
     packed.append(util.pack_list(self.actions))
     length = sum([len(x) for x in packed])
     packed[1] = struct.pack("!H", length)
     return ''.join(packed)
コード例 #4
0
ファイル: common.py プロジェクト: StonyBrookUniversity/oftest
 def pack(self):
     packed = []
     packed.append(struct.pack("!L", self.queue_id))
     packed.append(struct.pack("!H", 0))  # placeholder for len at index 1
     packed.append('\x00' * 2)
     packed.append(util.pack_list(self.properties))
     length = sum([len(x) for x in packed])
     packed[1] = struct.pack("!H", length)
     return ''.join(packed)
コード例 #5
0
ファイル: common.py プロジェクト: dtalayco/oftest
 def pack(self):
     packed = []
     packed.append(struct.pack("!H", 0))  # placeholder for length at index 0
     packed.append(struct.pack("!B", self.table_id))
     packed.append("\x00" * 1)
     packed.append(self.match.pack())
     packed.append(struct.pack("!L", self.duration_sec))
     packed.append(struct.pack("!L", self.duration_nsec))
     packed.append(struct.pack("!H", self.priority))
     packed.append(struct.pack("!H", self.idle_timeout))
     packed.append(struct.pack("!H", self.hard_timeout))
     packed.append("\x00" * 6)
     packed.append(struct.pack("!Q", self.cookie))
     packed.append(struct.pack("!Q", self.packet_count))
     packed.append(struct.pack("!Q", self.byte_count))
     packed.append(util.pack_list(self.actions))
     length = sum([len(x) for x in packed])
     packed[0] = struct.pack("!H", length)
     return "".join(packed)
コード例 #6
0
ファイル: common.py プロジェクト: StonyBrookUniversity/oftest
 def pack(self):
     packed = []
     packed.append(struct.pack("!H",
                               0))  # placeholder for length at index 0
     packed.append(struct.pack("!B", self.table_id))
     packed.append('\x00' * 1)
     packed.append(self.match.pack())
     packed.append(struct.pack("!L", self.duration_sec))
     packed.append(struct.pack("!L", self.duration_nsec))
     packed.append(struct.pack("!H", self.priority))
     packed.append(struct.pack("!H", self.idle_timeout))
     packed.append(struct.pack("!H", self.hard_timeout))
     packed.append('\x00' * 6)
     packed.append(struct.pack("!Q", self.cookie))
     packed.append(struct.pack("!Q", self.packet_count))
     packed.append(struct.pack("!Q", self.byte_count))
     packed.append(util.pack_list(self.actions))
     length = sum([len(x) for x in packed])
     packed[0] = struct.pack("!H", length)
     return ''.join(packed)