aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_validation.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-05 09:36:02 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-05 09:36:02 +0000
commitfb567582ca24ac7450336782365e86a177d8a472 (patch)
tree053b29071811155a328bf8dec1f1c922997fe02f /src/transport/gnunet-service-transport_validation.c
parentec057166095a225d45be16e66671e0f7f74cbef2 (diff)
downloadgnunet-fb567582ca24ac7450336782365e86a177d8a472.tar.gz
gnunet-fb567582ca24ac7450336782365e86a177d8a472.zip
more refactoring
Diffstat (limited to 'src/transport/gnunet-service-transport_validation.c')
-rw-r--r--src/transport/gnunet-service-transport_validation.c143
1 files changed, 143 insertions, 0 deletions
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c
new file mode 100644
index 000000000..6cdd99e25
--- /dev/null
+++ b/src/transport/gnunet-service-transport_validation.c
@@ -0,0 +1,143 @@
1/*
2 This file is part of GNUnet.
3 (C) 2010,2011 Christian Grothoff (and other contributing authors)
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
21/**
22 * @file transport/gnunet-service-transport_validation.c
23 * @brief address validation subsystem
24 * @author Christian Grothoff
25 */
26#include "platform.h"
27#include "gnunet-service-transport_validation.h"
28
29
30/**
31 * Start the validation subsystem.
32 */
33void
34GST_validation_start ()
35{
36}
37
38
39/**
40 * Stop the validation subsystem.
41 */
42void
43GST_validation_stop ()
44{
45}
46
47
48/**
49 * We've received a PING. If appropriate, generate a PONG.
50 *
51 * @param sender peer sending the PING
52 * @param hdr the PING
53 * @param plugin_name name of plugin that received the PING
54 * @param sender_address address of the sender as known to the plugin, NULL
55 * if we did not initiate the connection
56 * @param sender_address_len number of bytes in sender_address
57 */
58void
59GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender,
60 const struct GNUNET_MessageHeader *hdr,
61 const char *plugin_name,
62 const void *sender_address,
63 size_t sender_address_len)
64{
65}
66
67
68/**
69 * We've received a PONG. Check if it matches a pending PING and
70 * mark the respective address as confirmed.
71 *
72 * @param sender peer sending the PONG
73 * @param hdr the PONG
74 * @param plugin_name name of plugin that received the PONG
75 * @param sender_address address of the sender as known to the plugin, NULL
76 * if we did not initiate the connection
77 * @param sender_address_len number of bytes in sender_address
78 */
79void
80GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender,
81 const struct GNUNET_MessageHeader *hdr,
82 const char *plugin_name,
83 const void *sender_address,
84 size_t sender_address_len)
85{
86}
87
88
89/**
90 * We've received a HELLO, check which addresses are new and trigger
91 * validation.
92 *
93 * @param hello the HELLO we received
94 */
95void
96GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello)
97{
98}
99
100
101/**
102 * Opaque handle to stop incremental validation address callbacks.
103 */
104struct GST_ValidationIteratorContext
105{
106};
107
108
109/**
110 * Call the given function for each address for the given target.
111 * Can either give a snapshot (synchronous API) or be continuous.
112 *
113 * @param target peer information is requested for
114 * @param snapshot_only GNUNET_YES to iterate over addresses once, GNUNET_NO to
115 * continue to give information about addresses as it evolves
116 * @param cb function to call; will not be called after this function returns
117 * if snapshot_only is GNUNET_YES
118 * @param cb_cls closure for 'cb'
119 * @return context to cancel, NULL if 'snapshot_only' is GNUNET_YES
120 */
121struct GST_ValidationIteratorContext *
122GST_validation_get_addresses (const struct GNUNET_PeerIdentity *target,
123 int snapshot_only,
124 GST_ValidationAddressCallback cb,
125 void *cb_cls)
126{
127 return NULL;
128}
129
130
131/**
132 * Cancel an active validation address iteration.
133 *
134 * @param ctx the context of the operation that is cancelled
135 */
136void
137GST_validation_get_addresses_cancel (struct GST_ValidationIteratorContext *ctx)
138{
139 GNUNET_break (0);
140}
141
142
143/* end of file gnunet-service-transport_validation.c */