Applies VC mappings

        :param mappings: mappings (dict)

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

        :param mappings: mappings (dict)
        """

        for source, destination in mappings.items():
            if not isinstance(source, str) or not isinstance(destination, str):
                raise DynamipsError("Invalid Frame-Relay mappings")
            source_port, source_dlci = map(int, source.split(':'))
            destination_port, destination_dlci = map(int, destination.split(':'))
            if self.has_port(destination_port):
                if (source_port, source_dlci) not in self._active_mappings and (destination_port, destination_dlci) not in self._active_mappings:
                    log.info('Frame Relay switch "{name}" [{id}]: mapping VC between port {source_port} DLCI {source_dlci} and port {destination_port} DLCI {destination_dlci}'.format(name=self._name,
                                                                                                                                                                                       id=self._id,
                                                                                                                                                                                       source_port=source_port,
                                                                                                                                                                                       source_dlci=source_dlci,
                                                                                                                                                                                       destination_port=destination_port,
                                                                                                                                                                                       destination_dlci=destination_dlci))

                    yield from self.map_vc(source_port, source_dlci, destination_port, destination_dlci)
                    yield from self.map_vc(destination_port, destination_dlci, source_port, source_dlci)