* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*/
+/** \file dccp.c common functions of the dccp sender/receiver */
+
/*
* based on common.c of dccp-cs-0.01.tar.bz2,
* (C) 2005 Ian McDonald <imcdnzl@gmail.com>
#include "error.h"
#include "dccp.h"
+/** \cond some magic dccp constants */
+#define SOL_DCCP 269
+#define SOCK_DCCP 6
+#define IPPROTO_DCCP 33
+#define DCCP_SOCKOPT_PACKET_SIZE 1
+#define DCCP_SOCKOPT_SERVICE 2
+/** \endcond */
+
+/**
+ * obtain a dccp socket for sending/receiving
+ *
+ * \return the file descriptor of the new socket or \p -E_DCCP_SOCKET
+ * on errors.
+ */
int dccp_get_socket(void)
{
int s = socket(AF_INET, SOCK_DCCP, IPPROTO_DCCP);
return s;
}
+/**
+ * prepare a dccp socket
+ *
+ * \param fd the file descriptor of the socket
+ *
+ * \returns positive on success, negative on errors.
+ */
int dccp_set_socket(int fd)
{
int pkt_size = 256, ret;
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*/
+/** \file dccp.h functions exported by dccp.c */
+
/*
* based on common.h of dccp-cs-0.01.tar.bz2,
* (C) 2005 Ian McDonald <imcdnzl@gmail.com>
*/
-#define SOL_DCCP 269
-#define SOCK_DCCP 6
-#define IPPROTO_DCCP 33
-#define DCCP_SOCKOPT_PACKET_SIZE 1
-#define DCCP_SOCKOPT_SERVICE 2
-
int dccp_get_socket(void);
int dccp_set_socket(int fd);
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*/
+/** \file dccp_recv.c paraslash's dccp receiver */
+
/*
* based on client.c of dccp-cs-0.01.tar.bz2,
* (C) 2005 Ian McDonald <imcdnzl@gmail.com>
#include <sys/socket.h>
#include <netdb.h>
-
+/** the size of the output buffer */
#define DCCP_BUFSIZE 40960
/**
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*/
+/** \file dccp_send.c paraslash's dccp sender */
+
/*
* based on server.c of dccp-cs-0.01.tar.bz2,
* (C) 2005 Ian McDonald <imcdnzl@gmail.com>
struct sockaddr_in addr;
/** the position of this client in the client list */
struct list_head node;
- int header_sent; /* non-zero if audio file header has been sent */
+ /** non-zero if audio file header has been sent */
+ int header_sent;
};
static void dccp_pre_select(__unused struct audio_format *af, int *max_fileno, fd_set *rfds,
return make_message("no help available\n");
}
+/**
+ * the init function of the dccp sender
+ *
+ * \param s pointer to the dccp sender struct
+ *
+ * It initializes all function pointers of \a s and starts
+ * listening on the given port.
+ */
void dccp_send_init(struct sender *s)
{
int ret;