Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move protocol module to separate crate in workspace #6

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

5t0n3
Copy link
Contributor

@5t0n3 5t0n3 commented Jul 25, 2024

This is mainly due to Cargo not supporting optional dev-dependencies, which is inconvenient if we want to have client-specific (std-only) dev dependencies while having it in the same crate. It does make sense to break it out regardless though since I imagine packet (de)serialization can be useful even without a client.

Everything was basically directly moved over, with some imports changed here and there for correctness.

@5t0n3 5t0n3 self-assigned this Jul 25, 2024
Copy link
Contributor

@ctrlaltf24 ctrlaltf24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean diff, well done

@@ -26,7 +26,7 @@ pub struct HeaderInfo {

impl HeaderInfo {
/// Size of a full TACACS+ packet header.
pub(in crate::protocol) const HEADER_SIZE_BYTES: usize = 12;
pub const HEADER_SIZE_BYTES: usize = 12;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This used to be pub(in crate::protocol)

Suggested change
pub const HEADER_SIZE_BYTES: usize = 12;
pub(crate) const HEADER_SIZE_BYTES: usize = 12;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When working on the actual client, I ended up changing it to pub(crate) since I used it when reading a packet from a connection, which is why I made it fully pub here (since they will technically be different crates now). I'm fine leaving it as pub(crate) here but I'll likely change anyways once the initial client stuff is merged.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can keep it as pub if you want, interested to see where this was needed in the client, seems more like a protocol matter

Copy link

@sginnett sginnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@5t0n3 5t0n3 merged commit 129fbfe into cPacketNetworks:main Jul 25, 2024
5 checks passed
@5t0n3 5t0n3 deleted the crate-workspace-split branch July 25, 2024 18:32
@5t0n3 5t0n3 removed their assignment Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants