Tor 0.4.9.0-alpha-dev
Data Fields
scheduler_t Struct Reference

#include <scheduler.h>

Data Fields

scheduler_types_t type
 
void(* init )(void)
 
void(* free_all )(void)
 
void(* schedule )(void)
 
void(* run )(void)
 
void(* on_new_consensus )(void)
 
void(* on_channel_free )(const channel_t *)
 
void(* on_new_options )(void)
 

Detailed Description

A scheduler implementation is a collection of function pointers. If you would like to add a new scheduler called foo, create scheduler_foo.c, implement at least the mandatory ones, and implement get_foo_scheduler() that returns a complete scheduler_t for your foo scheduler. See scheduler_kist.c for an example.

These function pointers SHOULD NOT be used anywhere outside of the scheduling source files. The rest of Tor should communicate with the scheduling system through the functions near the bottom of this file, and those functions will call into the current scheduler implementation as necessary.

If your scheduler doesn't need to implement something (for example: it doesn't create any state for itself, thus it has nothing to free when Tor is shutting down), then set that function pointer to NULL.

Definition at line 43 of file scheduler.h.

Field Documentation

◆ free_all

void(* free_all) (void)

Definition at line 58 of file scheduler.h.

◆ init

void(* init) (void)

Definition at line 53 of file scheduler.h.

◆ on_channel_free

void(* on_channel_free) (const channel_t *)

Definition at line 89 of file scheduler.h.

◆ on_new_consensus

void(* on_new_consensus) (void)

Definition at line 83 of file scheduler.h.

◆ on_new_options

void(* on_new_options) (void)

Definition at line 95 of file scheduler.h.

◆ run

void(* run) (void)

Definition at line 71 of file scheduler.h.

◆ schedule

void(* schedule) (void)

Definition at line 63 of file scheduler.h.

◆ type

Definition at line 46 of file scheduler.h.


The documentation for this struct was generated from the following file: