tor  0.4.2.1-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-2019, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
13 #ifndef TOR_STATEFILE_H
14 #define TOR_STATEFILE_H
15 
16 MOCK_DECL(or_state_t *,get_or_state,(void));
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 #endif /* defined(STATEFILE_PRIVATE) */
35 
36 #endif /* !defined(TOR_STATEFILE_H) */
STATIC config_line_t * get_transport_in_state_by_name(const char *transport)
Definition: statefile.c:563
void or_state_mark_dirty(or_state_t *state, time_t when)
Definition: statefile.c:722
char * get_stored_bindaddr_for_server_transport(const char *transport)
Definition: statefile.c:627
int or_state_save(time_t now)
Definition: statefile.c:500
int did_last_state_file_write_fail(void)
Definition: statefile.c:485
int or_state_load(void)
Definition: statefile.c:381
void save_transport_to_state(const char *transport_name, const tor_addr_t *addr, uint16_t port)
Definition: statefile.c:660
#define MOCK_DECL(rv, funcname, arglist)
Definition: testsupport.h:94
int or_state_loaded(void)
Definition: statefile.c:203