Extract adb tunnel to a separate component

This simplifies the server code.
This commit is contained in:
Romain Vimont
2021-11-12 22:32:29 +01:00
parent 0d45c29d13
commit c4d008b96a
5 changed files with 260 additions and 191 deletions

View File

@@ -8,6 +8,7 @@
#include <stdint.h>
#include "adb.h"
#include "adb_tunnel.h"
#include "coords.h"
#include "options.h"
#include "util/intr.h"
@@ -52,13 +53,10 @@ struct server {
bool stopped;
struct sc_intr intr;
struct sc_adb_tunnel tunnel;
sc_socket server_socket; // only used if !tunnel_forward
sc_socket video_socket;
sc_socket control_socket;
uint16_t local_port; // selected from port_range
bool tunnel_enabled;
bool tunnel_forward; // use "adb forward" instead of "adb reverse"
const struct server_callbacks *cbs;
void *cbs_userdata;