當前位置: 首頁>>代碼示例>>Python>>正文


Python Activity.__init__方法代碼示例

本文整理匯總了Python中ryu.services.protocols.bgp.base.Activity.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python Activity.__init__方法的具體用法?Python Activity.__init__怎麽用?Python Activity.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ryu.services.protocols.bgp.base.Activity的用法示例。


在下文中一共展示了Activity.__init__方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from ryu.services.protocols.bgp.base import Activity [as 別名]
# 或者: from ryu.services.protocols.bgp.base.Activity import __init__ [as 別名]
 def __init__(self):
     FlexinetPeer.__init__(self)
     Activity.__init__(self, name='NETWORK_CONTROLLER')
     # Outstanding requests, i.e. requests for which we are yet to receive
     # response from peer. We currently do not have any requests going out.
     self._outstanding_reqs = {}
     self._rpc_session = None
開發者ID:Annjana,項目名稱:ryu,代碼行數:9,代碼來源:net_ctrl.py

示例2: __init__

# 需要導入模塊: from ryu.services.protocols.bgp.base import Activity [as 別名]
# 或者: from ryu.services.protocols.bgp.base.Activity import __init__ [as 別名]
 def __init__(self, socket, signal_bus, is_reactive_conn=False):
     # Validate input.
     if socket is None:
         raise ValueError('Invalid arguments passed.')
     self._remotename = self.get_remotename(socket)
     self._localname = self.get_localname(socket)
     activity_name = ('BgpProtocol %s, %s, %s' % (is_reactive_conn,
                                                  self._remotename,
                                                  self._localname))
     Activity.__init__(self, name=activity_name)
     # Intialize instance variables.
     self._peer = None
     self._recv_buff = ''
     self._socket = socket
     self._socket.setsockopt(IPPROTO_TCP, TCP_NODELAY, 1)
     self._sendlock = semaphore.Semaphore()
     self._signal_bus = signal_bus
     self._holdtime = None
     self._keepalive = None
     self._expiry = None
     # Add socket to Activity's socket container for managing it.
     if is_reactive_conn:
         self._asso_socket_map['passive_conn'] = self._socket
     else:
         self._asso_socket_map['active_conn'] = self._socket
     self._open_msg = None
     self.state = BGP_FSM_CONNECT
     self._is_reactive = is_reactive_conn
     self.sent_open_msg = None
     self.recv_open_msg = None
     self._is_bound = False
開發者ID:John-Lin,項目名稱:ryu,代碼行數:33,代碼來源:speaker.py

示例3: __init__

# 需要導入模塊: from ryu.services.protocols.bgp.base import Activity [as 別名]
# 或者: from ryu.services.protocols.bgp.base.Activity import __init__ [as 別名]
 def __init__(self, socket, signal_bus, is_reactive_conn=False):
     # Validate input.
     if socket is None:
         raise ValueError("Invalid arguments passed.")
     activity_name = "BgpProtocol %s, %s, %s" % (is_reactive_conn, socket.getpeername(), socket.getsockname())
     Activity.__init__(self, name=activity_name)
     # Intialize instance variables.
     self._peer = None
     self._recv_buff = ""
     self._socket = socket
     self._signal_bus = signal_bus
     self._holdtime = None
     self._keepalive = None
     self._expiry = None
     # Add socket to Activity's socket container for managing it.
     if is_reactive_conn:
         self._asso_socket_map["passive_conn"] = self._socket
     else:
         self._asso_socket_map["active_conn"] = self._socket
     self._open_msg = None
     self.state = BGP_FSM_CONNECT
     self._is_reactive = is_reactive_conn
     self.sent_open_msg = None
     self.recv_open_msg = None
     self._is_bound = False
開發者ID:prashanthvarma,項目名稱:ryu,代碼行數:27,代碼來源:speaker.py

示例4: __init__

# 需要導入模塊: from ryu.services.protocols.bgp.base import Activity [as 別名]
# 或者: from ryu.services.protocols.bgp.base.Activity import __init__ [as 別名]
 def __init__(self, core_service, work_units_per_cycle=None):
     Activity.__init__(self)
     # Back pointer to core service instance that created this processor.
     self._core_service = core_service
     self._dest_queue = BgpProcessor._DestQueue()
     self._rtdest_queue = BgpProcessor._DestQueue()
     self.dest_que_evt = EventletIOFactory.create_custom_event()
     self.work_units_per_cycle = work_units_per_cycle or BgpProcessor.MAX_DEST_PROCESSED_PER_CYCLE
開發者ID:shinpeimuraoka,項目名稱:ryu,代碼行數:10,代碼來源:processor.py

示例5: __init__

# 需要導入模塊: from ryu.services.protocols.bgp.base import Activity [as 別名]
# 或者: from ryu.services.protocols.bgp.base.Activity import __init__ [as 別名]
    def __init__(self, common_conf, neighbors_conf, vrfs_conf):
        self._common_config = common_conf
        self._neighbors_conf = neighbors_conf
        self._vrfs_conf = vrfs_conf

        Activity.__init__(self, name='core_service')

        self._signal_bus = BgpSignalBus()
        self._init_signal_listeners()

        self._rt_mgr = RouteTargetManager(self, neighbors_conf, vrfs_conf)

        self._table_manager = core_managers.TableCoreManager(
            self, common_conf
        )

        self._importmap_manager = core_managers.ImportMapManager()

        # Autonomous system number of this BGP speaker.
        self._asn = self._common_config.local_as

        self._peer_manager = core_managers.PeerManager(
            self,
            self._neighbors_conf,
        )

        # Initialize sink for flexinet-peers
        self._sinks = set()

        self._conf_manager = core_managers.ConfigurationManager(
            self, common_conf, vrfs_conf, neighbors_conf
        )

        # Register Flexinet peer sink
        from ryu.services.protocols.bgp.net_ctrl import NET_CONTROLLER

        self.register_flexinet_sink(NET_CONTROLLER)

        # State per route family
        # Key: RouteFamily
        # Value: BgpInstanceRf
        self.rf_state = {}

        # Protocol factories for pro-active and re-active bgp-sessions.
        self.client_factory = None
        self.server_factory = None

        # Key: RD:Next_Hop
        # Value: label
        self._next_hop_label = {}

        # BgpProcessor instance (initialized during start)
        self._bgp_processor = None

        # BMP clients key: (host, port) value: BMPClient instance
        self.bmpclients = {}
開發者ID:Aminiok,項目名稱:ryu,代碼行數:58,代碼來源:core.py


注:本文中的ryu.services.protocols.bgp.base.Activity.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。