-
Notifications
You must be signed in to change notification settings - Fork 256
Options variables converted to a structure #469
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
Open
gsnw-sebast
wants to merge
2
commits into
schweikert:develop
Choose a base branch
from
gsnw:flags-variable-to-struct
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,52 +1,21 @@ | ||
| #include "flags.h" | ||
| #include "options.h" | ||
|
|
||
| #include <stdint.h> | ||
| Options options_init(void) | ||
| { | ||
| Options o = { 0 }; | ||
|
|
||
| /* options with values */ | ||
| /* all time-related values are int64_t nanoseconds */ | ||
| unsigned int opt_retry = DEFAULT_RETRY; | ||
| int64_t opt_timeout = (int64_t)DEFAULT_TIMEOUT * 1000000; | ||
| int64_t opt_seqmap_timeout = (int64_t)DEFAULT_SEQMAP_TIMEOUT * 1000000; | ||
| int64_t opt_interval = (int64_t)DEFAULT_INTERVAL * 1000000; | ||
| int64_t opt_perhost_interval = (int64_t)DEFAULT_PERHOST_INTERVAL * 1000000; | ||
| float opt_backoff = DEFAULT_BACKOFF_FACTOR; | ||
| unsigned int opt_ping_data_size = DEFAULT_PING_DATA_SIZE; | ||
| unsigned int opt_count = 1; | ||
| unsigned int opt_min_reachable = 0; | ||
| unsigned int opt_ttl = 0; | ||
| /* options with values — set non-zero defaults */ | ||
| o.retry = DEFAULT_RETRY; | ||
| o.timeout = (int64_t)DEFAULT_TIMEOUT * 1000000; | ||
| o.seqmap_timeout = (int64_t)DEFAULT_SEQMAP_TIMEOUT * 1000000; | ||
| o.interval = (int64_t)DEFAULT_INTERVAL * 1000000; | ||
| o.perhost_interval = (int64_t)DEFAULT_PERHOST_INTERVAL * 1000000; | ||
| o.backoff = DEFAULT_BACKOFF_FACTOR; | ||
| o.ping_data_size = DEFAULT_PING_DATA_SIZE; | ||
| o.count = 1; | ||
|
|
||
| /* switches 0 = off 1 = on */ | ||
| int opt_version_on = 0; | ||
| int opt_verbose_on = 0; | ||
| int opt_unreachable_on = 0; | ||
| int opt_alive_on = 0; | ||
| int opt_quiet_on = 0; | ||
| int opt_elapsed_on = 0; | ||
| int opt_stats_on = 0; | ||
| int opt_cumulative_stats_on = 0; | ||
| int opt_generate_on = 0; /* flag for IP list generation */ | ||
| int opt_count_on = 0; | ||
| int opt_loop_on = 0; | ||
| int opt_print_netdata_on = 0; | ||
| int opt_print_json_on = 0; | ||
| int opt_print_tos_on = 0; | ||
| int opt_print_ttl_on = 0; | ||
| int opt_per_recv_on = 0; | ||
| int opt_report_all_rtts_on = 0; | ||
| int opt_name_on = 0; | ||
| int opt_addr_on = 0; | ||
| int opt_rdns_on = 0; | ||
| int opt_backoff_on = 0; | ||
| int opt_multif_on = 0; | ||
| int opt_timeout_on = 0; | ||
| int opt_fast_reachable_on = 0; | ||
| int opt_outage_on = 0; | ||
| int opt_random_data_on = 0; | ||
| int opt_check_source_on = 0; | ||
| int opt_size_on = 0; | ||
| int opt_oiface_on = 0; | ||
| int opt_bindiface_on = 0; | ||
| int opt_timestamp_on = 0; | ||
| int opt_timestamp_format = 0; | ||
| int opt_icmp_request_typ = 0; | ||
| return o; | ||
| } | ||
|
|
||
| Options opt; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.