gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r20703 - in gnunet/src: fs include transport


From: gnunet
Subject: [GNUnet-SVN] r20703 - in gnunet/src: fs include transport
Date: Fri, 23 Mar 2012 09:39:18 +0100

Author: grothoff
Date: 2012-03-23 09:39:18 +0100 (Fri, 23 Mar 2012)
New Revision: 20703

Modified:
   gnunet/src/fs/fs_uri.c
   gnunet/src/include/gnunet_protocols.h
   gnunet/src/transport/gnunet-helper-transport-wlan-dummy.c
   gnunet/src/transport/gnunet-helper-transport-wlan.c
   gnunet/src/transport/gnunet-transport-wlan-sender.c
   gnunet/src/transport/plugin_transport_wlan.c
   gnunet/src/transport/plugin_transport_wlan.h
Log:
-using cleaner message types for WLAN-HELPER IPC

Modified: gnunet/src/fs/fs_uri.c
===================================================================
--- gnunet/src/fs/fs_uri.c      2012-03-23 08:26:00 UTC (rev 20702)
+++ gnunet/src/fs/fs_uri.c      2012-03-23 08:39:18 UTC (rev 20703)
@@ -1378,12 +1378,11 @@
 {
   char *ret;
   char *name, *unique_name;
-  int getinfo_result;
 
   if (uri->type != sks)
     return NULL;
-  getinfo_result = GNUNET_PSEUDONYM_get_info (cfg, &uri->data.sks.namespace,
-      NULL, NULL, &name, NULL);
+  (void) GNUNET_PSEUDONYM_get_info (cfg, &uri->data.sks.namespace,
+                                   NULL, NULL, &name, NULL);
   unique_name = GNUNET_PSEUDONYM_name_uniquify (cfg, &uri->data.sks.namespace, 
name, NULL);
   GNUNET_free (name);
   GNUNET_asprintf (&ret, "%s: %s", unique_name, uri->data.sks.identifier);

Modified: gnunet/src/include/gnunet_protocols.h
===================================================================
--- gnunet/src/include/gnunet_protocols.h       2012-03-23 08:26:00 UTC (rev 
20702)
+++ gnunet/src/include/gnunet_protocols.h       2012-03-23 08:39:18 UTC (rev 
20703)
@@ -128,14 +128,18 @@
  
******************************************************************************/
 
 /**
- * Type of messages between the gnunet-wlan-helper and the daemon
- *
+ * Type of data messages from the plugin to the gnunet-wlan-helper 
  */
-#define GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA 40
+#define GNUNET_MESSAGE_TYPE_WLAN_DATA_TO_HELPER 39
 
 /**
- * Control messages between the gnunet-wlan-helper and the daemon
+ * Type of data messages from the gnunet-wlan-helper to the plugin
  */
+#define GNUNET_MESSAGE_TYPE_WLAN_DATA_FROM_HELPER 40
+
+/**
+ * Control message between the gnunet-wlan-helper and the daemon (with the 
MAC).
+ */
 #define GNUNET_MESSAGE_TYPE_WLAN_HELPER_CONTROL 41
 
 /**

Modified: gnunet/src/transport/gnunet-helper-transport-wlan-dummy.c
===================================================================
--- gnunet/src/transport/gnunet-helper-transport-wlan-dummy.c   2012-03-23 
08:26:00 UTC (rev 20702)
+++ gnunet/src/transport/gnunet-helper-transport-wlan-dummy.c   2012-03-23 
08:39:18 UTC (rev 20703)
@@ -82,7 +82,7 @@
   struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage newheader;
 
   in = (const struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *) hdr;
-  if ( (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA != ntohs (hdr->type)) ||
+  if ( (GNUNET_MESSAGE_TYPE_WLAN_DATA_TO_HELPER != ntohs (hdr->type)) ||
        (sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage) < ntohs 
(hdr->size)) )
   {
     fprintf (stderr, "Function stdin_send: wrong packet type or size\n");
@@ -96,7 +96,7 @@
   }
   memset (&newheader, 0, sizeof (newheader));
   newheader.header.size = htons (payload_size + sizeof (newheader));
-  newheader.header.type = htons (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA);
+  newheader.header.type = htons (GNUNET_MESSAGE_TYPE_WLAN_DATA_FROM_HELPER);
   newheader.frame = in->frame;
   memcpy (write_pout->buf + write_pout->size,
          &newheader,
@@ -116,12 +116,6 @@
   uint16_t sendsize;
 
   sendsize = ntohs (hdr->size);
-
-  if (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA != ntohs (hdr->type))
-  {
-    fprintf (stderr, "Function file_in_send: wrong packet type\n");
-    exit (1);
-  }
   if ((sendsize + write_std->size) > MAXLINE * 2)
   {
     fprintf (stderr, "Function file_in_send: Packet too big for buffer\n");

Modified: gnunet/src/transport/gnunet-helper-transport-wlan.c
===================================================================
--- gnunet/src/transport/gnunet-helper-transport-wlan.c 2012-03-23 08:26:00 UTC 
(rev 20702)
+++ gnunet/src/transport/gnunet-helper-transport-wlan.c 2012-03-23 08:39:18 UTC 
(rev 20703)
@@ -1795,7 +1795,7 @@
   sendsize = ntohs (hdr->size);
   if ( (sendsize <
        sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage)) ||
-       (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA != ntohs (hdr->type)) ) 
+       (GNUNET_MESSAGE_TYPE_WLAN_DATA_TO_HELPER != ntohs (hdr->type)) ) 
   {
     fprintf (stderr, "Received malformed message\n");
     exit (1);
@@ -2039,7 +2039,7 @@
          + sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage) 
          - sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame);
         rrm->header.size = htons (write_std.size);
-        rrm->header.type = htons (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA);
+        rrm->header.type = htons (GNUNET_MESSAGE_TYPE_WLAN_DATA_FROM_HELPER);
       }
     }
   }

Modified: gnunet/src/transport/gnunet-transport-wlan-sender.c
===================================================================
--- gnunet/src/transport/gnunet-transport-wlan-sender.c 2012-03-23 08:26:00 UTC 
(rev 20702)
+++ gnunet/src/transport/gnunet-transport-wlan-sender.c 2012-03-23 08:39:18 UTC 
(rev 20703)
@@ -58,7 +58,7 @@
                   uint16_t size)
 {
   header->header.size = htons (size);
-  header->header.type = htons (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA);
+  header->header.type = htons (GNUNET_MESSAGE_TYPE_WLAN_DATA_TO_HELPER);
   header->rate = 255;
   header->tx_power = 0;
   header->antenna = 0;

Modified: gnunet/src/transport/plugin_transport_wlan.c
===================================================================
--- gnunet/src/transport/plugin_transport_wlan.c        2012-03-23 08:26:00 UTC 
(rev 20702)
+++ gnunet/src/transport/plugin_transport_wlan.c        2012-03-23 08:39:18 UTC 
(rev 20703)
@@ -1221,7 +1221,7 @@
                    struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *header,
                   uint16_t size)
 {
-  header->header.type = ntohs (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA);
+  header->header.type = ntohs (GNUNET_MESSAGE_TYPE_WLAN_DATA_TO_HELPER);
   header->header.size = ntohs (size);
   if (endpoint != NULL)
   {
@@ -2778,12 +2778,12 @@
   GNUNET_assert (plugin != NULL);
   switch (ntohs (hdr->type))
   {
-  case GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA:
+  case GNUNET_MESSAGE_TYPE_WLAN_DATA_FROM_HELPER:
     GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME,
-                     "Func wlan_process_helper got 
GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA size: %u\n",
+                     "Got data message from helper with %u bytes\n",
                      ntohs (hdr->size));
     GNUNET_STATISTICS_update (plugin->env->stats,
-                              _("# wlan WLAN_HELPER_DATA received"), 1,
+                              _("# wlan data messages received"), 1,
                               GNUNET_NO);
     //call wlan_process_helper with the message inside, later with wlan: 
analyze signal
     if (ntohs (hdr->size) < sizeof (struct 
GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage))

Modified: gnunet/src/transport/plugin_transport_wlan.h
===================================================================
--- gnunet/src/transport/plugin_transport_wlan.h        2012-03-23 08:26:00 UTC 
(rev 20702)
+++ gnunet/src/transport/plugin_transport_wlan.h        2012-03-23 08:39:18 UTC 
(rev 20703)
@@ -142,7 +142,7 @@
 {
 
   /**
-   * Type is 'GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA'.
+   * Type is 'GNUNET_MESSAGE_TYPE_WLAN_DATA_TO_HELPER'.
    */
   struct GNUNET_MessageHeader header;
 
@@ -183,7 +183,7 @@
 {
 
   /**
-   * Type is 'GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA'.
+   * Type is 'GNUNET_MESSAGE_TYPE_WLAN_DATA_FROM_HELPER'.
    */
   struct GNUNET_MessageHeader header;
 




reply via email to

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