{% if filetype_loop == 0 %}Access Control List,Access Control Entry,Permission,Logging,Source Network,Destination Network,L3 Protocol,L4 Protocol,Operator,Port{% for list in to_parse_access_list %}{% if to_parse_access_list[list].aces is defined %}{% for ace in to_parse_access_list[list].aces %}{% if to_parse_access_list[list].aces[ace].matches.l3 is defined %}{% if to_parse_access_list[list].aces[ace].matches.l3.ipv4 is defined %}{% if to_parse_access_list[list].aces[ace].matches.l3.ipv4.source_network is defined %}{% for source_network in to_parse_access_list[list].aces[ace].matches.l3.ipv4.source_network %}
{{ list }},{{ ace }},{{ to_parse_access_list[list].aces[ace].actions.forwarding }},{{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }},{{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.source_network[source_network] | replace("{'source_network': ","") | replace("}","") | replace("'","") }},{{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.destination_network | replace(" {'destination_network':","") | replace("}","") | replace("{","") | replace("'","") | replace(":","") | default("N/A") }},{{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.protocol | default("N/A") }},N/A,N/A,N/A{% endfor %}{% else %}{% for destination_network in to_parse_access_list[list].aces[ace].matches.l3.ipv4.destination_network %}
{{ list }},{{ ace }},{{ to_parse_access_list[list].aces[ace].actions.forwarding }},{{ to_parse_access_list[list].aces[ace].actions.logging | default("No Logging") }},N/A,{{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.destination_network[destination_network]  | replace(" {'destination_network':","") | replace("}","") | replace("{","") | replace("'","") | replace(":","") | default("NA") }},{{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.protocol | default("N/A") }},N/A,N/A,N/A{% endfor %}{% endif %}{% endif %}{% endif %}{% endfor %}{% else %}
{{ list }},No ACEs,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A{% endif %}{% endfor %}{% for list in to_parse_access_list %}{% if to_parse_access_list[list].aces is defined %}{% for ace in to_parse_access_list[list].aces %}{% if to_parse_access_list[list].aces[ace].matches.l4 is defined %}{% if to_parse_access_list[list].aces[ace].matches.l4.udp is defined %}{% if to_parse_access_list[list].aces[ace].matches.l4.udp.source_port is defined %}
{{ list }},{{ ace }},{{ to_parse_access_list[list].aces[ace].actions.forwarding }},{{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }},Source Protocol,N/A,N/A,UDP,{% if to_parse_access_list[list].aces[ace].matches.l4.udp.source_port.operator is defined %}{{ to_parse_access_list[list].aces[ace].matches.l4.udp.source_port.operator.operator }},{{ to_parse_access_list[list].aces[ace].matches.l4.udp.source_port.operator.port }}{% else %}N/A,N/A{% endif %}{% else %}{% if to_parse_access_list[list].aces[ace].matches.l4.udp.destination_port is defined %}  
{{ list }},{{ ace }},{{ to_parse_access_list[list].aces[ace].actions.forwarding }},{{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }},N/A,Destination Protocol,N/A,UDP,{% if to_parse_access_list[list].aces[ace].matches.l4.udp.destination_port.operator is defined %}{{ to_parse_access_list[list].aces[ace].matches.l4.udp.destination_port.operator.operator }},{{ to_parse_access_list[list].aces[ace].matches.l4.udp.destination_port.operator.port }}{% else %}N/A,N/A{% endif %}{% endif %}{% endif %}{% else %}{% if to_parse_access_list[list].aces[ace].matches.l4.tcp is defined %}{% if to_parse_access_list[list].aces[ace].matches.l4.tcp.source_port is defined %}
{{ list }},{{ ace }},{{ to_parse_access_list[list].aces[ace].actions.forwarding }},{{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }},Source Protocol,N/A,N/A,TCP,{% if to_parse_access_list[list].aces[ace].matches.l4.tcp.source_port.operator is defined %}{{ to_parse_access_list[list].aces[ace].matches.l4.tcp.source_port.operator.operator }},{{ to_parse_access_list[list].aces[ace].matches.l4.tcp.source_port.operator.port }}{% else %}N/A,N/A{% endif %}{% else %}{% if to_parse_access_list[list].aces[ace].matches.l4.tcp.destination_port is defined %}  
{{ list }},{{ ace }},{{ to_parse_access_list[list].aces[ace].actions.forwarding }},{{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }},N/A,Destination Protocol,N/A,TCP,{% if to_parse_access_list[list].aces[ace].matches.l4.tcp.destination_port.operator is defined %}{{ to_parse_access_list[list].aces[ace].matches.l4.tcp.destination_port.operator.operator }},{{ to_parse_access_list[list].aces[ace].matches.l4.tcp.destination_port.operator.port }}{% else %}N/A,N/A{% endif %}{% endif %}{% endif %}{% endif %}{% endif %}{% endif %}{% endfor %}{% else %}
{{ list }},No ACEs,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A{% endif %}{% endfor %}{% else %}{% if filetype_loop == 1 %}
# Show IP Access-Lists
| Access Control List | Access Control Entry | Permission | Logging | Source Network | Destination Network | L3 Protocol | L4 Protocol | Operator | Port |
| ------------------- | -------------------- | ---------- | ------- | -------------- | ------------------- | ----------- | ----------- | -------- | ---- |{% for list in to_parse_access_list %}{% if to_parse_access_list[list].aces is defined %}{% for ace in to_parse_access_list[list].aces %}{% if to_parse_access_list[list].aces[ace].matches.l3 is defined %}{% if to_parse_access_list[list].aces[ace].matches.l3.ipv4 is defined %}{% if to_parse_access_list[list].aces[ace].matches.l3.ipv4.source_network is defined %}{% for source_network in to_parse_access_list[list].aces[ace].matches.l3.ipv4.source_network %}
| {{ list }} | {{ ace }} | {{ to_parse_access_list[list].aces[ace].actions.forwarding }} | {{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }} | {{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.source_network[source_network] | replace("{'source_network': ","") | replace("}","") | replace("'","") }} | {{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.destination_network | replace(" {'destination_network':","") | replace("}","") | replace("{","") | replace("'","") | replace(":","") | default("N/A") }} | {{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.protocol | default("N/A") }} | N/A | N/A | N/A |{% endfor %}{% else %}{% for destination_network in to_parse_access_list[list].aces[ace].matches.l3.ipv4.destination_network %}
| {{ list }} | {{ ace }} | {{ to_parse_access_list[list].aces[ace].actions.forwarding }} | {{ to_parse_access_list[list].aces[ace].actions.logging | default("No Logging") }} | N/A | {{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.destination_network[destination_network]  | replace(" {'destination_network':","") | replace("}","") | replace("{","") | replace("'","") | replace(":","") | default("NA") }} | {{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.protocol | default("N/A") }} | N/A | N/A | N/A |{% endfor %}{% endif %}{% endif %}{% endif %}{% endfor %}{% else %}
| {{ list }} | No ACEs | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |{% endif %}{% endfor %}{% for list in to_parse_access_list %}{% if to_parse_access_list[list].aces is defined %}{% for ace in to_parse_access_list[list].aces %}{% if to_parse_access_list[list].aces[ace].matches.l4 is defined %}{% if to_parse_access_list[list].aces[ace].matches.l4.udp is defined %}{% if to_parse_access_list[list].aces[ace].matches.l4.udp.source_port is defined %}
| {{ list }} | {{ ace }} | {{ to_parse_access_list[list].aces[ace].actions.forwarding }} | {{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }} | Source Protocol | N/A | N/A | UDP | {% if to_parse_access_list[list].aces[ace].matches.l4.udp.source_port.operator is defined %}{{ to_parse_access_list[list].aces[ace].matches.l4.udp.source_port.operator.operator }} | {{ to_parse_access_list[list].aces[ace].matches.l4.udp.source_port.operator.port }}{% else %} N/A | N/A {% endif %}|{% else %}{% if to_parse_access_list[list].aces[ace].matches.l4.udp.destination_port is defined %}  
| {{ list }} | {{ ace }} | {{ to_parse_access_list[list].aces[ace].actions.forwarding }} | {{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }} | N/A,Destination Protocol | N/A | UDP | {% if to_parse_access_list[list].aces[ace].matches.l4.udp.destination_port.operator is defined %}{{ to_parse_access_list[list].aces[ace].matches.l4.udp.destination_port.operator.operator }} | {{ to_parse_access_list[list].aces[ace].matches.l4.udp.destination_port.operator.port }}{% else %} N/A | N/A {% endif %} |{% endif %}{% endif %}{% else %}{% if to_parse_access_list[list].aces[ace].matches.l4.tcp is defined %}{% if to_parse_access_list[list].aces[ace].matches.l4.tcp.source_port is defined %}
| {{ list }} | {{ ace }} | {{ to_parse_access_list[list].aces[ace].actions.forwarding }} | {{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }} | Source Protocol | N/A | N/A | TCP | {% if to_parse_access_list[list].aces[ace].matches.l4.tcp.source_port.operator is defined %}{{ to_parse_access_list[list].aces[ace].matches.l4.tcp.source_port.operator.operator }} | {{ to_parse_access_list[list].aces[ace].matches.l4.tcp.source_port.operator.port }}{% else %} N/A | N/A {% endif %}|{% else %}{% if to_parse_access_list[list].aces[ace].matches.l4.tcp.destination_port is defined %}  
| {{ list }} | {{ ace }} | {{ to_parse_access_list[list].aces[ace].actions.forwarding }} | {{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }} | N/A | Destination Protocol | N/A | TCP | {% if to_parse_access_list[list].aces[ace].matches.l4.tcp.destination_port.operator is defined %}{{ to_parse_access_list[list].aces[ace].matches.l4.tcp.destination_port.operator.operator }} | {{ to_parse_access_list[list].aces[ace].matches.l4.tcp.destination_port.operator.port }}{% else %} N/A | N/A {% endif %} |{% endif %}{% endif %}{% endif %}{% endif %}{% endif %}{% endfor %}{% else %}
| {{ list }} | No ACEs | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |{% endif %}{% endfor %}{% else %}{% if filetype_loop == 2 %}
<html>
<head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://cdn.datatables.net/1.11.4/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/2.0.0/js/dataTables.buttons.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
    <script src="https://cdn.datatables.net/buttons/2.0.0/js/buttons.html5.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/2.0.0/js/buttons.print.min.js"></script>
    <script src="https://cdn.datatables.net/colreorder/1.5.4/js/dataTables.colReorder.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/2.0.0/js/buttons.colVis.min.js"></script>
    <script src="https://cdn.datatables.net/keytable/2.6.4/js/dataTables.keyTable.min.js"></script>
    <script src="https://cdn.datatables.net/select/1.3.3/js/dataTables.select.min.js"></script>
    <script src="https://cdn.datatables.net/fixedheader/3.1.9/js/dataTables.fixedHeader.min.js"></script>
    <link rel="stylesheet" href="https://cdn.datatables.net/fixedheader/3.1.9/css/fixedHeader.dataTables.min.css">
    <link rel="stylesheet" href="https://cdn.datatables.net/select/1.3.3/css/select.dataTables.min.css">
    <link rel="stylesheet" href="https://cdn.datatables.net/keytable/2.6.4/css/keyTable.dataTables.min.css">
    <link rel="stylesheet" href="https://cdn.datatables.net/1.11.4/css/jquery.dataTables.min.css">
