GNUnet  0.11.x
cadet_api_drop_message.c
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2011, 2017, 2019 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 */
25 #include "platform.h"
26 #include "cadet.h"
27 
28 
36 void
39  uint16_t type)
40 {
42  struct GNUNET_MQ_Envelope *env;
43 
45 
46  message->ccn = ccn;
47  message->type = type;
48 
50  "Dropping message for channel of type %s (%d)\n", type == GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY ? "GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY" : "UNKNOWN", type);
51 
52  GNUNET_MQ_send (mq, env);
53 
54 }
55 
56 
57 
58 
59 /* end of cadet_api_drop_message.c */
#define GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY
Ask the cadet service to destroy a channel.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
uint16_t type
Type of the message this handler covers, in host byte order.
Definition: cadet.h:332
struct GNUNET_CADET_ClientChannelNumber ccn
ID of the channel we want to drop a message for.
Definition: cadet.h:337
#define GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE
Request to drop a message of type X to peer y.
Number uniquely identifying a channel of a client.
Definition: cadet.h:101
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
Handle to a message queue.
Definition: mq.c:85
struct GNUNET_MQ_Handle * mq
Definition: 003.c:5
#define GNUNET_log(kind,...)
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:355
Message to drop another message of specific type.
Definition: cadet.h:321
void GNUNET_CADET_drop_message(struct GNUNET_MQ_Handle *mq, struct GNUNET_CADET_ClientChannelNumber ccn, uint16_t type)
Drop the next cadet message of a given type.