diff options
Diffstat (limited to 'src/dht/dhtlog.h')
-rw-r--r-- | src/dht/dhtlog.h | 122 |
1 files changed, 97 insertions, 25 deletions
diff --git a/src/dht/dhtlog.h b/src/dht/dhtlog.h index b2ba1c96f..36c81181b 100644 --- a/src/dht/dhtlog.h +++ b/src/dht/dhtlog.h | |||
@@ -72,16 +72,17 @@ struct GNUNET_DHTLOG_Handle | |||
72 | { | 72 | { |
73 | 73 | ||
74 | /* | 74 | /* |
75 | * Insert the result of a query into the database | 75 | * Inserts the specified query into the dhttests.queries table |
76 | * | 76 | * |
77 | * @param sqlqueryuid return value for the sql uid for this query | 77 | * @param sqlqueruid inserted query uid |
78 | * @param queryid gnunet internal query id (doesn't exist) | 78 | * @param queryid dht query id |
79 | * @param type the type of query (DHTLOG_GET, DHTLOG_PUT, DHTLOG_RESULT) | 79 | * @param type type of the query |
80 | * @param hops the hops the query has traveled | 80 | * @param hops number of hops query traveled |
81 | * @param succeeded is successful or not (GNUNET_YES or GNUNET_NO) | 81 | * @param succeeded whether or not query was successful |
82 | * @param GNUNET_PeerIdentity of the node the query is at now | 82 | * @param node the node the query hit |
83 | * @param key the GNUNET_HashCode of this query | 83 | * @param key the key of the query |
84 | * | 84 | * |
85 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure. | ||
85 | */ | 86 | */ |
86 | int (*insert_query) (unsigned long long *sqlqueryuid, | 87 | int (*insert_query) (unsigned long long *sqlqueryuid, |
87 | unsigned long long queryid, DHTLOG_MESSAGE_TYPES type, | 88 | unsigned long long queryid, DHTLOG_MESSAGE_TYPES type, |
@@ -91,7 +92,28 @@ struct GNUNET_DHTLOG_Handle | |||
91 | const GNUNET_HashCode * key); | 92 | const GNUNET_HashCode * key); |
92 | 93 | ||
93 | /* | 94 | /* |
94 | * Inserts the trial information into the database | 95 | * Inserts the specified trial into the dhttests.trials table |
96 | * | ||
97 | * @param trialuid return the trialuid of the newly inserted trial | ||
98 | * @param num_nodes how many nodes are in the trial | ||
99 | * @param topology integer representing topology for this trial | ||
100 | * @param blacklist_topology integer representing blacklist topology for this trial | ||
101 | * @param connect_topology integer representing connect topology for this trial | ||
102 | * @param connect_topology_option integer representing connect topology option | ||
103 | * @param connect_topology_option_modifier float to modify connect option | ||
104 | * @param topology_percentage percentage modifier for certain topologies | ||
105 | * @param topology_probability probability modifier for certain topologies | ||
106 | * @param puts number of puts to perform | ||
107 | * @param gets number of gets to perform | ||
108 | * @param concurrent number of concurrent requests | ||
109 | * @param settle_time time to wait between creating topology and starting testing | ||
110 | * @param num_rounds number of times to repeat the trial | ||
111 | * @param malicious_getters number of malicious GET peers in the trial | ||
112 | * @param malicious_putters number of malicious PUT peers in the trial | ||
113 | * @param malicious_droppers number of malicious DROP peers in the trial | ||
114 | * @param message string to put into DB for this trial | ||
115 | * | ||
116 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | ||
95 | */ | 117 | */ |
96 | int (*insert_trial) (unsigned long long *trialuid, int num_nodes, int topology, | 118 | int (*insert_trial) (unsigned long long *trialuid, int num_nodes, int topology, |
97 | int blacklist_topology, int connect_topology, | 119 | int blacklist_topology, int connect_topology, |
@@ -103,7 +125,14 @@ struct GNUNET_DHTLOG_Handle | |||
103 | char *message); | 125 | char *message); |
104 | 126 | ||
105 | /* | 127 | /* |
106 | * Update the trial information with the ending time and dropped message stats | 128 | * Update dhttests.trials table with current server time as end time |
129 | * | ||
130 | * @param trialuid trial to update | ||
131 | * @param totalMessagesDropped stats value for messages dropped | ||
132 | * @param totalBytesDropped stats value for total bytes dropped | ||
133 | * @param unknownPeers stats value for unknown peers | ||
134 | * | ||
135 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure. | ||
107 | */ | 136 | */ |
108 | int (*update_trial) (unsigned long long trialuid, | 137 | int (*update_trial) (unsigned long long trialuid, |
109 | unsigned long long totalMessagesDropped, | 138 | unsigned long long totalMessagesDropped, |
@@ -111,26 +140,58 @@ struct GNUNET_DHTLOG_Handle | |||
111 | unsigned long long unknownPeers); | 140 | unsigned long long unknownPeers); |
112 | 141 | ||
113 | /* | 142 | /* |
114 | * Update the trial information with the total connections | 143 | * Records the current topology (number of connections, time, trial) |
144 | * | ||
145 | * @param num_connections how many connections are in the topology | ||
146 | * | ||
147 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | ||
148 | */ | ||
149 | int (*insert_topology) (int num_connections); | ||
150 | |||
151 | /* | ||
152 | * Records a connection between two peers in the current topology | ||
153 | * | ||
154 | * @param first one side of the connection | ||
155 | * @param second other side of the connection | ||
156 | * | ||
157 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | ||
158 | */ | ||
159 | int (*insert_extended_topology) (struct GNUNET_PeerIdentity *first, struct GNUNET_PeerIdentity *second); | ||
160 | |||
161 | /* | ||
162 | * Update dhttests.trials table with total connections information | ||
163 | * | ||
164 | * @param trialuid the trialuid to update | ||
165 | * @param totalConnections the number of connections | ||
166 | * | ||
167 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure. | ||
115 | */ | 168 | */ |
116 | int (*update_connections) (unsigned long long trialuid, | 169 | int (*update_connections) (unsigned long long trialuid, |
117 | unsigned int totalConnections); | 170 | unsigned int totalConnections); |
118 | 171 | ||
119 | /* | 172 | /* |
120 | * Insert the query information from a single hop into the database | 173 | * Update dhttests.trials table with total connections information |
121 | * | 174 | * |
122 | * @param sqlqueryuid return value for the sql uid for this query | 175 | * @param connections the number of connections |
123 | * @param queryid gnunet internal query id (doesn't exist) | ||
124 | * @param type the type of query (DHTLOG_GET, DHTLOG_PUT, DHTLOG_RESULT) | ||
125 | * @param hops the hops the query has traveled | ||
126 | * @param succeeded query is successful or not (GNUNET_YES or GNUNET_NO) | ||
127 | * @param node GNUNET_PeerIdentity of the node the query is at now | ||
128 | * @param key the GNUNET_HashCode of this query | ||
129 | * @param from_node GNUNET_PeerIdentity of the node the query was | ||
130 | * received from (NULL if origin) | ||
131 | * @param to_node GNUNET_PeerIdentity of the node this node will forward | ||
132 | * to (NULL if none) | ||
133 | * | 176 | * |
177 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure. | ||
178 | */ | ||
179 | int (*update_topology) (unsigned int connections); | ||
180 | |||
181 | /* | ||
182 | * Inserts the specified route information into the dhttests.routes table | ||
183 | * | ||
184 | * @param sqlqueruid inserted query uid | ||
185 | * @param queryid dht query id | ||
186 | * @param type type of the query | ||
187 | * @param hops number of hops query traveled | ||
188 | * @param succeeded whether or not query was successful | ||
189 | * @param node the node the query hit | ||
190 | * @param key the key of the query | ||
191 | * @param from_node the node that sent the message to node | ||
192 | * @param to_node next node to forward message to | ||
193 | * | ||
194 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure. | ||
134 | */ | 195 | */ |
135 | int (*insert_route) (unsigned long long *sqlqueryuid, | 196 | int (*insert_route) (unsigned long long *sqlqueryuid, |
136 | unsigned long long queryid, | 197 | unsigned long long queryid, |
@@ -144,12 +205,23 @@ struct GNUNET_DHTLOG_Handle | |||
144 | 205 | ||
145 | /* | 206 | /* |
146 | * Inserts the specified node into the dhttests.nodes table | 207 | * Inserts the specified node into the dhttests.nodes table |
208 | * | ||
209 | * @param nodeuid the inserted node uid | ||
210 | * @param node the node to insert | ||
211 | * | ||
212 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | ||
147 | */ | 213 | */ |
148 | int (*insert_node) (unsigned long long *nodeuid, | 214 | int (*insert_node) (unsigned long long *nodeuid, |
149 | struct GNUNET_PeerIdentity * node); | 215 | struct GNUNET_PeerIdentity * node); |
150 | 216 | ||
151 | /* | 217 | /* |
152 | * Inserts a dhtkey into the database | 218 | * Inserts the specified dhtkey into the dhttests.dhtkeys table, |
219 | * stores return value of dhttests.dhtkeys.dhtkeyuid into dhtkeyuid | ||
220 | * | ||
221 | * @param dhtkeyuid return value | ||
222 | * @param dhtkey hashcode of key to insert | ||
223 | * | ||
224 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | ||
153 | */ | 225 | */ |
154 | int (*insert_dhtkey) (unsigned long long *dhtkeyuid, | 226 | int (*insert_dhtkey) (unsigned long long *dhtkeyuid, |
155 | const GNUNET_HashCode * dhtkey); | 227 | const GNUNET_HashCode * dhtkey); |