diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/vdrdiscovery.c | 25 | ||||
| -rw-r--r-- | tools/vdrdiscovery.h | 4 |
2 files changed, 19 insertions, 10 deletions
diff --git a/tools/vdrdiscovery.c b/tools/vdrdiscovery.c index 2383130d..da5bfb2a 100644 --- a/tools/vdrdiscovery.c +++ b/tools/vdrdiscovery.c @@ -7,7 +7,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: vdrdiscovery.c,v 1.3 2007-06-11 16:40:43 phintuka Exp $ + * $Id: vdrdiscovery.c,v 1.4 2007-06-11 19:39:06 phintuka Exp $ * */ @@ -106,17 +106,26 @@ static inline int udp_discovery_send(int fd_discovery, int port, char *msg) } #ifndef FE_STANDALONE -int udp_discovery_broadcast(int fd_discovery, int server_port) +int udp_discovery_broadcast(int fd_discovery, int server_port, const char *server_address) { char *msg = NULL; int result; - asprintf(&msg, - DISCOVERY_1_0_HDR //"VDR xineliboutput DISCOVERY 1.0" "\r\n" - DISCOVERY_1_0_SVR //"Server port: %d" "\r\n" - DISCOVERY_1_0_VERSION //"Server version: xineliboutput-" XINELIBOUTPUT_VERSION "\r\n" - "\r\n", - server_port); + if(server_address && *server_address) + asprintf(&msg, + DISCOVERY_1_0_HDR //"VDR xineliboutput DISCOVERY 1.0" "\r\n" + DISCOVERY_1_0_SVR //"Server port: %d" "\r\n" + DISCOVERY_1_0_ADDR //"Server Address: %d.%d.%d.%d \r\n" + DISCOVERY_1_0_VERSION //"Server version: xineliboutput-" XINELIBOUTPUT_VERSION "\r\n" + "\r\n", + server_port, server_address); + else + asprintf(&msg, + DISCOVERY_1_0_HDR //"VDR xineliboutput DISCOVERY 1.0" "\r\n" + DISCOVERY_1_0_SVR //"Server port: %d" "\r\n" + DISCOVERY_1_0_VERSION //"Server version: xineliboutput-" XINELIBOUTPUT_VERSION "\r\n" + "\r\n", + server_port); result = udp_discovery_send(fd_discovery, DISCOVERY_PORT, msg); diff --git a/tools/vdrdiscovery.h b/tools/vdrdiscovery.h index 51146268..7c4d18ae 100644 --- a/tools/vdrdiscovery.h +++ b/tools/vdrdiscovery.h @@ -7,7 +7,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: vdrdiscovery.h,v 1.2 2007-01-01 06:17:11 phintuka Exp $ + * $Id: vdrdiscovery.h,v 1.3 2007-06-11 19:39:06 phintuka Exp $ * */ @@ -24,7 +24,7 @@ extern "C" { int udp_discovery_find_server(int *port, char *address); #else int udp_discovery_init(void); -int udp_discovery_broadcast(int fd_discovery, int server_port); +int udp_discovery_broadcast(int fd_discovery, int server_port, const char *server_address); int udp_discovery_recv(int fd_discovery, char *buf, int timeout, struct sockaddr_in *source); int udp_discovery_is_valid_search(const char *buf); |
