+/** \file fec.c Forward error correction based on Vandermonde matrices. */
+
/*
- * fec.c -- forward error correction based on Vandermonde matrices
* 980624
* (C) 1997-98 Luigi Rizzo (luigi@iet.unipi.it)
*
* OF SUCH DAMAGE.
*/
+
#include "para.h"
#include "error.h"
#include "portable_io.h"
+/** \file fec.h Exported symbols from fec.c. */
+
/*
- * fec.c -- forward error correction based on Vandermonde matrices
* 980614
* (C) 1997-98 Luigi Rizzo (luigi@iet.unipi.it)
*
unsigned char *dst, int idx, int sz);
int fec_decode(struct fec_parms *parms, unsigned char **data, int *idx,
int sz);
-
-
struct fec_parms *fec;
/** Keeps track of what was received so far. */
struct fecdec_group groups[NUM_FEC_GROUPS];
+ /** Whether an audio file header was already received. */
int have_header;
};
HTTP_INVALID_GET_REQUEST
};
+/** For each connected client, a structure of this type is maintained. */
struct private_http_sender_data {
+ /** The current state of this client. */
enum http_client_status status;
};
return host_and_port((struct sockaddr *)&ss, sslen);
}
+/**
+ * Look up the local side of a connected socket structure.
+ *
+ * \param sockfd The file descriptor of the socket.
+ *
+ * \return A pointer to a static buffer containing hostname an port. This
+ * buffer must not be freed by the caller.
+ *
+ * \sa remote_name().
+ */
char *local_name(int sockfd)
{
return __get_sock_name(sockfd, getsockname);
}
+/**
+ * Look up the remote side of a connected socket structure.
+ *
+ * \param sockfd The file descriptor of the socket.
+ *
+ * \return Analogous to the return value of \ref local_name() but for the
+ * remote side.
+ *
+ * \sa local_name().
+ */
char *remote_name(int sockfd)
{
return __get_sock_name(sockfd, getpeername);
struct in_addr ia = {.s_addr = 0};
if (ss->ss_family == AF_INET)
- ia.s_addr = ((struct sockaddr_in *)ss)->sin_addr.s_addr;
+ ia.s_addr = ((struct sockaddr_in *)ss)->sin_addr.s_addr;
if (ss->ss_family == AF_INET6) {
const struct in6_addr v6_addr = ((struct sockaddr_in6 *)ss)->sin6_addr;
* \param len The length of \a buf.
*
* Check if encryption is available. If yes, encrypt the given buffer. Send
- * out the buffer, encrypted or not, and try to resend the remaing part in case
- * of short writes.
+ * out the buffer, encrypted or not, and try to resend the remaining part in
+ * case of short writes.
*
* \return Standard.
*/
return ret;
}
+/**
+ * Parse a FEC URL string.
+ *
+ * \param scd The structure containing host, port and the FEC parameters.
+ *
+ * \return Standard.
+ *
+ * A FEC URL consists of an ordinary URL string according to RFC 3986,
+ * optionally followed by a slash and the three FEC parameters slice_size,
+ * data_slices_per_group and slices_per_group. The three FEC parameters are
+ * separated by colons.
+ *
+ * \sa \ref parse_url().
+ */
int parse_fec_url(const char *arg, struct sender_command_data *scd)
{
int ret;
* - Ring buffer: \ref ringbuffer.c, \ref ringbuffer.h,
* - Hashing: \ref hash.h, \ref sha1.h, \ref sha1.c,
* - Crypto: \ref crypt.c.
- *
+ * - Forward error correction: \ref fec.c
*/
#include <signal.h>
return 1;
}
+/**
+ * Compute the loglevel number from its name.
+ *
+ * \param txt The name of the loglevel (debug, info, ...).
+ *
+ * \return The numeric representation of the loglevel name.
+ */
int get_loglevel_by_name(const char *txt)
{
if (!strcasecmp(txt, "debug"))
wng->writer_nodes[0].conf = writers[DEFAULT_WRITER].parse_config("");
return wng;
}
-
+/**
+ * Print the help text of all writers to stdout.
+ *
+ * \param detailed Whether to print the detailed help text.
+ */
void print_writer_helps(int detailed)
{
int i;