Revision e7d7c4b6 src/Chunkiser/output-stream-udp.c
src/Chunkiser/output-stream-udp.c | ||
---|---|---|
26 | 26 |
int ports; |
27 | 27 |
}; |
28 | 28 |
|
29 |
static int ports_parse(const char *config, int *ports)
|
|
29 |
static int dst_parse(const char *config, int *ports, char *ip)
|
|
30 | 30 |
{ |
31 | 31 |
int i = 0; |
32 | 32 |
struct tag *cfg_tags; |
33 | 33 |
|
34 |
sprintf(ip, "127.0.0.1"); |
|
34 | 35 |
cfg_tags = config_parse(config); |
35 | 36 |
if (cfg_tags) { |
36 | 37 |
int j; |
38 |
const char *addr; |
|
37 | 39 |
|
40 |
addr = config_value_str(cfg_tags, "addr"); |
|
41 |
if (addr) { |
|
42 |
sprintf(ip, "%s", addr); |
|
43 |
} |
|
38 | 44 |
for (j = 0; j < UDP_PORTS_NUM_MAX; j++) { |
39 | 45 |
char tag[8]; |
40 | 46 |
|
... | ... | |
70 | 76 |
return NULL; |
71 | 77 |
} |
72 | 78 |
|
73 |
res->ports = ports_parse(config, res->port);
|
|
79 |
res->ports = dst_parse(config, res->port, res->ip);
|
|
74 | 80 |
if (res->ports == 0) { |
75 | 81 |
fprintf(stderr, "cannot parse the output ports.\n"); |
76 | 82 |
close(res->outfd); |
Also available in: Unified diff