</head>
<body>
<h1>Show Access-Lists</h1>
<table id = "acl">
  <thead>
  <tr>
    <th>Access Control List</th>
    <th>Access Control Entry</th>
    <th>Permission</th>
    <th>Logging</th>
    <th>Source Network</th>
    <th>Destination Network</th>
    <th>L3 Protocol</th>
    <th>L4 Protocol</th>
    <th>Operator</th>
    <th>Port</th>
  </tr>
  </thead>
  <tbody>
  {% for list in to_parse_access_list %}{% if to_parse_access_list[list].aces is defined %}{% for ace in to_parse_access_list[list].aces %}{% if to_parse_access_list[list].aces[ace].matches.l3 is defined %}{% if to_parse_access_list[list].aces[ace].matches.l3.ipv4 is defined %}{% if to_parse_access_list[list].aces[ace].matches.l3.ipv4.source_network is defined %}{% for source_network in to_parse_access_list[list].aces[ace].matches.l3.ipv4.source_network %}
<tr>
    <td>{{ list }}</td>
    <td>{{ ace }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].actions.forwarding }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.source_network[source_network] | replace("{'source_network': ","") | replace("}","") | replace("'","") }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.destination_network | replace(" {'destination_network':","") | replace("}","") | replace("{","") | replace("'","") | replace(":","") | default("N/A") }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.protocol | default("N/A") }}</td>
    <td>N/A</td>
    <td>N/A</td>
    <td>N/A</td>
  </tr>{% endfor %}{% else %}{% for destination_network in to_parse_access_list[list].aces[ace].matches.l3.ipv4.destination_network %}
