nickname.c File Reference
#include "core/or/or.h"
#include "feature/nodelist/nickname.h"

Go to the source code of this file.


int is_legal_nickname (const char *s)
int is_legal_nickname_or_hexdigest (const char *s)
int is_legal_hexdigest (const char *s)

Detailed Description

Check and manipulate relay nicknames.

Definition in file nickname.c.

Function Documentation

◆ is_legal_hexdigest()

int is_legal_hexdigest ( const char *  s)

Return true iff s is a valid hex-encoded identity-key digest. (That is, an optional $, followed by 40 hex characters, followed by either nothing, or = or ~ followed by a nickname, or a character other than =, ~, or a hex character.)

Definition at line 45 of file nickname.c.

References HEX_CHARACTERS, HEX_DIGEST_LEN, is_legal_nickname(), and tor_assert().

Referenced by is_legal_nickname_or_hexdigest().

◆ is_legal_nickname()

int is_legal_nickname ( const char *  s)

Return true iff s is a valid server nickname. (That is, a string containing between 1 and MAX_NICKNAME_LEN characters from LEGAL_NICKNAME_CHARACTERS.)

Definition at line 19 of file nickname.c.


Referenced by is_legal_hexdigest(), is_legal_nickname_or_hexdigest(), and rend_service_parse_intro_for_v0_or_v1().

◆ is_legal_nickname_or_hexdigest()

int is_legal_nickname_or_hexdigest ( const char *  s)

Return true iff s is a valid server nickname or hex-encoded identity-key digest.

Definition at line 31 of file nickname.c.

References is_legal_hexdigest(), and is_legal_nickname().

Referenced by rend_service_parse_intro_for_v0_or_v1().