control_fmt.c File Reference
#include "core/or/or.h"
#include "core/mainloop/connection.h"
#include "core/or/circuitbuild.h"
#include "core/or/circuitlist.h"
#include "core/or/connection_edge.h"
#include "feature/control/control_fmt.h"
#include "feature/control/control_proto.h"
#include "feature/nodelist/nodelist.h"
#include "core/or/cpath_build_state_st.h"
#include "core/or/entry_connection_st.h"
#include "core/or/or_connection_st.h"
#include "core/or/origin_circuit_st.h"
#include "core/or/socks_request_st.h"
#include "feature/control/control_connection_st.h"

Go to the source code of this file.


int write_stream_target_to_buf (entry_connection_t *conn, char *buf, size_t len)
void orconn_target_get_name (char *name, size_t len, or_connection_t *conn)
char * circuit_describe_status_for_controller (origin_circuit_t *circ)
 MOCK_IMPL (const char *, node_describe_longname_by_id,(const char *id_digest))

Detailed Description

Formatting functions for controller data.

Definition in file control_fmt.c.

Function Documentation

◆ circuit_describe_status_for_controller()

char* circuit_describe_status_for_controller ( origin_circuit_t circ)


MOCK_IMPL ( const char *  ,
node_describe_longname_by_id  ,
(const char *id_digest)   

Return a longname the node whose identity is id_digest. If node_get_by_id() returns NULL, base 16 encoding of id_digest is returned instead.

This function is not thread-safe. Each call to this function invalidates previous values returned by this function.

Definition at line 175 of file control_fmt.c.

References MAX_VERBOSE_NICKNAME_LEN, and node_get_verbose_nickname_by_id().

◆ orconn_target_get_name()

void orconn_target_get_name ( char *  name,
size_t  len,
or_connection_t conn 

Figure out the best name for the target router of an OR connection conn, and write it into the len-character buffer name.

Definition at line 54 of file control_fmt.c.

◆ write_stream_target_to_buf()

int write_stream_target_to_buf ( entry_connection_t conn,
char *  buf,
size_t  len 

Given an AP connection conn and a len-character buffer buf, determine the address:port combination requested on conn, and write it to buf. Return 0 on success, -1 on failure.

Definition at line 32 of file control_fmt.c.

References socks_request_t::address, entry_connection_t::chosen_exit_name, connection_edge_is_rendezvous_stream(), socks_request_t::port, entry_connection_t::socks_request, and tor_snprintf().