diff options
author | Supriti Singh <supritisingh08@gmail.com> | 2014-09-22 15:12:15 +0000 |
---|---|---|
committer | Supriti Singh <supritisingh08@gmail.com> | 2014-09-22 15:12:15 +0000 |
commit | 3a85995c4a7a48f7afae1c554e9df3547ca7db3f (patch) | |
tree | bf4d46b158a973e4900e4792e80e860b324c2a0a /src/include | |
parent | b97fc3b79ac05184f0928af8071e76dcbd8f99ea (diff) | |
download | gnunet-3a85995c4a7a48f7afae1c554e9df3547ca7db3f.tar.gz gnunet-3a85995c4a7a48f7afae1c554e9df3547ca7db3f.zip |
- Act malicious API complete
- Using multiple trails in PUT/GET
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_dht_service.h | 23 | ||||
-rw-r--r-- | src/include/gnunet_protocols.h | 18 |
2 files changed, 32 insertions, 9 deletions
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h index 31d66ccf0..7a147b437 100644 --- a/src/include/gnunet_dht_service.h +++ b/src/include/gnunet_dht_service.h | |||
@@ -393,14 +393,31 @@ GNUNET_DHT_monitor_stop (struct GNUNET_DHT_MonitorHandle *handle); | |||
393 | 393 | ||
394 | #if ENABLE_MALICIOUS | 394 | #if ENABLE_MALICIOUS |
395 | /** | 395 | /** |
396 | * Turn the DHT service to act malicious depending on @a flag | 396 | * Type of a Malicious continuation. You must not call |
397 | * #GNUNET_DHT_disconnect in this continuation. | ||
398 | * | ||
399 | * @param cls closure | ||
400 | * @param success #GNUNET_OK if the set malicious request was transmitted, | ||
401 | * #GNUNET_NO on timeout, | ||
402 | * #GNUNET_SYSERR on disconnect from service | ||
403 | * after the PUT message was transmitted | ||
404 | * (so we don't know if it was received or not) | ||
405 | */ | ||
406 | typedef void (*GNUNET_DHT_ActMaliciousContinuation)(void *cls, | ||
407 | int success); | ||
408 | |||
409 | /** | ||
410 | * Turn the DHT service to act malicious | ||
397 | * | 411 | * |
398 | * @param handle the DHT handle | 412 | * @param handle the DHT handle |
399 | * @param action 1 to make the service malicious; 0 to make it benign | 413 | * @param action 1 to make the service malicious; 0 to make it benign |
400 | FIXME: perhaps make this an enum of known malicious behaviors? | 414 | FIXME: perhaps make this an enum of known malicious behaviors? |
401 | */ | 415 | */ |
402 | void | 416 | struct GNUNET_DHT_ActMaliciousHandle * |
403 | GNUNET_DHT_malicious (struct GNUNET_DHT_Handle *handle, unsigned int action); | 417 | GNUNET_DHT_act_malicious (struct GNUNET_DHT_Handle *handle, |
418 | unsigned int action, | ||
419 | GNUNET_DHT_PutContinuation cont, | ||
420 | void *cont_cls); | ||
404 | #endif | 421 | #endif |
405 | 422 | ||
406 | 423 | ||
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index 16dc9ae9a..7e653f551 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h | |||
@@ -2593,22 +2593,28 @@ extern "C" | |||
2593 | */ | 2593 | */ |
2594 | #define GNUNET_MESSAGE_TYPE_XDHT_P2P_GET 891 | 2594 | #define GNUNET_MESSAGE_TYPE_XDHT_P2P_GET 891 |
2595 | 2595 | ||
2596 | /** | ||
2597 | * Send back peer that considers you are its successor, a confirmation | ||
2598 | * that you got the notify successor message. | ||
2599 | */ | ||
2600 | #define GNUNET_MESSAGE_TYPE_XDHT_P2P_NOTIFY_SUCCESSOR_CONFIRMATION 892 | ||
2601 | |||
2596 | #if ENABLE_MALICIOUS | 2602 | #if ENABLE_MALICIOUS |
2597 | /** | 2603 | /** |
2598 | * Turn X-VINE DHT service malicious | 2604 | * Turn X-VINE DHT service malicious |
2599 | */ | 2605 | */ |
2600 | #define GNUNET_MESSAGE_TYPE_DHT_ACT_MALICIOUS 892 | 2606 | #define GNUNET_MESSAGE_TYPE_DHT_ACT_MALICIOUS 893 |
2601 | #endif | ||
2602 | 2607 | ||
2603 | /** | 2608 | /** |
2604 | * Send back peer that considers you are its successor, a confirmation | 2609 | * Acknowledge receiving ACT MALICIOUS request |
2605 | * that you got the notify successor message. | ||
2606 | */ | 2610 | */ |
2607 | #define GNUNET_MESSAGE_TYPE_XDHT_P2P_NOTIFY_SUCCESSOR_CONFIRMATION 893 | 2611 | #define GNUNET_MESSAGE_TYPE_DHT_CLIENT_ACT_MALICIOUS_OK 894 |
2612 | |||
2613 | #endif | ||
2608 | /*******************************************************************************/ | 2614 | /*******************************************************************************/ |
2609 | 2615 | ||
2610 | /** | 2616 | /** |
2611 | * Next available: 903 | 2617 | * Next available: 904 |
2612 | */ | 2618 | */ |
2613 | 2619 | ||
2614 | /** | 2620 | /** |