|
@@ -41,12 +41,14 @@ def add_padding(packet, bytes_padding:int = 0, user_padding:bool=True, rnd:bool
|
|
def equal_length(list_of_packets:list, length:int = 0, padding:int = 0, force_len:bool = False):
|
|
def equal_length(list_of_packets:list, length:int = 0, padding:int = 0, force_len:bool = False):
|
|
'''
|
|
'''
|
|
Equals the length of all packets of a given list of packets to the given length. If the given length is smaller than the largest
|
|
Equals the length of all packets of a given list of packets to the given length. If the given length is smaller than the largest
|
|
- packet, all the other packets are extended to the largest packet's length. Add additional padding
|
|
+ packet, all the other packets are extended to the largest packet's length. Adds additional padding
|
|
afterwards to create realism.
|
|
afterwards to create realism.
|
|
- :param list_of_packets: The given set of packet.
|
|
+ :param list_of_packets: The given list of packet.
|
|
:param length: The length each packet should have. Can be redundant, if the largest packet has more bytes
|
|
:param length: The length each packet should have. Can be redundant, if the largest packet has more bytes
|
|
:param force_len: if true, all packets are forced to take on the length of param length
|
|
:param force_len: if true, all packets are forced to take on the length of param length
|
|
than length.
|
|
than length.
|
|
|
|
+ :param padding: The amount of bytes that can be appended at most by the second add, that creates realism.
|
|
|
|
+ (The called function will randomly chose a value between zero and padding.)
|
|
:return: The list of extended packets.
|
|
:return: The list of extended packets.
|
|
'''
|
|
'''
|
|
if not force_len:
|
|
if not force_len:
|