Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Core
Tor
Commits
f1370a86
Commit
f1370a86
authored
3 months ago
by
Mike Perry
Browse files
Options
Downloads
Patches
Plain Diff
Ticket 40872: Add conflux helper functions for control port info
parent
0bd8752d
No related branches found
No related tags found
1 merge request
!851
Ticket40872
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/or/conflux_util.c
+27
-0
27 additions, 0 deletions
src/core/or/conflux_util.c
src/core/or/conflux_util.h
+3
-0
3 additions, 0 deletions
src/core/or/conflux_util.h
with
30 additions
and
0 deletions
src/core/or/conflux_util.c
+
27
−
0
View file @
f1370a86
...
...
@@ -442,3 +442,30 @@ conflux_validate_legs(const conflux_t *cfx)
conflux_log_set
(
LOG_PROTOCOL_WARN
,
cfx
,
is_client
);
}
}
/** Return the nonce for a circuit, for use on the control port */
const
uint8_t
*
conflux_get_nonce
(
const
circuit_t
*
circ
)
{
if
(
circ
->
conflux_pending_nonce
)
{
return
circ
->
conflux_pending_nonce
;
}
else
if
(
circ
->
conflux
)
{
return
circ
->
conflux
->
nonce
;
}
else
{
return
NULL
;
}
}
/** Return the conflux RTT for a circuit, for use on the control port */
uint64_t
conflux_get_circ_rtt
(
const
circuit_t
*
circ
)
{
if
(
circ
->
conflux
)
{
conflux_leg_t
*
leg
=
conflux_get_leg
(
circ
->
conflux
,
circ
);
tor_assert
(
leg
);
return
leg
->
circ_rtts_usec
;
}
else
{
return
0
;
}
}
This diff is collapsed.
Click to expand it.
src/core/or/conflux_util.h
+
3
−
0
View file @
f1370a86
...
...
@@ -34,6 +34,9 @@ CIRCUIT_IS_CONFLUX(const circuit_t *circ)
}
}
const
uint8_t
*
conflux_get_nonce
(
const
circuit_t
*
circ
);
uint64_t
conflux_get_circ_rtt
(
const
circuit_t
*
circ
);
int
circuit_get_package_window
(
circuit_t
*
circ
,
const
crypt_path_t
*
cpath
);
bool
conflux_can_send
(
conflux_t
*
cfx
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment