# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-PREDEFINED = __GNUC__=4 \
- __GNUC_MINOR__=4
+PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
NEWS
====
+------------------------------------------
+0.7.2 (to be announced) "optical friction"
+------------------------------------------
+
+- A major cleanup of the audio file selector.
+- The client no longer prints error messages from afs commands to
+ stdout but to stderr.
+- The sleep subcommand of para_mixer gained two options to control
+ the startup mood and the time period before fade-out starts. A bunch
+ of further improvements for this subcommand went in as well.
+- Minor cleanup of the net subsystem.
+
+Downloads:
+[tarball](./releases/paraslash-git.tar.xz)
+
--------------------------------------
0.7.1 (2022-10-03) "digital spindrift"
--------------------------------------
requires support from the compiler, the oldest supported gcc version
has been bumped to gcc-5.4 (released in 2015).
+Downloads:
[tarball](./releases/paraslash-0.7.1.tar.xz),
[signature](./releases/paraslash-0.7.1.tar.xz.asc)
[tarball](./releases/paraslash-0.6.1.tar.xz),
[signature](./releases/paraslash-0.6.1.tar.xz.asc)
+---------------------------------------
+0.5.9 (2021-11-04) "reversed dimension"
+---------------------------------------
+This release contains a few important fixes which have accumulated in
+the maint branch. The paraslash-0.5.x series has now reached its end
+of life and will no longer be supported. All users should upgrade to
+a more recent version at this point.
+
+- Fix an issue with the bash completion script.
+- Initialize the random seed also when using libgrypt.
+- Fix some compiler warnings in the resample filter
+- Don't return spurious errors from the ff server command.
+
+Downloads:
+[tarball](./releases/paraslash-0.5.9.tar.bz2),
+[signature](./releases/paraslash-0.5.9.tar.bz2.asc)
+
---------------------------------------
0.5.8 (2017-09-23) "branching parabola"
---------------------------------------
PARA_NOTICE_LOG("connecting %s:%u\n", host, port);
ct->scc.fd = -1;
- ret = para_connect_simple(IPPROTO_TCP, host, port);
+ ret = para_connect(IPPROTO_TCP, host, port);
if (ret < 0)
return ret;
ct->scc.fd = ret;
#include "net.h"
#include "fd.h"
+#ifndef DCCP_SOCKOPT_CCID
+#define DCCP_SOCKOPT_CCID 13 /**< Sets both TX/RX CCID. */
+#endif
+
static void dccp_recv_close(struct receiver_node *rn)
{
if (rn->fd > 0)
return 1;
}
+/** Flowopt shortcut */
+#define OPT_ADD(fo, lev, opt, val, len) flowopt_add(fo, lev, opt, #opt, val, len)
+
static int dccp_recv_open(struct receiver_node *rn)
{
struct lls_parse_result *lpr = rn->lpr;
OPT_ADD(fo, SOL_DCCP, DCCP_SOCKOPT_CCID, ccids, i);
}
- fd = makesock(IPPROTO_DCCP, 0, host, port, fo);
+ fd = makesock(IPPROTO_DCCP, false, host, port, fo);
flowopt_cleanup(fo);
free(ccids);
if (fd < 0)
sched_monitor_readfd(dss->listen_fds[n], s);
}
+#ifndef DCCP_SOCKOPT_TX_CCID
+#define DCCP_SOCKOPT_TX_CCID 14 /**< Set/get the TX CCID. */
+#endif
+
/**
* Query the TX CCID used on the sender-client half connection.
* \param sockfd Server socket descriptor to query (after accept(2)).
free_sender_status(dss);
}
+#ifndef DCCP_SOCKOPT_GET_CUR_MPS
+#define DCCP_SOCKOPT_GET_CUR_MPS 5 /**< Max packet size, RFC 4340, 14. */
+#endif
+
+/** Estimated worst-case length of a DCCP header including options. */
+#define DCCP_MAX_HEADER 128
+
/** * Obtain current MPS according to RFC 4340, sec. 14. */
static int dccp_init_fec(struct sender_client *sc)
{
/** \file error.h List of error codes and messages. */
+/** \cond para_error */
/** Codes and messages. */
#define PARA_ERRORS \
PARA_ERROR(SUCCESS, "success"), \
extern const char * const para_errlist[];
/** Exactly one .c file per executable must define the array. */
#define DEFINE_PARA_ERRLIST const char * const para_errlist[] = {PARA_ERRORS}
+/** \endcond para_error */
/**
* This bit indicates whether a number is considered a system error number
d[SI_status_flags].align = LEFT;
d[SI_status_flags].x = 11;
d[SI_status_flags].y = 17;
- d[SI_status_flags].len = 10;
+ d[SI_status_flags].len = 8;
d[SI_image_id].prefix = "img: ";
d[SI_image_id].postfix = "";
d[SI_image_id].color.fg = COLOR_RED;
d[SI_image_id].color.bg = COLOR_BLACK;
d[SI_image_id].align = CENTER;
- d[SI_image_id].x = 21;
+ d[SI_image_id].x = 19;
d[SI_image_id].y = 17;
- d[SI_image_id].len = 10;
+ d[SI_image_id].len = 12;
d[SI_lyrics_id].prefix = "lyr: ";
d[SI_lyrics_id].postfix = "";
struct lls_parse_result *lpr = rn->lpr;
const char *r_i = RECV_CMD_OPT_STRING_VAL(HTTP, HOST, lpr);
uint32_t r_p = RECV_CMD_OPT_UINT32_VAL(HTTP, PORT, lpr);
- int fd, ret = para_connect_simple(IPPROTO_TCP, r_i, r_p);
+ int fd, ret = para_connect(IPPROTO_TCP, r_i, r_p);
if (ret < 0)
return ret;
[subcommand sleep]
purpose = stream, fade out, sleep, fade in
[description]
- Change to the initial volume and select the initial mood/playlist.
- Fade out to the given fade-out volume in the specified time. Switch
- to the sleep mood/playlist and wait until wake time minus fade-in
- time. Finally, switch to the wake mood/playlist and fade in to the
- fade-in volume.
+ Set the initial volume and mood, start playing and sleep. Then switch
+ to the fade-out mood and fade to the fade-out volume. Next, switch to
+ the sleep mood and wait until wake time minus fade-in time. Finally,
+ switch to the wake mood and fade in to the fade-in volume.
[/description]
[option ivol]
summary = set initial volume
channel part may be omitted, in which case the default channel is
used. This option may be given multiple times.
[/help]
+ [option initial-mood]
+ summary = mood or playlist to start with
+ arg_info = required_arg
+ arg_type = string
+ typestr = mood_spec
+ [help]
+ This mood or playlist is selected right after setting the initial
+ volume and before fade-out starts. If unset, fade-out starts
+ immediately.
+ [/help]
+ [option initial-delay]
+ summary = time before fade-out starts.
+ arg_info = required_arg
+ arg_type = uint32
+ typestr = seconds
+ default_val = 0
+ [help]
+ If left at the default, no initial delay occurs even if an initial
+ mood is given.
+ [/help]
[option fo-mood]
summary = mood or playlist for fade-out
arg_info = required_arg
}
EXPORT_CMD(fade);
-static void client_cmd(const char *cmd)
+static void run(const char *exe, const char *cmd)
{
int ret, status, fds[3] = {0, 0, 0};
pid_t pid;
- char *cmdline = make_message(BINDIR "/para_client %s", cmd);
+ char *cmdline = make_message("%s %s", exe, cmd);
PARA_NOTICE_LOG("%s\n", cmdline);
ret = para_exec_cmdline_pid(&pid, cmdline, fds);
exit(EXIT_FAILURE);
}
+static void client_cmd(const char *cmd)
+{
+ run(BINDIR "/para_client", cmd);
+}
+
+static void audioc_cmd(const char *cmd)
+{
+ run(BINDIR "/para_audioc", cmd);
+}
+
static void change_afs_mode(const char *afs_mode)
{
char *cmd;
return 1;
}
+static void stop(const struct mixer *m, struct mixer_handle *h)
+{
+ int ret, old_vol = 0;
+
+ ret = m->get(h);
+ if (ret > 0)
+ old_vol = ret;
+ fade(m, h, 0, 3);
+ audioc_cmd("off");
+ client_cmd("stop");
+ audioc_cmd("on");
+ m->set(h, old_vol);
+}
+
static int com_sleep(const struct mixer *m)
{
time_t t1, wake_time_epoch;
struct tm *tm;
int ret;
const char *wake_time = OPT_STRING_VAL(SLEEP, WAKE_TIME);
+ const char *initial_mood = OPT_STRING_VAL(SLEEP, INITIAL_MOOD);
const char *fo_mood = OPT_STRING_VAL(SLEEP, FO_MOOD);
const char *fi_mood = OPT_STRING_VAL(SLEEP, FI_MOOD);
const char *sleep_mood = OPT_STRING_VAL(SLEEP, SLEEP_MOOD);
}
wake_time_epoch = mktime(tm);
PARA_INFO_LOG("waketime: %d:%02d\n", tm->tm_hour, tm->tm_min);
- client_cmd("stop");
- sleep(1);
+ stop(m, h);
+ ret = set_initial_volume(m, h);
+ if (ret < 0)
+ goto close_mixer;
+ /*
+ * Setting the volume invalidates the current channel setting, so we
+ * have to set it again.
+ */
+ ret = set_channel(m, h, OPT_STRING_VAL(PARA_MIXER, MIXER_CHANNEL));
+ if (ret < 0)
+ goto close_mixer;
+ delay = OPT_UINT32_VAL(SLEEP, INITIAL_DELAY);
+ if (delay > 0 && initial_mood && *initial_mood) {
+ change_afs_mode(initial_mood);
+ client_cmd("play");
+ sleep(delay);
+ stop(m, h);
+ }
if (fot && fo_mood && *fo_mood) {
- ret = set_initial_volume(m, h);
- if (ret < 0)
- goto close_mixer;
change_afs_mode(fo_mood);
client_cmd("play");
- ret = set_channel(m, h, OPT_STRING_VAL(PARA_MIXER, MIXER_CHANNEL));
- if (ret < 0)
- goto close_mixer;
ret = fade(m, h, fov, fot);
if (ret < 0)
goto close_mixer;
if (!fot || !fo_mood) /* currently stopped */
client_cmd("play");
} else if (fot && fo_mood && *fo_mood) /* currently playing */
- client_cmd("stop");
+ stop(m, h);
m->close(&h);
if (!fit || !fi_mood || !*fi_mood) /* nothing to do */
return 1;
sleep(delay);
}
change_afs_mode(fi_mood);
- if (sleep_mood && *sleep_mood) /* currently playing */
- client_cmd("next");
- else /* currently stopped */
- client_cmd("play");
ret = open_mixer_and_set_channel(m, &h);
if (ret < 0)
return ret;
+ if (sleep_mood && *sleep_mood) /* currently playing */
+ stop(m, h);
+ client_cmd("play");
ret = fade(m, h, fiv, fit);
close_mixer:
m->close(&h);
* overflows and rounding errors we store the common divisor of the
* correction factors separately.
*/
-static int64_t normalized_value(int64_t x, int64_t n, int64_t sum, int64_t qd)
-{
- if (!n || !qd)
- return 0;
- return 100 * (n * x - sum) / (int64_t)int_sqrt(n) / (int64_t)int_sqrt(qd);
-}
-
static long compute_score(struct afs_info *afsi,
const struct afs_statistics *stats)
{
- long score = -normalized_value(afsi->num_played, stats->num,
- stats->num_played_sum, stats->num_played_qd);
- score -= normalized_value(afsi->last_played, stats->num,
- stats->last_played_sum, stats->last_played_qd);
- return score / 2;
+ int64_t mean_n, mean_l,score_n, score_l;
+
+ assert(stats->normalization_divisor > 0);
+ assert(stats->num > 0);
+ mean_n = stats->num_played_sum / stats->num;
+ mean_l = stats->last_played_sum / stats->num;
+
+ score_n = -((int64_t)afsi->num_played - mean_n)
+ * stats->num_played_correction
+ / stats->normalization_divisor;
+ score_l = -((int64_t)afsi->last_played - mean_l)
+ * stats->last_played_correction
+ / stats->normalization_divisor;
+ return (score_n + score_l) / 2;
}
static int add_afs_statistics(const struct osl_row *row,
#include "list.h"
#include "fd.h"
+/* Whether the given address conforms to the IPv4 address format. */
+static inline bool is_valid_ipv4_address(const char *address)
+{
+ struct in_addr test_it;
+ return inet_pton(AF_INET, address, &test_it) != 0;
+}
+
/**
* Parse and validate IPv4 address/netmask string.
*
return NULL;
}
-
-/**
- * Match string as a candidate IPv4 address.
- *
- * \param address The string to match.
- * \return True if \a address has "dot-quad" format.
- */
static bool is_v4_dot_quad(const char *address)
{
bool result;
return result;
}
+/* Whether a string conforms to IPv6 address format (RFC 4291). */
+static inline bool is_valid_ipv6_address(const char *address)
+{
+ struct in6_addr test_it;
+ return inet_pton(AF_INET6, address, &test_it) != 0;
+}
+
/**
* Perform basic syntax checking on the host-part of an URL:
*
* \param transport Transport protocol name (e.g. "udp", "tcp"), or NULL.
* \return Pointer to static result buffer.
*
- * \sa getservent(3), services(5), nsswitch.conf(5).
+ * \sa getservbyport(3), services(5), nsswitch.conf(5).
*/
const char *stringify_port(int port, const char *transport)
{
return service;
}
-/**
- * Determine the socket type for a given layer-4 protocol.
- *
- * \param l4type The symbolic name of the transport-layer protocol.
- *
- * \sa ip(7), socket(2).
+#ifndef SOCK_DCCP
+#define SOCK_DCCP 6 /**< Linux socket type. */
+#endif
+
+/*
+ * Determine the socket type, given the symbolic name of the transport-layer
+ * protocol. See ip(7), socket(2).
*/
static inline int sock_type(const unsigned l4type)
{
return -1; /* not supported here */
}
-/**
- * Pretty-print transport-layer name.
- */
+/* Pretty-print transport-layer name. */
static const char *layer4_name(const unsigned l4type)
{
switch (l4type) {
struct list_head node; /**< FIFO, as sockopt order matters. */
};
-/** FIFO list of pre-connection socket options to be set */
+/**
+ * List of pre-connection socket options to be set.
+ *
+ * This list contains transport-layer independent encapsulation of socket
+ * options that need to be registered prior to setting up a connection.
+ */
struct flowopts {
struct list_head sockopts;
};
list_add_tail(&new->node, &fo->sockopts);
}
-/** Set the entire bunch of pre-connection options at once. */
+/* Set the entire bunch of pre-connection options at once. */
static void flowopt_setopts(int sockfd, struct flowopts *fo)
{
struct pre_conn_opt *pc;
if (ai)
freeaddrinfo(ai);
if (ret < 0) {
- PARA_ERROR_LOG("can not create %s socket %s#%d.\n",
+ PARA_NOTICE_LOG("can not create %s socket %s#%d.\n",
layer4_name(l4type), host? host : (passive?
"[loopback]" : "[localhost]"), port_number);
}
return para_listen(l4type, NULL, port);
}
-/**
- * Determine IPv4/v6 socket address length.
- * \param sa Container of IPv4 or IPv6 address.
- * \return Address-family dependent address length.
- */
+/* Compute the address-family dependent address length of an IPv4/v6 socket. */
static socklen_t salen(const struct sockaddr *sa)
{
assert(sa->sa_family == AF_INET || sa->sa_family == AF_INET6);
: sizeof(struct sockaddr_in);
}
-/** True if @ss holds a v6-mapped-v4 address (RFC 4291, 2.5.5.2) */
+/* True if ss holds a v6-mapped-v4 address (RFC 4291, 2.5.5.2) */
static bool SS_IS_ADDR_V4MAPPED(const struct sockaddr_storage *ss)
{
const struct sockaddr_in6 *ia6 = (const struct sockaddr_in6 *)ss;
return ss->ss_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&ia6->sin6_addr);
}
-/**
+/*
* Process IPv4/v6 address, turn v6-mapped-v4 address into normal IPv4 address.
- * \param ss Container of IPv4/6 address.
- * \return Pointer to normalized address (may be static storage).
+ * ss: Container of IPv4/6 address.
+ * Returns: Pointer to normalized address (may be static storage).
*
* \sa RFC 3493.
*/
return (const struct sockaddr *)ss;
}
-/**
+/*
* Generic/fallback MTU values
*
* These are taken from RFC 1122, RFC 2460, and RFC 5405.
return af_type == AF_INET6 ? 1280 : 576;
}
-/** Crude approximation of IP header overhead - neglecting options. */
+/* Crude approximation of IP header overhead - neglecting options. */
static inline int estimated_header_overhead(const int af_type)
{
return af_type == AF_INET6 ? 40 : 20;
return -ERRNO_TO_PARA_ERROR(errno);
}
+#ifndef DCCP_SOCKOPT_AVAILABLE_CCIDS
+#define DCCP_SOCKOPT_AVAILABLE_CCIDS 12 /**< List of supported CCIDs. */
+#endif
+
/**
* Probe the list of DCCP CCIDs configured on this host.
* \param ccid_array Pointer to return statically allocated array in.
socklen_t nccids = sizeof(ccids);
int ret, fd;
- ret = fd = makesock(IPPROTO_DCCP, 1, NULL, 0, NULL);
+ ret = fd = makesock(IPPROTO_DCCP, true /* passive */, NULL, 0, NULL);
if (ret < 0)
return ret;
return nccids;
}
+/**
+ * The buffer size of the sun_path component of struct sockaddr_un.
+ *
+ * While glibc doesn't define UNIX_PATH_MAX, it documents it has being limited
+ * to 108 bytes. On NetBSD it is only 104 bytes though. We trust UNIX_PATH_MAX
+ * if it is defined and use the size of the ->sun_path member otherwise. This
+ * should be safe everywhere.
+ */
+#ifndef UNIX_PATH_MAX
+#define UNIX_PATH_MAX (sizeof(((struct sockaddr_un *)0)->sun_path))
+#endif
+
/*
* Prepare a structure for AF_UNIX socket addresses.
*
/* Copyright (C) 2006 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
/** \file net.h exported symbols from net.c */
-/**
- * The buffer size of the sun_path component of struct sockaddr_un.
- *
- * While glibc doesn't define \p UNIX_PATH_MAX, it documents it has being
- * limited to 108 bytes. On NetBSD it is only 104 bytes though. We trust \p
- * UNIX_PATH_MAX if it is defined and use the size of the ->sun_path member
- * otherwise. This should be safe everywhere.
- */
-#ifndef UNIX_PATH_MAX
-#define UNIX_PATH_MAX (sizeof(((struct sockaddr_un *)0)->sun_path))
-#endif
-
/* Userland defines for Linux DCCP support. */
-#ifndef IPPROTO_DCCP
-#define IPPROTO_DCCP 33 /**< IANA assigned value. */
-#endif
-
-#ifndef SOCK_DCCP
-#define SOCK_DCCP 6 /**< Linux socket type. */
-#endif
-
-#ifndef DCCP_SOCKOPT_RX_CCID
-/** Per-connection CCID support (set/get the RX CCID, since v2.6.30-rc1). */
-#define DCCP_SOCKOPT_RX_CCID 15
-#endif
-
#ifndef SOL_DCCP
#define SOL_DCCP 269 /**< Linux socket level. */
#endif
-#ifndef DCCP_SOCKOPT_GET_CUR_MPS
-#define DCCP_SOCKOPT_GET_CUR_MPS 5 /**< Max packet size, RFC 4340, 14. */
-#endif
-
-#ifndef DCCP_SOCKOPT_AVAILABLE_CCIDS
-#define DCCP_SOCKOPT_AVAILABLE_CCIDS 12 /**< List of supported CCIDs. */
-#endif
-
-#ifndef DCCP_SOCKOPT_CCID
-#define DCCP_SOCKOPT_CCID 13 /**< Sets both TX/RX CCID. */
-#endif
-
-#ifndef DCCP_SOCKOPT_TX_CCID
-#define DCCP_SOCKOPT_TX_CCID 14 /**< Set/get the TX CCID. */
-#endif
-
/** The maximum length of the host component in an URL. */
#define MAX_HOSTLEN 256
-/**
- * Flowopts: Transport-layer independent encapsulation of socket options
- * that need to be registered prior to setting up a connection.
- */
+/* Opaque, only known to net.c. */
struct flowopts;
-extern struct flowopts *flowopt_new(void);
-extern void flowopt_add(struct flowopts *fo, int level, int opt,
+struct flowopts *flowopt_new(void);
+void flowopt_add(struct flowopts *fo, int level, int opt,
const char *name, const void *val, int len);
void flowopt_cleanup(struct flowopts *fo);
-/** Flowopt shortcut macros */
-#define OPT_ADD(fo, lev, opt, val, len) flowopt_add(fo, lev, opt, #opt, val, len)
/**
* Functions to parse and validate (parts of) URLs.
*/
-extern char *parse_cidr(const char *cidr,
- char *addr, ssize_t addrlen, int32_t *netmask);
-extern char *parse_url(const char *url,
- char *host, ssize_t hostlen, int32_t *port);
+char *parse_cidr(const char *cidr,
+ char *addr, ssize_t addrlen, int32_t *netmask);
+char *parse_url(const char *url,
+ char *host, ssize_t hostlen, int32_t *port);
char *format_url(const char *url, int default_port);
-extern const char *stringify_port(int port, const char *transport);
-/**
- * Ensure that string conforms to the IPv4 address format.
- *
- * \param address The address string to check.
- *
- * \return 1 if \a address conforms to the IPv4 address format, else 0.
- */
-_static_inline_ bool is_valid_ipv4_address(const char *address)
-{
- struct in_addr test_it;
-
- return inet_pton(AF_INET, address, &test_it) != 0;
-}
-
-/**
- * Ensure that string conforms to IPv6 address format.
- *
- * \param address The address string to check.
- *
- * \return 1 if string has a valid IPv6 address syntax, 0 if not.
- * \sa RFC 4291.
- */
-_static_inline_ bool is_valid_ipv6_address(const char *address)
-{
- struct in6_addr test_it;
-
- return inet_pton(AF_INET6, address, &test_it) != 0;
-}
+const char *stringify_port(int port, const char *transport);
int lookup_address(unsigned l4type, bool passive, const char *host,
int port_number, struct addrinfo **result);
int makesock_addrinfo(unsigned l4type, bool passive, struct addrinfo *ai,
struct flowopts *fo);
-static inline int para_connect_simple(unsigned l4type,
- const char *host, uint16_t port)
+static inline int para_connect(unsigned l4type, const char *host, uint16_t port)
{
- return makesock(l4type, 0, host, port, NULL);
+ return makesock(l4type, false, host, port, NULL);
}
void extract_v4_addr(const struct sockaddr_storage *ss, struct in_addr *ia);
int para_listen_simple(unsigned l4type, uint16_t port);
/** Pretty-printing of IPv4/6 socket addresses */
-extern char *remote_name(int sockfd);
+char *remote_name(int sockfd);
/**
* Determining maximum payload (packet) size
*/
-extern int generic_max_transport_msg_size(int sockfd);
+int generic_max_transport_msg_size(int sockfd);
int recv_bin_buffer(int fd, char *buf, size_t size);
int recv_buffer(int fd, char *buf, size_t size);
/**
* Functions and definitions to support \p IPPROTO_DCCP
*/
-/** Estimated worst-case length of a DCCP header including options. */
-#define DCCP_MAX_HEADER 128
/** Hardcoded maximum number of separate CCID modules compiled into a host. */
#define DCCP_MAX_HOST_CCIDS 20
-extern int dccp_available_ccids(uint8_t **ccid_array);
+int dccp_available_ccids(uint8_t **ccid_array);
#define PARA_CRIT_LOG(f,...) para_log(LL_CRIT, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
#define PARA_EMERG_LOG(f,...) para_log(LL_EMERG, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
+/** \cond status_items */
#define STATUS_ITEMS \
STATUS_ITEM(basename) \
STATUS_ITEM(status) \
enum status_items {STATUS_ITEMS NUM_STAT_ITEMS};
#undef STATUS_ITEM
#define STATUS_ITEM(_name) #_name,
+/** \endcond status items */
extern const char *status_item_list[];
/** Loop over each status item. */
uint32_t port = RECV_CMD_OPT_UINT32_VAL(UDP, PORT, lpr);
int ret;
- ret = makesock(IPPROTO_UDP, 1, host, port, NULL);
+ ret = makesock(IPPROTO_UDP, true /* passive */, host, port, NULL);
if (ret < 0)
return ret;
rn->fd = ret;
return ret;
port = scd->port > 0 ? scd->port : OPT_UINT32_VAL(UDP_DEFAULT_PORT);
- ret = para_connect_simple(IPPROTO_UDP, scd->host, port);
+ ret = para_connect(IPPROTO_UDP, scd->host, port);
if (ret < 0)
return ret;
sc->private_data = ut;
sc->fd = -1;
- ret = para_connect_simple(IPPROTO_UDP, scd->host, scd->port);
+ ret = para_connect(IPPROTO_UDP, scd->host, scd->port);
if (ret < 0)
goto err;
sc->fd = ret;
}
/**
- * Main sending function.
- *
- * This function gets called from vss_post_monitor(). It checks whether the next
- * chunk of data should be pushed out. It obtains a pointer to the data to be
- * sent out as well as its length from mmd->afd.afhi. This information is then
- * passed to each supported sender's send() function as well as to the send()
- * functions of each registered fec client.
+ * If the next chunk needs to be sent, pass a pointer to the chunk data to all
+ * registered fec clients and to each sender's ->send() method.
*/
static void vss_send(struct vss_task *vsst)
{