<tr>
    <td>{{ list }}</td>
    <td>{{ ace }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].actions.forwarding }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }}</td>
    <td>N/A</td>
    <td>{{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.destination_network | replace(" {'destination_network':","") | replace("}","") | replace("{","") | replace("'","") | replace(":","") | default("N/A") }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.protocol | default("N/A") }}</td>
    <td>N/A</td>
    <td>N/A</td>
    <td>N/A</td>
  </tr>{% endfor %}{% endif %}{% endif %}{% endif %}{% endfor %}{% else %}
<tr>
    <td>{{ list }}</td>
    <td>No ACEs</td>
    <td>N/A</td>
    <td>N/A</td>
    <td>N/A</td>
    <td>N/A</td>
    <td>N/A</td>
    <td>N/A</td>
    <td>N/A</td>
    <td>N/A</td>
  </tr>{% endif %}{% endfor %}{% for list in to_parse_access_list %}{% if to_parse_access_list[list].aces is defined %}{% for ace in to_parse_access_list[list].aces %}{% if to_parse_access_list[list].aces[ace].matches.l4 is defined %}{% if to_parse_access_list[list].aces[ace].matches.l4.udp is defined %}{% if to_parse_access_list[list].aces[ace].matches.l4.udp.source_port is defined %}
<tr>
    <td>{{ list }}</td>
    <td>{{ ace }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].actions.forwarding }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }}</td>
    <td>Source Protocol</td>
    <td>N/A</td>
    <td>N/A</td>
    <td>UDP</td>{% if to_parse_access_list[list].aces[ace].matches.l4.udp.source_port.operator is defined %}
    <td>{{ to_parse_access_list[list].aces[ace].matches.l4.udp.source_port.operator.operator }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].matches.l4.udp.source_port.operator.port }}</td>{% else %}
    <td>N/A</td>
    <td>N/A</td>{% endif %}
  </tr>{% else %}{% if to_parse_access_list[list].aces[ace].matches.l4.udp.destination_port is defined%}
