Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/flexstack/btp/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def btp_data_request(self, request: BTPDataRequest) -> None:
communication_profile=request.communication_profile,
traffic_class=request.traffic_class,
data=data,
length=len(data)
length=len(data),
max_hop_limit=request.max_hop_limit,
)
self.logging.debug(
"Sending BTP Data Request: %s", gn_data_request.data)
Expand Down
3 changes: 1 addition & 2 deletions src/flexstack/geonet/common_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ def initialize_with_request(cls, request: GNDataRequest) -> "CommonHeader":
if ht == HeaderType.TSB and hst == TopoBroadcastHST.SINGLE_HOP:
mhl = 1
else:
# TODO: Set the maximum hop limit on other cases than SHB As specified in: Section 10.3.4 Table 20
mhl = 1
mhl = request.max_hop_limit
return cls(nh=nh, reserved=0, ht=ht, hst=hst, tc=tc, flags=0, pl=pl, mhl=mhl) # type: ignore

def encode_to_int(self) -> int:
Expand Down
2 changes: 1 addition & 1 deletion src/flexstack/geonet/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ def gn_data_indicate(self, packet: bytes) -> None:
# Decap the common header
common_header = CommonHeader.decode_from_bytes(packet[0:8])
packet = packet[8:]
if basic_header.rhl > self.mib.itsGnDefaultHopLimit:
if basic_header.rhl > common_header.mhl:
raise DecapError("Hop limit exceeded")
# TODO: Forwarding packet buffer flush
if common_header.ht == HeaderType.ANY:
Expand Down
3 changes: 3 additions & 0 deletions src/flexstack/geonet/service_access_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ class GNDataRequest:
Payload.
area : Area
Area of the GBC algorithm. Only used when the packet transport type is GBC.
max_hop_limit : int
Maximum hop limit for the packet. Default is 10.

THIS CLASS WILL BE EXTENDED WHEN FURTHER PACKET TYPES ARE IMPLEMENTED
"""
Expand All @@ -421,6 +423,7 @@ class GNDataRequest:
length: int = 0
data: bytes = b""
area: Area = field(default_factory=Area)
max_hop_limit: int = 10

def to_dict(self) -> dict:
"""
Expand Down
Loading