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-2013, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
7 #ifndef TOR_STATEFILE_H
8 #define TOR_STATEFILE_H
10 MOCK_DECL(or_state_t
*,get_or_state
,(void));
11 int did_last_state_file_write_fail(void);
12 int or_state_save(time_t now
);
14 void save_transport_to_state(const char *transport_name
,
15 const tor_addr_t
*addr
, uint16_t port
);
16 char *get_stored_bindaddr_for_server_transport(const char *transport
);
17 int or_state_load(void);
18 int or_state_loaded(void);
19 void or_state_free_all(void);
21 #ifdef STATEFILE_PRIVATE
22 STATIC config_line_t
*get_transport_in_state_by_name(const char *transport
);
23 STATIC
void or_state_free(or_state_t
*state
);
24 STATIC or_state_t
*or_state_new(void);