Tor  0.4.7.0-alpha-dev
Data Structures | Macros | Enumerations | Functions
scheduler.h File Reference

Header file for scheduler*.c. More...

#include "core/or/or.h"
#include "core/or/channel.h"
#include "lib/testsupport/testsupport.h"

Go to the source code of this file.

Data Structures

struct  scheduler_t
 

Macros

#define KIST_SCHED_RUN_INTERVAL_DEFAULT   10
 
#define KIST_SCHED_RUN_INTERVAL_MIN   0
 
#define KIST_SCHED_RUN_INTERVAL_MAX   100
 

Enumerations

enum  scheduler_types_t { SCHEDULER_NONE = -1 , SCHEDULER_VANILLA = 1 , SCHEDULER_KIST = 2 , SCHEDULER_KIST_LITE = 3 }
 

Functions

void scheduler_init (void)
 
void scheduler_free_all (void)
 
void scheduler_conf_changed (void)
 
void scheduler_notify_networkstatus_changed (void)
 
void scheduler_release_channel (channel_t *chan)
 
void scheduler_channel_wants_writes (channel_t *chan)
 
void scheduler_channel_doesnt_want_writes (channel_t *chan)
 
void scheduler_channel_has_waiting_cells (channel_t *chan)
 

Detailed Description

Header file for scheduler*.c.

Definition in file scheduler.h.

Enumeration Type Documentation

◆ scheduler_types_t

Scheduler type, we build an ordered list with those values from the parsed strings in Schedulers. The reason to do such a thing is so we can quickly and without parsing strings select the scheduler at anytime.

Definition at line 19 of file scheduler.h.

Function Documentation

◆ scheduler_channel_doesnt_want_writes()

void scheduler_channel_doesnt_want_writes ( channel_t chan)

Mark a channel as no longer ready to accept writes.

Possible state changes:

  • SCHED_CHAN_PENDING -> SCHED_CHAN_WAITING_TO_WRITE
  • SCHED_CHAN_WAITING_FOR_CELLS -> SCHED_CHAN_IDLE

Definition at line 512 of file scheduler.c.

◆ scheduler_channel_has_waiting_cells()

void scheduler_channel_has_waiting_cells ( channel_t chan)

Mark a channel as having waiting cells.

Possible state changes:

  • SCHED_CHAN_WAITING_FOR_CELLS -> SCHED_CHAN_PENDING
  • SCHED_CHAN_IDLE -> SCHED_CHAN_WAITING_TO_WRITE

Definition at line 548 of file scheduler.c.

◆ scheduler_channel_wants_writes()

void scheduler_channel_wants_writes ( channel_t chan)

Mark a channel as ready to accept writes. Possible state changes:

  • SCHED_CHAN_WAITING_TO_WRITE -> SCHED_CHAN_PENDING
  • SCHED_CHAN_IDLE -> SCHED_CHAN_WAITING_FOR_CELLS

Definition at line 673 of file scheduler.c.

◆ scheduler_conf_changed()

void scheduler_conf_changed ( void  )

This is how the scheduling system is notified of Tor's configuration changing. For example: a SIGHUP was issued.

Definition at line 452 of file scheduler.c.

◆ scheduler_free_all()

void scheduler_free_all ( void  )

Free everything scheduling-related from main.c. Note this is only called when Tor is shutting down, while scheduler_t->free_all() is called both when Tor is shutting down and when we are switching schedulers.

Definition at line 484 of file scheduler.c.

◆ scheduler_notify_networkstatus_changed()

void scheduler_notify_networkstatus_changed ( void  )

Whenever we get a new consensus, this function is called.

Definition at line 467 of file scheduler.c.