def encode_reply(version, rep, rsv, address_type, bind_address, bind_port):
 data = struct.pack('BBBB', version, rep, rsv, address_type)
 data += __encode_address(address_type, bind_address)
 data += struct.pack('!H', bind_port)
 return data

def encode_reply ( version , rep , rsv , address_type , bind_address , bind_port ) : data = struct . pack ( 'BBBB' , version , rep , rsv , address_type ) data += __encode_address ( address_type , bind_address ) data += struct . pack ( '!H' , bind_port ) return data
encode a reply .