[hipl-commit] [trunk] Rev 4312: Remove disabled code from firewall/proxy*.[ch].

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Fri, 16 Apr 2010 02:36:06 +0300

Committer: Diego Biurrun <diego@xxxxxxxxxx>
Date: 16/04/2010 at 02:36:06
Revision: 4312
Revision-id: diego@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  Remove disabled code from firewall/proxy*.[ch].

Modified:
  M  firewall/proxy.c
  M  firewall/proxyconndb.c
  M  firewall/proxyconndb.h
  M  firewall/proxydb.c
  M  firewall/proxydb.h

=== modified file 'firewall/proxy.c'
--- firewall/proxy.c    2010-04-15 20:47:19 +0000
+++ firewall/proxy.c    2010-04-15 23:33:52 +0000
@@ -358,7 +358,6 @@
     int err = 0;
 
     hip_uninit_proxy_db();
-    //hip_proxy_uninit_raw_sockets(); // FIXME not implemented yet
     hip_proxy_uninit_conn_db();
 
     return err;
@@ -713,7 +712,6 @@
             HIP_DEBUG_INADDR("ipv4 src address  inbound: ", &src4->sin_addr);
             HIP_DEBUG_INADDR("ipv4 src address  inbound: ", &dst4->sin_addr);
             icmp->checksum =  htons(0);
-            //icmp->checksum = ipv4_checksum(IPPROTO_ICMP, &(src4->sin_addr), 
&(dst4->sin_addr), icmp, (len - sizeof(struct ip6_hdr))); //checksum is ok for 
ipv4
             icmp->checksum = inchksum(icmp, (len - sizeof(struct ip6_hdr)));   
          //checksum is ok for ipv4
             HIP_HEXDUMP("icmp dump: ", icmp, (len - sizeof(struct ip6_hdr)));
             memcpy((msg + sizeof(struct ip)), (uint8_t *) icmp, (len - 
sizeof(struct ip6_hdr)));
@@ -725,7 +723,6 @@
             hip_raw_sock = hip_proxy_raw_sock_tcp_v6;
             sa_size      = sizeof(struct sockaddr_in6);
             msg          = malloc(len);
-            //memset(msg, 0, len);
             tcp->check   =  htons(0);
             tcp->check   = ipv6_checksum(IPPROTO_TCP, &(src6->sin6_addr), 
&(dst6->sin6_addr), tcp, (len - sizeof(struct ip6_hdr)));           //checksum 
is ok for ipv6
             memcpy((msg + sizeof(struct ip6_hdr)), (uint8_t *) tcp, (len - 
sizeof(struct ip6_hdr)));
@@ -736,7 +733,6 @@
             hip_raw_sock = hip_proxy_raw_sock_udp_v6;
             sa_size      = sizeof(struct sockaddr_in6);
             msg          = malloc(len);
-            //memset(msg, 0, len);
             udp->check   =  htons(0);
             udp->check   = ipv6_checksum(IPPROTO_UDP, &(src6->sin6_addr), 
&(dst6->sin6_addr), udp, (len - sizeof(struct ip6_hdr)));           //checksum 
is ok for ipv6
             memcpy((msg + sizeof(struct ip6_hdr)), (uint8_t *) udp, (len - 
sizeof(struct ip6_hdr)));
@@ -747,7 +743,6 @@
             hip_raw_sock        = hip_proxy_raw_sock_icmp_v6;
             sa_size             = sizeof(struct sockaddr_in6);
             msg                 = malloc(len);
