diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-01-02 10:34:48 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-01-02 10:34:48 +0000 |
commit | b36b0e9f8ee778f309f202e55b408522023625fa (patch) | |
tree | 556092938bd1814ed0c17054af3cf46af7cb25c3 | |
parent | 6372edeff7c14b4311d6da8b4f8fa2163c11f7db (diff) | |
download | gnunet-b36b0e9f8ee778f309f202e55b408522023625fa.tar.gz gnunet-b36b0e9f8ee778f309f202e55b408522023625fa.zip |
-minor cleanup
-rw-r--r-- | src/vpn/gnunet-daemon-exit.c | 116 |
1 files changed, 59 insertions, 57 deletions
diff --git a/src/vpn/gnunet-daemon-exit.c b/src/vpn/gnunet-daemon-exit.c index e35f99024..6d5dc7797 100644 --- a/src/vpn/gnunet-daemon-exit.c +++ b/src/vpn/gnunet-daemon-exit.c | |||
@@ -34,52 +34,6 @@ | |||
34 | 34 | ||
35 | #include "gnunet-vpn-packet.h" | 35 | #include "gnunet-vpn-packet.h" |
36 | 36 | ||
37 | /** | ||
38 | * The handle to the configuration used throughout the process | ||
39 | */ | ||
40 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | ||
41 | |||
42 | /** | ||
43 | * The handle to the helper | ||
44 | */ | ||
45 | static struct GNUNET_HELPER_Handle *helper_handle; | ||
46 | |||
47 | /** | ||
48 | * Arguments to the exit helper. | ||
49 | */ | ||
50 | static char *exit_argv[7]; | ||
51 | |||
52 | /** | ||
53 | * Final status code. | ||
54 | */ | ||
55 | static int ret; | ||
56 | |||
57 | /** | ||
58 | * The handle to mesh | ||
59 | */ | ||
60 | static struct GNUNET_MESH_Handle *mesh_handle; | ||
61 | |||
62 | /** | ||
63 | * This hashmaps contains the mapping from peer, service-descriptor, | ||
64 | * source-port and destination-port to a struct redirect_state | ||
65 | */ | ||
66 | static struct GNUNET_CONTAINER_MultiHashMap *udp_connections; | ||
67 | |||
68 | static struct GNUNET_CONTAINER_Heap *udp_connections_heap; | ||
69 | |||
70 | static struct GNUNET_CONTAINER_MultiHashMap *tcp_connections; | ||
71 | |||
72 | static struct GNUNET_CONTAINER_Heap *tcp_connections_heap; | ||
73 | |||
74 | /** | ||
75 | * If there are at least this many udp-Connections, old ones will be removed | ||
76 | */ | ||
77 | static long long unsigned int max_udp_connections = 200; | ||
78 | |||
79 | /** | ||
80 | * If there are at least this many tcp-Connections, old ones will be removed | ||
81 | */ | ||
82 | static long long unsigned int max_tcp_connections = 200; | ||
83 | 37 | ||
84 | struct remote_addr | 38 | struct remote_addr |
85 | { | 39 | { |
@@ -148,17 +102,6 @@ struct redirect_state | |||
148 | struct redirect_info redirect_info; | 102 | struct redirect_info redirect_info; |
149 | }; | 103 | }; |
150 | 104 | ||
151 | /** | ||
152 | * This hashmaps saves interesting things about the configured UDP services | ||
153 | */ | ||
154 | static struct GNUNET_CONTAINER_MultiHashMap *udp_services; | ||
155 | |||
156 | /** | ||
157 | * This hashmaps saves interesting things about the configured TCP services | ||
158 | */ | ||
159 | |||
160 | static struct GNUNET_CONTAINER_MultiHashMap *tcp_services; | ||
161 | |||
162 | struct tunnel_notify_queue | 105 | struct tunnel_notify_queue |
163 | { | 106 | { |
164 | struct tunnel_notify_queue *next; | 107 | struct tunnel_notify_queue *next; |
@@ -176,6 +119,65 @@ struct tunnel_state | |||
176 | 119 | ||
177 | 120 | ||
178 | /** | 121 | /** |
122 | * The handle to the configuration used throughout the process | ||
123 | */ | ||
124 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | ||
125 | |||
126 | /** | ||
127 | * The handle to the helper | ||
128 | */ | ||
129 | static struct GNUNET_HELPER_Handle *helper_handle; | ||
130 | |||
131 | /** | ||
132 | * Arguments to the exit helper. | ||
133 | */ | ||
134 | static char *exit_argv[7]; | ||
135 | |||
136 | /** | ||
137 | * Final status code. | ||
138 | */ | ||
139 | static int ret; | ||
140 | |||
141 | /** | ||
142 | * The handle to mesh | ||
143 | */ | ||
144 | static struct GNUNET_MESH_Handle *mesh_handle; | ||
145 | |||
146 | /** | ||
147 | * This hashmaps contains the mapping from peer, service-descriptor, | ||
148 | * source-port and destination-port to a struct redirect_state | ||
149 | */ | ||
150 | static struct GNUNET_CONTAINER_MultiHashMap *udp_connections; | ||
151 | |||
152 | static struct GNUNET_CONTAINER_Heap *udp_connections_heap; | ||
153 | |||
154 | static struct GNUNET_CONTAINER_MultiHashMap *tcp_connections; | ||
155 | |||
156 | static struct GNUNET_CONTAINER_Heap *tcp_connections_heap; | ||
157 | |||
158 | /** | ||
159 | * If there are at least this many udp-Connections, old ones will be removed | ||
160 | */ | ||
161 | static long long unsigned int max_udp_connections = 200; | ||
162 | |||
163 | /** | ||
164 | * If there are at least this many tcp-Connections, old ones will be removed | ||
165 | */ | ||
166 | static long long unsigned int max_tcp_connections = 200; | ||
167 | |||
168 | /** | ||
169 | * This hashmaps saves interesting things about the configured UDP services | ||
170 | */ | ||
171 | static struct GNUNET_CONTAINER_MultiHashMap *udp_services; | ||
172 | |||
173 | /** | ||
174 | * This hashmaps saves interesting things about the configured TCP services | ||
175 | */ | ||
176 | |||
177 | static struct GNUNET_CONTAINER_MultiHashMap *tcp_services; | ||
178 | |||
179 | |||
180 | /** | ||
179 | * Function that frees everything from a hashmap | 181 | * Function that frees everything from a hashmap |
180 | */ | 182 | */ |
181 | static int | 183 | static int |