Tor  0.4.5.0-alpha-dev
Functions
fmt_serverstatus.c File Reference

Format relay info for a controller. More...

#include "core/or/or.h"
#include "feature/control/fmt_serverstatus.h"
#include "app/config/config.h"
#include "feature/dirauth/authmode.h"
#include "feature/dirauth/voteflags.h"
#include "feature/nodelist/describe.h"
#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/node_st.h"
#include "feature/nodelist/routerinfo_st.h"

Go to the source code of this file.

Functions

static char * list_single_server_status (const routerinfo_t *desc, int is_live)
 
int list_server_status_v1 (smartlist_t *routers, char **router_status_out, int for_controller)
 

Detailed Description

Format relay info for a controller.

Definition in file fmt_serverstatus.c.

Function Documentation

◆ list_server_status_v1()

int list_server_status_v1 ( smartlist_t routers,
char **  router_status_out,
int  for_controller 
)

Based on the routerinfo_ts in routers, allocate the contents of a v1-style router-status line, and store it in *router_status_out. Return 0 on success, -1 on failure.

If for_controller is true, include the routers with very old descriptors.

This is deprecated: it's only used for controllers that want outputs in the old format.

Definition at line 66 of file fmt_serverstatus.c.

◆ list_single_server_status()

static char* list_single_server_status ( const routerinfo_t desc,
int  is_live 
)
static

Allocate and return a description of the status of the server desc, for use in a v1-style router-status line. The server is listed as running iff is_live is true.

This is deprecated: it's only used for controllers that want outputs in the old format.

Definition at line 32 of file fmt_serverstatus.c.

Referenced by list_server_status_v1().