Applies VC mappings

        :param mappings: mappings (dict)

def set_mappings(self, mappings):
        """
        Applies VC mappings

        :param mappings: mappings (dict)
        """

        pvc_entry = re.compile(r"""^([0-9]*):([0-9]*):([0-9]*)$""")
        for source, destination in mappings.items():
            if not isinstance(source, str) or not isinstance(destination, str):
                raise DynamipsError("Invalid ATM mappings")
            match_source_pvc = pvc_entry.search(source)
            match_destination_pvc = pvc_entry.search(destination)
            if match_source_pvc and match_destination_pvc:
                # add the virtual channels
                source_port, source_vpi, source_vci = map(int, match_source_pvc.group(1, 2, 3))
                destination_port, destination_vpi, destination_vci = map(int, match_destination_pvc.group(1, 2, 3))
                if self.has_port(destination_port):
                    if (source_port, source_vpi, source_vci) not in self._active_mappings and \
                       (destination_port, destination_vpi, destination_vci) not in self._active_mappings:
                        log.info('ATM switch "{name}" [{id}]: mapping VCC between port {source_port} VPI {source_vpi} VCI {source_vci} and port {destination_port} VPI {destination_vpi} VCI {destination_vci}'.format(name=self._name,
                                                                                                                                                                                                                       id=self._id,
                                                                                                                                                                                                                       source_port=source_port,
                                                                                                                                                                                                                       source_vpi=source_vpi,
                                                                                                                                                                                                                       source_vci=source_vci,
                                                                                                                                                                                                                       destination_port=destination_port,
                                                                                                                                                                                                                       destination_vpi=destination_vpi,
                                                                                                                                                                                                                       destination_vci=destination_vci))
                        yield from self.map_pvc(source_port, source_vpi, source_vci, destination_port, destination_vpi, destination_vci)
                        yield from self.map_pvc(destination_port, destination_vpi, destination_vci, source_port, source_vpi, source_vci)
            else:
                # add the virtual paths
                source_port, source_vpi = map(int, source.split(':'))
                destination_port, destination_vpi = map(int, destination.split(':'))
                if self.has_port(destination_port):
                    if (source_port, source_vpi) not in self._active_mappings and (destination_port, destination_vpi) not in self._active_mappings:
                        log.info('ATM switch "{name}" [{id}]: mapping VPC between port {source_port} VPI {source_vpi} and port {destination_port} VPI {destination_vpi}'.format(name=self._name,
                                                                                                                                                                                id=self._id,
                                                                                                                                                                                source_port=source_port,
                                                                                                                                                                                source_vpi=source_vpi,
                                                                                                                                                                                destination_port=destination_port,
                                                                                                                                                                                destination_vpi=destination_vpi))
                        yield from self.map_vp(source_port, source_vpi, destination_port, destination_vpi)
                        yield from self.map_vp(destination_port, destination_vpi, source_port, source_vpi)