gcc-compat.h: Remove gcc-3 workaround. Since b0e2c4a9 we require gcc-4.2 or later, so this is no longer needed.
Add sideband implementation. This adds the new source files sideband.[ch] to the repository and links the corresponding object file into para_server, para_audiod and para_client. The sideband API enables the command handlers of para_server to send a multiplexed output stream. The client side (para_client or para_audiod) demultiplex the received stream afterwards. The design is as simple as it can be: Each data buffer is preceded by a 5-byte header containing the length and the band designator, a one-byte number which specifies the type of the data which follows. The server-side and the client-side implement their own variant of the send_sb() and recv_sb() functions for sending and receiving sideband packets. Two implementations are necessary because the underlying file descriptor is blocking on the server side (command handlers of para_server) while it is non-blocking on the client side (para_client and para_audiod). The sideband API allows to optionally filter all data (including the sideband header) through an arbitrary transformation. This patch adds a suitable transformation as a new public function performs RC4 to the crypto API. To keep the patch within reasonable size, this commit does not contain any users of the new sideband API yet. Subsequent commits will teach the authentication handshake code and the command handlers to send and receive data as sideband packets.
Replace PARA_VSNPRINTF by xvasprintf(). The PARA_VSNPRINTF macro is rather clumsy, and too large to be inlined. Moreover, it does not return the length of the formated string, so users have to call strlen() after the call to PARA_VSNPRINTF(). This is extra work which can easily be avoided since the number of bytes written is returned by the underlying call to vsnprintf(). This patch replaces the macro by the public function xvasprintf(), which is similar to the non-standard vasprintf() on GNU systems. It also adds xasprintf(), a similar variant which takes a variable number of arguments. Unlike PARA_VSNPRINTF, xasprintf() and xvasprintf() return the number of bytes written. This relies on vsnprintf() conforming to the C99 standard and breaks in particular on glibc 2.0 systems. Since glibc 2.0 is about 15 years old, this is unlikely to cause problems on real systems. All users which called strlen() right after xvasprintf() are changed to use the return value of xvasprintf() instead.
Mark a couple of functions as const. Probably does not matter much..
Improve ARRAY_SIZE macro. Compilation now fails if the given argument not an array but a pointer. Idea taken from ccan. Thanks Rusty!
__aligned is already defined on NetBSD. Use __a_aligned in analogy to __a_unused which was introduced since __unused is already defined on MacOS. This fixes the warning gcc-compat.h:5:1: warning: "__aligned" redefined In file included from /usr/include/regex.h:77, from daemon.c:9: /usr/include/sys/cdefs.h:202:1: warning: this is the location of the previous definition on NetBSD and has the additional advantage that it keeps working even if the NetBSD people decide to redefine __aligned.
Add __aligned macro to gcc-compat.h. and use this instead of DECLARE_ALIGNED. Fix some whitespace issues in gcc-compat.h while we're at it.
Remove the likely/unlikely macros. These also slow down the compress filter, its only user, by about 10%.
gcc-compat.h: Fix __must_check. It didn't work for gcc-4.
Make it compile on FreeBSD. This was easier than expected. Only two items needed fixing: - signal.h has to be included for several files that use signals. - The __used and __packed macros are already defined on FreeBSD which leads to an error at compile time. Fortunately paraslash doesn't use these macros at all, so we can simply remove them.
gcc-compat.h: Remove compatibility code for gcc-2. gcc-2 is not supported any longer.
Merge the new afs code.
Fix typo in gcc-compat.h It only affects gcc-2 and non-gcc (which is untested anyway).
gcc-compat.h: rename __unused to __a_unused __unused is already defined on MacOS.
gcc-compat: Kill __pure It is not used within paraslash and is already defined on MacOS.
initial git commit Let's try if this works out.