本文整理匯總了Python中scapy.automaton.ATMT.receive_condition方法的典型用法代碼示例。如果您正苦於以下問題:Python ATMT.receive_condition方法的具體用法?Python ATMT.receive_condition怎麽用?Python ATMT.receive_condition使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類scapy.automaton.ATMT
的用法示例。
在下文中一共展示了ATMT.receive_condition方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: receive_offer
# 需要導入模塊: from scapy.automaton import ATMT [as 別名]
# 或者: from scapy.automaton.ATMT import receive_condition [as 別名]
def receive_offer(self, pkt):
"""Receive offer on SELECTING state."""
logger.debug("C2. Received OFFER?, in SELECTING state.")
if isoffer(pkt):
logger.debug("C2: T, OFFER received")
self.offers.append(pkt)
if len(self.offers) >= MAX_OFFERS_COLLECTED:
logger.debug("C2.5: T, raise REQUESTING.")
self.select_offer()
raise self.REQUESTING()
logger.debug("C2.5: F, raise SELECTING.")
raise self.SELECTING()
# same as:, but would can not be overloaded
# @ATMT.receive_condition(RENEWING)
# @ATMT.receive_condition(REBINDING)
示例2: receive_ack_requesting
# 需要導入模塊: from scapy.automaton import ATMT [as 別名]
# 或者: from scapy.automaton.ATMT import receive_condition [as 別名]
def receive_ack_requesting(self, pkt):
"""Receive ACK in REQUESTING state."""
logger.debug("C3. Received ACK?, in REQUESTING state.")
if self.process_received_ack(pkt):
logger.debug("C3: T. Received ACK, in REQUESTING state, "
"raise BOUND.")
raise self.BOUND()
# same as:, but would can not be overloaded
# @ATMT.receive_condition(RENEWING)
# @ATMT.receive_condition(REBINDING)