Commit deed2e8a authored by Pedro Oliveira's avatar Pedro Oliveira

log events more verbose

parent 8fec9cb1
......@@ -8,11 +8,11 @@ import ipaddress
from RWLock.RWLock import RWLockWrite
import Main
import UnicastRouting
from InterfacePIM import InterfacePim
from InterfaceIGMP import InterfaceIGMP
from tree.KernelEntry import KernelEntry
class Kernel:
# MRT
MRT_BASE = 200
......@@ -237,6 +237,20 @@ class Kernel:
struct_mfcctl = struct.pack("4s 4s H " + "B"*Kernel.MAXVIFS + " IIIi", source_ip, group_ip, kernel_entry.inbound_interface_index, *outbound_interfaces_and_other_parameters)
self.socket.setsockopt(socket.IPPROTO_IP, Kernel.MRT_ADD_MFC, struct_mfcctl)
def set_flood_multicast_route(self, source_ip, group_ip, inbound_interface_index):
source_ip = socket.inet_aton(source_ip)
group_ip = socket.inet_aton(group_ip)
outbound_interfaces = [1]*self.MAXVIFS
outbound_interfaces[inbound_interface_index] = 0
#outbound_interfaces_and_other_parameters = list(kernel_entry.outbound_interfaces) + [0]*4
outbound_interfaces_and_other_parameters = outbound_interfaces + [0]*3 + [20]
#outbound_interfaces, 0, 0, 0, 0 <- only works with python>=3.5
#struct_mfcctl = struct.pack("4s 4s H " + "B"*Kernel.MAXVIFS + " IIIi", source_ip, group_ip, inbound_interface_index, *outbound_interfaces, 0, 0, 0, 0)
struct_mfcctl = struct.pack("4s 4s H " + "B"*Kernel.MAXVIFS + " IIIi", source_ip, group_ip, inbound_interface_index, *outbound_interfaces_and_other_parameters)
self.socket.setsockopt(socket.IPPROTO_IP, Kernel.MRT_ADD_MFC, struct_mfcctl)
def remove_multicast_route(self, kernel_entry: KernelEntry):
source_ip = socket.inet_aton(kernel_entry.source_ip)
......@@ -341,6 +355,8 @@ class Kernel:
if ip_src not in self.routing:
self.routing[ip_src] = {}
iif = self.vif_dic.get(UnicastRouting.check_rpf(ip_src))
self.set_flood_multicast_route(ip_src, ip_dst, iif)
self.routing[ip_src][ip_dst] = kernel_entry
return kernel_entry
else:
......
from pyroute2 import IPDB, IPRoute
import socket
import RWLock
import Main
import ipaddress
from threading import RLock
from pyroute2 import IPDB, IPRoute
import Main
def get_route(ip_dst: str):
return UnicastRouting.get_route(ip_dst)
def get_metric(ip_dst: str):
return UnicastRouting.get_metric(ip_dst)
def check_rpf(ip_dst):
return UnicastRouting.check_rpf(ip_dst)
......@@ -18,36 +20,37 @@ def check_rpf(ip_dst):
class UnicastRouting(object):
ipr = None
ipdb = None
lock = RLock()
def __init__(self):
UnicastRouting.ipr = IPRoute()
UnicastRouting.ipdb = IPDB()
self._ipdb = UnicastRouting.ipdb
self._ipdb.register_callback(UnicastRouting.unicast_changes)
self._ipdb.register_callback(UnicastRouting.unicast_changes, mode="post")
@staticmethod
def get_route(ip_dst: str):
ipdb = UnicastRouting.ipdb
ip_bytes = socket.inet_aton(ip_dst)
ip_int = int.from_bytes(ip_bytes, byteorder='big')
info = None
for mask_len in range(32, 0, -1):
ip_bytes = (ip_int & (0xFFFFFFFF << (32 - mask_len))).to_bytes(4, "big")
ip_dst = socket.inet_ntoa(ip_bytes) + "/" + str(mask_len)
print(ip_dst)
try:
info = ipdb.routes[ip_dst]
break
except:
continue
if not info:
print("0.0.0.0/0")
info = ipdb.routes["default"]
print(info)
return info
with UnicastRouting.lock:
ipdb = UnicastRouting.ipdb # type:IPDB
for mask_len in range(32, 0, -1):
ip_bytes = (ip_int & (0xFFFFFFFF << (32 - mask_len))).to_bytes(4, "big")
ip_dst = socket.inet_ntoa(ip_bytes) + "/" + str(mask_len)
print(ip_dst)
if ip_dst in ipdb.routes:
info = ipdb.routes[ip_dst]
break
else:
continue
if not info:
print("0.0.0.0/0")
info = ipdb.routes["default"]
print(info)
return info
# get metrics (routing preference and cost) to IP ip_dst
@staticmethod
......@@ -60,7 +63,6 @@ class UnicastRouting(object):
entry_cost = 0
return (entry_protocol, entry_cost, mask)
# get output interface IP, used to send data to IP ip_dst
# (root interface IP to ip_dst)
@staticmethod
......@@ -74,11 +76,11 @@ class UnicastRouting(object):
rpf_interface_source = UnicastRouting.ipr.get_routes(family=socket.AF_INET, dst=ip_dst)[0]['attrs'][3][1]
return rpf_interface_source
@staticmethod
def unicast_changes(ipdb, msg, action):
print("unicast change?")
print(action)
UnicastRouting.lock.acquire()
UnicastRouting.ipdb = ipdb
if action == "RTM_NEWROUTE" or action == "RTM_DELROUTE":
print(ipdb.routes)
......@@ -87,7 +89,7 @@ class UnicastRouting(object):
attrs = msg["attrs"]
print(attrs)
for (key, value) in attrs:
print((key,value))
print((key, value))
if key == "RTA_DST":
network_address = value
break
......@@ -98,8 +100,10 @@ class UnicastRouting(object):
print(network_address + "/" + str(mask_len))
subnet = ipaddress.ip_network(network_address + "/" + str(mask_len))
print(str(subnet))
UnicastRouting.lock.release()
Main.kernel.notify_unicast_changes(subnet)
elif action == "RTM_NEWADDR" or action == "RTM_DELADDR":
UnicastRouting.lock.release()
# TODO ALTERACOES NA INTERFACE
'''
print(action)
......@@ -111,11 +115,11 @@ class UnicastRouting(object):
if key == "IFA_LABEL":
interface_name = value
break
Main.kernel.notify_interface_change(interface_name)
'''
pass
else:
UnicastRouting.lock.release()
def stop(self):
if UnicastRouting.ipr:
......
......@@ -19,24 +19,9 @@ class KernelEntry:
self.source_ip = source_ip
self.group_ip = group_ip
# ip of neighbor of the rpf
#next_hop = UnicastRouting.get_route(source_ip)["gateway"]
#self.rpf_node = source_ip if next_hop is None else next_hop
'''
next_hop = UnicastRouting.get_route(source_ip)["gateway"]
multipaths = UnicastRouting.get_route(source_ip)["multipath"]
self.rpf_node = next_hop if next_hop is not None else source_ip
print("MUL", multipaths)
#self.rpf_node = multipaths[0]["gateway"]
for m in multipaths:
if m["gateway"] is None:
self.rpf_node = source_ip
break
else:
self.rpf_node = m["gateway"]
'''
# CHECK UNICAST ROUTING INFORMATION###################################################
# CHOSE RPC INTERFACE
# GET RPC TO SOURCE
unicast_route = UnicastRouting.get_route(source_ip)
next_hop = unicast_route["gateway"]
multipaths = unicast_route["multipath"]
......
from abc import ABCMeta, abstractstaticmethod
from abc import ABCMeta, abstractmethod
import tree.globals as pim_globals
from .metric import AssertMetric
......@@ -8,7 +8,8 @@ if TYPE_CHECKING:
class AssertStateABC(metaclass=ABCMeta):
@abstractstaticmethod
@staticmethod
@abstractmethod
def receivedDataFromDownstreamIf(interface: "TreeInterfaceDownstream"):
"""
An (S,G) Data packet received on downstream interface
......@@ -17,7 +18,8 @@ class AssertStateABC(metaclass=ABCMeta):
"""
raise NotImplementedError()
@abstractstaticmethod
@staticmethod
@abstractmethod
def receivedInferiorMetricFromWinner(interface: "TreeInterfaceDownstream"):
"""
Receive Inferior (Assert OR State Refresh) from Assert Winner
......@@ -26,7 +28,8 @@ class AssertStateABC(metaclass=ABCMeta):
"""
raise NotImplementedError()
@abstractstaticmethod
@staticmethod
@abstractmethod
def receivedInferiorMetricFromNonWinner_couldAssertIsTrue(interface: "TreeInterfaceDownstream"):
"""
Receive Inferior (Assert OR State Refresh) from non-Assert Winner
......@@ -36,7 +39,8 @@ class AssertStateABC(metaclass=ABCMeta):
"""
raise NotImplementedError()
@abstractstaticmethod
@staticmethod
@abstractmethod
def receivedPreferedMetric(interface: "TreeInterfaceDownstream", better_metric):
"""
Receive Preferred Assert OR State Refresh
......@@ -46,7 +50,8 @@ class AssertStateABC(metaclass=ABCMeta):
"""
raise NotImplementedError()
@abstractstaticmethod
@staticmethod
@abstractmethod
def sendStateRefresh(interface: "TreeInterfaceDownstream", time):
"""
Send State Refresh
......@@ -57,7 +62,8 @@ class AssertStateABC(metaclass=ABCMeta):
"""
raise NotImplementedError()
@abstractstaticmethod
@staticmethod
@abstractmethod
def assertTimerExpires(interface: "TreeInterfaceDownstream"):
"""
AT(S,G) Expires
......@@ -66,7 +72,8 @@ class AssertStateABC(metaclass=ABCMeta):
"""
raise NotImplementedError()
@abstractstaticmethod
@staticmethod
@abstractmethod
def couldAssertIsNowFalse(interface: "TreeInterfaceDownstream"):
"""
CouldAssert -> FALSE
......@@ -75,7 +82,8 @@ class AssertStateABC(metaclass=ABCMeta):
"""
raise NotImplementedError()
@abstractstaticmethod
@staticmethod
@abstractmethod
def couldAssertIsNowTrue(interface: "TreeInterfaceDownstream"):
"""
CouldAssert -> TRUE
......@@ -84,7 +92,8 @@ class AssertStateABC(metaclass=ABCMeta):
"""
raise NotImplementedError()
@abstractstaticmethod
@staticmethod
@abstractmethod
def winnerLivelinessTimerExpires(interface: "TreeInterfaceDownstream"):
"""
Winner’s NLT(N,I) Expires
......@@ -93,7 +102,8 @@ class AssertStateABC(metaclass=ABCMeta):
"""
raise NotImplementedError()
@abstractstaticmethod
@staticmethod
@abstractmethod
def receivedPruneOrJoinOrGraft(interface: "TreeInterfaceDownstream"):
"""
Receive Prune(S,G), Join(S,G) or Graft(S,G)
......@@ -198,7 +208,7 @@ class NoInfoState(AssertStateABC):
interface.assert_logger.debug('receivedPruneOrJoinOrGraft, NI -> NI')
def __str__(self) -> str:
return "NI"
return "NoInfo"
class WinnerState(AssertStateABC):
......@@ -288,7 +298,7 @@ class WinnerState(AssertStateABC):
pass
def __str__(self) -> str:
return "W"
return "Winner"
......@@ -383,7 +393,7 @@ class LoserState(AssertStateABC):
interface.set_assert_state(AssertState.NoInfo)
def __str__(self) -> str:
return "L"
return "Loser"
class AssertState():
NoInfo = NoInfoState()
......
from abc import ABCMeta, abstractstaticmethod
from abc import ABCMeta, abstractmethod
from tree import globals as pim_globals
from utils import TYPE_CHECKING
......@@ -6,7 +6,8 @@ if TYPE_CHECKING:
from .tree_if_downstream import TreeInterfaceDownstream
class DownstreamStateABS(metaclass=ABCMeta):
@abstractstaticmethod
@staticmethod
@abstractmethod
def receivedPrune(interface: "TreeInterfaceDownstream", holdtime):
"""
Receive Prune(S,G)
......@@ -15,7 +16,8 @@ class DownstreamStateABS(metaclass=ABCMeta):
"""
raise NotImplementedError()
@abstractstaticmethod
@staticmethod
@abstractmethod
def receivedJoin(interface: "TreeInterfaceDownstream"):
"""
Receive Join(S,G)
......@@ -24,7 +26,8 @@ class DownstreamStateABS(metaclass=ABCMeta):
"""
raise NotImplementedError()
@abstractstaticmethod
@staticmethod
@abstractmethod
def receivedGraft(interface: "TreeInterfaceDownstream", source_ip):
"""
Receive Graft(S,G)
......@@ -33,7 +36,8 @@ class DownstreamStateABS(metaclass=ABCMeta):
"""
raise NotImplementedError()
@abstractstaticmethod
@staticmethod
@abstractmethod
def PPTexpires(interface: "TreeInterfaceDownstream"):
"""
PPT(S,G) Expires
......@@ -42,7 +46,8 @@ class DownstreamStateABS(metaclass=ABCMeta):
"""
raise NotImplementedError()
@abstractstaticmethod
@staticmethod
@abstractmethod
def PTexpires(interface: "TreeInterfaceDownstream"):
"""
PT(S,G) Expires
......@@ -51,7 +56,8 @@ class DownstreamStateABS(metaclass=ABCMeta):
"""
raise NotImplementedError()
@abstractstaticmethod
@staticmethod
@abstractmethod
def is_now_RPF_Interface(interface: "TreeInterfaceDownstream"):
"""
RPF_Interface(S) becomes I
......@@ -60,7 +66,8 @@ class DownstreamStateABS(metaclass=ABCMeta):
"""
raise NotImplementedError()
@abstractstaticmethod
@staticmethod
@abstractmethod
def send_state_refresh(interface: "TreeInterfaceDownstream"):
"""
Send State Refresh(S,G) out I
......@@ -88,6 +95,7 @@ class NoInfo(DownstreamStateABS):
@type interface: TreeInterfaceDownstreamDownstream
"""
interface.join_prune_logger.debug("receivedPrune, NI -> PP")
interface.set_prune_state(DownstreamState.PrunePending)
time = 0
......@@ -96,9 +104,6 @@ class NoInfo(DownstreamStateABS):
interface.set_prune_pending_timer(time)
#print("receivedPrune, NI -> PP")
interface.join_prune_logger.debug("receivedPrune, NI -> PP")
@staticmethod
def receivedJoin(interface: "TreeInterfaceDownstream"):
"""
......@@ -106,9 +111,7 @@ class NoInfo(DownstreamStateABS):
@type interface: TreeInterfaceDownstreamDownstream
"""
# Do nothing
#print("receivedJoin, NI -> NI")
interface.join_prune_logger.debug("receivedJoin, NI -> NI")
@staticmethod
......@@ -118,10 +121,8 @@ class NoInfo(DownstreamStateABS):
@type interface: TreeInterfaceDownstreamDownstream
"""
interface.send_graft_ack(source_ip)
#print('receivedGraft, NI -> NI')
interface.join_prune_logger.debug('receivedGraft, NI -> NI')
interface.send_graft_ack(source_ip)
@staticmethod
def PPTexpires(interface: "TreeInterfaceDownstream"):
......@@ -164,7 +165,7 @@ class NoInfo(DownstreamStateABS):
return
def __str__(self):
return "NI"
return "NoInfo"
......@@ -185,8 +186,6 @@ class PrunePending(DownstreamStateABS):
@type interface: TreeInterfaceDownstreamDownstream
"""
#print('receivedPrune, PP -> PP')
interface.join_prune_logger.debug('receivedPrune, PP -> PP')
......@@ -197,12 +196,12 @@ class PrunePending(DownstreamStateABS):
@type interface: TreeInterfaceDownstreamDownstream
"""
interface.join_prune_logger.debug('receivedJoin, PP -> NI')
interface.clear_prune_pending_timer()
interface.set_prune_state(DownstreamState.NoInfo)
#print('receivedJoin, PP -> NI')
interface.join_prune_logger.debug('receivedJoin, PP -> NI')
@staticmethod
def receivedGraft(interface: "TreeInterfaceDownstream", source_ip):
......@@ -211,14 +210,13 @@ class PrunePending(DownstreamStateABS):
@type interface: TreeInterfaceDownstreamDownstream
"""
interface.join_prune_logger.debug('receivedGraft, PP -> NI')
interface.clear_prune_pending_timer()
interface.set_prune_state(DownstreamState.NoInfo)
interface.send_graft_ack(source_ip)
#print('receivedGraft, PP -> NI')
interface.join_prune_logger.debug('receivedGraft, PP -> NI')
@staticmethod
def PPTexpires(interface: "TreeInterfaceDownstream"):
"""
......@@ -226,15 +224,13 @@ class PrunePending(DownstreamStateABS):
@type interface: TreeInterfaceDownstreamDownstream
"""
interface.join_prune_logger.debug('PPTexpires, PP -> P')
interface.set_prune_state(DownstreamState.Pruned)
interface.set_prune_timer(interface.get_received_prune_holdtime() - pim_globals.JP_OVERRIDE_INTERVAL)
if len(interface.get_interface().neighbors) > 1:
interface.send_pruneecho()
#print('PPTexpires, PP -> P')
interface.join_prune_logger.debug('PPTexpires, PP -> P')
@staticmethod
def PTexpires(interface: "TreeInterfaceDownstream"):
"""
......@@ -242,7 +238,6 @@ class PrunePending(DownstreamStateABS):
@type interface: TreeInterfaceDownstreamDownstream
"""
#assert False, "PTexpires in state PP"
return
......@@ -253,12 +248,12 @@ class PrunePending(DownstreamStateABS):
@type interface: TreeInterfaceDownstreamDownstream
"""
interface.join_prune_logger.debug('is_now_RPF_Interface, PP -> NI')
interface.clear_prune_pending_timer()
interface.set_prune_state(DownstreamState.NoInfo)
print('is_now_RPF_Interface, PP -> NI')
@staticmethod
def send_state_refresh(interface: "TreeInterfaceDownstream"):
"""
......@@ -269,7 +264,7 @@ class PrunePending(DownstreamStateABS):
return
def __str__(self):
return "PP"
return "PrunePending"
class Pruned(DownstreamStateABS):
'''
......@@ -287,12 +282,10 @@ class Pruned(DownstreamStateABS):
@type interface: TreeInterfaceDownstreamDownstream
"""
interface.join_prune_logger.debug('receivedPrune, P -> P')
if holdtime > interface.remaining_prune_timer():
interface.set_prune_timer(holdtime)
#print('receivedPrune, P -> P')
interface.join_prune_logger.debug('receivedPrune, P -> P')
@staticmethod
def receivedJoin(interface: "TreeInterfaceDownstream"):
"""
......@@ -300,13 +293,12 @@ class Pruned(DownstreamStateABS):
@type interface: TreeInterfaceDownstreamDownstream
"""
interface.join_prune_logger.debug('receivedPrune, P -> NI')
interface.clear_prune_timer()
interface.set_prune_state(DownstreamState.NoInfo)
#print('receivedPrune, P -> NI')
interface.join_prune_logger.debug('receivedPrune, P -> NI')
@staticmethod
def receivedGraft(interface: "TreeInterfaceDownstream", source_ip):
"""
......@@ -314,13 +306,11 @@ class Pruned(DownstreamStateABS):
@type interface: TreeInterfaceDownstreamDownstream
"""
interface.join_prune_logger.debug('receivedGraft, P -> NI')
interface.clear_prune_timer()
interface.set_prune_state(DownstreamState.NoInfo)
interface.send_graft_ack(source_ip)
#print('receivedGraft, P -> NI')
interface.join_prune_logger.debug('receivedGraft, P -> NI')
@staticmethod
def PPTexpires(interface: "TreeInterfaceDownstream"):
"""
......@@ -338,10 +328,8 @@ class Pruned(DownstreamStateABS):
@type interface: TreeInterfaceDownstreamDownstream
"""
interface.set_prune_state(DownstreamState.NoInfo)
#print('PTexpires, P -> NI')
interface.join_prune_logger.debug('PTexpires, P -> NI')
interface.set_prune_state(DownstreamState.NoInfo)
@staticmethod
def is_now_RPF_Interface(interface: "TreeInterfaceDownstream"):
......@@ -350,11 +338,10 @@ class Pruned(DownstreamStateABS):
@type interface: TreeInterfaceDownstreamDownstream
"""
interface.join_prune_logger('is_now_RPF_Interface, P -> NI')
interface.clear_prune_timer()
interface.set_prune_state(DownstreamState.NoInfo)
print('is_now_RPF_Interface, P -> NI')
@staticmethod
def send_state_refresh(interface: "TreeInterfaceDownstream"):
"""
......@@ -362,14 +349,12 @@ class Pruned(DownstreamStateABS):
@type interface: TreeInterfaceDownstreamDownstream
"""
interface.join_prune_logger.debug('send_state_refresh, P -> P')
if interface.get_interface().is_state_refresh_capable():
interface.set_prune_timer(interface.get_received_prune_holdtime())
#print('send_state_refresh, P -> P')
interface.join_prune_logger.debug('send_state_refresh, P -> P')
def __str__(self):
return "P"
return "Pruned"
class DownstreamState():
NoInfo = NoInfo()
......
......@@ -30,30 +30,25 @@ class Originator(OriginatorStateABC):
'''
@type tree: Tree
'''
tree.originator_logger.debug('SRT expired, O -> O')
tree.set_state_refresh_timer()
tree.create_state_refresh_msg()
#print('SRT expired, O to O')
tree.originator_logger.debug('SRT expired, O -> O')
@staticmethod
def SATexpires(tree):
tree.originator_logger.debug('SAT expired, O -> NO')
tree.clear_state_refresh_timer()
tree.set_originator_state(OriginatorState.NotOriginator)
#print('SAT expired, O to NO')
tree.originator_logger.debug('SAT expired, O -> NO')
@staticmethod
def SourceNotConnected(tree):
tree.originator_logger.debug('Source no longer directly connected, O -> NO')
tree.clear_state_refresh_timer()
tree.clear_source_active_timer()
tree.set_originator_state(OriginatorState.NotOriginator)
#print('Source no longer directly connected, O to NO')
tree.originator_logger.debug('Source no longer directly connected, O -> NO')
def __str__(self):
return 'O'
return 'Originator'
class NotOriginator(OriginatorStateABC):
@staticmethod
......@@ -61,14 +56,12 @@ class NotOriginator(OriginatorStateABC):
'''
@type interface: Tree
'''
tree.originator_logger.debug('new DataMsg from Source, NO -> O')
tree.set_originator_state(OriginatorState.Originator)
tree.set_state_refresh_timer()
tree.set_source_active_timer()
#print('new DataMsg from Source, NO to O')
tree.originator_logger.debug('new DataMsg from Source, NO -> O')
@staticmethod
def SRTexpires(tree):
assert False, "SRTexpires in NO"
......@@ -82,7 +75,7 @@ class NotOriginator(OriginatorStateABC):
return
def __str__(self):
return 'NO'
return 'NotOriginator'
class OriginatorState():
......
......@@ -25,7 +25,7 @@ class TreeInterfaceDownstream(TreeInterface):
logger = logging.LoggerAdapter(TreeInterfaceDownstream.LOGGER, extra_dict_logger)
TreeInterface.__init__(self, kernel_entry, interface_id, logger)
self.logger.debug('Created DownstreamInterface')
self.join_prune_logger.debug(str(self._prune_state))
self.join_prune_logger.debug('Downstream state transitions to ' + str(self._prune_state))
# Last state refresh message sent (resend in case of new neighbors)
self._last_state_refresh_message = None
......@@ -37,7 +37,7 @@ class TreeInterfaceDownstream(TreeInterface):
with self.get_state_lock():
if new_state != self._prune_state:
self._prune_state = new_state
self.join_prune_logger.debug(str(new_state))
self.join_prune_logger.debug('Downstream state transitions to ' + str(new_state))
self.change_tree()
self.evaluate_ingroup()
......
......@@ -35,7 +35,7 @@ class TreeInterfaceUpstream(TreeInterface):
self._override_timer = None
self._prune_limit_timer = None
self._last_rpf = self.get_neighbor_RPF()
self.join_prune_logger.debug(str(self._graft_prune_state))
self.join_prune_logger.debug('Upstream state transitions to ' + str(self._graft_prune_state))
# Originator state
self._originator_state = OriginatorState.NotOriginator
......@@ -43,7 +43,7 @@ class TreeInterfaceUpstream(TreeInterface):
self._source_active_timer = None
self._prune_now_counter = 0
self.originator_logger = logging.LoggerAdapter(TreeInterfaceUpstream.LOGGER.getChild('Originator'), extra_dict_logger)
self.originator_logger.debug(str(self._originator_state))
self.originator_logger.debug('StateRefresh state transitions to ' + str(self._originator_state))
if self.is_S_directly_conn():
self._graft_prune_state.sourceIsNowDirectConnect(self)
......@@ -82,7 +82,7 @@ class TreeInterfaceUpstream(TreeInterface):
with self.get_state_lock():
if new_state != self._graft_prune_state:
self._graft_prune_state = new_state
self.join_prune_logger.debug(str(new_state))
self.join_prune_logger.debug('Upstream state transitions to ' + str(new_state))
self.change_tree()
self.evaluate_ingroup()
......@@ -90,7 +90,7 @@ class TreeInterfaceUpstream(TreeInterface):
def set_originator_state(self, new_state: OriginatorStateABC):
if new_state != self._originator_state:
self._originator_state = new_state
self.originator_logger.debug(str(new_state))
self.originator_logger.debug('StateRefresh state transitions to ' + str(new_state))
##########################################
# Check timers
......
......@@ -55,7 +55,7 @@ class TreeInterface(metaclass=ABCMeta):
self._assert_state = AssertState.NoInfo
self._assert_winner_metric = AssertMetric()
self._assert_timer = None
self.assert_logger.debug("NI")
self.assert_logger.debug("Assert state transitions to NoInfo")
# Received prune hold time
self._received_prune_holdtime = None
......@@ -70,7 +70,7 @@ class TreeInterface(metaclass=ABCMeta):
with self.get_state_lock():
if new_state != self._assert_state:
self._assert_state = new_state
self.assert_logger.debug(str(new_state))
self.assert_logger.debug('Assert state transitions to ' + str(new_state))
self.change_tree()
self.evaluate_ingroup()
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment