04_DCCP-socket-functions.diff
[paraslash.git] / dccp.c
diff --git a/dccp.c b/dccp.c
index 147e46307676b60025561e4f81167a3a72b22b90..f5f940a665d1d4c160bd3b312f09c61c5e815ce5 100644 (file)
--- a/dccp.c
+++ b/dccp.c
@@ -1,19 +1,7 @@
 /*
- * Copyright (C) 2006 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2006-2007 Andre Noll <maan@systemlinux.org>
  *
- *     This program is free software; you can redistribute it and/or modify
- *     it under the terms of the GNU General Public License as published by
- *     the Free Software Foundation; either version 2 of the License, or
- *     (at your option) any later version.
- *
- *     This program is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- *     You should have received a copy of the GNU General Public License
- *     along with this program; if not, write to the Free Software
- *     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Licensed under the GPL v2. For licencing details see COPYING.
  */
 
 /** \file dccp.c common functions of the dccp sender/receiver */
  * (C) 2005 Ian McDonald <imcdnzl@gmail.com>
  */
 
+#include <sys/types.h>
+#include <dirent.h>
+
 #include "para.h"
 #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 */
+#include "fd.h"
+#include "net.h"
 
 /**
  * obtain a dccp socket for sending/receiving
@@ -57,18 +42,7 @@ int dccp_get_socket(void)
  *
  * \returns positive on success, negative on errors.
  */
-int dccp_set_socket(int fd)
+int dccp_set_socket(__a_unused int fd)
 {
-       int pkt_size = 256, ret;
-
-       /* hack to get a service code */
-       ret = setsockopt(fd, SOL_DCCP, DCCP_SOCKOPT_PACKET_SIZE,
-               (char*)&pkt_size, sizeof(pkt_size));
-       if (ret < 0)
-               return -E_DCCP_PACKET_SIZE;
-       ret = setsockopt(fd, SOL_DCCP, DCCP_SOCKOPT_SERVICE,
-               (char*)&pkt_size, sizeof(pkt_size));
-       if (ret < 0)
-               return -E_DCCP_SERVICE;
-       return 1;
+       return 1;       /* nothing to do at the moment */
 }