<tr>
    <td>{{ list }}</td>
    <td>{{ ace }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].actions.forwarding }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }}</td>
    <td>N/A</td>
    <td>Destination Protocol</td>
    <td>N/A</td>
    <td>UDP</td>{% if to_parse_access_list[list].aces[ace].matches.l4.udp.destination_port.operator is defined %}
    <td>{{ to_parse_access_list[list].aces[ace].matches.l4.udp.destination_port.operator.operator }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].matches.l4.udp.destination_port.operator.port }}</td>{% else %}
    <td>N/A</td>
    <td>N/A</td>{% endif %}
  </tr>{% endif %}{% endif %}{% else %}{% if to_parse_access_list[list].aces[ace].matches.l4.tcp is defined %}{% if to_parse_access_list[list].aces[ace].matches.l4.tcp.source_port is defined %}
<tr>
    <td>{{ list }}</td>
    <td>{{ ace }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].actions.forwarding }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }}</td>
    <td>Source Protocol</td>
    <td>N/A</td>
    <td>N/A</td>
    <td>TCP</td>{% if to_parse_access_list[list].aces[ace].matches.l4.tcp.source_port.operator is defined %}
    <td>{{ to_parse_access_list[list].aces[ace].matches.l4.tcp.source_port.operator.operator }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].matches.l4.tcp.source_port.operator.port }}</td>{% else %}
    <td>N/A</td>
    <td>N/A</td>{% endif %}
  </tr>{% else %}{% if to_parse_access_list[list].aces[ace].matches.l4.tcp.destination_port is defined%}
