diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-04 21:11:17 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-04 21:11:17 +0000 |
commit | 933084f007e0ec3d7a73e85ddd1b0b0b62da6f6e (patch) | |
tree | 4877fe6adfd8e97fabbce6d8df2ecea7ac4ebcb1 /src/transport/gnunet-service-transport_neighbours.h | |
parent | 7a60a53dc6196477508fcdd1aef7994a2151814f (diff) | |
download | gnunet-933084f007e0ec3d7a73e85ddd1b0b0b62da6f6e.tar.gz gnunet-933084f007e0ec3d7a73e85ddd1b0b0b62da6f6e.zip |
improved neighbour API
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.h')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.h | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.h b/src/transport/gnunet-service-transport_neighbours.h index 914134ac5..5473a80db 100644 --- a/src/transport/gnunet-service-transport_neighbours.h +++ b/src/transport/gnunet-service-transport_neighbours.h | |||
@@ -31,10 +31,7 @@ | |||
31 | #include "gnunet_util_lib.h" | 31 | #include "gnunet_util_lib.h" |
32 | 32 | ||
33 | // TODO: | 33 | // TODO: |
34 | // - have a way to access the currently 'connected' session | 34 | // - ATS and similar info is a bit lacking in the API right now... |
35 | // (for sending and to notice disconnect of it!) | ||
36 | // - have a way to access/update bandwidth/quota information per peer | ||
37 | // (for CostReport/TrafficReport callbacks) | ||
38 | 35 | ||
39 | 36 | ||
40 | 37 | ||
@@ -78,6 +75,42 @@ GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target); | |||
78 | 75 | ||
79 | 76 | ||
80 | /** | 77 | /** |
78 | * Function called after the transmission is done. | ||
79 | * | ||
80 | * @param cls closure | ||
81 | * @param success GNUNET_OK on success, GNUNET_NO on failure | ||
82 | */ | ||
83 | typedef void (*GST_NeighbourSendContinuation)(void *cls, | ||
84 | int success); | ||
85 | |||
86 | |||
87 | /** | ||
88 | * Transmit a message to the given target using the active connection. | ||
89 | * | ||
90 | * @param target destination | ||
91 | * @param msg message to send | ||
92 | * @param cont function to call when done | ||
93 | * @param cont_cls closure for 'cont' | ||
94 | */ | ||
95 | void | ||
96 | GST_neighbours_send (const struct GNUNET_PeerIdentity *target, | ||
97 | const struct GNUNET_MessageHeader *msg, | ||
98 | GST_NeighbourSendContinuation cont, | ||
99 | void *cont_cls); | ||
100 | |||
101 | /** | ||
102 | * Change the quota for the given peer. | ||
103 | * FIXME: inbound or outbound quota? | ||
104 | * | ||
105 | * @param neighbour identity of peer to change qutoa for | ||
106 | * @param quota new quota FIXME: fix type! | ||
107 | */ | ||
108 | void | ||
109 | GST_neighbours_set_quota (const struct GNUNET_PeerIdentity *neighbour, | ||
110 | const float quota); | ||
111 | |||
112 | |||
113 | /** | ||
81 | * If we have an active connection to the given target, it must be shutdown. | 114 | * If we have an active connection to the given target, it must be shutdown. |
82 | * | 115 | * |
83 | * @param target peer to disconnect from | 116 | * @param target peer to disconnect from |