aboutsummaryrefslogtreecommitdiff
path: root/src/common/sandbox.h
diff options
context:
space:
mode:
authorCristian Toader <cristian.matei.toader@gmail.com>2013-09-02 11:44:04 +0300
committerCristian Toader <cristian.matei.toader@gmail.com>2013-09-02 11:44:04 +0300
commit1ef0b2e1a37878ebbc29b03fefb214b7501656a6 (patch)
treebc4d26556a06c18c1981db987ab8da14c6d2270c /src/common/sandbox.h
parent3e803a1f18aa04c69e18652f84bf054841706eea (diff)
downloadtor-1ef0b2e1a37878ebbc29b03fefb214b7501656a6.tar
tor-1ef0b2e1a37878ebbc29b03fefb214b7501656a6.tar.gz
changed how sb getaddrinfo works such that it supports storing multiple results
Diffstat (limited to 'src/common/sandbox.h')
-rw-r--r--src/common/sandbox.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/common/sandbox.h b/src/common/sandbox.h
index 51449ca41..9a61749a3 100644
--- a/src/common/sandbox.h
+++ b/src/common/sandbox.h
@@ -62,6 +62,21 @@ struct pfd_elem {
/** Typedef to structure used to manage a sandbox configuration. */
typedef struct pfd_elem sandbox_cfg_t;
+/**
+ * Structure used for keeping a linked list of getaddrinfo pre-recorded
+ * results.
+ */
+struct sb_addr_info_el {
+ /** Name of the address info result. */
+ char *name;
+ /** Pre-recorded getaddrinfo result. */
+ struct addrinfo *info;
+ /** Next element in the list. */
+ struct sb_addr_info_el *next;
+};
+/** Typedef to structure used to manage an addrinfo list. */
+typedef struct sb_addr_info_el sb_addr_info_t;
+
/** Function pointer defining the prototype of a filter function.*/
typedef int (*sandbox_filter_func_t)(scmp_filter_ctx ctx,
sandbox_cfg_t *filter);
@@ -93,6 +108,9 @@ typedef struct {
#endif // __linux__
+/** Pre-calls getaddrinfo in order to pre-record result. */
+int sandbox_add_addrinfo(const char *addr);
+
/** Replacement for getaddrinfo(), using pre-recorded results. */
int sandbox_getaddrinfo(const char *name, struct addrinfo **res);