Skip to content
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- `TransactionStep.SENDING_ACK_OF_FINISHED` for source handler which is not required anymore.

## Changed

- Replaced `*Cfg*` abbreviation with `*Config*`

# [v0.5.1] 2025-02-10

- Bump allowed `spacepackets` to v0.28.0
Expand Down
8 changes: 4 additions & 4 deletions examples/cfdp-cli-udp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
CheckTimerProvider,
DefaultFaultHandlerBase,
EntityType,
IndicationCfg,
RemoteEntityCfg,
IndicationConfig,
RemoteEntityConfig,
)
from cfdppy.user import (
CfdpUserBase,
Expand All @@ -58,13 +58,13 @@
LOCAL_ENTITY_ID = ByteFieldU16(1)
REMOTE_ENTITY_ID = ByteFieldU16(2)
# Enable all indications for both local and remote entity.
INDICATION_CFG = IndicationCfg()
INDICATION_CFG = IndicationConfig()

FILE_CONTENT = "Hello World!\n"
FILE_SEGMENT_SIZE = 256
MAX_PACKET_LEN = 512

REMOTE_CFG_OF_LOCAL_ENTITY = RemoteEntityCfg(
REMOTE_CFG_OF_LOCAL_ENTITY = RemoteEntityConfig(
entity_id=LOCAL_ENTITY_ID,
max_packet_len=MAX_PACKET_LEN,
max_file_segment_len=FILE_SEGMENT_SIZE,
Expand Down
10 changes: 5 additions & 5 deletions examples/cfdp-cli-udp/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
from cfdppy.handler.dest import DestHandler
from cfdppy.handler.source import SourceHandler
from cfdppy.mib import (
LocalEntityCfg,
RemoteEntityCfgTable,
LocalEntityConfig,
RemoteEntityConfigTable,
)

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -80,7 +80,7 @@ def main() -> None:

basicConfig(level=logging_level)

remote_cfg_table = RemoteEntityCfgTable()
remote_cfg_table = RemoteEntityConfigTable()
remote_cfg_table.add_config(REMOTE_CFG_OF_REMOTE_ENTITY)

src_fault_handler = CfdpFaultHandler(BASE_STR_SRC)
Expand All @@ -89,7 +89,7 @@ def main() -> None:
src_user = CfdpUser(BASE_STR_SRC, PUT_REQ_QUEUE)
check_timer_provider = CustomCheckTimerProvider()
source_handler = SourceHandler(
cfg=LocalEntityCfg(LOCAL_ENTITY_ID, INDICATION_CFG, src_fault_handler),
cfg=LocalEntityConfig(LOCAL_ENTITY_ID, INDICATION_CFG, src_fault_handler),
seq_num_provider=src_seq_count_provider,
remote_cfg_table=remote_cfg_table,
user=src_user,
Expand All @@ -109,7 +109,7 @@ def main() -> None:
dest_fault_handler = CfdpFaultHandler(BASE_STR_DEST)
dest_user = CfdpUser(BASE_STR_DEST, PUT_REQ_QUEUE)
dest_handler = DestHandler(
cfg=LocalEntityCfg(LOCAL_ENTITY_ID, INDICATION_CFG, dest_fault_handler),
cfg=LocalEntityConfig(LOCAL_ENTITY_ID, INDICATION_CFG, dest_fault_handler),
user=dest_user,
remote_cfg_table=remote_cfg_table,
check_timer_provider=check_timer_provider,
Expand Down
10 changes: 5 additions & 5 deletions examples/cfdp-cli-udp/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
from cfdppy.handler.dest import DestHandler
from cfdppy.handler.source import SourceHandler
from cfdppy.mib import (
LocalEntityCfg,
RemoteEntityCfgTable,
LocalEntityConfig,
RemoteEntityConfigTable,
)

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -62,11 +62,11 @@ def main() -> None:
# 16 bit sequence count for transactions.
src_seq_count_provider = SeqCountProvider(16)
src_user = CfdpUser(BASE_STR_SRC, PUT_REQ_QUEUE)
remote_cfg_table = RemoteEntityCfgTable()
remote_cfg_table = RemoteEntityConfigTable()
remote_cfg_table.add_config(REMOTE_CFG_OF_LOCAL_ENTITY)
check_timer_provider = CustomCheckTimerProvider()
source_handler = SourceHandler(
cfg=LocalEntityCfg(REMOTE_ENTITY_ID, INDICATION_CFG, src_fault_handler),
cfg=LocalEntityConfig(REMOTE_ENTITY_ID, INDICATION_CFG, src_fault_handler),
user=src_user,
remote_cfg_table=remote_cfg_table,
check_timer_provider=check_timer_provider,
Expand All @@ -86,7 +86,7 @@ def main() -> None:
dest_fault_handler = CfdpFaultHandler(BASE_STR_DEST)
dest_user = CfdpUser(BASE_STR_DEST, PUT_REQ_QUEUE)
dest_handler = DestHandler(
cfg=LocalEntityCfg(REMOTE_ENTITY_ID, INDICATION_CFG, dest_fault_handler),
cfg=LocalEntityConfig(REMOTE_ENTITY_ID, INDICATION_CFG, dest_fault_handler),
user=dest_user,
remote_cfg_table=remote_cfg_table,
check_timer_provider=check_timer_provider,
Expand Down
4 changes: 2 additions & 2 deletions examples/cfdp-libre-cube-crosstest/common.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from spacepackets.cfdp import ChecksumType, TransmissionMode
from spacepackets.util import ByteFieldU16

from cfdppy.mib import RemoteEntityCfg
from cfdppy.mib import RemoteEntityConfig

SOURCE_ENTITY_ID = 2
REMOTE_ENTITY_ID = 3
Expand All @@ -12,7 +12,7 @@
FILE_SEGMENT_SIZE = 128
MAX_PACKET_LEN = 512

REMOTE_CFG_FOR_DEST_ENTITY = RemoteEntityCfg(
REMOTE_CFG_FOR_DEST_ENTITY = RemoteEntityConfig(
entity_id=ByteFieldU16(REMOTE_ENTITY_ID),
max_packet_len=MAX_PACKET_LEN,
max_file_segment_len=FILE_SEGMENT_SIZE,
Expand Down
12 changes: 6 additions & 6 deletions examples/cfdp-libre-cube-crosstest/tmtccmd-client.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
CheckTimerProvider,
DefaultFaultHandlerBase,
EntityType,
IndicationCfg,
LocalEntityCfg,
RemoteEntityCfgTable,
IndicationConfig,
LocalEntityConfig,
RemoteEntityConfigTable,
)
from cfdppy.request import PutRequest
from cfdppy.user import (
Expand Down Expand Up @@ -217,12 +217,12 @@ def main() -> None:
with open(SOURCE_FILE, "w") as file:
file.write(FILE_CONTENT)

remote_cfg_table = RemoteEntityCfgTable([REMOTE_CFG_FOR_DEST_ENTITY])
remote_cfg_table = RemoteEntityConfigTable([REMOTE_CFG_FOR_DEST_ENTITY])

# Enable all indications.
src_indication_cfg = IndicationCfg()
src_indication_cfg = IndicationConfig()
src_fault_handler = CfdpFaultHandler()
src_entity_cfg = LocalEntityCfg(SOURCE_ENTITY_ID, src_indication_cfg, src_fault_handler)
src_entity_cfg = LocalEntityConfig(SOURCE_ENTITY_ID, src_indication_cfg, src_fault_handler)
# 16 bit sequence count for transactions.
src_seq_count_provider = SeqCountProvider(16)
src_user = CfdpUser("SRC ENTITY")
Expand Down
20 changes: 10 additions & 10 deletions examples/cfdp-simple/file-copy-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
CheckTimerProvider,
DefaultFaultHandlerBase,
EntityType,
IndicationCfg,
LocalEntityCfg,
RemoteEntityCfg,
RemoteEntityCfgTable,
IndicationConfig,
LocalEntityConfig,
RemoteEntityConfig,
RemoteEntityConfigTable,
)
from cfdppy.request import PutRequest
from cfdppy.user import (
Expand Down Expand Up @@ -67,7 +67,7 @@ class TransferParams:
_LOGGER = logging.getLogger()


REMOTE_CFG_FOR_SOURCE_ENTITY = RemoteEntityCfg(
REMOTE_CFG_FOR_SOURCE_ENTITY = RemoteEntityConfig(
entity_id=SOURCE_ENTITY_ID,
max_packet_len=MAX_PACKET_LEN,
max_file_segment_len=FILE_SEGMENT_SIZE,
Expand Down Expand Up @@ -235,14 +235,14 @@ def main() -> None:
with open(SOURCE_FILE, "w") as file:
file.write(FILE_CONTENT)

remote_cfg_table = RemoteEntityCfgTable()
remote_cfg_table = RemoteEntityConfigTable()
remote_cfg_table.add_config(REMOTE_CFG_FOR_SOURCE_ENTITY)
remote_cfg_table.add_config(REMOTE_CFG_FOR_DEST_ENTITY)

# Enable all indications.
src_indication_cfg = IndicationCfg()
src_indication_cfg = IndicationConfig()
src_fault_handler = CfdpFaultHandler()
src_entity_cfg = LocalEntityCfg(SOURCE_ENTITY_ID, src_indication_cfg, src_fault_handler)
src_entity_cfg = LocalEntityConfig(SOURCE_ENTITY_ID, src_indication_cfg, src_fault_handler)
# 16 bit sequence count for transactions.
src_seq_count_provider = SeqCountProvider(16)
src_user = CfdpUser("SRC ENTITY")
Expand All @@ -262,9 +262,9 @@ def main() -> None:
)

# Enable all indications.
dest_indication_cfg = IndicationCfg()
dest_indication_cfg = IndicationConfig()
dest_fault_handler = CfdpFaultHandler()
dest_entity_cfg = LocalEntityCfg(DEST_ENTITY_ID, dest_indication_cfg, dest_fault_handler)
dest_entity_cfg = LocalEntityConfig(DEST_ENTITY_ID, dest_indication_cfg, dest_fault_handler)
dest_user = CfdpUser("DEST ENTITY")
dest_handler = DestHandler(
cfg=dest_entity_cfg,
Expand Down
16 changes: 8 additions & 8 deletions src/cfdppy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
from .filestore import HostFilestore, VirtualFilestore
from .handler.common import PacketDestination, get_packet_destination
from .mib import (
IndicationCfg,
LocalEntityCfg,
RemoteEntityCfg,
RemoteEntityCfgTable,
IndicationConfig,
LocalEntityConfig,
RemoteEntityConfig,
RemoteEntityConfigTable,
)
from .request import PutRequest
from .restricted_filestore import RestrictedFilestore
Expand All @@ -22,12 +22,12 @@
"CfdpState",
"CfdpUserBase",
"HostFilestore",
"IndicationCfg",
"LocalEntityCfg",
"IndicationConfig",
"LocalEntityConfig",
"PacketDestination",
"PutRequest",
"RemoteEntityCfg",
"RemoteEntityCfgTable",
"RemoteEntityConfig",
"RemoteEntityConfigTable",
"RestrictedFilestore",
"TransactionId",
"VirtualFilestore",
Expand Down
12 changes: 6 additions & 6 deletions src/cfdppy/handler/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from spacepackets.seqcount import ProvidesSeqCount

from cfdppy.mib import (
LocalEntityCfg,
RemoteEntityCfg,
RemoteEntityCfgTable,
LocalEntityConfig,
RemoteEntityConfig,
RemoteEntityConfigTable,
)

from .common import PacketDestination, get_packet_destination
Expand All @@ -17,11 +17,11 @@
"DestStateWrapper",
"DestTransactionStep",
"FsmResult",
"LocalEntityCfg",
"LocalEntityConfig",
"PacketDestination",
"ProvidesSeqCount",
"RemoteEntityCfg",
"RemoteEntityCfgTable",
"RemoteEntityConfig",
"RemoteEntityConfigTable",
"SourceHandler",
"SourceStateWrapper",
"SourceTransactionStep",
Expand Down
12 changes: 6 additions & 6 deletions src/cfdppy/handler/dest.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
from cfdppy.mib import (
CheckTimerProvider,
EntityType,
LocalEntityCfg,
RemoteEntityCfg,
RemoteEntityCfgTable,
LocalEntityConfig,
RemoteEntityConfig,
RemoteEntityConfigTable,
)
from cfdppy.user import (
CfdpUserBase,
Expand Down Expand Up @@ -238,7 +238,7 @@ class _DestFieldWrapper:

def __init__(self):
self.transaction_id: TransactionId | None = None
self.remote_cfg: RemoteEntityCfg | None = None
self.remote_cfg: RemoteEntityConfig | None = None
self.check_timer: Countdown | None = None
self.current_check_count: int = 0
self.closure_requested: bool = False
Expand Down Expand Up @@ -319,9 +319,9 @@ class DestHandler:

def __init__(
self,
cfg: LocalEntityCfg,
cfg: LocalEntityConfig,
user: CfdpUserBase,
remote_cfg_table: RemoteEntityCfgTable,
remote_cfg_table: RemoteEntityConfigTable,
check_timer_provider: CheckTimerProvider,
) -> None:
self.cfg = cfg
Expand Down
14 changes: 7 additions & 7 deletions src/cfdppy/handler/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
SourceFileDoesNotExist,
UnretrievedPdusToBeSent,
)
from cfdppy.mib import CheckTimerProvider, EntityType, RemoteEntityCfgTable
from cfdppy.mib import CheckTimerProvider, EntityType, RemoteEntityConfigTable
from cfdppy.user import TransactionFinishedParams, TransactionParams

from .common import _PositiveAckProcedureParams
Expand All @@ -69,8 +69,8 @@

from cfdppy import (
CfdpUserBase,
LocalEntityCfg,
RemoteEntityCfg,
LocalEntityConfig,
RemoteEntityConfig,
)
from cfdppy.request import PutRequest

Expand Down Expand Up @@ -146,7 +146,7 @@ def __init__(self, local_entity_id: UnsignedByteField):
self.ack_params: _AckedModeParams = _AckedModeParams()
self.fp: _SourceFileParams = _SourceFileParams.empty()
self.finished_params: FinishedParams | None = None
self.remote_cfg: RemoteEntityCfg | None = None
self.remote_cfg: RemoteEntityConfig | None = None
self.closure_requested: bool = False
self.pdu_conf = PduConfig.empty()
self.pdu_conf.source_entity_id = local_entity_id
Expand Down Expand Up @@ -237,9 +237,9 @@ class SourceHandler:

def __init__(
self,
cfg: LocalEntityCfg,
cfg: LocalEntityConfig,
user: CfdpUserBase,
remote_cfg_table: RemoteEntityCfgTable,
remote_cfg_table: RemoteEntityConfigTable,
check_timer_provider: CheckTimerProvider,
seq_num_provider: ProvidesSeqCount,
):
Expand Down Expand Up @@ -457,7 +457,7 @@ def state_machine(self, packet: AbstractFileDirectiveBase | None = None) -> FsmR
Invalid PDU file directive type.
PduIgnoredForSource
The specified PDU can not be handled in the current state.
NoRemoteEntityCfgFound
NoRemoteEntityConfigFound
No remote configuration found for specified destination entity.
InvalidSourceId
Source ID not identical to local entity ID.
Expand Down
Loading
Loading