Revision 5f72f6b3
streamer.c | ||
---|---|---|
45 | 45 |
static const char *output_config; |
46 | 46 |
static bool loop_input = false; |
47 | 47 |
static const char *net_helper_config = ""; |
48 |
static const char *topo_config = ""; |
|
48 | 49 |
unsigned char msgTypes[] = {MSG_TYPE_CHUNK,MSG_TYPE_SIGNALLING}; |
49 | 50 |
bool chunk_log = false; |
50 | 51 |
|
... | ... | |
72 | 73 |
"\t[-c chunks]: set the number of chunks a peer can send per seconds.\n" |
73 | 74 |
"\t it controls the upload capacity of peer as well.\n" |
74 | 75 |
"\t[-M peers]: neighbourhood target size.\n" |
76 |
"\t[-t config]: topology config.\n" |
|
75 | 77 |
"\t[-P port]: local UDP port to be used by the peer.\n" |
76 | 78 |
"\t[-I iface]: local netwok interface to be used by the peer.\n" |
77 | 79 |
"\t Useful if the host has several interfaces/addresses.\n" |
... | ... | |
117 | 119 |
{0, 0, 0, 0} |
118 | 120 |
}; |
119 | 121 |
|
120 |
while ((o = getopt_long (argc, argv, "b:o:c:p:i:P:I:f:F:m:lC:N:n:M:",long_options, &option_index)) != -1) { //use this function to manage long options |
|
122 |
while ((o = getopt_long (argc, argv, "b:o:c:p:i:P:I:f:F:m:lC:N:n:M:t:",long_options, &option_index)) != -1) { //use this function to manage long options
|
|
121 | 123 |
switch(o) { |
122 | 124 |
case 0: //for long options |
123 | 125 |
if( strcmp( "chunk_log", long_options[option_index].name ) == 0 ) { chunk_log = true; } |
... | ... | |
169 | 171 |
case 'M': |
170 | 172 |
NEIGHBORHOOD_TARGET_SIZE = atoi(optarg); |
171 | 173 |
break; |
174 |
case 't': |
|
175 |
topo_config = strdup(optarg); |
|
176 |
break; |
|
172 | 177 |
default: |
173 | 178 |
fprintf(stderr, "Error: unknown option %c\n", o); |
174 | 179 |
print_usage(argc, argv); |
... | ... | |
215 | 220 |
} |
216 | 221 |
free(my_addr); |
217 | 222 |
fprintf(stderr, "My network ID is: %s\n", node_addr(myID)); |
218 |
topologyInit(myID, "");
|
|
223 |
topologyInit(myID, topo_config);
|
|
219 | 224 |
|
220 | 225 |
return myID; |
221 | 226 |
} |
Also available in: Unified diff