Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #140 from timdoug/howl-support

Add support for mDNSPublish, from the howl zeroconf implementation.
  • Loading branch information...
commit 58a6ab8818ea1ee63554a826202beadd652b447c 2 parents ceb2fbc + ebe637f
@abrasive abrasive authored
Showing with 13 additions and 5 deletions.
  1. +1 −1  INSTALL.md
  2. +5 −2 shairport.c
  3. +7 −2 shairport.pl
View
2  INSTALL.md
@@ -5,7 +5,7 @@ You need the following installed:
* openssl
* libao
* Perl 5.10 or higher
- * Linux: avahi
+ * Linux: avahi (or, for embedded systems, howl)
* Windows/Mac OS X: Bonjour
Perl modules (install from CPAN if needed e.g. `perl -MCPAN -e 'install X'`):
View
7 shairport.c
@@ -181,7 +181,7 @@ int main(int argc, char **argv)
slog(LOG_INFO, "Usage:\nshairport [OPTION...]\n\nOptions:\n");
slog(LOG_INFO, " -a, --apname=AirPort Sets Airport name\n");
slog(LOG_INFO, " -p, --password=secret Sets Password (not working)\n");
- slog(LOG_INFO, " -o, --server_port=5002 Sets Port for Avahi/dns-sd\n");
+ slog(LOG_INFO, " -o, --server_port=5002 Sets Port for Avahi/dns-sd/howl\n");
slog(LOG_INFO, " -b, --buffer=282 Sets Number of frames to buffer before beginning playback\n");
slog(LOG_INFO, " -d Daemon mode\n");
slog(LOG_INFO, " -q, --quiet Supresses all output.\n");
@@ -975,11 +975,14 @@ static int startAvahi(const char *pHWStr, const char *pServerName, int pPort)
execlp("dns-sd", "dns-sd", "-R", tName,
"_raop._tcp", ".", tPort, "tp=UDP","sm=false","sv=false","ek=1","et=0,1",
"cn=0,1","ch=2","ss=16","sr=44100","pw=false","vn=3","txtvers=1", NULL);
+ execlp("mDNSPublish", "mDNSPublish", tName,
+ "_raop._tcp", tPort, "tp=UDP","sm=false","sv=false","ek=1","et=0,1",
+ "cn=0,1","ch=2","ss=16","sr=44100","pw=false","vn=3","txtvers=1", NULL);
if(errno == -1) {
perror("error");
}
- slog(LOG_INFO, "Bad error... couldn't find or failed to run: avahi-publish-service OR dns-sd\n");
+ slog(LOG_INFO, "Bad error... couldn't find or failed to run: avahi-publish-service OR dns-sd OR mDNSPublish\n");
exit(1);
}
else
View
9 shairport.pl
@@ -113,7 +113,7 @@ sub usage {
"Options:\n".
" -a, --apname=AirPort Sets AirPort name\n".
" -p, --password=secret Sets password\n",
- " -o, --server_port=5002 Sets Port for Avahi/dns-sd\n",
+ " -o, --server_port=5002 Sets Port for Avahi/dns-sd/howl\n",
" -i, --pipe=pipepath Sets the path to a named pipe for output\n",
" --ao_driver=driver Sets the ao driver (optional)\n",
" --ao_devicename=devicename Sets the ao device name (optional)\n",
@@ -281,7 +281,12 @@ sub REAP {
".",
$port,
"tp=UDP","sm=false","sv=false","ek=1","et=0,1","cn=0,1","ch=2","ss=16","sr=44100",$pw_clause,"vn=3","txtvers=1"; };
- die "could not run avahi-publish-service nor dns-sd";
+ { exec 'mDNSPublish',
+ join('', map { sprintf "%02X", $_ } @hw_addr) . "\@$apname",
+ "_raop._tcp",
+ $port,
+ "tp=UDP","sm=false","sv=false","ek=1","et=0,1","cn=0,1","ch=2","ss=16","sr=44100",$pw_clause,"vn=3","txtvers=1"; };
+ die "could not run avahi-publish-service nor dns-sd nor mDNSPublish";
}
my $airport_pem = join '', <DATA>;
Please sign in to comment.
Something went wrong with that request. Please try again.