Doxyfile: Change web sync directory.
[paraslash.git] / dccp.c
1 /*
2 * Copyright (C) 2006-2007 Andre Noll <maan@systemlinux.org>
3 *
4 * Licensed under the GPL v2. For licencing details see COPYING.
5 */
6
7 /** \file dccp.c common functions of the dccp sender/receiver */
8
9 /*
10 * based on common.c of dccp-cs-0.01.tar.bz2,
11 * (C) 2005 Ian McDonald <imcdnzl@gmail.com>
12 */
13
14 #include <sys/types.h>
15 #include <dirent.h>
16
17 #include "para.h"
18 #include "error.h"
19 #include "dccp.h"
20 #include "fd.h"
21
22 /** \cond some magic dccp constants */
23 #define SOCK_DCCP 6
24 #define IPPROTO_DCCP 33
25 /** \endcond */
26
27 /**
28 * obtain a dccp socket for sending/receiving
29 *
30 * \return the file descriptor of the new socket or \p -E_DCCP_SOCKET
31 * on errors.
32 */
33 int dccp_get_socket(void)
34 {
35 int s = socket(AF_INET, SOCK_DCCP, IPPROTO_DCCP);
36
37 if (s < 0)
38 return -E_DCCP_SOCKET;
39 return s;
40 }
41
42 /**
43 * prepare a dccp socket
44 *
45 * \param fd the file descriptor of the socket
46 *
47 * \returns positive on success, negative on errors.
48 */
49 int dccp_set_socket(__a_unused int fd)
50 {
51 return 1; /* nothing to do at the moment */
52 }