+/**
+ * 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;
+}
+