+ if (dss->listen_fd >= 0)
+ para_fd_set(dss->listen_fd, rfds, max_fileno);
+}
+
+/**
+ * Query the TX CCID used on the sender-client half connection.
+ * \param sockfd Server socket descriptor to query (after accept(2)).
+ * \return CCID number > 0, -1 on error/incompatibility.
+ *
+ * NB: This feature is only available on Linux > 2.6.30; on older kernels
+ * ENOPROTOOPT ("Protocol not available") will be returned.
+ */
+static int dccp_get_tx_ccid(int sockfd)
+{
+ int tx_ccid;
+ socklen_t len = sizeof(tx_ccid);
+
+ if (getsockopt(sockfd, SOL_DCCP,
+ DCCP_SOCKOPT_TX_CCID, &tx_ccid, &len) < 0) {
+ PARA_WARNING_LOG("DCCP_SOCKOPT_TX_CCID: %s\n", strerror(errno));
+ return -1;
+ }
+ return tx_ccid;
+}
+
+static void dccp_shutdown_client(struct sender_client *sc)
+{
+ struct dccp_fec_client *dfc = sc->private_data;
+
+ vss_del_fec_client(dfc->fc);
+ shutdown_client(sc, dss);
+}
+
+static void dccp_shutdown_clients(void)
+{
+ struct sender_client *sc, *tmp;
+
+ list_for_each_entry_safe(sc, tmp, &dss->client_list, node)
+ dccp_shutdown_client(sc);
+}
+
+static int dccp_open(void *client, struct fec_client_parms **fcp)
+{
+ struct dccp_fec_client *dfc = client;
+
+ dfc->fcp.slices_per_group = 4;
+ dfc->fcp.data_slices_per_group = 3;
+ dfc->fcp.max_slice_bytes = 1472;
+ *fcp = &dfc->fcp;
+ return 1;
+}
+
+static int dccp_send_fec(char *buf, size_t len, void *private_data)
+{
+ struct dccp_fec_client *dfc = private_data;
+ int ret = write_nonblock(dfc->sc->fd, buf, len, DCCP_MAX_BYTES_PER_WRITE);
+
+ if (ret < 0)
+ dccp_shutdown_client(dfc->sc);
+ return ret;