Tor  0.4.7.0-alpha-dev
statefile.h
Go to the documentation of this file.
1 /* Copyright (c) 2001 Matej Pfajfar.
2  * Copyright (c) 2001-2004, Roger Dingledine.
3  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4  * Copyright (c) 2007-2021, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
7 /**
8  * \file statefile.h
9  *
10  * \brief Header for statefile.c
11  */
12 
13 #ifndef TOR_STATEFILE_H
14 #define TOR_STATEFILE_H
15 
18 int or_state_save(time_t now);
19 
20 void save_transport_to_state(const char *transport_name,
21  const tor_addr_t *addr, uint16_t port);
22 char *get_stored_bindaddr_for_server_transport(const char *transport);
23 int or_state_load(void);
24 int or_state_loaded(void);
25 void or_state_free_all(void);
26 void or_state_mark_dirty(or_state_t *state, time_t when);
27 
28 #ifdef STATEFILE_PRIVATE
30  const char *transport);
31 STATIC void or_state_free_(or_state_t *state);
32 #define or_state_free(st) FREE_AND_NULL(or_state_t, or_state_free_, (st))
33 STATIC or_state_t *or_state_new(void);
34 struct config_mgr_t;
35 STATIC const struct config_mgr_t *get_state_mgr(void);
36 STATIC void or_state_remove_obsolete_lines(struct config_line_t **extra_lines);
37 #endif /* defined(STATEFILE_PRIVATE) */
38 
39 #endif /* !defined(TOR_STATEFILE_H) */
STATIC const config_mgr_t * get_state_mgr(void)
Definition: statefile.c:200
STATIC void or_state_remove_obsolete_lines(config_line_t **extra_lines)
Definition: statefile.c:513
STATIC config_line_t * get_transport_in_state_by_name(const char *transport)
Definition: statefile.c:625
int or_state_loaded(void)
Definition: statefile.c:228
or_state_t * get_or_state(void)
Definition: statefile.c:220
int or_state_load(void)
Definition: statefile.c:412
void save_transport_to_state(const char *transport_name, const tor_addr_t *addr, uint16_t port)
Definition: statefile.c:722
void or_state_mark_dirty(or_state_t *state, time_t when)
Definition: statefile.c:784
char * get_stored_bindaddr_for_server_transport(const char *transport)
Definition: statefile.c:689
int did_last_state_file_write_fail(void)
Definition: statefile.c:547
int or_state_save(time_t now)
Definition: statefile.c:562
#define STATIC
Definition: testsupport.h:32
#define MOCK_DECL(rv, funcname, arglist)
Definition: testsupport.h:127