gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r18180 - in libmwmodem/src: include main


From: gnunet
Subject: [GNUnet-SVN] r18180 - in libmwmodem/src: include main
Date: Thu, 17 Nov 2011 13:56:16 +0100

Author: ruppa
Date: 2011-11-17 13:56:15 +0100 (Thu, 17 Nov 2011)
New Revision: 18180

Modified:
   libmwmodem/src/include/libmwmodem.h
   libmwmodem/src/main/libmwmodem.c
Log:
Author: Christian Rupp
Date:   2011-11-11 1356




Modified: libmwmodem/src/include/libmwmodem.h
===================================================================
--- libmwmodem/src/include/libmwmodem.h 2011-11-17 12:11:10 UTC (rev 18179)
+++ libmwmodem/src/include/libmwmodem.h 2011-11-17 12:56:15 UTC (rev 18180)
@@ -171,10 +171,12 @@
  * @param port number of port for use to receive the package
  * @param cb higher function for information Callback
  * @param cb_cls user function
+ * @param af_int int from AF_INET or AF_INET6
  * @return MWModem_Context
  */
 struct MWMODEM_Context *
 MWMODEM_init (uint16_t port,
+             int af_int,
              MWMODEM_InformationCallback cb,
              void *cb_cls);
 

Modified: libmwmodem/src/main/libmwmodem.c
===================================================================
--- libmwmodem/src/main/libmwmodem.c    2011-11-17 12:11:10 UTC (rev 18179)
+++ libmwmodem/src/main/libmwmodem.c    2011-11-17 12:56:15 UTC (rev 18180)
@@ -26,20 +26,28 @@
 {
        struct MWMODEM_Content content;
        content.cb = cb;
-       content.socket = socket(AF_INET, SOCK_STREAM, 0);
+       content.socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
        if (content.socket==-1);//TODO Error Message
+       struct sockaddr_in adress;
+       adress.sin_family = AF_INET;
+
        if (port == 0)
        {
-                       
+               
                //do everytthing with standard port
        }
        else
        {
                
        }
-       return content;
+       return *content;
 }
 
+int MWMODEM_get_select_socket(struct MWMODEM_Context *fc)
+{
+       return fc.socket;
+}
+
 void MWMODEM_run (struct MWMODEM_Content *fc)
 {
        MWMODEM_Package package;
@@ -49,9 +57,9 @@
 
 void MWMODEM_free (struct MWMODWEM_Content *fc)
 {
-       if (fc.socket >0) close(fc.socket);
-       delete fc.socket;
-       delete fc.cb;
-       delete fc.cls;
-       delete fc;
+       close(fc.socket);
+       free(fc.socket);
+       free(fc.cb);
+       free(fc.cls);
+       free(fc);
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]