GNUnet 0.21.1
gnunet-service-core_typemap.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2011 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
26#ifndef GNUNET_SERVICE_CORE_TYPEMAP_H
27#define GNUNET_SERVICE_CORE_TYPEMAP_H
28
29#include "gnunet_util_lib.h"
30
34struct GSC_TypeMap;
35
36
43void
44GSC_TYPEMAP_add (const uint16_t *types,
45 unsigned int tlen);
46
47
54void
55GSC_TYPEMAP_remove (const uint16_t *types,
56 unsigned int tlen);
57
58
66
67
74int
76
77
84void
85GSC_TYPEMAP_hash (const struct GSC_TypeMap *tm,
86 struct GNUNET_HashCode *hc);
87
88
97struct GSC_TypeMap *
99
100
110int
111GSC_TYPEMAP_test_match (const struct GSC_TypeMap *tmap,
112 const uint16_t *types,
113 unsigned int tcnt);
114
115
124struct GSC_TypeMap *
125GSC_TYPEMAP_extend (const struct GSC_TypeMap *tmap,
126 const uint16_t *types,
127 unsigned int tcnt);
128
129
135struct GSC_TypeMap *
136GSC_TYPEMAP_create (void);
137
138
144void
145GSC_TYPEMAP_destroy (struct GSC_TypeMap *tmap);
146
147
151void
152GSC_TYPEMAP_init (void);
153
154
158void
159GSC_TYPEMAP_done (void);
160
161#endif
162/* end of gnunet-service-core_typemap.h */
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
struct GNUNET_MessageHeader * GSC_TYPEMAP_compute_type_map_message(void)
Compute a type map message for this peer.
struct GSC_TypeMap * GSC_TYPEMAP_extend(const struct GSC_TypeMap *tmap, const uint16_t *types, unsigned int tcnt)
Add additional types to a given typemap.
void GSC_TYPEMAP_init(void)
Initialize typemap subsystem.
void GSC_TYPEMAP_destroy(struct GSC_TypeMap *tmap)
Free the given type map.
int GSC_TYPEMAP_check_hash(const struct GNUNET_HashCode *hc)
Check if the given hash matches our current type map.
struct GSC_TypeMap * GSC_TYPEMAP_get_from_message(const struct GNUNET_MessageHeader *msg)
Extract a type map from a #GNUNET_MESSAGE_TYPE_CORE_COMRESSED_TYPE_MAP or GNUNET_MESSAGE_TYPE_CORE_BI...
int GSC_TYPEMAP_test_match(const struct GSC_TypeMap *tmap, const uint16_t *types, unsigned int tcnt)
Test if any of the types from the types array is in the given type map.
void GSC_TYPEMAP_done(void)
Shutdown typemap subsystem.
void GSC_TYPEMAP_add(const uint16_t *types, unsigned int tlen)
Add a set of types to our type map.
struct GSC_TypeMap * GSC_TYPEMAP_create(void)
Create an empty type map.
void GSC_TYPEMAP_hash(const struct GSC_TypeMap *tm, struct GNUNET_HashCode *hc)
Hash the contents of a type map.
void GSC_TYPEMAP_remove(const uint16_t *types, unsigned int tlen)
Remove a set of message types from our type map.
A 512-bit hashcode.
Header for all communications.
A type map describing which messages a given neighbour is able to process.