X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=dccp.c;h=fa48976e72f44f0cc8b0bdac7d93bcf6368075ec;hp=b5cf7fd9abd106a5c942c96f0cab9e53445d12de;hb=7c3bec32f4a34753a40e2c22086ce2353e8a7b9c;hpb=abbddde3ee707103d5d8b088c8fa6fc53f09ebff;ds=sidebyside diff --git a/dccp.c b/dccp.c index b5cf7fd9..fa48976e 100644 --- a/dccp.c +++ b/dccp.c @@ -16,6 +16,8 @@ * 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 @@ -24,7 +26,22 @@ #include "para.h" #include "error.h" #include "dccp.h" +#include "fd.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); @@ -34,6 +51,13 @@ int dccp_get_socket(void) 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;