aboutsummaryrefslogtreecommitdiffstats
path: root/src/main_udt.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-01-03 23:51:07 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-01-17 11:21:11 +0100
commit644aafbc94a2c2bfb49b2352fe31452a1cddab27 (patch)
tree3e140e6454358d853eec32af370c87d6715f74b4 /src/main_udt.c
parentc8405692b381e4079eeaf52f38610a6a24f64773 (diff)
mtp: Make the link_data be a child of the link_set
Change the order of the link and linkset. The link will be below the linkset. This change should make it more easy to introduce multiple linksets.
Diffstat (limited to 'src/main_udt.c')
-rw-r--r--src/main_udt.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main_udt.c b/src/main_udt.c
index 40fe616..b8d754e 100644
--- a/src/main_udt.c
+++ b/src/main_udt.c
@@ -104,7 +104,7 @@ static void sigint()
printf("Terminating.\n");
handled = 1;
if (bsc.setup)
- bsc.link.shutdown(&bsc.link);
+ bsc.link_set->link->shutdown(bsc.link_set->link);
exit(0);
out:
@@ -150,14 +150,14 @@ static void handle_options(int argc, char **argv)
print_help();
exit(0);
case 'p':
- if (bsc.link.pcap_fd >= 0)
- close(bsc.link.pcap_fd);
- bsc.link.pcap_fd = open(optarg, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP| S_IROTH);
- if (bsc.link.pcap_fd < 0) {
+ if (bsc.pcap_fd >= 0)
+ close(bsc.pcap_fd);
+ bsc.pcap_fd = open(optarg, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP| S_IROTH);
+ if (bsc.pcap_fd < 0) {
fprintf(stderr, "Failed to open PCAP file.\n");
exit(0);
}
- mtp_pcap_write_header(bsc.link.pcap_fd);
+ mtp_pcap_write_header(bsc.pcap_fd);
break;
case 'c':
config = optarg;
@@ -207,8 +207,8 @@ int main(int argc, char **argv)
bsc.setup = 0;
bsc.msc_address = "127.0.0.1";
- bsc.link.pcap_fd = -1;
- bsc.link.udp.reset_timeout = 180;
+ bsc.pcap_fd = -1;
+ bsc.udp_reset_timeout = 180;
bsc.ping_time = 20;
bsc.pong_time = 5;
bsc.msc_time = 20;