gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r19291 - in gnunet/src: exit include vpn


From: gnunet
Subject: [GNUnet-SVN] r19291 - in gnunet/src: exit include vpn
Date: Fri, 20 Jan 2012 18:21:22 +0100

Author: grothoff
Date: 2012-01-20 18:21:21 +0100 (Fri, 20 Jan 2012)
New Revision: 19291

Modified:
   gnunet/src/exit/gnunet-daemon-exit.c
   gnunet/src/include/gnunet_protocols.h
   gnunet/src/vpn/gnunet-service-vpn.c
Log:
-use different message types for different directions for TCP DATA

Modified: gnunet/src/exit/gnunet-daemon-exit.c
===================================================================
--- gnunet/src/exit/gnunet-daemon-exit.c        2012-01-20 17:21:05 UTC (rev 
19290)
+++ gnunet/src/exit/gnunet-daemon-exit.c        2012-01-20 17:21:21 UTC (rev 
19291)
@@ -721,7 +721,7 @@
   tnq->len = mlen;
   tdm = (struct GNUNET_EXIT_TcpDataMessage *) &tnq[1];
   tdm->header.size = htons ((uint16_t) mlen);
-  tdm->header.type = htons (GNUNET_MESSAGE_TYPE_VPN_TCP_DATA);
+  tdm->header.type = htons (GNUNET_MESSAGE_TYPE_VPN_TCP_DATA_TO_VPN);
   tdm->reserved = htonl (0);
   memcpy (&tdm->tcp_header,
          buf, 
@@ -789,6 +789,7 @@
                    _("IPv4 packet options received.  Ignored.\n"));
        return;
       }
+      
       size -= sizeof (struct GNUNET_TUN_IPv4Header);
       switch (pkt4->protocol)
       {
@@ -2143,7 +2144,7 @@
     {&receive_udp_remote, GNUNET_MESSAGE_TYPE_VPN_UDP_TO_INTERNET, 0},
     {&receive_tcp_service, GNUNET_MESSAGE_TYPE_VPN_TCP_TO_SERVICE_START, 0},
     {&receive_tcp_remote, GNUNET_MESSAGE_TYPE_VPN_TCP_TO_INTERNET_START, 0},
-    {&receive_tcp_data, GNUNET_MESSAGE_TYPE_VPN_TCP_DATA, 0},
+    {&receive_tcp_data, GNUNET_MESSAGE_TYPE_VPN_TCP_DATA_TO_EXIT, 0},
     {NULL, 0, 0}
   };
 

Modified: gnunet/src/include/gnunet_protocols.h
===================================================================
--- gnunet/src/include/gnunet_protocols.h       2012-01-20 17:21:05 UTC (rev 
19290)
+++ gnunet/src/include/gnunet_protocols.h       2012-01-20 17:21:21 UTC (rev 
19291)
@@ -597,29 +597,34 @@
 /**
  * Type of messages containing an DNS request for a DNS exit service.
  */
-#define GNUNET_MESSAGE_TYPE_VPN_DNS_TO_INTERNET 194
+#define GNUNET_MESSAGE_TYPE_VPN_DNS_TO_INTERNET 193
 
 /**
  * Type of messages containing an DNS reply from a DNS exit service.
  */
-#define GNUNET_MESSAGE_TYPE_VPN_DNS_FROM_INTERNET 195
+#define GNUNET_MESSAGE_TYPE_VPN_DNS_FROM_INTERNET 194
 
 /**
  * Type of messages containing an TCP packet for a service.
  */
-#define GNUNET_MESSAGE_TYPE_VPN_TCP_TO_SERVICE_START 196
+#define GNUNET_MESSAGE_TYPE_VPN_TCP_TO_SERVICE_START 195
 
 /**
  * Type of messages containing an TCP packet for the Internet.
  */
-#define GNUNET_MESSAGE_TYPE_VPN_TCP_TO_INTERNET_START 197
+#define GNUNET_MESSAGE_TYPE_VPN_TCP_TO_INTERNET_START 196
 
 /**
  * Type of messages containing an TCP packet of an established connection.
  */
-#define GNUNET_MESSAGE_TYPE_VPN_TCP_DATA 198
+#define GNUNET_MESSAGE_TYPE_VPN_TCP_DATA_TO_EXIT 197
 
 /**
+ * Type of messages containing an TCP packet of an established connection.
+ */
+#define GNUNET_MESSAGE_TYPE_VPN_TCP_DATA_TO_VPN 198
+
+/**
  * Type of messages containing an UDP packet for a service.
  */
 #define GNUNET_MESSAGE_TYPE_VPN_UDP_TO_SERVICE 199

Modified: gnunet/src/vpn/gnunet-service-vpn.c
===================================================================
--- gnunet/src/vpn/gnunet-service-vpn.c 2012-01-20 17:21:05 UTC (rev 19290)
+++ gnunet/src/vpn/gnunet-service-vpn.c 2012-01-20 17:21:21 UTC (rev 19291)
@@ -1196,7 +1196,7 @@
       tnq->msg = &tnq[1];
       tdm = (struct  GNUNET_EXIT_TcpDataMessage *) &tnq[1];
       tdm->header.size = htons ((uint16_t) mlen);
-      tdm->header.type = htons (GNUNET_MESSAGE_TYPE_VPN_TCP_DATA);
+      tdm->header.type = htons (GNUNET_MESSAGE_TYPE_VPN_TCP_DATA_TO_EXIT);
       tdm->reserved = htonl (0);
       tdm->tcp_header = *tcp;
       memcpy (&tdm[1],
@@ -2322,7 +2322,7 @@
   };
   static const struct GNUNET_MESH_MessageHandler mesh_handlers[] = {
     { &receive_udp_back, GNUNET_MESSAGE_TYPE_VPN_UDP_REPLY, 0},
-    { &receive_tcp_back, GNUNET_MESSAGE_TYPE_VPN_TCP_DATA, 0},
+    { &receive_tcp_back, GNUNET_MESSAGE_TYPE_VPN_TCP_DATA_TO_VPN, 0},
     {NULL, 0, 0}
   };
   static const GNUNET_MESH_ApplicationType types[] = {




reply via email to

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