]> git.tuebingen.mpg.de Git - paraslash.git/blob - dccp.c
f5f940a665d1d4c160bd3b312f09c61c5e815ce5
[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 #include "net.h"
22
23 /**
24  * obtain a dccp socket for sending/receiving
25  *
26  * \return the file descriptor of the new socket or \p -E_DCCP_SOCKET
27  * on errors.
28  */
29 int dccp_get_socket(void)
30 {
31         int s = socket(AF_INET, SOCK_DCCP, IPPROTO_DCCP);
32
33         if (s < 0)
34                 return -E_DCCP_SOCKET;
35         return s;
36 }
37
38 /**
39  * prepare a dccp socket
40  *
41  * \param fd the file descriptor of the socket
42  *
43  * \returns positive on success, negative on errors.
44  */
45 int dccp_set_socket(__a_unused int fd)
46 {
47         return 1;       /* nothing to do at the moment */
48 }