Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add remote configurable output port #202

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add remote configurable output port
Signed-off-by: Nuno Goncalves <[email protected]>
  • Loading branch information
nunojpg committed Sep 30, 2022
commit 7ad248697252bc0ba96bb70cc4cd8dc310be14d3
9 changes: 8 additions & 1 deletion dump1090.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ static void showHelp(void)
"--net-bi-port <ports> TCP Beast input listen ports (default: 30004,30104)\n"
"--net-bo-port <ports> TCP Beast output listen ports (default: 30005)\n"
"--net-stratux-port <ports> TCP Stratux output listen ports (default: disabled)\n"
"--net-dynamic-port <ports> TCP remote configurable output ports (default: 30006)\n"
"--net-ro-size <size> TCP output minimum size (default: 0)\n"
"--net-ro-interval <rate> TCP output memory flush rate in seconds (default: 0)\n"
"--net-heartbeat <rate> TCP heartbeat rate in seconds\n"
Expand Down Expand Up @@ -589,6 +590,8 @@ static void applyNetDefaults()
Modes.net_input_beast_ports = strdup("30004,30104");
if (!Modes.net_output_beast_ports)
Modes.net_output_beast_ports = strdup("30005");
if (!Modes.net_output_dynamic_ports)
Modes.net_output_dynamic_ports = strdup("30006");
}

int main(int argc, char **argv) {
Expand Down Expand Up @@ -689,7 +692,11 @@ int main(int argc, char **argv) {
Modes.net = 1;
free(Modes.net_output_stratux_ports);
Modes.net_output_stratux_ports = strdup(argv[++j]);
} else if (!strcmp(argv[j],"--net-buffer") && more) {
} else if (!strcmp(argv[j],"--net-dynamic-port") && more) {
Modes.net = 1;
free(Modes.net_output_dynamic_ports);
Modes.net_output_dynamic_ports = strdup(argv[++j]);
} else if (!strcmp(argv[j],"--net-buffer") && more) {
Modes.net_sndbuf_size = atoi(argv[++j]);
} else if (!strcmp(argv[j],"--net-verbatim")) {
Modes.net_verbatim = 1;
Expand Down
12 changes: 2 additions & 10 deletions dump1090.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,18 +326,9 @@ struct _Modes { // Internal state
// Networking
char aneterr[ANET_ERR_LEN];
struct net_service *services; // Active services
struct net_writer *writers[OUT_SERVICE_FORMAT_COUNT];
struct client *clients; // Our clients

struct net_service *beast_verbatim_service; // Beast-format output service, verbatim mode
struct net_service *beast_cooked_service; // Beast-format output service, "cooked" mode

struct net_writer raw_out; // AVR-format output
struct net_writer beast_verbatim_out; // Beast-format output, verbatim mode
struct net_writer beast_cooked_out; // Beast-format output, "cooked" mode
struct net_writer sbs_out; // SBS-format output
struct net_writer stratux_out; // Stratux-format output
struct net_writer fatsv_out; // FATSV-format output

#ifdef _WIN32
WSADATA wsaData; // Windows socket initialisation
#endif
Expand All @@ -362,6 +353,7 @@ struct _Modes { // Internal state
char *net_output_stratux_ports; // List of Stratux output TCP ports
char *net_input_beast_ports; // List of Beast input TCP ports
char *net_output_beast_ports; // List of Beast output TCP ports
char *net_output_dynamic_ports; // List of Remote configurable output TCP ports
char *net_bind_address; // Bind address
int net_sndbuf_size; // TCP output buffer size (64Kb * 2^n)
int net_verbatim; // if true, Beast output connections default to verbatim mode
Expand Down
Loading