diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-09-20 15:14:05 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-09-20 15:14:05 +0000 |
commit | 5663ca18885242fca4dd209898ffda9cbe675c58 (patch) | |
tree | eba7a80df59830aefd927a5a5383e47b353d5a09 /src/core/gnunet-service-core.h | |
parent | 7e835e78aa82869715c9aee96a73ba40aad3f39f (diff) | |
download | gnunet-5663ca18885242fca4dd209898ffda9cbe675c58.tar.gz gnunet-5663ca18885242fca4dd209898ffda9cbe675c58.zip |
converting core service to new service API
Diffstat (limited to 'src/core/gnunet-service-core.h')
-rw-r--r-- | src/core/gnunet-service-core.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/src/core/gnunet-service-core.h b/src/core/gnunet-service-core.h index 068a2f84f..86ac333b5 100644 --- a/src/core/gnunet-service-core.h +++ b/src/core/gnunet-service-core.h | |||
@@ -29,6 +29,8 @@ | |||
29 | #include "gnunet_statistics_service.h" | 29 | #include "gnunet_statistics_service.h" |
30 | #include "gnunet_core_service.h" | 30 | #include "gnunet_core_service.h" |
31 | #include "core.h" | 31 | #include "core.h" |
32 | #include "gnunet-service-core_typemap.h" | ||
33 | |||
32 | 34 | ||
33 | /** | 35 | /** |
34 | * Opaque handle to a client. | 36 | * Opaque handle to a client. |
@@ -100,6 +102,84 @@ struct GSC_ClientActiveRequest | |||
100 | 102 | ||
101 | 103 | ||
102 | /** | 104 | /** |
105 | * Tell a client that we are ready to receive the message. | ||
106 | * | ||
107 | * @param car request that is now ready; the responsibility | ||
108 | * for the handle remains shared between CLIENTS | ||
109 | * and SESSIONS after this call. | ||
110 | */ | ||
111 | void | ||
112 | GSC_CLIENTS_solicit_request (struct GSC_ClientActiveRequest *car); | ||
113 | |||
114 | |||
115 | /** | ||
116 | * We will never be ready to transmit the given message in (disconnect | ||
117 | * or invalid request). Frees resources associated with @a car. We | ||
118 | * don't explicitly tell the client, he'll learn with the disconnect | ||
119 | * (or violated the protocol). | ||
120 | * | ||
121 | * @param car request that now permanently failed; the | ||
122 | * responsibility for the handle is now returned | ||
123 | * to CLIENTS (SESSIONS is done with it). | ||
124 | * @param drop_client #GNUNET_YES if the client violated the protocol | ||
125 | * and we should thus drop the connection | ||
126 | */ | ||
127 | void | ||
128 | GSC_CLIENTS_reject_request (struct GSC_ClientActiveRequest *car, | ||
129 | int drop_client); | ||
130 | |||
131 | |||
132 | /** | ||
133 | * Notify a particular client about a change to existing connection to | ||
134 | * one of our neighbours (check if the client is interested). Called | ||
135 | * from #GSC_SESSIONS_notify_client_about_sessions(). | ||
136 | * | ||
137 | * @param client client to notify | ||
138 | * @param neighbour identity of the neighbour that changed status | ||
139 | * @param tmap_old previous type map for the neighbour, NULL for connect | ||
140 | * @param tmap_new updated type map for the neighbour, NULL for disconnect | ||
141 | */ | ||
142 | void | ||
143 | GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, | ||
144 | const struct GNUNET_PeerIdentity *neighbour, | ||
145 | const struct GSC_TypeMap *tmap_old, | ||
146 | const struct GSC_TypeMap *tmap_new); | ||
147 | |||
148 | |||
149 | /** | ||
150 | * Deliver P2P message to interested clients. Caller must have checked | ||
151 | * that the sending peer actually lists the given message type as one | ||
152 | * of its types. | ||
153 | * | ||
154 | * @param sender peer who sent us the message | ||
155 | * @param msg the message | ||
156 | * @param msize number of bytes to transmit | ||
157 | * @param options options for checking which clients should | ||
158 | * receive the message | ||
159 | */ | ||
160 | void | ||
161 | GSC_CLIENTS_deliver_message (const struct GNUNET_PeerIdentity *sender, | ||
162 | const struct GNUNET_MessageHeader *msg, | ||
163 | uint16_t msize, | ||
164 | uint32_t options); | ||
165 | |||
166 | |||
167 | /** | ||
168 | * Notify all clients about a change to existing session. | ||
169 | * Called from SESSIONS whenever there is a change in sessions | ||
170 | * or types processed by the respective peer. | ||
171 | * | ||
172 | * @param neighbour identity of the neighbour that changed status | ||
173 | * @param tmap_old previous type map for the neighbour, NULL for connect | ||
174 | * @param tmap_new updated type map for the neighbour, NULL for disconnect | ||
175 | */ | ||
176 | void | ||
177 | GSC_CLIENTS_notify_clients_about_neighbour (const struct GNUNET_PeerIdentity *neighbour, | ||
178 | const struct GSC_TypeMap *tmap_old, | ||
179 | const struct GSC_TypeMap *tmap_new); | ||
180 | |||
181 | |||
182 | /** | ||
103 | * Our configuration. | 183 | * Our configuration. |
104 | */ | 184 | */ |
105 | extern const struct GNUNET_CONFIGURATION_Handle *GSC_cfg; | 185 | extern const struct GNUNET_CONFIGURATION_Handle *GSC_cfg; |