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

Adding the PDU types. #4

Merged
merged 28 commits into from
Sep 26, 2019
Merged

Adding the PDU types. #4

merged 28 commits into from
Sep 26, 2019

Conversation

pauldotknopf
Copy link
Contributor

No description provided.

@pauldotknopf pauldotknopf force-pushed the master branch 6 times, most recently from 44fd496 to a2ec71a Compare September 3, 2019 17:32
@pauldotknopf
Copy link
Contributor Author

This pull request is now ready. I've added an scpproxy tool for debug/diagnosing issues between SCU/SCP.

USAGE:
    scpproxy [OPTIONS] <destination-host> <destination-port>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -l, --listen-port <listen-port>    The port that we will listen for SCU connections on [default: 3333]

ARGS:
    <destination-host>    The destination host name (SCP)
    <destination-port>    The destination host port (SCP)

Here is an example output of an echo request.

listening on: 0.0.0.0:3333
forwarding to: 127.0.0.1:2222
scu ----> scp: AssociationRQ { protocol_version: 1, calling_ae_title: "ECHOSCU", called_ae_title: "ANY-SCP", application_context_name: "1.2.840.10008.3.1.1.1", presentation_contexts: [PresentationContextProposed { id: 1, abstract_syntax: "1.2.840.10008.1.1", transfer_syntaxes: ["1.2.840.10008.1.2"] }], user_variables: [MaxLength(16384), ImplementationClassUID("1.2.276.0.7230010.3.0.3.6.4"), ImplementationVersionName("OFFIS_DCMTK_364")] }
scu <---- scp: AssociationAC { protocol_version: 1, application_context_name: "1.2.840.10008.3.1.1.1", presentation_contexts: [PresentationContextResult { id: 1, reason: Acceptance, transfer_syntax: "1.2.840.10008.1.2" }], user_variables: [MaxLength(16384), ImplementationClassUID("1.2.276.0.7230010.3.0.3.6.4"), ImplementationVersionName("OFFIS_DCMTK_364")] }
scu ----> scp: PData { data: [PDataValue { presentation_context_id: 1, value_type: Command, is_last: true, data: [0, 0, 0, 0, 4, 0, 0, 0, 56, 0, 0, 0, 0, 0, 2, 0, 18, 0, 0, 0, 49, 46, 50, 46, 56, 52, 48, 46, 49, 48, 48, 48, 56, 46, 49, 46, 49, 0, 0, 0, 0, 1, 2, 0, 0, 0, 48, 0, 0, 0, 16, 1, 2, 0, 0, 0, 1, 0, 0, 0, 0, 8, 2, 0, 0, 0, 1, 1] }] }
scu <---- scp: PData { data: [PDataValue { presentation_context_id: 1, value_type: Command, is_last: true, data: [0, 0, 0, 0, 4, 0, 0, 0, 66, 0, 0, 0, 0, 0, 2, 0, 18, 0, 0, 0, 49, 46, 50, 46, 56, 52, 48, 46, 49, 48, 48, 48, 56, 46, 49, 46, 49, 0, 0, 0, 0, 1, 2, 0, 0, 0, 48, 128, 0, 0, 32, 1, 2, 0, 0, 0, 1, 0, 0, 0, 0, 8, 2, 0, 0, 0, 1, 1, 0, 0, 0, 9, 2, 0, 0, 0, 0, 0] }] }
scu ----> scp: ReleaseRQ
scu <---- scp: ReleaseRP
shutdown initiated from: SCU

@pauldotknopf pauldotknopf marked this pull request as ready for review September 3, 2019 19:09
@pauldotknopf
Copy link
Contributor Author

I will be submitting another pull request that will implement an echoscp and echoscu command. They won't be super useful, but they will ensure the correctness of the state machine that will be built with them.

Copy link
Owner

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

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

Thank you very much for the efforts deposited on the project so far!

This is the first review iteration. A bunch of suggestions and nitpicks below. I hope that they won't overwhelm you. Please take your time and leave a comment if you're having trouble dealing with any of them.

On a broader perspective, wouldn't it make sense to delegate some of these mechanisms to the encoding crate, which is already dedicated to the reading/writing of DICOM elements and loading text with the intended character set?

Added the PDU types.
Added logic for reading/writing PDU types to a stream.
@pauldotknopf
Copy link
Contributor Author

I fully expected some changes, so no worries.

I made the changes you requested. I'm ready for another review.

@pauldotknopf
Copy link
Contributor Author

Also, give me a heads up before you merge, and I'll squash these commits.

Copy link
Owner

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

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

Here's the second wave.

@pauldotknopf
Copy link
Contributor Author

Ready for you again.

Copy link
Owner

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

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

Here's another wave of nitpicks, but it should be ready to merge very soon.

pauldotknopf and others added 6 commits September 25, 2019 21:31
@pauldotknopf
Copy link
Contributor Author

Ready for you again.

Copy link
Owner

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

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

This should be ready to become part of the crate roster. Thank you very much!

@Enet4 Enet4 merged commit 414e297 into Enet4:master Sep 26, 2019
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.

2 participants