<!DOCTYPE html>
<html lang="en">
<head>
  <title>SDN-C AdminPortal</title>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <% include ../partials/head %>
  <% include ../partials/header %>
</head>
<body>

<h2>VR-LAN</h2>

<% if ( typeof result != 'undefined' ) {
        if (result.code.length > 0) {
            if ( result.code == 'success' ) { %>
                <div class='alert alert-success' role='alert'>
                <%
                for ( x in result.msg ){ %>
                    <div><%= result.msg[x] %></div>
                <% } %>
                </div>
            <% } else { %>
                <div class='alert alert-danger' role='danger'>
                <%
                for ( x in result.msg ){ %>
                    <div><%= result.msg[x] %></div>
                <% } %>
                </div>
            <% } %>
        <% } %>
<% } %>

<% if( typeof privilege != 'undefined'){
    var priv = privilege.privilege;
} else {
    var priv = 'A';
} %>

<div class="container-fluid">
<div class="content">

<% if ( typeof response_obj['vr-lan']['routing-protocol'] != 'undefined' ){ %>
	<div class="content">
	service-instance-id: <%= svc_instance_id %><br>
	routing-protocol   : <%= response_obj['vr-lan']['routing-protocol'] %>
	</div>
<% } %>

<table class="tree">

<% var i=1; root_node=1;
if ( typeof response_obj['vr-lan'] != 'undefined' )  
{
	if( typeof response_obj['vr-lan']['vr-lan-interface'] != 'undefined' )
	{
       	response_obj['vr-lan']['vr-lan-interface'].forEach(function(request) { 
		var root_node = i %>

		<tr class="treegrid-<%= i %>">
            <td>vr-lan-interface</td>
		</tr>
		<% i++; %>

		<% if ( request['vr-designation'] != 'undefined')
		{
			var vr_designation = request['vr-designation'];
		} %> 

		<tr class="treegrid-<%= i %> treegrid-parent-<%= root_node %>">
        <td>
			<a href="javascript:vrlan_interface(
               '<%= svc_instance_id %>',
               '<%= request['vr-designation'] %>',
               '<%= request['v6-vr-lan-prefix'] %>',
               '<%= request['v6-vr-lan-prefix-length'] %>',
               '<%= request['v6-vce-wan-address'] %>',
               '<%= request['v4-vr-lan-prefix-length'] %>',
               '<%= request['v4-vr-lan-prefix'] %>',
               '<%= request['t-defaulted-v6-vrlan'] %>',
               '<%= request['v4-vce-loopback-address'] %>');">vr-lan-interface</a>
		</td>
		</tr>
		<% i++; %>

		<% if ( (typeof request['v6-public-lan-prefixes'] != 'undefined') && (typeof request['v6-public-lan-prefixes']['t-provided-v6-lan-public-prefixes'] != 'undefined') )
        { %>
        	<% request['v6-public-lan-prefixes']['t-provided-v6-lan-public-prefixes'].forEach(function(trequest){ var t_v6_root = i; %>
				<tr class="treegrid-<%= i %> treegrid-parent-<%= root_node %>">
				<td>v6-public-lan-prefixes</td>
				</tr>
				<% i++; %>
				<tr class="treegrid-<%= i %> treegrid-parent-<%= t_v6_root %>">
				<td>
					<a href="javascript:t_provided_v6_prefixes(
                       '<%= svc_instance_id %>',
                       '<%= trequest['request-index'] %>',
                       '<%= trequest['v6-next-hop-address'] %>',
                       '<%= trequest['v6-lan-public-prefix-length'] %>',
                       '<%= trequest['v6-lan-public-prefix'] %>');">t-provided-v6-lan-public-prefixes</a>
				</td>
				</tr>
				<% i++; %>
            <% }); %>
        <% } %>

		<% if ( typeof request['dhcp'] != 'undefined' )
        { %>
			<% var dhcp_node = i; %>
			<tr class="treegrid-<%= i %> treegrid-parent-<%= root_node %>">
			<td>dhcp</td>
			</tr>
			<% i++; %>

			<tr class="treegrid-<%= i %> treegrid-parent-<%= dhcp_node %>">
            <td>
                <a href="javascript:dhcp(
                   '<%= svc_instance_id %>',
                   '<%= request['dhcp']['use-v4-default-pool'] %>',
                   '<%= request['dhcp']['use-v6-default-pool'] %>',
                   '<%= request['dhcp']['v4-dhcp-server-enabled'] %>',
                   '<%= request['dhcp']['v6-dhcp-server-enabled'] %>',
                   '<%= request['dhcp']['v6-dhcp-default-pool-prefix'] %>',
                   '<%= request['dhcp']['v6-dhcp-default-pool-prefix-length'] %>',
                   '<%= request['dhcp']['v4-dhcp-default-pool-prefix'] %>',
                   '<%= request['dhcp']['v4-dhcp-default-pool-prefix-length'] %>');">dhcp</a>
            </td>
            </tr>
			<% i++; %>

			<% if ( typeof request['dhcp']['v4-dhcp-pools'] != 'undefined' )
            { %>
				<% var v4_dhcp_pools_node = i; %>
				<tr class="treegrid-<%= i %> treegrid-parent-<%= dhcp_node %>">
				<td>v4-dhcp-pool</td>
				</tr>
				<% i++; %>

                <% request['dhcp']['v4-dhcp-pools'].forEach(function(v4request)
                { %>
                    <tr class="treegrid-<%= i %> treegrid-parent-<%= dhcp_node %>">
                    <td>
                        <a href="javascript:v4_dhcp_pools(
                        '<%= svc_instance_id %>',
                        '<%= v4request['v4-dhcp-relay-next-hop-address'] %>',
                        '<%= v4request['v4-dhcp-pool-prefix'] %>',
                        '<%= v4request['v4-dhcp-pool-prefix-length'] %>',
                        '<%= v4request['v4-dhcp-relay-gateway-address'] %>');">v4-dhcp-pools</a>
                    </td>
                    </tr>
                    <% i++; %>

					<% if ( typeof v4request['excluded-v4-address'] != 'undefined' )
                    { %>
						<% var excluded_v4_address_node = i; %>
						<tr class="treegrid-<%= i %> treegrid-parent-<%= v4_dhcp_node %>">
							<td>exluded-v4-address</td>
						</tr>
						<% i++; %>

                        <% v4request['excluded-v4-addresses'].forEach(function(ex_request)
                        { %>
                            <tr class="treegrid-<%= i %> treegrid-parent-<%= excluded_v4_address_node %>">
                            <td>
                                <a href="javascript:excluded_v4_address(
                                '<%= svc_instance_id %>',
                                '<%= ex_request['excluded-v4-address'] %>');">excluded-v4-address</a>
                            </td>
                            </tr>
                            <% i++; %>
                        <% }); %>
                    <% } %>
                <% }); %>
        	<% } %>

			<% if ( typeof request['dhcp']['excluded-v4-dhcp-addresses-from-default-pool'] != 'undefined' )
            { %>
				<% var exc_v4_address_node = i; %>
				<tr class="treegrid-<%= i %> treegrid-parent-<%= dhcp_node %>">
				<td>excluded-v4-dhcp-addresses-from-default-pool</td>
				</tr>
				<% i++; %>
				
				<% request['dhcp']['excluded-v4-dhcp-addresses-from-default-pool'].forEach(function(ex_request)
                { %>
                    <tr class="treegrid-<%= i %> treegrid-parent-<%= exc_v4_address_node %>">
					<td>
                        <a href="javascript:excluded_v4_addresses_from_default_pool(
                        '<%= svc_instance_id %>',
                        '<%= ex_request['excluded-v4-address'] %>');">excluded-v4-dhcp-addresses-from-default-pool</a>
                    </td>
                    </tr>
                    </tr>
                    <% i++; %>
				<% }); %>
			<% } %>

			<% if ( typeof request['dhcp']['v6-dhcp-pools'] != 'undefined' )
            { %>
				<% var v6_dhcp_pools_node = i; %>
                <tr class="treegrid-<%= i %> treegrid-parent-<%= dhcp_node %>">
                <td>v6-dhcp-pool</td>
                </tr>
                <% i++; %>

                <% request['dhcp']['v6-dhcp-pools'].forEach(function(v6request)
                { %>
                    <tr class="treegrid-<%= i %> treegrid-parent-<%= dhcp_node %>">
                    <td>
                        <a href="javascript:v6_dhcp_pools(
                        '<%= svc_instance_id %>',
                        '<%= v6request['v6-dhcp-relay-next-hop-address'] %>',
                        '<%= v6request['v6-dhcp-pool-prefix'] %>',
                        '<%= v6request['v6-dhcp-pool-prefix-length'] %>',
                        '<%= v6request['v6-dhcp-relay-gateway-address'] %>');">v6-dhcp-pools</a>
                    </td>
                    </tr>
                    <% i++; %>

                    <% if ( typeof v4request['excluded-v6-addresses'] != 'undefined' )
                    { %>
                        <% var excluded_v6_address_node = i; %>
                        <tr class="treegrid-<%= i %> treegrid-parent-<%= v6_dhcp_node %>">
                            <td>exluded-v6-address</td>
                        </tr>
                        <% i++; %>

                        <% v6request['excluded-v6-addresses'].forEach(function(ex_request)
                        { %>
                            <tr class="treegrid-<%= i %> treegrid-parent-<%= excluded_v6_address_node %>">
                            <td>
                                <a href="javascript:excluded_v6_address(
                                '<%= svc_instance_id %>',
                                '<%= ex_request['excluded-v6-address'] %>');">excluded-v6-address</a>
                            </td>
                            </tr>
                            <% i++; %>
                        <% }); %>
                    <% } %>
                <% }); %>
			<% } %>

			<% if ( typeof request['dhcp']['excluded-v6-dhcp-addresses-from-default-pool'] != 'undefined' )
            { %>
				<% var exc_v6_address_node = i; %>
                <tr class="treegrid-<%= i %> treegrid-parent-<%= dhcp_node %>">
                <td>excluded-v6-dhcp-addresses-from-default-pool</td>
                </tr>
                <% i++; %>

                <% request['dhcp']['excluded-v6-dhcp-addresses-from-default-pool'].forEach(function(ex_request)
                { %>
                    <tr class="treegrid-<%= i %> treegrid-parent-<%= exc_v6_address_node %>">
                    <td>
                        <a href="javascript:excluded_v6_addresses_from_default_pool(
                        '<%= svc_instance_id %>',
                        '<%= ex_request['excluded-v6-address'] %>');">excluded-v6-dhcp-addresses-from-default-pool</a>
                    </td>
                    </tr>
                    </tr>
                    <% i++; %>
                <% }); %>
			<% } %>
		<% } %>

		<% if ( typeof request['firewall-lite'] != 'undefined' )
        { %>
			<% var firewall_lite_node = i; %>
			<tr class="treegrid-<%= i %> treegrid-parent-<%= root_node %>">
				<td>firewall-lite</td>
			</tr>
			<% i++; %>

			<tr class="treegrid-<%= i %> treegrid-parent-<%= firewall_lite_node %>">
            <td>
                <a href="javascript:firewall_lite(
                '<%= svc_instance_id %>',
				'<%= vr_designation %>',
                '<%= request['firewall-lite']['stateful-firewall-lite-v6-enabled'] %>',
                '<%= request['firewall-lite']['stateful-firewall-lite-v4-enabled'] %>');">firewall-lite</a>
            </td>
            </tr>
            <% i++; %>

			<% if ( typeof request['firewall-lite']['v6-firewall-packet-filters'] != 'undefined' )
            {
                var v6_firewall_packet_filters_node = i; %>
                <tr class="treegrid-<%= i %> treegrid-parent-<%= firewall_lite_node %>">
                    <td>v6-firewall-packet-filters</td>
                </tr>
                <% i++; %>

                <% request['firewall-lite']['v6-firewall-packet-filters'].forEach(function(v6request)
                { %>
                    <tr class="treegrid-<%= i %> treegrid-parent-<%= v6_firewall_packet_filters_node %>">
                    <td>
                        <a href="javascript:v6_firewall_packet_filters(
                                    '<%= svc_instance_id %>',
                                    '<%= v6request['v6-firewall-prefix'] %>',
                                    '<%= v6request['v6-firewall-prefix-length'] %>',
                                    '<%= v6request['allow-icmp-ping'] %>');">v6-firewall-packet-filters</a>
                    </td>
                    </tr>
                    <% i++; %>

                    <% if ( typeof v6request['udp-port-list'] != 'undefined' )
                    { %>
                        <% v6request['udp-port-list'].forEach(function(udp_request)
                        { %>
                            <tr class="treegrid-<%= i %> treegrid-parent-<%= v6_firewall_packet_filters_node %>">
                            <td>
                                <a href="javascript:udp_port_list(
                                '<%= svc_instance_id %>',
                                '<%= udp_request['port-number'] %>');">udp-port-list</a>
                            </td>
                            </tr>
                            <% i++; %>
                        <% }); %>
                    <% } %>
                    <% if ( typeof v6p_request['tcp-port-list'] != 'undefined' )
                    { %>
                        <% v6request['tcp-port-list'].forEach(function(tcp_request)
                        { %>
                            <tr class="treegrid-<%= i %> treegrid-parent-<%= v6_firewall_packet_filters_node %>">
                            <td>
                                <a href="javascript:tcp_port_list(
                                '<%= svc_instance_id %>',
                                '<%= tcp_request['port-number'] %>');">tcp-port-list</a>
                            </td>
                            </tr>
                            <% i++; %>
                        <% }); %>
                    <% } %>
                <% }); %>
            <% } %>
			<% if ( typeof request['firewall-lite']['v4-firewall-packet-filters'] != 'undefined' )
            {
                var v4_firewall_packet_filters_node = i; %>
                <tr class="treegrid-<%= i %> treegrid-parent-<%= firewall_lite_node %>">
                    <td>v4-firewall-packet-filters</td>
                </tr>
                <% i++; %>

                <% request['firewall-lite']['v4-firewall-packet-filters'].forEach(function(v4request)
                { %>
                    <tr class="treegrid-<%= i %> treegrid-parent-<%= v4_firewall_packet_filters_node %>">
                    <td>
                        <a href="javascript:v4_firewall_packet_filters(
                                    '<%= svc_instance_id %>',
                                    '<%= v4request['v4-firewall-prefix'] %>',
                                    '<%= v4request['v4-firewall-prefix-length'] %>',
                                    '<%= v4request['allow-icmp-ping'] %>');">v4-firewall-packet-filters</a>
                    </td>
                    </tr>
                    <% i++; %>

                    <% if ( typeof v4request['udp-port-list'] != 'undefined' )
                    { %>
                        <% v4request['udp-port-list'].forEach(function(udp_request)
                        { %>
                            <tr class="treegrid-<%= i %> treegrid-parent-<%= v4_firewall_packet_filters_node %>">
                            <td>
                                <a href="javascript:udp_port_list(
                                '<%= svc_instance_id %>',
                                '<%= udp_request['port-number'] %>');">udp-port-list</a>
                            </td>
                            </tr>
                            <% i++; %>
                        <% }); %>
                    <% } %>
                    <% if ( typeof v4p_request['tcp-port-list'] != 'undefined' )
                    { %>
                        <% v4request['tcp-port-list'].forEach(function(tcp_request)
                        { %>
                            <tr class="treegrid-<%= i %> treegrid-parent-<%= v4_firewall_packet_filters_node %>">
                            <td>
                                <a href="javascript:tcp_port_list(
                                '<%= svc_instance_id %>',
                                '<%= tcp_request['port-number'] %>');">tcp-port-list</a>
                            </td>
                            </tr>
                            <% i++; %>
                        <% }); %>
                    <% } %>
                <% }); %>
            <% } %>

		<% } %>

		<% if ( typeof request['static-routes'] != 'undefined' )
		{ 
			var static_route_node = i; %>
			<tr class="treegrid-<%= i %> treegrid-parent-<%= root_node %>">
        	<td>static-routes</td>
			</tr>
			<% i++; %>
            <% if ( typeof request['static-routes']['v6-static-routes'] != 'undefined' )
            { %>
				<% v6_static_route = i %>
				<tr class="treegrid-<%= i %> treegrid-parent-<%= static_route_node %>">
				<td>v6-static-routes</td>
				</tr>
				<% i++; %>
			
                <% request['static-routes']['v6-static-routes'].forEach(function(strequest){ %>
					<tr class="treegrid-<%= i %> treegrid-parent-<%= v6_static_route %>">
					<td>
						<a href="javascript:v6_static_routes(
                       	'<%= svc_instance_id %>',
                        '<%= strequest['v6-static-route-prefix'] %>',
                        '<%= strequest['v6-next-hop-address'] %>',
                        '<%= strequest['v6-static-route-prefix-length'] %>');">v6-static-routes</a>
					</td>
					</tr>
					<% i++; %>
                <% }); %>
            <% } %>
            <% if ( typeof request['static-routes']['v4-static-routes'] != 'undefined' )
            { %>
				<% v4_static_route = i %>
				<tr class="treegrid-<%= i %> treegrid-parent-<%= static_route_node %>">
				<td>v4-static-routes</td>
				</tr>
				<% i++; %>
                <% request['static-routes']['v4-static-routes'].forEach(function(v4request)
				{ %>
					<tr class="treegrid-<%= i %> treegrid-parent-<%= v4_static_route %>">
					<td>
						<a href="javascript:v4_static_routes(
                       	'<%= svc_instance_id %>',
                        '<%= v4request['v4-static-route-prefix'] %>',
                        '<%= v4request['v4-next-hop-address'] %>',
                        '<%= v4request['v4-static-route-prefix-length'] %>');">v4-static-routes</a>
					</td>
					</tr>
					<% i++; %>
                <% }); %>
			<% } %>
		<% } %>
		<% if ( typeof request['pat'] != 'undefined' )
        { %>
			<% var pat_node = i %>
			<tr class="treegrid-<%= i %> treegrid-parent-<%= root_node %>">
				<td>pat</td>
			</tr>
			<% i++; %>

			<tr class="treegrid-<%= i %> treegrid-parent-<%= pat_node %>">
			<td>
				<a href="javascript:pat(
               	'<%= svc_instance_id %>',
               	'<%= request['pat']['v4-pat-default-pool-prefix-length'] %>',
               	'<%= request['pat']['use-v4-default-pool'] %>',
               	'<%= request['pat']['v4-pat-enabled'] %>',
               	'<%= request['pat']['v4-pat-default-pool-prefix'] %>');">pat</a>
			</td>
			</tr>
			<% i++; %>

			<% if ( typeof request['pat']['v4-pat-pools'] != 'undefined' )
			{ 
				var pat_pools_node = i %>
				<tr class="treegrid-<%= i %> treegrid-parent-<%= pat_node %>">
					<td>v4-pat-pools</td>
				</tr>
				<% i++; %>

        		<% request['pat']['v4-pat-pools'].forEach(function(trequest)
				{ %>
				<tr class="treegrid-<%= i %> treegrid-parent-<%= pat_pools_node %>">
				<td>
					<a href="javascript:pat_pools(
                    '<%= svc_instance_id %>',
                    '<%= trequest['v4-pat-pool-next-hop-address'] %>',
                    '<%= trequest['v4-pat-pool-prefix-length'] %>',
                    '<%= trequest['v4-pat-pool-prefix'] %>');">v4-pat-pools</a>
				</td>
				</tr>
				<% }); %> 
				<% i++; %>
			
        	<% } %>
		<% } %>
		<% if ( typeof request['nat'] != 'undefined' )
        { %>
            <% var nat_node = i %>
            <tr class="treegrid-<%= i %> treegrid-parent-<%= root_node %>">
                <td>nat</td>
            </tr>
            <% i++; %>

            <tr class="treegrid-<%= i %> treegrid-parent-<%= nat_node %>">
            <td>
                <a href="javascript:nat(
                '<%= svc_instance_id %>',
                '<%= request['pat']['v4-nat-enabled'] %>');">nat</a>
            </td>
            </tr>
            <% i++; %>

            <% if ( typeof request['nat']['v4-nat-mapping-entries'] != 'undefined' )
            {
                var nat_mapping_node = i %>
                <tr class="treegrid-<%= i %> treegrid-parent-<%= nat_node %>">
                    <td>v4-nat-mapping-entries</td>
                </tr>
                <% i++; %>

                <% request['nat']['v4-nat-mapping-entries'].forEach(function(trequest)
                { %>
                <tr class="treegrid-<%= i %> treegrid-parent-<%= nat_mapping_node %>">
                <td>
                    <a href="javascript:v4_nat_mapping_entries(
                    '<%= svc_instance_id %>',
                    '<%= trequest['v4-nat-external'] %>',
                    '<%= trequest['v4-nat-next-hop-address'] %>',
                    '<%= trequest['v4-nat-internal'] %>');">v4-nat-mapping-entries</a>
                </td>
                </tr>
                <% }); %>
                <% i++; %>

            <% } %>
        <% } %>

		<% if ( (typeof request['v4-public-lan-prefixes'] != 'undefined') && (typeof request['v4-public-lan-prefixes']['t-provided-v4-lan-public-prefixes'] != 'undefined') )
        { %>
        	<% request['v4-public-lan-prefixes']['t-provided-v4-lan-public-prefixes'].forEach(function(trequest){ 
				var v4_public_root = i; %>
				<tr class="treegrid-<%= i %> treegrid-parent-<%= root_node %>">
				<td>v4-public-lan-prefixes</td>
				</tr>
				<% i++; %>
				<tr class="treegrid-<%= i %> treegrid-parent-<%= v4_public_root %>">
				<td>
					<a href="javascript:t_provided_v4_prefixes(
                    '<%= svc_instance_id %>',
                    '<%= trequest['request-index'] %>',
                    '<%= trequest['v4-lan-public-prefix-length'] %>',
                    '<%= trequest['v4-lan-public-prefix'] %>');">t-provided-v4-lan-public-prefixes</a>
				</td>
				</tr>
				<% i++; %>
            <% }); %>
        <% } %>
		<% }); 
	} 
} else { %>
			<div><pre>no data</pre></div>
<% } %>
</table>
</div>
</div>

   <% include ../partials/vr_lan_interface %>
   <% include ../partials/dhcp %>
   <% include ../partials/v4_dhcp_pools %>
   <% include ../partials/v6_dhcp_pools %>
   <% include ../partials/excluded_v4_address %>
   <% include ../partials/excluded_v4_address_from_default_pool %>
   <% include ../partials/excluded_v6_address_from_default_pool %>
   <% include ../partials/t_provided_v6_lan_public_prefixes %>
   <% include ../partials/firewall_lite %>
   <% include ../partials/v6_static_routes %>
   <% include ../partials/v4_static_routes %>
   <% include ../partials/pat %>
   <% include ../partials/pat_pools %>
   <% include ../partials/nat %>
   <% include ../partials/v4_nat_mapping_entries %>
   <% include ../partials/t_provided_v4_lan_public_prefixes %>
   <% include ../partials/v6_firewall_packet_filters %>
   <% include ../partials/v4_firewall_packet_filters %>
   <% include ../partials/udp_port_list %>
   <% include ../partials/tcp_port_list %>
   <footer>
       <% include ../partials/footer %>
   </footer>
    
