Skip to content

Commit

Permalink
must fix recvq
Browse files Browse the repository at this point in the history
  • Loading branch information
jfuruness committed Dec 20, 2024
1 parent a74fac1 commit b8fbaa4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 25 deletions.
6 changes: 3 additions & 3 deletions bgpy/shared/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ class Prefixes(YamlAbleEnum):
prefix always belongs to the victim
"""

SUPERPREFIX: str = "1.0.0.0/8"
SUPERPREFIX: str = 1#"1.0.0.0/8"
# Prefix always belongs to victim
PREFIX: str = "1.2.0.0/16"
SUBPREFIX: str = "1.2.3.0/24"
PREFIX: str = 2#"1.2.0.0/16"
SUBPREFIX: str = 3#"1.2.3.0/24"


class ASNs(YamlAbleEnum):
Expand Down
19 changes: 0 additions & 19 deletions bgpy/simulation_engine/policies/bgp/bgp/bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,6 @@ def _valid_ann(

# Make sure there are no loops before propagating
return True
# BGP Loop Prevention Check
# Newly added October 31 2024 - no AS 0 either
self_asn = self.as_.asn
for asn in ann.as_path:
if asn == self_asn or asn == 0:
return False
return True


def _copy_and_process(
self: "BGP",
Expand All @@ -173,17 +165,6 @@ def _copy_and_process(
seed_asn=None,
recv_relationship=recv_relationship,
)
kwargs: dict[str, Any] = {
"as_path": (self.as_.asn, *ann.as_path),
"recv_relationship": recv_relationship,
"seed_asn": None,
}

if overwrite_default_kwargs:
kwargs.update(overwrite_default_kwargs)
# Don't use a dict comp here for speed
return ann.copy(overwrite_default_kwargs=kwargs)


#############
# ROA Funcs #
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ def _get_announcements(
"""

# First get victim's anns
victim_anns = super()._get_announcements(engine=engine)
assert isinstance(victim_anns, tuple), "mypy"
# victim_anns = super()._get_announcements(engine=engine)
# CACHE THE VICTIM ALWAYS!!!!!
# assert isinstance(victim_anns, tuple), "mypy"
attacker_anns = self._get_subprefix_attacker_anns(engine=engine)
return victim_anns + attacker_anns
return attacker_anns# victim_anns + attacker_anns

def _get_subprefix_attacker_anns(
self,
Expand Down

0 comments on commit b8fbaa4

Please sign in to comment.