diff options
Diffstat (limited to 'src/messenger/messenger_api_handle.h')
-rw-r--r-- | src/messenger/messenger_api_handle.h | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/src/messenger/messenger_api_handle.h b/src/messenger/messenger_api_handle.h index d246855ff..2a97a45db 100644 --- a/src/messenger/messenger_api_handle.h +++ b/src/messenger/messenger_api_handle.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2020--2021 GNUnet e.V. | 3 | Copyright (C) 2020--2023 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
@@ -34,7 +34,6 @@ | |||
34 | #include "gnunet_messenger_service.h" | 34 | #include "gnunet_messenger_service.h" |
35 | 35 | ||
36 | #include "messenger_api_contact_store.h" | 36 | #include "messenger_api_contact_store.h" |
37 | #include "messenger_api_room.h" | ||
38 | 37 | ||
39 | struct GNUNET_MESSENGER_Handle | 38 | struct GNUNET_MESSENGER_Handle |
40 | { | 39 | { |
@@ -42,13 +41,11 @@ struct GNUNET_MESSENGER_Handle | |||
42 | 41 | ||
43 | struct GNUNET_MQ_Handle *mq; | 42 | struct GNUNET_MQ_Handle *mq; |
44 | 43 | ||
45 | GNUNET_MESSENGER_IdentityCallback identity_callback; | ||
46 | void *identity_cls; | ||
47 | |||
48 | GNUNET_MESSENGER_MessageCallback msg_callback; | 44 | GNUNET_MESSENGER_MessageCallback msg_callback; |
49 | void *msg_cls; | 45 | void *msg_cls; |
50 | 46 | ||
51 | char *name; | 47 | char *name; |
48 | struct GNUNET_IDENTITY_PrivateKey *key; | ||
52 | struct GNUNET_IDENTITY_PublicKey *pubkey; | 49 | struct GNUNET_IDENTITY_PublicKey *pubkey; |
53 | 50 | ||
54 | struct GNUNET_TIME_Relative reconnect_time; | 51 | struct GNUNET_TIME_Relative reconnect_time; |
@@ -70,8 +67,6 @@ struct GNUNET_MESSENGER_Handle | |||
70 | */ | 67 | */ |
71 | struct GNUNET_MESSENGER_Handle* | 68 | struct GNUNET_MESSENGER_Handle* |
72 | create_handle (const struct GNUNET_CONFIGURATION_Handle *cfg, | 69 | create_handle (const struct GNUNET_CONFIGURATION_Handle *cfg, |
73 | GNUNET_MESSENGER_IdentityCallback identity_callback, | ||
74 | void *identity_cls, | ||
75 | GNUNET_MESSENGER_MessageCallback msg_callback, | 70 | GNUNET_MESSENGER_MessageCallback msg_callback, |
76 | void *msg_cls); | 71 | void *msg_cls); |
77 | 72 | ||
@@ -103,14 +98,23 @@ const char* | |||
103 | get_handle_name (const struct GNUNET_MESSENGER_Handle *handle); | 98 | get_handle_name (const struct GNUNET_MESSENGER_Handle *handle); |
104 | 99 | ||
105 | /** | 100 | /** |
106 | * Sets the public key of a given <i>handle</i> to a specific public key. | 101 | * Sets the keypair of a given <i>handle</i> to the keypair of a specific private <i>key</i>. |
107 | * | 102 | * |
108 | * @param[in,out] handle Handle | 103 | * @param[in,out] handle Handle |
109 | * @param[in] pubkey Public key | 104 | * @param[in] key Private key or NULL |
110 | */ | 105 | */ |
111 | void | 106 | void |
112 | set_handle_key (struct GNUNET_MESSENGER_Handle *handle, | 107 | set_handle_key (struct GNUNET_MESSENGER_Handle *handle, |
113 | const struct GNUNET_IDENTITY_PublicKey *pubkey); | 108 | const struct GNUNET_IDENTITY_PrivateKey *key); |
109 | |||
110 | /** | ||
111 | * Returns the private key of a given <i>handle</i>. | ||
112 | * | ||
113 | * @param[in] handle Handle | ||
114 | * @return Private key of the handle | ||
115 | */ | ||
116 | const struct GNUNET_IDENTITY_PrivateKey* | ||
117 | get_handle_key (const struct GNUNET_MESSENGER_Handle *handle); | ||
114 | 118 | ||
115 | /** | 119 | /** |
116 | * Returns the public key of a given <i>handle</i>. | 120 | * Returns the public key of a given <i>handle</i>. |
@@ -119,7 +123,7 @@ set_handle_key (struct GNUNET_MESSENGER_Handle *handle, | |||
119 | * @return Public key of the handle | 123 | * @return Public key of the handle |
120 | */ | 124 | */ |
121 | const struct GNUNET_IDENTITY_PublicKey* | 125 | const struct GNUNET_IDENTITY_PublicKey* |
122 | get_handle_key (const struct GNUNET_MESSENGER_Handle *handle); | 126 | get_handle_pubkey (const struct GNUNET_MESSENGER_Handle *handle); |
123 | 127 | ||
124 | /** | 128 | /** |
125 | * Returns the used contact store of a given <i>handle</i>. | 129 | * Returns the used contact store of a given <i>handle</i>. |
@@ -175,4 +179,15 @@ void | |||
175 | close_handle_room (struct GNUNET_MESSENGER_Handle *handle, | 179 | close_handle_room (struct GNUNET_MESSENGER_Handle *handle, |
176 | const struct GNUNET_HashCode *key); | 180 | const struct GNUNET_HashCode *key); |
177 | 181 | ||
182 | /** | ||
183 | * Returns the room known to a <i>handle</i> identified by a given <i>key</i>. | ||
184 | * | ||
185 | * @param[in,out] handle handle Handle | ||
186 | * @param[in] key Key of room | ||
187 | * @return Room or NULL | ||
188 | */ | ||
189 | struct GNUNET_MESSENGER_Room* | ||
190 | get_handle_room (struct GNUNET_MESSENGER_Handle *handle, | ||
191 | const struct GNUNET_HashCode *key); | ||
192 | |||
178 | #endif //GNUNET_MESSENGER_API_HANDLE_H | 193 | #endif //GNUNET_MESSENGER_API_HANDLE_H |