<script type="text/javascript">

$(document).ready(function() {
        $('.tree').treegrid( { initialState: 'collapsed' } );
});

function excluded_v4_addresses_from_default_pool(svc_instance_id, excluded_v4_address)
{
    document.getElementById('svc_instance_id').value = svc_instance_id;
    var lvalue = document.getElementById('excluded_v4_address_from_default_pool');
    if( excluded_v4_address != 'undefined' ){
        lvalue.value=excluded_v4_address;
    } else {
        lvalue.value='';
    }
    $('#excluded-v4-address-from-default-pool-modal').modal('show');
}
function excluded_v6_addresses_from_default_pool(svc_instance_id, excluded_v6_address)
{
    document.getElementById('svc_instance_id').value = svc_instance_id;
    var lvalue = document.getElementById('excluded_v6_address');
    if( excluded_v6_address != 'undefined' ){
        lvalue.value=excluded_v6_address;
    } else {
        lvalue.value='';
    }
    $('#excluded-v6-address-modal').modal('show');
}
function excluded_v4_addresses_from_default_pool(svc_instance_id, excluded_v4_address)
{
    document.getElementById('svc_instance_id').value = svc_instance_id;
    var lvalue = document.getElementById('excluded_v4_address');
    if( excluded_v4_address != 'undefined' ){
        lvalue.value=excluded_v4_address;
    } else {
        lvalue.value='';
    }
    $('#excluded-v4-address-modal').modal('show');
}
function exluded_v4_address(svc_instance_id, excluded_v4_address)
{
    document.getElementById('svc_instance_id').value = svc_instance_id;
    var lvalue = document.getElementById('excluded_v4_address');
    if( excluded_v4_address != 'undefined' ){
        lvalue.value=excluded_v4_address;
    } else {
        lvalue.value='';
    }
    $('#excluded-v4-address-modal').modal('show');
}

