diff options
Diffstat (limited to 'src/core/core.h')
-rw-r--r-- | src/core/core.h | 58 |
1 files changed, 51 insertions, 7 deletions
diff --git a/src/core/core.h b/src/core/core.h index 88e6b748c..021aa4184 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2009 Christian Grothoff (and other contributing authors) | 3 | (C) 2009, 2010 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 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 | 6 | it under the terms of the GNU General Public License as published |
@@ -23,6 +23,7 @@ | |||
23 | * @brief common internal definitions for core service | 23 | * @brief common internal definitions for core service |
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | */ | 25 | */ |
26 | #include "gnunet_bandwidth_lib.h" | ||
26 | #include "gnunet_crypto_lib.h" | 27 | #include "gnunet_crypto_lib.h" |
27 | #include "gnunet_time_lib.h" | 28 | #include "gnunet_time_lib.h" |
28 | 29 | ||
@@ -45,10 +46,11 @@ | |||
45 | #define GNUNET_CORE_OPTION_NOTHING 0 | 46 | #define GNUNET_CORE_OPTION_NOTHING 0 |
46 | #define GNUNET_CORE_OPTION_SEND_CONNECT 1 | 47 | #define GNUNET_CORE_OPTION_SEND_CONNECT 1 |
47 | #define GNUNET_CORE_OPTION_SEND_DISCONNECT 2 | 48 | #define GNUNET_CORE_OPTION_SEND_DISCONNECT 2 |
48 | #define GNUNET_CORE_OPTION_SEND_FULL_INBOUND 4 | 49 | #define GNUNET_CORE_OPTION_SEND_STATUS_CHANGE 4 |
49 | #define GNUNET_CORE_OPTION_SEND_HDR_INBOUND 8 | 50 | #define GNUNET_CORE_OPTION_SEND_FULL_INBOUND 8 |
50 | #define GNUNET_CORE_OPTION_SEND_FULL_OUTBOUND 16 | 51 | #define GNUNET_CORE_OPTION_SEND_HDR_INBOUND 16 |
51 | #define GNUNET_CORE_OPTION_SEND_HDR_OUTBOUND 32 | 52 | #define GNUNET_CORE_OPTION_SEND_FULL_OUTBOUND 32 |
53 | #define GNUNET_CORE_OPTION_SEND_HDR_OUTBOUND 64 | ||
52 | 54 | ||
53 | 55 | ||
54 | /** | 56 | /** |
@@ -100,13 +102,12 @@ struct InitReplyMessage | |||
100 | 102 | ||
101 | /** | 103 | /** |
102 | * Message sent by the service to clients to notify them | 104 | * Message sent by the service to clients to notify them |
103 | * about a peer connecting or disconnecting. | 105 | * about a peer connecting. |
104 | */ | 106 | */ |
105 | struct ConnectNotifyMessage | 107 | struct ConnectNotifyMessage |
106 | { | 108 | { |
107 | /** | 109 | /** |
108 | * Header with type GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT | 110 | * Header with type GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT |
109 | * or GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT. | ||
110 | */ | 111 | */ |
111 | struct GNUNET_MessageHeader header; | 112 | struct GNUNET_MessageHeader header; |
112 | 113 | ||
@@ -128,6 +129,49 @@ struct ConnectNotifyMessage | |||
128 | }; | 129 | }; |
129 | 130 | ||
130 | 131 | ||
132 | /** | ||
133 | * Message sent by the service to clients to notify them | ||
134 | * about a peer changing status. | ||
135 | */ | ||
136 | struct PeerStatusNotifyMessage | ||
137 | { | ||
138 | /** | ||
139 | * Header with type GNUNET_MESSAGE_TYPE_CORE_NOTIFY_PEER_STATUS | ||
140 | */ | ||
141 | struct GNUNET_MessageHeader header; | ||
142 | |||
143 | /** | ||
144 | * Distance to the peer. | ||
145 | */ | ||
146 | uint32_t distance GNUNET_PACKED; | ||
147 | |||
148 | /** | ||
149 | * Currently observed latency. | ||
150 | */ | ||
151 | struct GNUNET_TIME_RelativeNBO latency; | ||
152 | |||
153 | /** | ||
154 | * When the peer would time out (unless we see activity) | ||
155 | */ | ||
156 | struct GNUNET_TIME_AbsoluteNBO timeout; | ||
157 | |||
158 | /** | ||
159 | * Available bandwidth from the peer. | ||
160 | */ | ||
161 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in; | ||
162 | |||
163 | /** | ||
164 | * Available bandwidth to the peer. | ||
165 | */ | ||
166 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out; | ||
167 | |||
168 | /** | ||
169 | * Identity of the peer. | ||
170 | */ | ||
171 | struct GNUNET_PeerIdentity peer; | ||
172 | |||
173 | }; | ||
174 | |||
131 | 175 | ||
132 | /** | 176 | /** |
133 | * Message sent by the service to clients to notify them | 177 | * Message sent by the service to clients to notify them |