Gerrit Renker [Sat, 28 Feb 2009 12:40:01 +0000 (13:40 +0100)]
Auxiliary functions to parse and validate parts of URIs.
To support URI syntax in the manner of RFC 3986, this adds a self-contained set
of functions to parse (parts of) URIs and to validate such parts using basic
syntax checks.
To avoid blocking while resolving DNS strings, strings that do not have the
characteristics of native IPv4/v6 address strings always pass; a wrong hostname
will then be detected later when connecting.
Note: strictly speaking, this does not deal with URIs, since the 'scheme' part
is missing and only the "locator" part is parsed. It is possible to extend
this later, using something like dccp://host[:port], http://host[:port],
or udp://host[:port] to specify the transport protocols of paraslash.
Gerrit Renker [Sat, 7 Feb 2009 19:16:50 +0000 (20:16 +0100)]
Put IPv4-specific parts inside the ACL subsystem
The ACL subsystem performs access validation based on IPv4 address /
netmask pairs. Since the internals of this system are exposed via
struct sender_command_data, other subsystems can only use IPv4.
This patch migrates the IPv4-specific parts of the ACL subsystem inside
that system and replaces the 'struct in_addr' address with a host
string. A subsequent patch converts the remaining subsystems to also
use strings instead of AF-dependent addresses.
For the present purpose the string size (fixed) is over-dimensioned,
since a valid IPv4 address contains at most 15 = 4*3 + 3 + 1 bytes
(including the 3 dots and the '\0'). The size should also be sufficient
for hostnames, since RFC 1123, 2.1 suggests a maximum length of 255.
Since the conversion string -> struct in_addr now happens later,
syntax checks have been added for argument strings.
The option simplifies multicast streaming, which is now possible without
having to set a multicast route when there is more than one network interface.
This option works unconditionally for UDPv6. For UDPv4 it is only enabled
on hosts that support `struct ip_mreqn', support for which is detected
via configure.
On OSes that do not support this struct, a warning message is printed;
while it is possible to add the same functionality also in those cases,
it would complicate the implementation and thus has been left out.
Gerrit Renker [Mon, 2 Feb 2009 19:58:49 +0000 (20:58 +0100)]
Support for UDPv4/v6 multicast streaming
This provides self-contained support for UDPv4/v6 multicast:
* receiver joins multicast v4/v6 address;
* sender, on encountering a multicast address, sets TTL/IPv6
number of multicast hops, and (as a precaution) enables looping
back of multicast packets.
The use of the sender is still restricted to UDPv4, since it is also
necessary to perform changes to the (IPv4-based) udp_target struct,
which should be done in a separate patch.
Andre Noll [Wed, 4 Feb 2009 21:25:55 +0000 (22:25 +0100)]
afs: Fix a shm leak.
Even if the command handler stops to read the command output
afs must continue to read shmids from server fd so that it can
destroy all shared memory areas that the server created for afs.
Andre Noll [Tue, 3 Feb 2009 20:41:08 +0000 (21:41 +0100)]
Call shm(destroy) on the mmd shared memory area right after creating it.
It will only be destroyed when the last reference is gone, which
is when para_server exits. This allows to get rid of a global
variable. Moreover, the shared memory area will be destroyed even
in case para_server crashes.
Andre Noll [Mon, 26 Jan 2009 13:19:19 +0000 (14:19 +0100)]
Fix build as root.
As noted by Gerrit Renker, when trying to extract help text from
./para_audiod, the build stops when logged in as root because
para_audiod refuses to start as root if --user and --group are
not given.
This patch moves the check for UID==0 after the check for --help and
--detailed-help so that the help text may be extracted as root even
if no --user and --group options are given.
Gerrit Renker [Sat, 24 Jan 2009 22:37:04 +0000 (23:37 +0100)]
Build problem when no audiod.conf exists
This avoids stopping the build process and allows users to read
the detailed help before getting the error message about a missing
audiod.conf file - fixed by parsing after testing for the help text.
Andre Noll [Sun, 18 Jan 2009 01:25:42 +0000 (02:25 +0100)]
Use symbolic names for loglevels and clean up the ggo mess.
We now use m4 to generate the ggo files, which allows to get rid of
a lot of duplicated command line options and improves the readability
of the man pages.
Andre Noll [Sun, 11 Jan 2009 22:18:04 +0000 (23:18 +0100)]
Major udp sender/receiver improvements.
- Reserve some bytes in the udp header for future extensions.
- Simplify udp audio header reading/writing.
- Handle short reads in udp_recv.
- Extended sanity checks for the udp audio header.
- Fix a memory leak in the error path of udp_recv_open().
Andre Noll [Sat, 10 Jan 2009 17:19:15 +0000 (18:19 +0100)]
Fix a bug in udp_send_buf().
In case multiple targets are defined and a write for one of them
fails, the old code would return early rather than continue to send
the chunk to the other targets.
Andre Noll [Sat, 10 Jan 2009 17:03:24 +0000 (18:03 +0100)]
Make send_queued_chunks() public.
The udp sender will start to use it soon. Make it take the fd and
the chunk queue instead of a struct sender_client as the udp sender
does not use struct sender_client.