Tor  0.4.5.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-2020, 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 #endif /* defined(STATEFILE_PRIVATE) */
37 
38 #endif /* !defined(TOR_STATEFILE_H) */
save_transport_to_state
void save_transport_to_state(const char *transport_name, const tor_addr_t *addr, uint16_t port)
Definition: statefile.c:679
or_state_t
Definition: or_state_st.h:21
get_or_state
or_state_t * get_or_state(void)
Definition: statefile.c:208
tor_addr_t
Definition: address.h:69
get_transport_in_state_by_name
STATIC config_line_t * get_transport_in_state_by_name(const char *transport)
Definition: statefile.c:582
or_state_save
int or_state_save(time_t now)
Definition: statefile.c:519
config_mgr_t
Definition: confmgt.c:107
get_state_mgr
STATIC const config_mgr_t * get_state_mgr(void)
Definition: statefile.c:188
or_state_loaded
int or_state_loaded(void)
Definition: statefile.c:216
did_last_state_file_write_fail
int did_last_state_file_write_fail(void)
Definition: statefile.c:504
or_state_load
int or_state_load(void)
Definition: statefile.c:400
MOCK_DECL
#define MOCK_DECL(rv, funcname, arglist)
Definition: testsupport.h:127
get_stored_bindaddr_for_server_transport
char * get_stored_bindaddr_for_server_transport(const char *transport)
Definition: statefile.c:646
config_line_t
Definition: confline.h:29
STATIC
#define STATIC
Definition: testsupport.h:32
or_state_mark_dirty
void or_state_mark_dirty(or_state_t *state, time_t when)
Definition: statefile.c:741