function v6_dhcp_pools(svc_instance_id,v6_dhcp_relay_next_hop_address,v6_dhcp_pool_prefix,v6_dhcp_pool_prefix_length,v6_dhcp_relay_gateway_address)
{
    document.getElementById('svc_instance_id').value = svc_instance_id;
    var lvalue = document.getElementById('v6_dhcp_relay_next_hop_address');
    if( v6_dhcp_relay_next_hop_address != 'undefined' ){
        lvalue.value=v6_dhcp_relay_next_hop_address;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v6_dhcp_pool_prefix');
    if( v6_dhcp_pool_prefix != 'undefined' ){
        lvalue.value=v6_dhcp_pool_prefix;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v6_dhcp_pool_prefix_length');
    if( v6_dhcp_pool_prefix_length != 'undefined' ){
        lvalue.value=v6_dhcp_pool_prefix_length;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v6_dhcp_relay_gateway_address');
    if( v6_dhcp_relay_gateway_address != 'undefined' ){
        lvalue.value=v6_dhcp_relay_gateway_address;
    } else {
        lvalue.value='';
    }
    $('#v6-dhcp-pools-modal').modal('show');
}

function v4_dhcp_pools(svc_instance_id,v4_dhcp_relay_next_hop_address,v4_dhcp_pool_prefix,v4_dhcp_pool_prefix_length,v4_dhcp_relay_gateway_address)
{
    document.getElementById('svc_instance_id').value = svc_instance_id;
    var lvalue = document.getElementById('v4_dhcp_relay_next_hop_address');
    if( v4_dhcp_relay_next_hop_address != 'undefined' ){
        lvalue.value=v4_dhcp_relay_next_hop_address;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v4_dhcp_pool_prefix');
    if( v4_dhcp_pool_prefix != 'undefined' ){
        lvalue.value=v4_dhcp_pool_prefix;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v4_dhcp_pool_prefix_length');
    if( v4_dhcp_pool_prefix_length != 'undefined' ){
        lvalue.value=v4_dhcp_pool_prefix_length;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v4_dhcp_relay_gateway_address');
    if( v4_dhcp_relay_gateway_address != 'undefined' ){
        lvalue.value=v4_dhcp_relay_gateway_address;
    } else {
        lvalue.value='';
    }
    $('#v4-dhcp-pools-modal').modal('show');
}

function dhcp(svc_instance_id,use_v4_default_pool,use_v6_default_pool,v4_dhcp_server_enabled,v6_dhcp_server_enabled,v6_dhcp_default_pool_prefix,v6_dhcp_default_pool_prefix_length,v4_dhcp_default_pool_prefix,v4_dhcp_default_pool_prefix_length)
{
    document.getElementById('svc_instance_id').value = svc_instance_id;
    var lvalue = document.getElementById('use_v4_default_pool');
    if( use_v4_default_pool != 'undefined' ){
        lvalue.value=use_v4_default_pool;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('use_v6_default_pool');
    if( use_v6_default_pool != 'undefined' ){
        lvalue.value=use_v6_default_pool;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v4_dhcp_server_enabled');
    if( v4_dhcp_server_enabled != 'undefined' ){
        lvalue.value=v4_dhcp_server_enabled;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v6_dhcp_server_enabled');
    if( v6_dhcp_server_enabled != 'undefined' ){
        lvalue.value=v6_dhcp_server_enabled;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v6_dhcp_default_pool_prefix');
    if( v6_dhcp_default_pool_prefix != 'undefined' ){
        lvalue.value=v6_dhcp_default_pool_prefix;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v6_dhcp_default_pool_prefix_length');
    if( v6_dhcp_default_pool_prefix_length != 'undefined' ){
        lvalue.value=v6_dhcp_default_pool_prefix_length;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v4_dhcp_default_pool_prefix');
    if( v4_dhcp_default_pool_prefix != 'undefined' ){
        lvalue.value=v4_dhcp_default_pool_prefix;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v4_dhcp_default_pool_prefix_length');
    if( v4_dhcp_default_pool_prefix_length != 'undefined' ){
        lvalue.value=v4_dhcp_default_pool_prefix_length;
    } else {
        lvalue.value='';
    }
    $('#dhcp-modal').modal('show');
}

function tcp_port_list(svc_instance_id,tcp_port_number)
{
	document.getElementById('svc_instance_id').value = svc_instance_id;
	var lvalue = document.getElementById('tcp_port_number');
    if( tcp_port_number != 'undefined' ){
    	lvalue.value=tcp_port_number;
    } else {
    	lvalue.value='';
	}
    $('#tcp-port-list-modal').modal('show');
}
function udp_port_list(svc_instance_id,udp_port_number)
{
	document.getElementById('svc_instance_id').value = svc_instance_id;
	var lvalue = document.getElementById('udp_port_number');
    if( udp_port_number != 'undefined' ){
    	lvalue.value=udp_port_number;
    } else {
    	lvalue.value='';
	}
    $('#udp-port-list-modal').modal('show');
}
function v4_firewall_packet_filters(svc_instance_id,v4_firewall_prefix,v4_firewall_prefix_length,v4_allow_icmp_ping)
{
    document.getElementById('svc_instance_id').value = svc_instance_id;
    var lvalue = document.getElementById('v4_firewall_prefix');
    if( v4_firewall_prefix != 'undefined' ){
        lvalue.value=v4_firewall_prefix;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v4_firewall_prefix_length');
    if( v4_firewall_prefix_length != 'undefined' ){
        lvalue.value=v4_firewall_prefix_length;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v4_allow_icmp_ping');
    if( v4_allow_icmp_ping != 'undefined' ){
        lvalue.value=v4_allow_icmp_ping;
    } else {
        lvalue.value='';
    }
    $('#v4-firewall-packet-filters-modal').modal('show');
}

function v6_firewall_packet_filters(svc_instance_id,v6_firewall_prefix,v6_firewall_prefix_length,v6_allow_icmp_ping)
{
	document.getElementById('svc_instance_id').value = svc_instance_id;
	var lvalue = document.getElementById('v6_firewall_prefix');
    if( v6_firewall_prefix != 'undefined' ){
    	lvalue.value=v6_firewall_prefix;
    } else {
    	lvalue.value='';
	}
	lvalue = document.getElementById('v6_firewall_prefix_length');
    if( v6_firewall_prefix_length != 'undefined' ){
    	lvalue.value=v6_firewall_prefix_length;
    } else {
    	lvalue.value='';
	}
	lvalue = document.getElementById('v6_allow_icmp_ping');
    if( v6_allow_icmp_ping != 'undefined' ){
    	lvalue.value=v6_allow_icmp_ping;
    } else {
    	lvalue.value='';
	}
    $('#v6-firewall-packet-filters-modal').modal('show');
} function nat(svc_instance_id,v4_nat_enabled) {
	document.getElementById('svc_instance_id').value = svc_instance_id;
	var lvalue = document.getElementById('v4_nat_enabled');
    if( v4_nat_enabled != 'undefined' ){
    	lvalue.value=v4_nat_enabled;
    } else {
    	lvalue.value='';
	}
    $('#nat-modal').modal('show');
}
function v4_nat_mapping_entries(svc_instance_id,v4_nat_external,v4_nat_next_hop_address,v4_nat_internal)
{
	document.getElementById('svc_instance_id').value = svc_instance_id;
	var lvalue = document.getElementById('v4_nat_external');
    if( v4_nat_external != 'undefined' ){
    	lvalue.value=v4_nat_external;
    } else {
    	lvalue.value='';
	}
	lvalue = document.getElementById('v4_nat_next_hop_address');
    if( v4_nat_next_hop_address != 'undefined' ){
    	lvalue.value=v4_nat_next_hop_address;
    } else {
    	lvalue.value='';
	}
	lvalue = document.getElementById('v4_nat_internal');
    if( v4_nat_internal != 'undefined' ){
    	lvalue.value=v4_nat_internal;
    } else {
    	lvalue.value='';
	}
    $('#v4-nat-mapping-entries-modal').modal('show');
}
function pat_pools(svc_instance_id,v4_pat_pool_next_hop_address,v4_pat_pool_prefix_length,v4_pat_pool_prefix)
{
	document.getElementById('svc_instance_id').value = svc_instance_id;
	var lvalue = document.getElementById('v4_pat_pool_next_hop_address');
    if( v4_pat_pool_next_hop_address != 'undefined' ){
    	lvalue.value=v4_pat_pool_next_hop_address;
    } else {
    	lvalue.value='';
	}
	lvalue = document.getElementById('v4_pat_pool_prefix_length');
    if( v4_pat_pool_prefix_length != 'undefined' ){
    	lvalue.value=v4_pat_pool_prefix_length;
    } else {
    	lvalue.value='';
	}
	lvalue = document.getElementById('v4_pat_pool_prefix');
    if( v4_pat_pool_prefix != 'undefined' ){
    	lvalue.value=v4_pat_pool_prefix;
    } else {
    	lvalue.value='';
	}
    $('#pat-pools-modal').modal('show');
}
function pat(svc_instance_id,v4_pat_default_pool_prefix_length,use_v4_default_pool,v4_pat_enabled,v4_pat_default_pool_prefix)
{
	document.getElementById('svc_instance_id').value = svc_instance_id;
	var lvalue = document.getElementById('v4_pat_default_pool_prefix_length');
    if( v4_pat_default_pool_prefix_length != 'undefined' ){
    	lvalue.value=v4_pat_default_pool_prefix_length;
    } else {
    	lvalue.value='';
	}

	lvalue = document.getElementById('use_v4_default_pool');
    if( use_v4_default_pool != 'undefined' ){
    	lvalue.value = use_v4_default_pool;
    } else {
    	lvalue.value = '';
    }

	lvalue = document.getElementById('v4_pat_enabled');
    if( v4_pat_enabled != 'undefined' ){
    	lvalue.value = v4_pat_enabled;
    } else {
    	lvalue.value = '';
	}

	lvalue = document.getElementById('v4_pat_default_pool_prefix');
    if( v4_pat_default_pool_prefix != 'undefined' ){
    	lvalue.value = v4_pat_default_pool_prefix;
    } else {
    	lvalue.value = '';
	}
    $('#pat-modal').modal('show');
}
function v4_static_routes(svc_instance_id,v4_static_route_prefix,static_v4_next_hop_address,v4_static_route_prefix_length)
{
	document.getElementById('svc_instance_id').value = svc_instance_id;
    var lvalue = document.getElementById('v4_static_route_prefix');
    if( v4_static_route_prefix != 'undefined' ){
        lvalue.value=v4_static_route_prefix;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('static_v4_next_hop_address');
    if( static_v4_next_hop_address != 'undefined' ){
        lvalue.value=static_v4_next_hop_address;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v4_static_route_prefix_length');
    if( v4_static_route_prefix_length != 'undefined' ){
        lvalue.value=v4_static_route_prefix_length;
    } else {
        lvalue.value='';
    }
    $('#v4-static-routes-modal').modal('show');
}

function v6_static_routes(svc_instance_id,v6_static_route_prefix,static_v6_next_hop_address,v6_static_route_prefix_length)
{
	document.getElementById('svc_instance_id').value = svc_instance_id;
    var lvalue = document.getElementById('v6_static_route_prefix');
    if( v6_static_route_prefix != 'undefined' ){
        lvalue.value=v6_static_route_prefix;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('static_v6_next_hop_address');
    if( static_v6_next_hop_address != 'undefined' ){
        lvalue.value=static_v6_next_hop_address;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v6_static_route_prefix_length');
    if( v6_static_route_prefix_length != 'undefined' ){
        lvalue.value=v6_static_route_prefix_length;
    } else {
        lvalue.value='';
    }
    $('#v6-static-routes-modal').modal('show');
}
function firewall_lite(svc_instance_id,firewall_lite_vr_designation,stateful_firewall_lite_v4_enabled,stateful_firewall_lite_v6_enabled)
{
	document.getElementById('svc_instance_id').value = svc_instance_id;
	document.getElementById('firewall_lite_vr_designation').value = firewall_lite_vr_designation;
    var lvalue = document.getElementById('stateful_firewall_lite_v4_enabled');
    if( stateful_firewall_lite_v4_enabled != 'undefined' ){
        lvalue.value=stateful_firewall_lite_v4_enabled;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('stateful_firewall_lite_v6_enabled');
    if( stateful_firewall_lite_v6_enabled != 'undefined' ){
        lvalue.value=stateful_firewall_lite_v6_enabled;
    } else {
        lvalue.value='';
    }
    $('#firewall-lite-modal').modal('show');
}
function t_provided_v6_prefixes(svc_instance_id,v6_request_index,v6_lan_public_prefix_length,v6_lan_public_prefix)
{
	document.getElementById('svc_instance_id').value = svc_instance_id;
	var lvalue = document.getElementById('v6_request_index'); 
	if( v6_request_index != 'undefined' ){
		lvalue.value=v6_request_index;
	} else {
		lvalue.value='';
	}
	lvalue = document.getElementById('v6_lan_public_prefix_length'); 
	if( v6_lan_public_prefix_length != 'undefined' ){
		lvalue.value=v6_lan_public_prefix_length;
	} else {
		lvalue.value='';
	}
	lvalue = document.getElementById('v6_lan_public_prefix'); 
	if( v6_lan_public_prefix != 'undefined' ){
		lvalue.value=v6_lan_public_prefix;
	} else {
		lvalue.value='';
	}
	$('#t-provided-v6-lan-public-prefixes-modal').modal('show');
}
function t_provided_v4_prefixes(svc_instance_id,v4_request_index,v4_lan_public_prefix_length,v4_lan_public_prefix)
{
	document.getElementById('svc_instance_id').value = svc_instance_id;
    var lvalue = document.getElementById('v4_request_index');
    if( v4_request_index != 'undefined' ){
        lvalue.value=v4_request_index;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v4_lan_public_prefix_length');
    if( v4_lan_public_prefix_length != 'undefined' ){
        lvalue.value=v4_lan_public_prefix_length;
    } else {
        lvalue.value='';
    }
    lvalue = document.getElementById('v4_lan_public_prefix');
    if( v4_lan_public_prefix != 'undefined' ){
        lvalue.value=v4_lan_public_prefix;
    } else {
        lvalue.value='';
    }
    $('#t-provided-v4-lan-public-prefixes-modal').modal('show');
}

function vrlan_interface(svc_instance_id,vr_designation,v6_vr_lan_prefix, v6_vr_lan_prefix_length, v6_vce_wan_address, v4_vr_lan_prefix_length, v4_vr_lan_prefix, t_defaulted_v6_vrlan,v4_vce_loopback_address)
{
	document.getElementById('svc_instance_id').value = svc_instance_id;
	var lvalue = document.getElementById('vr_designation'); 
	if( vr_designation != 'undefined' ){
		lvalue.value=vr_designation;
	} else {
		lvalue.value='';
	}
	lvalue = document.getElementById('v6_vr_lan_prefix'); 
	if( v6_vr_lan_prefix != 'undefined' ){
		lvalue.value=v6_vr_lan_prefix;
	} else {
		lvalue.value='';
	}
	lvalue = document.getElementById('v6_vr_lan_prefix_length'); 
	if( v6_vr_lan_prefix_length != 'undefined' ){
		lvalue.value=v6_vr_lan_prefix_length;
	} else {
		lvalue.value='';
	}
	lvalue = document.getElementById('v6_vce_wan_address'); 
	if( v6_vce_wan_address != 'undefined' ){
		lvalue.value=v6_vce_wan_address;
	} else {
		lvalue.value='';
	}
	lvalue = document.getElementById('v4_vr_lan_prefix_length'); 
	if( v4_vr_lan_prefix_length != 'undefined' ){
		lvalue.value=v4_vr_lan_prefix_length;
	} else {
		lvalue.value='';
	}
	lvalue = document.getElementById('v4_vr_lan_prefix'); 
	if( v4_vr_lan_prefix != 'undefined' ){
		lvalue.value=v4_vr_lan_prefix;
	} else {
		lvalue.value='';
	}
	lvalue = document.getElementById('v4_vce_loopback_address'); 
	if( v4_vce_loopback_address != 'undefined' ){
		lvalue.value=v4_vce_loopback_address;
	} else {
		lvalue.value='';
	}
	lvalue = document.getElementById('t_defaulted_v6_vrlan'); 
	if( t_defaulted_v6_vrlan != 'undefined' ){
		lvalue.value=t_defaulted_v6_vrlan;
	} else {
		lvalue.value='';
	}
	$('#vr-lan-interface-modal').modal('show');
}
</script>

</body>
</html>