aptdetector/network/packet.py
def create_packet(self,
                      target_id,
                      show_port={bool: False},
                      reverse={bool: False}):
        """create an address based on target_id"""
        if (target_id == 1 and reverse is False) or (target_id == 2 and
                                                     reverse is True):
            if show_port:
                return self.sourceHost + ":" + str(self.sourcePort)
            else:
                return self.sourceHost
        elif (target_id == 2 and reverse is False) or (target_id == 1 and
                                                       reverse is True):
            if show_port:
                return self.destinationHost + ":" + str(self.destinationPort)
            else:
                return self.destinationHost
        else:
            return None
create an address based on target_id
create an address based on target_id
create an address based on target_id
def create_packet(self,
                      target_id,
                      show_port={bool: False},
                      reverse={bool: False}):
        if (target_id == 1 and reverse is False) or (target_id == 2 and
                                                     reverse is True):
            if show_port:
                return self.sourceHost + ":" + str(self.sourcePort)
            else:
                return self.sourceHost
        elif (target_id == 2 and reverse is False) or (target_id == 1 and
                                                       reverse is True):
            if show_port:
                return self.destinationHost + ":" + str(self.destinationPort)
            else:
                return self.destinationHost
        else:
            return None
def create_packet ( self , target_id , show_port = { bool : False } , reverse = { bool : False } ) : if ( target_id == 1 and reverse is False ) or ( target_id == 2 and reverse is True ) : if show_port : return self . sourceHost + ":" + str ( self . sourcePort ) else : return self . sourceHost elif ( target_id == 2 and reverse is False ) or ( target_id == 1 and reverse is True ) : if show_port : return self . destinationHost + ":" + str ( self . destinationPort ) else : return self . destinationHost else : return None
create an address based on target_id
create an address based on target_id
"""create an address based on target_id"""
self
target_id
show_port
reverse