Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Benjamin J. Thompson
Tor
Commits
e591aafc
Commit
e591aafc
authored
16 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Add a function to get a LongName from a routerstatus. Needed for partial bug 941 fix.
svn:r19077
parent
49308dcc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/or/or.h
+2
-1
2 additions, 1 deletion
src/or/or.h
src/or/router.c
+18
-1
18 additions, 1 deletion
src/or/router.c
with
20 additions
and
2 deletions
src/or/or.h
+
2
−
1
View file @
e591aafc
...
...
@@ -4238,7 +4238,8 @@ char *extrainfo_get_client_geoip_summary(time_t);
int
is_legal_nickname
(
const
char
*
s
);
int
is_legal_nickname_or_hexdigest
(
const
char
*
s
);
int
is_legal_hexdigest
(
const
char
*
s
);
void
router_get_verbose_nickname
(
char
*
buf
,
routerinfo_t
*
router
);
void
router_get_verbose_nickname
(
char
*
buf
,
const
routerinfo_t
*
router
);
void
routerstatus_get_verbose_nickname
(
char
*
buf
,
const
routerstatus_t
*
router
);
void
router_reset_warnings
(
void
);
void
router_reset_reachability
(
void
);
void
router_free_all
(
void
);
...
...
This diff is collapsed.
Click to expand it.
src/or/router.c
+
18
−
1
View file @
e591aafc
...
...
@@ -1980,7 +1980,7 @@ is_legal_hexdigest(const char *s)
* The router's nickname.
**/
void
router_get_verbose_nickname
(
char
*
buf
,
routerinfo_t
*
router
)
router_get_verbose_nickname
(
char
*
buf
,
const
routerinfo_t
*
router
)
{
buf
[
0
]
=
'$'
;
base16_encode
(
buf
+
1
,
HEX_DIGEST_LEN
+
1
,
router
->
cache_info
.
identity_digest
,
...
...
@@ -1989,6 +1989,23 @@ router_get_verbose_nickname(char *buf, routerinfo_t *router)
strlcpy
(
buf
+
1
+
HEX_DIGEST_LEN
+
1
,
router
->
nickname
,
MAX_NICKNAME_LEN
+
1
);
}
/** Set <b>buf</b> (which must have MAX_VERBOSE_NICKNAME_LEN+1 bytes) to the
* verbose representation of the identity of <b>router</b>. The format is:
* A dollar sign.
* The upper-case hexadecimal encoding of the SHA1 hash of router's identity.
* A "=" if the router is named; a "~" if it is not.
* The router's nickname.
**/
void
routerstatus_get_verbose_nickname
(
char
*
buf
,
const
routerstatus_t
*
router
)
{
buf
[
0
]
=
'$'
;
base16_encode
(
buf
+
1
,
HEX_DIGEST_LEN
+
1
,
router
->
identity_digest
,
DIGEST_LEN
);
buf
[
1
+
HEX_DIGEST_LEN
]
=
router
->
is_named
?
'='
:
'~'
;
strlcpy
(
buf
+
1
+
HEX_DIGEST_LEN
+
1
,
router
->
nickname
,
MAX_NICKNAME_LEN
+
1
);
}
/** Forget that we have issued any router-related warnings, so that we'll
* warn again if we see the same errors. */
void
...
...
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