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

Convert edge command line options to a new parser #8

Merged
merged 81 commits into from
Jan 2, 2024

Conversation

hamishcoleman
Copy link
Contributor

This paves the way to add a proper config file, add built-in config help and should assist with consolidating the command line options for the supernode as well.

Eventually, I want to have each available transop register itself with a
transop manager interface (similar to how the n3n_config_register_section
is used to register available config options), however that is not ready
yet.

In a config file, I definitely want to use a descriptive string to
configure the cipher used, so these numbers will be going away.

The current commandline option will probably be deprecated, too, which
would mean that nothing external is using a raw ID number for any cipher
settings.

For now, the less of evils seems to be to quick check against the bounds
of the transform id.

To ensure we have a known memory storage size for the config parser,
this also changes the transop_id to be uint8_t.
Convert from storing string representation of a dotted quad netmask to
simply using the mask length.  This helps remove a bunch of double
conversions and ultimately makes the tuntap config simpler and easier to
refactor into using the new option parser.

This commit will have broken every OS except for linux.
Since the inet_pton is unsupported on pre-Vista versions of windows,
simply refuse to allow static addresses in that case.

This is intended to be a temporary solution - when this is converted to
the new option parser, a more permanent answer will be used.
@hamishcoleman hamishcoleman self-assigned this Jan 2, 2024
@hamishcoleman hamishcoleman merged commit 2b24706 into n42n:main Jan 2, 2024
31 checks passed
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.

1 participant