# Path: netjsonconfig/backends/openwrt/schema.py



from collections import OrderedDict
from copy import deepcopy
from ipaddress import ip_address, ip_interface
from ..schema import schema
from .base import OpenWrtConverter



class Interfaces(OpenWrtConverter):
    netjson_key = 'interfaces'
    intermediate_key = 'network'
    _uci_types = ['interface', 'globals']

    def to_intermediate_loop(self, block, result, index=None):
        uci_name = self._get_uci_name(block.get('network') or block['name'])
        address_list = self.__intermediate_addresses(block)
        interface = self.__intermediate_interface(block, uci_name)
        # create one or more "config interface" UCI blocks
        i = 1

# Path: netjsonconfig/backends/openwrt/schema.py



# Path: netjsonconfig/backends/openwrt/converters/interfaces.py
from collections import OrderedDict
from copy import deepcopy
from ipaddress import ip_address, ip_interface
from ..schema import schema
from .base import OpenWrtConverter




class Interfaces(OpenWrtConverter):
    netjson_key = 'interfaces'
    intermediate_key = 'network'
    _uci_types = ['interface', 'globals']

    def to_intermediate_loop(self, block, result, index=None):
        uci_name = self._get_uci_name(block.get('network') or block['name'])
        address_list = self.__intermediate_addresses(block)
        interface = self.__intermediate_interface(block, uci_name)
        # create one or more "config interface" UCI blocks
        i = 1

        for address in address_list: