diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/gnunet-service-transport.h | 51 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_blacklist.h | 81 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_clients.h | 51 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_hello.h | 71 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.h | 110 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_plugins.h | 61 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_validation.h | 107 |
7 files changed, 532 insertions, 0 deletions
diff --git a/src/transport/gnunet-service-transport.h b/src/transport/gnunet-service-transport.h new file mode 100644 index 000000000..544b60507 --- /dev/null +++ b/src/transport/gnunet-service-transport.h | |||
@@ -0,0 +1,51 @@ | |||
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.h | ||
23 | * @brief globals | ||
24 | * @author Christian Grothoff | ||
25 | */ | ||
26 | #ifndef GNUNET_SERVICE_TRANSPORT_H | ||
27 | #define GNUNET_SERVICE_TRANSPORT_H | ||
28 | |||
29 | #include "gnunet_statistics_service.h" | ||
30 | #include "gnunet_transport_plugins.h" | ||
31 | #include "gnunet_transport_service.h" | ||
32 | #include "gnunet_util_lib.h" | ||
33 | |||
34 | /** | ||
35 | * Statistics handle. | ||
36 | */ | ||
37 | extern struct GNUNET_STATISTICS_Handle *GST_stats; | ||
38 | |||
39 | /** | ||
40 | * Configuration handle. | ||
41 | */ | ||
42 | extern const struct GNUNET_CONFIGURATION_Handle *GST_cfg; | ||
43 | |||
44 | /** | ||
45 | * Configuration handle. | ||
46 | */ | ||
47 | extern struct GNUNET_PeerIdentity GST_my_identity; | ||
48 | |||
49 | |||
50 | #endif | ||
51 | /* end of file gnunet-service-transport_plugins.h */ | ||
diff --git a/src/transport/gnunet-service-transport_blacklist.h b/src/transport/gnunet-service-transport_blacklist.h new file mode 100644 index 000000000..e1674ead3 --- /dev/null +++ b/src/transport/gnunet-service-transport_blacklist.h | |||
@@ -0,0 +1,81 @@ | |||
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_blacklist.h | ||
23 | * @brief blacklisting API | ||
24 | * @author Christian Grothoff | ||
25 | */ | ||
26 | #ifndef GNUNET_SERVICE_TRANSPORT_BLACKLIST_H | ||
27 | #define GNUNET_SERVICE_TRANSPORT_BLACKLIST_H | ||
28 | |||
29 | #include "gnunet_statistics_service.h" | ||
30 | #include "gnunet_transport_blacklist.h" | ||
31 | #include "gnunet_util_lib.h" | ||
32 | |||
33 | /** | ||
34 | * | ||
35 | */ | ||
36 | void | ||
37 | GST_blacklist_start (void); | ||
38 | |||
39 | |||
40 | /** | ||
41 | * | ||
42 | */ | ||
43 | void | ||
44 | GST_blacklist_stop (void); | ||
45 | |||
46 | |||
47 | /** | ||
48 | * | ||
49 | */ | ||
50 | void | ||
51 | GST_blacklist_handle_init (void *cls, | ||
52 | const struct GNUNET_SERVER_Client *client, | ||
53 | const struct GNUNET_MessageHeader *message); | ||
54 | |||
55 | /** | ||
56 | * | ||
57 | */ | ||
58 | void | ||
59 | GST_blacklist_handle_reply (void *cls, | ||
60 | const struct GNUNET_SERVER_Client *client, | ||
61 | const struct GNUNET_MessageHeader *message); | ||
62 | |||
63 | /** | ||
64 | * | ||
65 | */ | ||
66 | void | ||
67 | GST_blacklist_add_peer (const struct GNUNET_PeerIdentity *peer, | ||
68 | const char *transport_name); | ||
69 | |||
70 | |||
71 | /** | ||
72 | * | ||
73 | */ | ||
74 | int | ||
75 | GST_blacklist_test (const struct GNUNET_PeerIdentity *peer, | ||
76 | const char *transport_name); | ||
77 | |||
78 | |||
79 | |||
80 | #endif | ||
81 | /* end of file gnunet-service-transport_blacklist.h */ | ||
diff --git a/src/transport/gnunet-service-transport_clients.h b/src/transport/gnunet-service-transport_clients.h new file mode 100644 index 000000000..299d75857 --- /dev/null +++ b/src/transport/gnunet-service-transport_clients.h | |||
@@ -0,0 +1,51 @@ | |||
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_clients.h | ||
23 | * @brief plugin management API | ||
24 | * @author Christian Grothoff | ||
25 | */ | ||
26 | #ifndef GNUNET_SERVICE_TRANSPORT_CLIENTS_H | ||
27 | #define GNUNET_SERVICE_TRANSPORT_CLIENTS_H | ||
28 | |||
29 | #include "gnunet_statistics_service.h" | ||
30 | #include "gnunet_transport_clients.h" | ||
31 | #include "gnunet_util_lib.h" | ||
32 | |||
33 | |||
34 | /** | ||
35 | * | ||
36 | */ | ||
37 | void | ||
38 | GST_clients_start (struct GNUNET_SERVER_Handle *server); | ||
39 | |||
40 | |||
41 | /** | ||
42 | * | ||
43 | */ | ||
44 | void | ||
45 | GST_clients_stop (void); | ||
46 | |||
47 | |||
48 | |||
49 | |||
50 | #endif | ||
51 | /* end of file gnunet-service-transport_clients.h */ | ||
diff --git a/src/transport/gnunet-service-transport_hello.h b/src/transport/gnunet-service-transport_hello.h new file mode 100644 index 000000000..75fef07ae --- /dev/null +++ b/src/transport/gnunet-service-transport_hello.h | |||
@@ -0,0 +1,71 @@ | |||
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_hello.h | ||
23 | * @brief hello API | ||
24 | * @author Christian Grothoff | ||
25 | */ | ||
26 | #ifndef GNUNET_SERVICE_TRANSPORT_HELLO_H | ||
27 | #define GNUNET_SERVICE_TRANSPORT_HELLO_H | ||
28 | |||
29 | #include "gnunet_statistics_service.h" | ||
30 | #include "gnunet_transport_service.h" | ||
31 | #include "gnunet_util_lib.h" | ||
32 | |||
33 | |||
34 | /** | ||
35 | * | ||
36 | */ | ||
37 | void | ||
38 | GST_hello_start (void); | ||
39 | |||
40 | /** | ||
41 | * | ||
42 | */ | ||
43 | void | ||
44 | GST_hello_stop (void); | ||
45 | |||
46 | /** | ||
47 | * | ||
48 | */ | ||
49 | const struct GNUNET_MessageHeader * | ||
50 | GST_hello_get (void); | ||
51 | |||
52 | /** | ||
53 | * | ||
54 | */ | ||
55 | void | ||
56 | GST_hello_modify_addresses (int addremove, | ||
57 | const char *plugin_name, | ||
58 | const void *plugin_address, | ||
59 | size_t plugin_address_len); | ||
60 | |||
61 | /** | ||
62 | * | ||
63 | */ | ||
64 | int | ||
65 | GST_hello_test_address (const char *plugin_name, | ||
66 | const void *plugin_address, | ||
67 | size_t plugin_address_len); | ||
68 | |||
69 | |||
70 | #endif | ||
71 | /* end of file gnunet-service-transport_hello.h */ | ||
diff --git a/src/transport/gnunet-service-transport_neighbours.h b/src/transport/gnunet-service-transport_neighbours.h new file mode 100644 index 000000000..18134fd33 --- /dev/null +++ b/src/transport/gnunet-service-transport_neighbours.h | |||
@@ -0,0 +1,110 @@ | |||
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_neighbours.h | ||
23 | * @brief plugin management API | ||
24 | * @author Christian Grothoff | ||
25 | */ | ||
26 | #ifndef GNUNET_SERVICE_TRANSPORT_NEIGHBOURS_H | ||
27 | #define GNUNET_SERVICE_TRANSPORT_NEIGHBOURS_H | ||
28 | |||
29 | #include "gnunet_statistics_service.h" | ||
30 | #include "gnunet_transport_service.h" | ||
31 | #include "gnunet_util_lib.h" | ||
32 | |||
33 | |||
34 | /** | ||
35 | * | ||
36 | */ | ||
37 | void | ||
38 | GST_neighbours_start (void *cls, | ||
39 | GNUNET_TRANSPORT_NotifyConnect connect_cb, | ||
40 | GNUNET_TRANSPORT_NotifyDisconnect disconnect_cb); | ||
41 | |||
42 | /** | ||
43 | * | ||
44 | */ | ||
45 | void | ||
46 | GST_neighbours_stop (void); | ||
47 | |||
48 | /** | ||
49 | * | ||
50 | */ | ||
51 | void | ||
52 | GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target); | ||
53 | |||
54 | /** | ||
55 | * | ||
56 | */ | ||
57 | int | ||
58 | GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target); | ||
59 | |||
60 | /** | ||
61 | * | ||
62 | */ | ||
63 | void | ||
64 | GST_neighbours_force_disconnect (const struct GNUNET_PeerIdentity *target); | ||
65 | |||
66 | |||
67 | typedef void (*GST_NeighbourIterator)(void *cls, | ||
68 | const struct GNUNET_PeerIdentity *neighbour); | ||
69 | |||
70 | |||
71 | void | ||
72 | GST_neighbours_iterate (GST_NeighbourIterator cb, | ||
73 | void *cb_cls); | ||
74 | |||
75 | |||
76 | /** | ||
77 | * | ||
78 | */ | ||
79 | int | ||
80 | GST_neighbours_handle_pong (const 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 | int | ||
90 | GST_neighbours_handle_connect (const GNUNET_PeerIdentity *sender, | ||
91 | const struct GNUNET_MessageHeader *hdr, | ||
92 | const char *plugin_name, | ||
93 | const void *sender_address, | ||
94 | size_t sender_address_len); | ||
95 | |||
96 | /** | ||
97 | * | ||
98 | */ | ||
99 | int | ||
100 | GST_neighbours_handle_disconnect (const GNUNET_PeerIdentity *sender, | ||
101 | const struct GNUNET_MessageHeader *hdr, | ||
102 | const char *plugin_name, | ||
103 | const void *sender_address, | ||
104 | size_t sender_address_len); | ||
105 | |||
106 | |||
107 | |||
108 | |||
109 | #endif | ||
110 | /* end of file gnunet-service-transport_neighbours.h */ | ||
diff --git a/src/transport/gnunet-service-transport_plugins.h b/src/transport/gnunet-service-transport_plugins.h new file mode 100644 index 000000000..ad8746b4c --- /dev/null +++ b/src/transport/gnunet-service-transport_plugins.h | |||
@@ -0,0 +1,61 @@ | |||
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_plugins.h | ||
23 | * @brief plugin management API | ||
24 | * @author Christian Grothoff | ||
25 | */ | ||
26 | #ifndef GNUNET_SERVICE_TRANSPORT_PLUGINS_H | ||
27 | #define GNUNET_SERVICE_TRANSPORT_PLUGINS_H | ||
28 | |||
29 | #include "gnunet_statistics_service.h" | ||
30 | #include "gnunet_transport_plugins.h" | ||
31 | #include "gnunet_util_lib.h" | ||
32 | |||
33 | |||
34 | /** | ||
35 | * | ||
36 | */ | ||
37 | int | ||
38 | GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb, | ||
39 | GNUNET_TRANSPORT_AddressNotification address_cb, | ||
40 | GNUNET_TRANSPORT_TrafficReport traffic_cb, | ||
41 | GNUNET_TRANSPORT_SessionEnd session_end_cb, | ||
42 | GNUNET_TRANSPORT_CostReport cost_cb); | ||
43 | |||
44 | |||
45 | /** | ||
46 | * | ||
47 | */ | ||
48 | int | ||
49 | GST_plugins_unload (void); | ||
50 | |||
51 | |||
52 | /** | ||
53 | * | ||
54 | */ | ||
55 | struct GNUNET_TRANSPORT_PluginFunctions * | ||
56 | GST_plugins_find (const char *name); | ||
57 | |||
58 | |||
59 | |||
60 | #endif | ||
61 | /* end of file gnunet-service-transport_plugins.h */ | ||
diff --git a/src/transport/gnunet-service-transport_validation.h b/src/transport/gnunet-service-transport_validation.h new file mode 100644 index 000000000..374512e47 --- /dev/null +++ b/src/transport/gnunet-service-transport_validation.h | |||
@@ -0,0 +1,107 @@ | |||
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.h | ||
23 | * @brief plugin management API | ||
24 | * @author Christian Grothoff | ||
25 | */ | ||
26 | #ifndef GNUNET_SERVICE_TRANSPORT_VALIDATION_H | ||
27 | #define GNUNET_SERVICE_TRANSPORT_VALIDATION_H | ||
28 | |||
29 | #include "gnunet_statistics_service.h" | ||
30 | #include "gnunet_transport_validation.h" | ||
31 | #include "gnunet_util_lib.h" | ||
32 | |||
33 | |||
34 | /** | ||
35 | * | ||
36 | */ | ||
37 | void | ||
38 | GST_validation_start (void); | ||
39 | |||
40 | |||
41 | /** | ||
42 | * | ||
43 | */ | ||
44 | void | ||
45 | GST_validation_stop (void); | ||
46 | |||
47 | |||
48 | /** | ||
49 | * | ||
50 | */ | ||
51 | int | ||
52 | GST_validation_handle_ping (const GNUNET_PeerIdentity *sender, | ||
53 | const struct GNUNET_MessageHeader *hdr, | ||
54 | const char *plugin_name, | ||
55 | const void *sender_address, | ||
56 | size_t sender_address_len); | ||
57 | |||
58 | /** | ||
59 | * | ||
60 | */ | ||
61 | int | ||
62 | GST_validation_handle_pong (const GNUNET_PeerIdentity *sender, | ||
63 | const struct GNUNET_MessageHeader *hdr, | ||
64 | const char *plugin_name, | ||
65 | const void *sender_address, | ||
66 | size_t sender_address_len); | ||
67 | |||
68 | |||
69 | /** | ||
70 | * | ||
71 | */ | ||
72 | void | ||
73 | GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello); | ||
74 | |||
75 | |||
76 | struct GST_ValidationIteratorContext; | ||
77 | |||
78 | /** | ||
79 | * @param last_validated_at is FOREVER if the address has not been validated (we're currently checking) | ||
80 | * is ZERO if the address was validated a long time ago (from PEERINFO) | ||
81 | * is a time in the past if this process validated the address | ||
82 | * @param validation_block is FOREVER if the address is for an unsupported plugin (from PEERINFO) | ||
83 | * is ZERO if the address is considered valid (no validation needed) | ||
84 | * is a time in the future if we're currently denying re-validation | ||
85 | */ | ||
86 | typedef void (*GST_ValidationAddressCallback)(void *cls, | ||
87 | const GNUNET_PeerIdentity *target, | ||
88 | struct GNUNET_TIME_Absolute last_validated_at, | ||
89 | struct GNUNET_TIME_Absolute validation_block, | ||
90 | const char *plugin_name, | ||
91 | const void *plugin_address, | ||
92 | size_t plugin_address_len); | ||
93 | |||
94 | struct GST_ValidationIteratorContext * | ||
95 | GST_validation_get_addresses (const GNUNET_PeerIdentity *target, | ||
96 | GST_ValidationAddressCallback cb, | ||
97 | void *cb_cls); | ||
98 | |||
99 | |||
100 | |||
101 | void | ||
102 | GST_validation_get_addresses_cancel (struct GST_ValidationIteratorContext *ctx); | ||
103 | |||
104 | |||
105 | |||
106 | #endif | ||
107 | /* end of file gnunet-service-transport_validation.h */ | ||