def _send_outgoing_route(self, outgoing_route):
        """Constructs `Update` message from given `outgoing_route` and sends
        it to peer.

        Also, checks if any policies prevent sending this message.
        Populates Adj-RIB-out with corresponding `SentRoute`.
        """

        path = outgoing_route.path
        block, blocked_cause = self._apply_out_filter(path)

        nlri_str = outgoing_route.path.nlri.formatted_nlri_str
        sent_route = SentRoute(outgoing_route.path, self, block)
        self._adj_rib_out[nlri_str] = sent_route
        self._signal_bus.adj_rib_out_changed(self, sent_route)

        # TODO(PH): optimized by sending several prefixes per update.
        # Construct and send update message.
        if not block:
            update_msg = self._construct_update(outgoing_route)
            self._protocol.send(update_msg)
            # Collect update statistics.
            self.state.incr(PeerCounterNames.SENT_UPDATES)
        else:
            LOG.debug('prefix : %s is not sent by filter : %s',
                      path.nlri, blocked_cause)

        # We have to create sent_route for every OutgoingRoute which is
        # not a withdraw or was for route-refresh msg.
        if (not outgoing_route.path.is_withdraw and
                not outgoing_route.for_route_refresh):
            # Update the destination with new sent route.
            tm = self._core_service.table_manager
            tm.remember_sent_route(sent_route)
def _send_outgoing_route ( self , outgoing_route ) : path = outgoing_route . path block , blocked_cause = self . _apply_out_filter ( path ) nlri_str = outgoing_route . path . nlri . formatted_nlri_str sent_route = SentRoute ( outgoing_route . path , self , block ) self . _adj_rib_out [ nlri_str ] = sent_route self . _signal_bus . adj_rib_out_changed ( self , sent_route ) if not block : update_msg = self . _construct_update ( outgoing_route ) self . _protocol . send ( update_msg ) self . state . incr ( PeerCounterNames . SENT_UPDATES ) else : LOG . debug ( 'prefix : %s is not sent by filter : %s' , path . nlri , blocked_cause ) if ( not outgoing_route . path . is_withdraw and not outgoing_route . for_route_refresh ) : tm = self . _core_service . table_manager tm . remember_sent_route ( sent_route )
Constructs `Update` message from given `outgoing_route` and sends
        it to peer.

        Also, checks if any policies prevent sending this message.
        Populates Adj-RIB-out with corresponding `SentRoute`.