def get_src_ip(setup_info, direction, interface_type, nat_type=None, second_port=False):
    """
    return source IP based on test case direction and interface_type
    :param setup_info: setup info fixture
    :param direction: 'host-tor', 'leaf-tor'
    :param interface_type: type of interface
    :param second_port: boolean if second port's IP settings need to be returned
    :param nat_type: string nat type
    :return: source IP
    """
    if direction == 'host-tor' or nat_type == "static_napt":
        if second_port:
            return setup_info[interface_type]["second_src_ip"]
        return setup_info[interface_type]['src_ip']
    return setup_info[interface_type]['dst_ip']