-            //memset(msg, 0, len);
             icmpv6->icmp6_cksum =  htons(0);
             icmpv6->icmp6_cksum = ipv6_checksum(IPPROTO_ICMPV6, 
&(src6->sin6_addr), &(dst6->sin6_addr), icmpv6, (len - sizeof(struct 
ip6_hdr)));             //checksum is ok for ipv6
             memcpy((msg + sizeof(struct ip6_hdr)), (uint8_t *) icmpv6, (len - 
sizeof(struct ip6_hdr)));
@@ -1106,14 +1101,6 @@
                                                 port_peer)) {
                 HIP_DEBUG("find same connection  in connDB\n");
             } else {
-#if 0
-                /* add outbound entry */
-                if (hip_proxy_conn_add_entry(&entry->addr_client, 
&entry->addr_peer, &entry->hit_proxy, &entry->hit_peer, protocol, port_client, 
port_peer, HIP_PROXY_TRANSLATE)) {
-                    HIP_DEBUG("ConnDB add entry Failed!\n");
-                } else {
-                    HIP_DEBUG("ConnDB add entry Successful!\n");
-                }
-#endif
                 /* add inbound entry */
                 HIP_DEBUG_HIT("proxy_hit:",  &entry->hit_proxy);
                 HIP_DEBUG_IN6ADDR("src_addr:",  &entry->addr_peer);

=== modified file 'firewall/proxyconndb.c'
--- firewall/proxyconndb.c      2010-04-15 16:57:50 +0000
+++ firewall/proxyconndb.c      2010-04-15 23:33:52 +0000
@@ -139,8 +139,6 @@
     new_item->key.protocol    = protocol;
     new_item->key.port_client = port_client;
     new_item->key.port_peer   = port_peer;
-    //new_item->key.hit_proxy   = *hit_proxy;
-    //new_item->key.hit_peer    = *hit_peer;
     new_item->state           = state;
     err                       = hip_ht_add(hip_proxy_conn_db, new_item);
     HIP_DEBUG("conn adds connection state successfully!\n");

=== modified file 'firewall/proxyconndb.h'
--- firewall/proxyconndb.h      2010-03-19 09:00:54 +0000
+++ firewall/proxyconndb.h      2010-04-15 23:33:52 +0000
@@ -19,8 +19,8 @@
 typedef struct hip_proxy_conn {
     struct hip_proxy_conn_key key;
     int                       state;
-    struct in6_addr           addr_client; // addr_proxy_client
-    struct in6_addr           addr_peer; // addr_proxy_peer
+    struct in6_addr           addr_client;
+    struct in6_addr           addr_peer;
 } hip_proxy_conn_t;
 
 void hip_proxy_init_conn_db(void);

=== modified file 'firewall/proxydb.c'
--- firewall/proxydb.c  2010-04-15 16:57:50 +0000
+++ firewall/proxydb.c  2010-04-15 23:33:52 +0000
@@ -116,7 +116,6 @@
     memset(new_item, 0, sizeof(hip_proxy_t));
     ipv6_addr_copy(&new_item->addr_client, addr_client);
     ipv6_addr_copy(&new_item->addr_peer, addr_peer);
-    // new_item->state = 1;
     err = hip_ht_add(hip_proxy_db, new_item);
     HIP_DEBUG("Proxy adds connection state successfully!\n");
     HIP_DEBUG_IN6ADDR("source ip addr", &new_item->addr_client );

=== modified file 'firewall/proxydb.h'
--- firewall/proxydb.h  2010-03-19 09:00:54 +0000
+++ firewall/proxydb.h  2010-04-15 23:33:52 +0000
@@ -21,11 +21,11 @@
 #include "firewall_control.h"
 
 typedef struct hip_proxy_t {
-    hip_hit_t       hit_proxy; // hit_proxy_client
-    hip_hit_t       hit_peer; // hit_proxy_peer
-    struct in6_addr addr_client;     // addr_proxy_client
-    struct in6_addr addr_peer;     // addr_proxy_peer
-    struct in6_addr addr_proxy;     // addr_proxy_server
+    hip_hit_t       hit_proxy;
+    hip_hit_t       hit_peer;
+    struct in6_addr addr_client;
+    struct in6_addr addr_peer;
+    struct in6_addr addr_proxy;
     int             state;
     int             hip_capable;
 } hip_proxy_t;

Other related posts:

  • » [hipl-commit] [trunk] Rev 4312: Remove disabled code from firewall/proxy*.[ch]. - Diego Biurrun