Skip to content

Introduce DatagramOptions#12

Merged
altonen merged 5 commits intoeepnet:masterfrom
sjlgasnier:master
Jul 27, 2025
Merged

Introduce DatagramOptions#12
altonen merged 5 commits intoeepnet:masterfrom
sjlgasnier:master

Conversation

@sjlgasnier
Copy link
Contributor

@sjlgasnier sjlgasnier commented Jul 26, 2025

Aims at closing #9

I wrote 2 new doctests for the asynchronous module, but I had to set the root options.rs file to public in order to use DatagramOptions.
Is it an issue ?

Feel free to tear those doctests if so.

Copy link
Member

@altonen altonen left a comment

Choose a reason for hiding this comment

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

Ty! Left a few documentation nits.

You also need to re-export DatagramOptions in src/lib.rs, i.e., add DatagramOptions to pub use options::{...}

Comment on lines +402 to +423
#[derive(Default)]
pub struct DatagramOptions {
/// Overrides the source port
pub from_port: u16,

/// Overrides the destination port
pub to_port: u16,

/// Overrides the I2P protocol used
///
/// Only for RAW/Anonymous sessions
pub protocol: u8,

/// Overrides the crypto_tags_to_send I2CP option
pub send_tags: usize,

/// Overrides the crypto_low_tag_threshold I2CP option
pub tag_threshold: usize,

/// Overrides the should_bundle_reply_info I2CP option
pub send_leaseset: bool,
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#[derive(Default)]
pub struct DatagramOptions {
/// Overrides the source port
pub from_port: u16,
/// Overrides the destination port
pub to_port: u16,
/// Overrides the I2P protocol used
///
/// Only for RAW/Anonymous sessions
pub protocol: u8,
/// Overrides the crypto_tags_to_send I2CP option
pub send_tags: usize,
/// Overrides the crypto_low_tag_threshold I2CP option
pub tag_threshold: usize,
/// Overrides the should_bundle_reply_info I2CP option
pub send_leaseset: bool,
}
/// Datagram options.
#[derive(Default)]
pub struct DatagramOptions {
/// Overrides the source port.
///
/// Defaults to `0`.
pub from_port: u16,
/// Overrides the destination port.
///
/// Defaults to `0`.
pub to_port: u16,
/// Overrides the I2P protocol used.
///
/// Only for RAW/Anonymous sessions.
///
/// Defaults to `18`.
pub protocol: u8,
/// Overrides the [`SessionOptions::crypto_tags_to_send`] I2CP option.
///
/// Defaults to `0`.
pub send_tags: usize,
/// Overrides the [`SessionOptions::crypto_low_tag_threshold`] I2CP option.
///
/// Defaults to `0`.
pub tag_threshold: usize,
/// Overrides the [`SessionOptions::should_bundle_reply_info`] I2CP option.
///
/// Defaults to `true`.
pub send_lease_set: bool,
}

options.to_port,
options.send_tags,
options.tag_threshold,
options.send_leaseset,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
options.send_leaseset,
options.send_lease_set,

options.protocol,
options.send_tags,
options.tag_threshold,
options.send_leaseset,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
options.send_leaseset,
options.send_lease_set,

options.protocol,
options.send_tags,
options.tag_threshold,
options.send_leaseset,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
options.send_leaseset,
options.send_lease_set,

options.to_port,
options.send_tags,
options.tag_threshold,
options.send_leaseset,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
options.send_leaseset,
options.send_lease_set,

@sjlgasnier sjlgasnier requested a review from altonen July 27, 2025 10:48
@altonen altonen merged commit 89def14 into eepnet:master Jul 27, 2025
1 check passed
@altonen altonen mentioned this pull request Oct 19, 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.

2 participants