diff options
Diffstat (limited to 'src/service/messenger/gnunet-service-messenger_message_kind.h')
-rw-r--r-- | src/service/messenger/gnunet-service-messenger_message_kind.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/src/service/messenger/gnunet-service-messenger_message_kind.h b/src/service/messenger/gnunet-service-messenger_message_kind.h new file mode 100644 index 000000000..2e13e7710 --- /dev/null +++ b/src/service/messenger/gnunet-service-messenger_message_kind.h | |||
@@ -0,0 +1,80 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | Copyright (C) 2020--2023 GNUnet e.V. | ||
4 | |||
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 | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Affero General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | /** | ||
21 | * @author Tobias Frisch | ||
22 | * @file src/messenger/gnunet-service-messenger_message_kind.h | ||
23 | * @brief GNUnet MESSENGER service | ||
24 | */ | ||
25 | |||
26 | #ifndef GNUNET_SERVICE_MESSENGER_MESSAGE_KIND_H | ||
27 | #define GNUNET_SERVICE_MESSENGER_MESSAGE_KIND_H | ||
28 | |||
29 | #include "platform.h" | ||
30 | #include "gnunet_util_lib.h" | ||
31 | #include "gnunet_identity_service.h" | ||
32 | #include "gnunet_time_lib.h" | ||
33 | |||
34 | #include "messenger_api_message.h" | ||
35 | #include "gnunet-service-messenger_service.h" | ||
36 | #include "messenger_api_ego.h" | ||
37 | |||
38 | /** | ||
39 | * Creates and allocates a new info message containing the hosts service peer identity and version. | ||
40 | * (all values are stored as copy) | ||
41 | * | ||
42 | * @param[in,out] service Service | ||
43 | * @return New message | ||
44 | */ | ||
45 | struct GNUNET_MESSENGER_Message* | ||
46 | create_message_info (struct GNUNET_MESSENGER_Service *service); | ||
47 | |||
48 | /** | ||
49 | * Creates and allocates a new peer message containing a services peer identity. | ||
50 | * (all values are stored as copy) | ||
51 | * | ||
52 | * @param[in,out] service Service | ||
53 | * @return New message | ||
54 | */ | ||
55 | struct GNUNET_MESSENGER_Message* | ||
56 | create_message_peer (struct GNUNET_MESSENGER_Service *service); | ||
57 | |||
58 | /** | ||
59 | * Creates and allocates a new miss message containing the missing <i>peer</i> identity. | ||
60 | * (all values are stored as copy) | ||
61 | * | ||
62 | * @param[in] peer Missing peer identity | ||
63 | * @return New message | ||
64 | */ | ||
65 | struct GNUNET_MESSENGER_Message* | ||
66 | create_message_miss (const struct GNUNET_PeerIdentity *peer); | ||
67 | |||
68 | /** | ||
69 | * Creates and allocates a new merge message containing the hash of a second <i>previous</i> message | ||
70 | * besides the regular previous message mentioned in a messages header. | ||
71 | * (all values are stored as copy) | ||
72 | * | ||
73 | * @param[in] previous Hash of message | ||
74 | * @return New message | ||
75 | */ | ||
76 | struct GNUNET_MESSENGER_Message* | ||
77 | create_message_merge (const struct GNUNET_HashCode *previous); | ||
78 | |||
79 | |||
80 | #endif //GNUNET_SERVICE_MESSENGER_MESSAGE_KIND_H | ||