Tor  0.4.7.0-alpha-dev
protover_rust.c
1 /* Copyright (c) 2016-2021, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
3 
4 /*
5  * \file protover_rust.c
6  * \brief Provide a C wrapper for functions exposed in /src/rust/protover,
7  * and safe translation/handling between the Rust/C boundary.
8  */
9 
10 #include "core/or/or.h"
11 #include "core/or/protover.h"
12 
13 #ifdef HAVE_RUST
14 
15 /* Define for compatibility, used in main.c */
16 void
18 {
19 }
20 
21 int protover_contains_long_protocol_names_(const char *s);
22 
23 /**
24  * Return true if the unparsed protover in <b>s</b> would contain a protocol
25  * name longer than MAX_PROTOCOL_NAME_LENGTH, and false otherwise.
26  */
27 bool
28 protover_list_is_invalid(const char *s)
29 {
30  return protover_contains_long_protocol_names_(s) != 0;
31 }
32 
33 #endif /* defined(HAVE_RUST) */
34 
Master header file for Tor-specific functionality.
bool protover_list_is_invalid(const char *s)
Definition: protover.c:302
void protover_free_all(void)
Definition: protover.c:746
Headers and type declarations for protover.c.