<tr>
    <td>{{ list }}</td>
    <td>{{ ace }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].actions.forwarding }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }}</td>
    <td>N/A</td>
    <td>Destination Protocol</td>
    <td>N/A</td>    
    <td>TCP</td>{% if to_parse_access_list[list].aces[ace].matches.l4.tcp.destination_port.operator is defined %}
    <td>{{ to_parse_access_list[list].aces[ace].matches.l4.tcp.destination_port.operator.operator }}</td>
    <td>{{ to_parse_access_list[list].aces[ace].matches.l4.tcp.destination_port.operator.port }}</td>{% else %}
    <td>N/A</td>
    <td>N/A</td>{% endif %}
  </tr>{% endif %}{% endif %}{% endif %}{% endif %}{% endif %}{% endfor %}{% else %}
<tr>
    <td>{{ list }}</td>
    <td>No ACEs</td>
    <td>N/A</td>
    <td>N/A</td>
    <td>N/A</td>
    <td>N/A</td>
    <td>N/A</td>
    <td>N/A</td>
    <td>N/A</td>
    <td>N/A</td>
  </tr>{% endif %}{% endfor %}
  </tbody>  
</table>
<script type = "text/javascript">
  $(document).ready(function(){
    $('#acl thead tr')
    .clone(true)
    .addClass('filters')
    .appendTo('#acl thead');

    var table = $('#acl').DataTable({
        keys: true,
        dom: 'Bfrtip',
        lengthMenu: [
            [ 10, 25, 50, -1 ],
            [ '10 rows', '25 rows', '50 rows', 'Show all' ]
        ],
        buttons: [
        'pageLength','colvis','copy', 'csv', 'excel', 'pdf', 'print'
        ],
        colReorder: true,
        select: true,            
        orderCellsTop: true,
        fixedHeader: true,
        initComplete: function () {
        var api = this.api();

        // For each column
        api
            .columns()
            .eq(0)
            .each(function (colIdx) {
                // Set the header cell to contain the input element
                var cell = $('.filters th').eq(
                    $(api.column(colIdx).header()).index()
                );
                var title = $(cell).text();
                $(cell).html('<input type="text" placeholder="' + title + '" />');

                // On every keypress in this input
                $(
                    'input',
                    $('.filters th').eq($(api.column(colIdx).header()).index())
                )
                    .off('keyup change')
                    .on('keyup change', function (e) {
                        e.stopPropagation();

                        // Get the search value
                        $(this).attr('title', $(this).val());
                        var regexr = '({search})'; //$(this).parents('th').find('select').val();

                        var cursorPosition = this.selectionStart;
                        // Search the column for that value
                        api
                            .column(colIdx)
                            .search(
                                this.value != ''
                                    ? regexr.replace('{search}', '(((' + this.value + ')))')
                                    : '',
                                this.value != '',
                                this.value == ''
                            )
                            .draw();

                        $(this)
                            .focus()[0]
                            .setSelectionRange(cursorPosition, cursorPosition);
                    });
            });
    },
});
});        
</script>
</body></html>{% else %}
# Learn ACLs 
## Access Control List
{%- for list in to_parse_access_list %}
### {{ list }}
{%-     if to_parse_access_list[list].aces is defined %}
{%-         for ace in to_parse_access_list[list].aces %}
#### Access Control Entry: {{ ace }}
##### Permission: {{ to_parse_access_list[list].aces[ace].actions.forwarding }}
##### Logging: {{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }}
{%-             if to_parse_access_list[list].aces[ace].matches.l3 is defined %}
{%-                 if to_parse_access_list[list].aces[ace].matches.l3.ipv4 is defined %}
{%-                     if to_parse_access_list[list].aces[ace].matches.l3.ipv4.source_network is defined %}
{%-                         for source_network in to_parse_access_list[list].aces[ace].matches.l3.ipv4.source_network %}
##### Source Network
###### {{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.source_network[source_network] | replace("{'source_network': ","") | replace("}","") | replace("'","") }}
##### Destination Network
###### {{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.destination_network | replace(" {'destination_network':","") | replace("}","") | replace("{","") | replace("'","") | replace(":","") | default("N/A") }}
##### L3 Protocol
###### {{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.protocol | default("N/A") }}
{%-                         endfor %}
{%-                     else %}
{%-                         for destination_network in to_parse_access_list[list].aces[ace].matches.l3.ipv4.destination_network %}
##### Destination Network
###### {{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.destination_network | replace(" {'destination_network':","") | replace("}","") | replace("{","") | replace("'","") | replace(":","") | default("N/A") }}
##### L3 Protocol 
###### {{ to_parse_access_list[list].aces[ace].matches.l3.ipv4.protocol | default("N/A") }}
{%-                         endfor %}
{%-                     endif %}
{%-                 endif %}
{%-             endif %}
{%-         endfor %}
{%-     else %}
#### No ACEs
{%-     endif %}
{%- endfor %}
{%- for list in to_parse_access_list %}
{%-     if to_parse_access_list[list].aces is defined %}
{%-         for ace in to_parse_access_list[list].aces %}
{%-             if to_parse_access_list[list].aces[ace].matches.l4 is defined %}
{%-                 if to_parse_access_list[list].aces[ace].matches.l4.udp is defined %}
{%-                     if to_parse_access_list[list].aces[ace].matches.l4.udp.source_port is defined %}
#### Access Control Entry: {{ ace }}
##### Permission: {{ to_parse_access_list[list].aces[ace].actions.forwarding }}
##### Logging: {{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }}
##### Source Protocol
###### UDP
{%-                         if to_parse_access_list[list].aces[ace].matches.l4.udp.source_port.operator is defined %}
###### Operator: {{ to_parse_access_list[list].aces[ace].matches.l4.udp.source_port.operator.operator }}
###### Port: {{ to_parse_access_list[list].aces[ace].matches.l4.udp.source_port.operator.port }}
{%-                         endif %}
{%-                     else %}
{%-                         if to_parse_access_list[list].aces[ace].matches.l4.udp.destination_port is defined%}
#### Access Control Entry: {{ ace }}
##### Permission: {{ to_parse_access_list[list].aces[ace].actions.forwarding }}
##### Logging: {{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }}
##### Destination Protocol
###### UDP
{%-                             if to_parse_access_list[list].aces[ace].matches.l4.udp.destination_port.operator is defined %}
###### {{ to_parse_access_list[list].aces[ace].matches.l4.udp.destination_port.operator.operator }}
###### {{ to_parse_access_list[list].aces[ace].matches.l4.udp.destination_port.operator.port }}{% endif %}
{%-                             endif %}
{%-                         endif %}
{%-                     endif %}
{%-                 if to_parse_access_list[list].aces[ace].matches.l4.tcp is defined %}
{%-                     if to_parse_access_list[list].aces[ace].matches.l4.tcp.source_port is defined %}
#### Access Control Entry: {{ ace }}
##### Permission: {{ to_parse_access_list[list].aces[ace].actions.forwarding }}
##### Logging: {{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }}
##### Source Protocol
###### TCP
{%-                         if to_parse_access_list[list].aces[ace].matches.l4.tcp.source_port.operator is defined %}
###### Operator: {{ to_parse_access_list[list].aces[ace].matches.l4.tcp.source_port.operator.operator }}</td>
{{ to_parse_access_list[list].aces[ace].matches.l4.tcp.source_port.operator.port }}
{%                          endif %}
{%-                     else %}
{%-                         if to_parse_access_list[list].aces[ace].matches.l4.tcp.destination_port is defined%}
#### Access Control Entry: {{ ace }}
##### Permission: {{ to_parse_access_list[list].aces[ace].actions.forwarding }}
##### Logging: {{ to_parse_access_list[list].aces[ace].actions.logging | default ("No Logging") }}
##### Destination Protocol
##### TCP
{%-                             if to_parse_access_list[list].aces[ace].matches.l4.tcp.destination_port.operator is defined %}
###### Operator:{{ to_parse_access_list[list].aces[ace].matches.l4.tcp.destination_port.operator.operator }}
###### Port: {{ to_parse_access_list[list].aces[ace].matches.l4.tcp.destination_port.operator.port }}
{%-                             endif %}
{%-                         endif %}
{%-                     endif %}
{%-                 endif %}
{%-             endif %}
{%-         endfor %}
{%-     else %}
### {{ list }}
#### Access Control Entry: No ACEs
{%-     endif %}
{%- endfor %}{% endif %}{% endif %}{% endif %}