{% if not httpreplay.have %}
<div class="alert alert-warning">
    <strong>Deprecation note:</strong>
    While processing this analysis you did not have the httpreplay Python
    library installed. Installing this library (i.e., pip install httpreplay)
    will allow Cuckoo to do more proper PCAP analysis including but not
    limited to showing full HTTP and HTTPS (!) requests and responses.
    It is recommended that you install this library and possibly reprocess any
    interesting analysis tasks.
</div>
{% elif httpreplay.deprecated %}
<div class="alert alert-warning">
    <strong>Deprecation note:</strong>
    You are using version {{ httpreplay.current_version }} of HTTPReplay,
    rather than the latest version {{ httpreplay.latest_version }}, which may
    not handle various corner cases and/or TLS cipher suites correctly. This
    could result in not getting all the HTTP/HTTPS streams that are available
    or corrupt some streams that were not handled correctly before. Please
    upgrade it to the latest version (`pip install --upgrade httpreplay`).
</div>
{% endif %}

<div class="tabbable tabs">
    <ul class="nav nav-pills" style="margin-bottom: 0;">
        <li class="active"><a href="#network_hosts_tab" data-toggle="tab">Hosts ({{ analysis.network.hosts|length }})</a></li>
        <li><a href="#network_dns_tab" data-toggle="tab">DNS ({{ analysis.network.dns|length }})</a></li>
        <li><a href="#network_tcp_tab" data-toggle="tab">TCP ({{ analysis.network.tcp|length }})</a></li>
        <li><a href="#network_udp_tab" data-toggle="tab">UDP ({{ analysis.network.udp|length }})</a></li>
        <li><a href="#network_http_tab" data-toggle="tab">
            {% if analysis.network.http_ex %}
                HTTP/HTTPS ({{ analysis.network.http_ex|add:analysis.network.https_ex|length }})
            {% else %}
                HTTP ({{ analysis.network.http|length }})
            {% endif %}
        </a></li>
        <li><a href="#network_icmp_tab" data-toggle="tab">ICMP ({{ analysis.network.icmp|length }})</a></li>
        <li><a href="#network_irc_tab" data-toggle="tab">IRC ({{ analysis.network.irc|length }})</a></li>
        <li><a href="#network_suricata_tab" data-toggle="tab">Suricata ({{ analysis.suricata|custom_length:"alerts tls" }})</a></li>
        <li><a href="#network_snort_tab" data-toggle="tab">Snort ({{ analysis.snort.alerts|length }})</a></li>
        <li class="pull-right">
{% if analysis.network.pcap_id or analysis.network.mitmproxy_id %}
    {% if analysis.network.pcap_id %}
    <a class="btn btn-primary btn-small" href="{% url "analysis.views.file" "pcap" analysis.network.pcap_id %}">
        <span class="glyphicon glyphicon-save" aria-hidden="true"></span>
        Download PCAP
    </a>
    {% endif %}
    {% if analysis.network.mitmproxy_id %}
    <a class="btn btn-primary btn-small" href="{% url "analysis.views.file" "mitmproxy" analysis.network.mitmproxy_id %}">
        <span class="glyphicon glyphicon-save" aria-hidden="true"></span>
        Download mitmproxy dump
     </a>
    {% endif %}
{% endif %}
        </li>

    </ul>
    <div class="tab-content">
        <div class="tab-pane fade in active" id="network_hosts_tab">{% include "analysis/network/_hosts.html" %}</div>
        <div class="tab-pane fade" id="network_dns_tab">{% include "analysis/network/_dns.html" %}</div>
        <div class="tab-pane fade" id="network_tcp_tab">{% include "analysis/network/_tcp.html" %}</div>
        <div class="tab-pane fade" id="network_udp_tab">{% include "analysis/network/_udp.html" %}</div>
        <div class="tab-pane fade" id="network_http_tab">{% include "analysis/network/_http.html" %}</div>
        <div class="tab-pane fade" id="network_icmp_tab">{% include "analysis/network/_icmp.html" %}</div>
        <div class="tab-pane fade" id="network_irc_tab">{% include "analysis/network/_irc.html" %}</div>
        <div class="tab-pane fade" id="network_suricata_tab">{% include "analysis/network/_suricata.html" %}</div>
        <div class="tab-pane fade" id="network_snort_tab">{% include "analysis/network/_snort.html" %}</div>
    </div>
</div>
