summaryrefslogtreecommitdiffstats
path: root/src/fastd.h
diff options
context:
space:
mode:
authorRick Lei <ricklei@gmail.com>2015-01-14 15:11:43 +0100
committerRick Lei <ricklei@gmail.com>2015-01-14 15:11:43 +0100
commitc4378784ae2caec57634f9f04bcb3dcddc673f36 (patch)
tree70bbdb1c348803006a7cbf2092da65312720a386 /src/fastd.h
parent133cee578e04e561bb17e37393bbf7e427522560 (diff)
downloadfastd-c4378784ae2caec57634f9f04bcb3dcddc673f36.tar
fastd-c4378784ae2caec57634f9f04bcb3dcddc673f36.zip
Add Android 4.1+ support. See doc/README-Android.md for build HOWTO.
* Update CMake files to work with android-cmake * Use unix domain socket for communicating with Android GUI * May also run standalone but requires rooted Android device
Diffstat (limited to 'src/fastd.h')
-rw-r--r--src/fastd.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/fastd.h b/src/fastd.h
index 6e4cda6..3d62053 100644
--- a/src/fastd.h
+++ b/src/fastd.h
@@ -2,6 +2,10 @@
Copyright (c) 2012-2014, Matthias Schiffer <mschiffer@universe-factory.net>
All rights reserved.
+ Android port contributor:
+ Copyright (c) 2014-2015, Haofeng "Rick" Lei <ricklei@gmail.com>
+ All rights reserved.
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -239,6 +243,10 @@ struct fastd_config {
char *status_socket; /**< The path of the status socket */
#endif
+#ifdef __ANDROID__
+ bool android_integration; /**< Enable Android GUI integration features */
+#endif
+
bool daemon; /**< Set to make fastd fork to the background after initialization */
char *pid_file; /**< A filename to write fastd's PID to */
@@ -296,6 +304,10 @@ struct fastd_context {
int tunfd; /**< The file descriptor of the tunnel interface */
+#ifdef __ANDROID__
+ int android_ctrl_sock_fd; /**< The unix domain socket for communicating with Android GUI */
+#endif
+
size_t n_socks; /**< The number of sockets in socks */
fastd_socket_t *socks; /**< Array of all sockets */
@@ -337,6 +349,12 @@ fastd_socket_t * fastd_socket_open(fastd_peer_t *peer, int af);
void fastd_socket_close(fastd_socket_t *sock);
void fastd_socket_error(fastd_socket_t *sock);
+#ifdef __ANDROID__
+int fastd_android_receive_tunfd(void);
+void fastd_android_send_pid(void);
+bool fastd_android_protect_socket(int fd);
+#endif
+
void fastd_resolve_peer(fastd_peer_t *peer, fastd_remote_t *remote);
void fastd_tuntap_open(void);