mirror of
https://github.com/godotengine/buildroot.git
synced 2026-01-04 06:10:16 +03:00
Small (35k), and stand-alone, SSDP responder with built-in web server
(on port 1901) for serving description.xml when Windows scans for any
network devices on the LAN. Also includes ssdp-scan (31k), similar to
the mdns-scan tool, to probe for SSDP capable devices.
Although it does not use fork(), it still fails to build on noMMU: lots
of missing function declarations, and lots of multicast-related structs
definitions, causing warnings like:
ssdp-scan.c:57:12: warning: implicit declaration of function ‘strdup’; did you mean ‘strcmp’? [-Wimplicit-function-declaration]
ssdp-scan.c:57:10: warning: assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
and errors like:
ssdp.c:357:17: error: storage size of ‘imr’ isn’t known
struct ip_mreq imr;
^~~
Finding the root cause why those get not defined in MMU on uClibc is
quite a head-scratching, so let's just disablessdp-responder for noMMU
architectures.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
[yann.morin.1998@free.fr: extend commit log to explain noMMU state]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
43 lines
655 B
Bash
Executable File
43 lines
655 B
Bash
Executable File
#!/bin/sh
|
|
|
|
NAME=ssdpd
|
|
PIDFILE=/var/run/$NAME.pid
|
|
DAEMON=/usr/sbin/$NAME
|
|
CFGFILE=/etc/default/$NAME
|
|
|
|
DAEMON_ARGS=""
|
|
|
|
# Read configuration variable file if it is present
|
|
[ -f $CFGFILE ] && . $CFGFILE
|
|
|
|
start() {
|
|
printf 'Starting %s: ' "$NAME"
|
|
start-stop-daemon -S -q -p $PIDFILE -x $DAEMON -- $DAEMON_ARGS
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
|
}
|
|
|
|
stop() {
|
|
printf 'Stopping %s: ' "$NAME"
|
|
start-stop-daemon -K -q -p $PIDFILE -x $DAEMON
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
|
}
|
|
|
|
restart() {
|
|
stop
|
|
start
|
|
}
|
|
|
|
case "$1" in
|
|
start|stop|restart)
|
|
"$1"
|
|
;;
|
|
reload)
|
|
restart
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart|reload}"
|
|
exit 1
|
|
esac
|
|
|
|
exit $?
|