def get_network_interface_args(interface_index, interface_name):
    """Get QEMU command line arguments which add network interface.

    The arguments also instruct QEMU to capture packets on the interface. The
    packets are captured to file "link{interface_index}.pcap".

    :param interface_index: unique number for each interface
    :type interface_index: int
    :param interface_name: tap interface name
    :type interface_name: str
    :return: list of arguments
    :rtype: list(str)
    """
    packet_capture_filename = f'link{interface_index}.pcap'
    netdev_id = f'id_net{interface_index}'
    return ['-netdev',
        f'tap,id={netdev_id},ifname={interface_name},script=no,downscript=no',
        '-device', f'e1000,netdev={netdev_id}', '-object', 
        f'filter-dump,id=id_dump{interface_index},netdev={netdev_id},file=' +
        packet_capture_filename]
