GNUnet  0.10.x
Functions
gnunet-service-set_union.h File Reference

two-peer set operations More...

#include "gnunet-service-set.h"
#include "gnunet-service-set_protocol.h"
Include dependency graph for gnunet-service-set_union.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int check_union_p2p_strata_estimator (void *cls, const struct StrataEstimatorMessage *msg)
 Handle a strata estimator from a remote peer. More...
 
void handle_union_p2p_strata_estimator (void *cls, const struct StrataEstimatorMessage *msg)
 Handle a strata estimator from a remote peer. More...
 
int check_union_p2p_ibf (void *cls, const struct IBFMessage *msg)
 Check an IBF message from a remote peer. More...
 
void handle_union_p2p_ibf (void *cls, const struct IBFMessage *msg)
 Handle an IBF message from a remote peer. More...
 
int check_union_p2p_elements (void *cls, const struct GNUNET_SET_ElementMessage *emsg)
 Check an element message from a remote peer. More...
 
void handle_union_p2p_elements (void *cls, const struct GNUNET_SET_ElementMessage *emsg)
 Handle an element message from a remote peer. More...
 
int check_union_p2p_full_element (void *cls, const struct GNUNET_SET_ElementMessage *emsg)
 Check a full element message from a remote peer. More...
 
void handle_union_p2p_full_element (void *cls, const struct GNUNET_SET_ElementMessage *emsg)
 Handle an element message from a remote peer. More...
 
int check_union_p2p_inquiry (void *cls, const struct InquiryMessage *msg)
 Send offers (for GNUNET_Hash-es) in response to inquiries (for IBF_Key-s). More...
 
void handle_union_p2p_inquiry (void *cls, const struct InquiryMessage *msg)
 Send offers (for GNUNET_Hash-es) in response to inquiries (for IBF_Key-s). More...
 
void handle_union_p2p_request_full (void *cls, const struct GNUNET_MessageHeader *mh)
 Handle a request for full set transmission. More...
 
void handle_union_p2p_full_done (void *cls, const struct GNUNET_MessageHeader *mh)
 Handle a "full done" message. More...
 
int check_union_p2p_demand (void *cls, const struct GNUNET_MessageHeader *mh)
 Check a demand by the other peer for elements based on a list of struct GNUNET_HashCodes. More...
 
void handle_union_p2p_demand (void *cls, const struct GNUNET_MessageHeader *mh)
 Handle a demand by the other peer for elements based on a list of struct GNUNET_HashCodes. More...
 
int check_union_p2p_offer (void *cls, const struct GNUNET_MessageHeader *mh)
 Check offer (of struct GNUNET_HashCodes). More...
 
void handle_union_p2p_offer (void *cls, const struct GNUNET_MessageHeader *mh)
 Handle offers (of struct GNUNET_HashCodes) and respond with demands (of struct GNUNET_HashCodes). More...
 
void handle_union_p2p_done (void *cls, const struct GNUNET_MessageHeader *mh)
 Handle a done message from a remote peer. More...
 
void handle_union_p2p_over (void *cls, const struct GNUNET_MessageHeader *mh)
 Handle an over message from a remote peer. More...
 

Detailed Description

two-peer set operations

Author
Florian Dold
Christian Grothoff

Definition in file gnunet-service-set_union.h.

Function Documentation

◆ check_union_p2p_strata_estimator()

int check_union_p2p_strata_estimator ( void *  cls,
const struct StrataEstimatorMessage msg 
)

Handle a strata estimator from a remote peer.

Parameters
clsthe union operation
msgthe message

Definition at line 819 of file gnunet-service-set_union.c.

References GNUNET_break, GNUNET_MESSAGE_TYPE_SET_UNION_P2P_SEC, GNUNET_NO, GNUNET_OK, GNUNET_SYSERR, StrataEstimatorMessage::header, IBF_BUCKET_SIZE, len, op, OperationState::phase, PHASE_EXPECT_SE, SE_IBF_SIZE, SE_STRATA_COUNT, GNUNET_MessageHeader::size, Operation::state, and GNUNET_MessageHeader::type.

821 {
822  struct Operation *op = cls;
823  int is_compressed;
824  size_t len;
825 
826  if (op->state->phase != PHASE_EXPECT_SE)
827  {
828  GNUNET_break (0);
829  return GNUNET_SYSERR;
830  }
831  is_compressed = (GNUNET_MESSAGE_TYPE_SET_UNION_P2P_SEC == htons (msg->header.type));
832  len = ntohs (msg->header.size) - sizeof (struct StrataEstimatorMessage);
833  if ( (GNUNET_NO == is_compressed) &&
835  {
836  GNUNET_break (0);
837  return GNUNET_SYSERR;
838  }
839  return GNUNET_OK;
840 }
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SET_UNION_P2P_SE(C)
#define GNUNET_NO
Definition: gnunet_common.h:81
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
We sent the request message, and expect a strata estimator.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
uint16_t type
The type of the message (GNUNET_MESSAGE_TYPE_XXXX), in big-endian format.
#define GNUNET_MESSAGE_TYPE_SET_UNION_P2P_SEC
Compressed strata estimator.
enum IntersectionOperationPhase phase
Current state of the operation.
#define IBF_BUCKET_SIZE
Size of one ibf bucket in bytes.
Definition: ibf.h:72
#define GNUNET_SYSERR
Definition: gnunet_common.h:79
Strata estimator together with the peer's overall set size.
Operation context used to execute a set operation.
#define SE_IBF_SIZE
Size of the IBFs in the strata estimator.
struct OperationState * state
Operation-specific operation state.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
#define SE_STRATA_COUNT
Number of IBFs in a strata estimator.
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...

◆ handle_union_p2p_strata_estimator()

void handle_union_p2p_strata_estimator ( void *  cls,
const struct StrataEstimatorMessage msg 
)

Handle a strata estimator from a remote peer.

Parameters
clsthe union operation
msgthe message

Definition at line 850 of file gnunet-service-set_union.c.

References _GSS_statistics, Operation::byzantine, Operation::channel, removetrailingwhitespace::f, fail_union_operation(), Operation::force_full, get_order_from_difference(), getenv(), GNUNET_assert, GNUNET_break, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_MESSAGE_TYPE_SET_UNION_P2P_REQUEST_FULL, GNUNET_MESSAGE_TYPE_SET_UNION_P2P_SEC, GNUNET_MQ_msg_header, GNUNET_MQ_send(), GNUNET_NO, GNUNET_ntohll(), GNUNET_OK, GNUNET_STATISTICS_update(), GNUNET_YES, StrataEstimatorMessage::header, OperationState::initial_size, len, LOG, Operation::mq, op, OperationState::phase, PHASE_EXPECT_IBF, OperationState::se, SE_IBF_HASH_NUM, SE_IBF_SIZE, SE_STRATA_COUNT, send_full_set(), send_ibf(), StrataEstimatorMessage::set_size, GNUNET_MessageHeader::size, Operation::state, strata_estimator_create(), strata_estimator_destroy(), strata_estimator_difference(), strata_estimator_read(), and GNUNET_MessageHeader::type.

852 {
853  struct Operation *op = cls;
854  struct StrataEstimator *remote_se;
855  unsigned int diff;
856  uint64_t other_size;
857  size_t len;
858  int is_compressed;
859 
860  is_compressed = (GNUNET_MESSAGE_TYPE_SET_UNION_P2P_SEC == htons (msg->header.type));
862  "# bytes of SE received",
863  ntohs (msg->header.size),
864  GNUNET_NO);
865  len = ntohs (msg->header.size) - sizeof (struct StrataEstimatorMessage);
866  other_size = GNUNET_ntohll (msg->set_size);
868  SE_IBF_SIZE,
870  if (NULL == remote_se)
871  {
872  /* insufficient resources, fail */
874  return;
875  }
876  if (GNUNET_OK !=
877  strata_estimator_read (&msg[1],
878  len,
879  is_compressed,
880  remote_se))
881  {
882  /* decompression failed */
883  strata_estimator_destroy (remote_se);
885  return;
886  }
887  GNUNET_assert (NULL != op->state->se);
888  diff = strata_estimator_difference (remote_se,
889  op->state->se);
890 
891  if (diff > 200)
892  diff = diff * 3 / 2;
893 
894  strata_estimator_destroy (remote_se);
896  op->state->se = NULL;
898  "got se diff=%d, using ibf size %d\n",
899  diff,
900  1U << get_order_from_difference (diff));
901 
902  {
903  char *set_debug;
904 
905  set_debug = getenv ("GNUNET_SET_BENCHMARK");
906  if ( (NULL != set_debug) &&
907  (0 == strcmp (set_debug, "1")) )
908  {
909  FILE *f = fopen ("set.log", "a");
910  fprintf (f, "%llu\n", (unsigned long long) diff);
911  fclose (f);
912  }
913  }
914 
915  if ( (GNUNET_YES == op->byzantine) &&
916  (other_size < op->byzantine_lower_bound) )
917  {
918  GNUNET_break (0);
920  return;
921  }
922 
923  if ( (GNUNET_YES == op->force_full) ||
924  (diff > op->state->initial_size / 4) ||
925  (0 == other_size) )
926  {
928  "Deciding to go for full set transmission (diff=%d, own set=%u)\n",
929  diff,
930  op->state->initial_size);
932  "# of full sends",
933  1,
934  GNUNET_NO);
935  if ( (op->state->initial_size <= other_size) ||
936  (0 == other_size) )
937  {
938  send_full_set (op);
939  }
940  else
941  {
942  struct GNUNET_MQ_Envelope *ev;
943 
945  "Telling other peer that we expect its full set\n");
948  GNUNET_MQ_send (op->mq,
949  ev);
950  }
951  }
952  else
953  {
955  "# of ibf sends",
956  1,
957  GNUNET_NO);
958  if (GNUNET_OK !=
959  send_ibf (op,
961  {
962  /* Internal error, best we can do is shut the connection */
964  "Failed to send IBF, closing connection\n");
966  return;
967  }
968  }
970 }
We sent the strata estimator, and expect an IBF.
#define LOG(kind,...)
static unsigned int get_order_from_difference(unsigned int diff)
Compute the necessary order of an ibf from the size of the symmetric set difference.
struct StrataEstimator * strata_estimator_create(unsigned int strata_count, uint32_t ibf_size, uint8_t ibf_hashnum)
Create a new strata estimator with the given parameters.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
struct GNUNET_CADET_Channel * channel
Channel to the peer.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SET_UNION_P2P_SE(C)
#define GNUNET_NO
Definition: gnunet_common.h:81
uint64_t initial_size
Initial size of our set, just before the operation started.
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
A handle to a strata estimator.
struct GNUNET_STATISTICS_Handle * _GSS_statistics
Statistics handle.
static int send_ibf(struct Operation *op, uint16_t ibf_order)
Send an ibf of appropriate size.
struct StrataEstimator * se
Copy of the set&#39;s strata estimator at the time of creation of this operation.
uint16_t type
The type of the message (GNUNET_MESSAGE_TYPE_XXXX), in big-endian format.
#define GNUNET_MESSAGE_TYPE_SET_UNION_P2P_SEC
Compressed strata estimator.
void strata_estimator_destroy(struct StrataEstimator *se)
Destroy a strata estimator, free all of its resources.
enum IntersectionOperationPhase phase
Current state of the operation.
static void fail_union_operation(struct Operation *op)
Inform the client that the union operation has failed, and proceed to destroy the evaluate operation...
#define GNUNET_MESSAGE_TYPE_SET_UNION_P2P_REQUEST_FULL
Demand the whole element from the other peer, given only the hash code.
int strata_estimator_read(const void *buf, size_t buf_len, int is_compressed, struct StrataEstimator *se)
Read strata from the buffer into the given strata estimator.
int byzantine
GNUNET_YES to fail operations where Byzantine faults are suspected
char * getenv()
Strata estimator together with the peer&#39;s overall set size.
unsigned int strata_estimator_difference(const struct StrataEstimator *se1, const struct StrataEstimator *se2)
Estimate set difference with two strata estimators, i.e.
Operation context used to execute a set operation.
#define GNUNET_MQ_msg_header(type)
Allocate a GNUNET_MQ_Envelope, where the message only consists of a header.
Definition: gnunet_mq_lib.h:76
void GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel)
Send an ack on the channel to confirm the processing of a message.
Definition: cadet_api.c:973
struct GNUNET_MQ_Handle * mq
Message queue for the channel.
#define SE_IBF_SIZE
Size of the IBFs in the strata estimator.
#define SE_IBF_HASH_NUM
The hash num parameter for the difference digests and strata estimators.
#define GNUNET_log(kind,...)
#define GNUNET_YES
Definition: gnunet_common.h:80
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:353
static void send_full_set(struct Operation *op)
Switch to full set transmission for op.
struct OperationState * state
Operation-specific operation state.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
#define SE_STRATA_COUNT
Number of IBFs in a strata estimator.
uint64_t GNUNET_ntohll(uint64_t n)
Convert unsigned 64-bit integer to host byte order.
Definition: common_endian.c:48
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...
int force_full
Always send full sets, even if delta operations would be more efficient.
Here is the call graph for this function:

◆ check_union_p2p_ibf()

int check_union_p2p_ibf ( void *  cls,
const struct IBFMessage msg 
)

Check an IBF message from a remote peer.

Reassemble the IBF from multiple pieces, and process the whole IBF once possible.

Parameters
clsthe union operation
msgthe header of the message
Returns
GNUNET_OK if msg is well-formed

Definition at line 1203 of file gnunet-service-set_union.c.

References GNUNET_break_op, GNUNET_OK, GNUNET_SET_OPERATION_UNION, GNUNET_SYSERR, IBFMessage::header, IBF_BUCKET_SIZE, OperationState::ibf_buckets_received, msg, IBFMessage::offset, op, Set::operation, IBFMessage::order, OperationState::phase, PHASE_EXPECT_IBF, PHASE_EXPECT_IBF_CONT, PHASE_INVENTORY_PASSIVE, OperationState::remote_ibf, IBFMessage::salt, OperationState::salt_receive, Operation::set, InvertibleBloomFilter::size, GNUNET_MessageHeader::size, and Operation::state.

1205 {
1206  struct Operation *op = cls;
1207  unsigned int buckets_in_message;
1208 
1210  {
1211  GNUNET_break_op (0);
1212  return GNUNET_SYSERR;
1213  }
1214  buckets_in_message = (ntohs (msg->header.size) - sizeof *msg) / IBF_BUCKET_SIZE;
1215  if (0 == buckets_in_message)
1216  {
1217  GNUNET_break_op (0);
1218  return GNUNET_SYSERR;
1219  }
1220  if ((ntohs (msg->header.size) - sizeof *msg) != buckets_in_message * IBF_BUCKET_SIZE)
1221  {
1222  GNUNET_break_op (0);
1223  return GNUNET_SYSERR;
1224  }
1225  if (op->state->phase == PHASE_EXPECT_IBF_CONT)
1226  {
1227  if (ntohl (msg->offset) != op->state->ibf_buckets_received)
1228  {
1229  GNUNET_break_op (0);
1230  return GNUNET_SYSERR;
1231  }
1232  if (1<<msg->order != op->state->remote_ibf->size)
1233  {
1234  GNUNET_break_op (0);
1235  return GNUNET_SYSERR;
1236  }
1237  if (ntohl (msg->salt) != op->state->salt_receive)
1238  {
1239  GNUNET_break_op (0);
1240  return GNUNET_SYSERR;
1241  }
1242  }
1243  else if ( (op->state->phase != PHASE_INVENTORY_PASSIVE) &&
1244  (op->state->phase != PHASE_EXPECT_IBF) )
1245  {
1246  GNUNET_break_op (0);
1247  return GNUNET_SYSERR;
1248  }
1249 
1250  return GNUNET_OK;
1251 }
We sent the strata estimator, and expect an IBF.
uint32_t offset
Offset of the strata in the rest of the message.
The other peer is decoding the IBF we just sent.
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
struct Set * set
Set associated with the operation, NULL until the spec has been associated with a set...
struct InvertibleBloomFilter * remote_ibf
The IBF we currently receive.
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
uint32_t size
How many cells does this IBF have?
Definition: ibf.h:87
uint32_t salt_receive
Salt for the IBF we&#39;ve received and that we&#39;re currently decoding.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
uint8_t order
Order of the whole ibf, where num_buckets = 2^order.
enum IntersectionOperationPhase phase
Current state of the operation.
#define IBF_BUCKET_SIZE
Size of one ibf bucket in bytes.
Definition: ibf.h:72
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SET_UNION_P2P_IBF.
unsigned int ibf_buckets_received
Number of ibf buckets already received into the remote_ibf.
#define GNUNET_SYSERR
Definition: gnunet_common.h:79
enum GNUNET_SET_OperationType operation
Type of operation supported for this set.
Operation context used to execute a set operation.
uint32_t salt
Salt used when hashing elements for this IBF.
Continuation for multi part IBFs.
struct OperationState * state
Operation-specific operation state.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
Set union, return all elements that are in at least one of the sets.

◆ handle_union_p2p_ibf()

void handle_union_p2p_ibf ( void *  cls,
const struct IBFMessage msg 
)

Handle an IBF message from a remote peer.

Reassemble the IBF from multiple pieces, and process the whole IBF once possible.

Parameters
clsthe union operation
msgthe header of the message

Definition at line 1264 of file gnunet-service-set_union.c.

References Operation::channel, decode_and_send(), fail_union_operation(), GNUNET_assert, GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_OK, IBFMessage::header, IBF_BUCKET_SIZE, OperationState::ibf_buckets_received, ibf_create(), ibf_read_slice(), LOG, msg, IBFMessage::offset, op, IBFMessage::order, OperationState::phase, PHASE_EXPECT_IBF, PHASE_EXPECT_IBF_CONT, PHASE_INVENTORY_ACTIVE, PHASE_INVENTORY_PASSIVE, OperationState::remote_ibf, IBFMessage::salt, OperationState::salt_receive, SE_IBF_HASH_NUM, InvertibleBloomFilter::size, GNUNET_MessageHeader::size, and Operation::state.

1266 {
1267  struct Operation *op = cls;
1268  unsigned int buckets_in_message;
1269 
1270  buckets_in_message = (ntohs (msg->header.size) - sizeof *msg) / IBF_BUCKET_SIZE;
1271  if ( (op->state->phase == PHASE_INVENTORY_PASSIVE) ||
1272  (op->state->phase == PHASE_EXPECT_IBF) )
1273  {
1275  GNUNET_assert (NULL == op->state->remote_ibf);
1277  "Creating new ibf of size %u\n",
1278  1 << msg->order);
1279  op->state->remote_ibf = ibf_create (1<<msg->order, SE_IBF_HASH_NUM);
1280  op->state->salt_receive = ntohl (msg->salt);
1282  "Receiving new IBF with salt %u\n",
1283  op->state->salt_receive);
1284  if (NULL == op->state->remote_ibf)
1285  {
1287  "Failed to parse remote IBF, closing connection\n");
1288  fail_union_operation (op);
1289  return;
1290  }
1291  op->state->ibf_buckets_received = 0;
1292  if (0 != ntohl (msg->offset))
1293  {
1294  GNUNET_break_op (0);
1295  fail_union_operation (op);
1296  return;
1297  }
1298  }
1299  else
1300  {
1303  "Received more of IBF\n");
1304  }
1305  GNUNET_assert (NULL != op->state->remote_ibf);
1306 
1307  ibf_read_slice (&msg[1],
1309  buckets_in_message,
1310  op->state->remote_ibf);
1311  op->state->ibf_buckets_received += buckets_in_message;
1312 
1313  if (op->state->ibf_buckets_received == op->state->remote_ibf->size)
1314  {
1316  "received full ibf\n");
1318  if (GNUNET_OK !=
1319  decode_and_send (op))
1320  {
1321  /* Internal error, best we can do is shut down */
1323  "Failed to decode IBF, closing connection\n");
1324  fail_union_operation (op);
1325  return;
1326  }
1327  }
1329 }
We sent the strata estimator, and expect an IBF.
uint32_t offset
Offset of the strata in the rest of the message.
The other peer is decoding the IBF we just sent.
#define LOG(kind,...)
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
struct InvertibleBloomFilter * remote_ibf
The IBF we currently receive.
We are decoding an IBF.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
struct GNUNET_CADET_Channel * channel
Channel to the peer.
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
uint32_t size
How many cells does this IBF have?
Definition: ibf.h:87
uint32_t salt_receive
Salt for the IBF we&#39;ve received and that we&#39;re currently decoding.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
static int decode_and_send(struct Operation *op)
Decode which elements are missing on each side, and send the appropriate offers and inquiries...
uint8_t order
Order of the whole ibf, where num_buckets = 2^order.
enum IntersectionOperationPhase phase
Current state of the operation.
#define IBF_BUCKET_SIZE
Size of one ibf bucket in bytes.
Definition: ibf.h:72
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SET_UNION_P2P_IBF.
static void fail_union_operation(struct Operation *op)
Inform the client that the union operation has failed, and proceed to destroy the evaluate operation...
void ibf_read_slice(const void *buf, uint32_t start, uint32_t count, struct InvertibleBloomFilter *ibf)
Read buckets from a buffer into an ibf.
Definition: ibf.c:315
unsigned int ibf_buckets_received
Number of ibf buckets already received into the remote_ibf.
struct InvertibleBloomFilter * ibf_create(uint32_t size, uint8_t hash_num)
Create an invertible bloom filter.
Definition: ibf.c:76
Operation context used to execute a set operation.
void GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel)
Send an ack on the channel to confirm the processing of a message.
Definition: cadet_api.c:973
uint32_t salt
Salt used when hashing elements for this IBF.
#define SE_IBF_HASH_NUM
The hash num parameter for the difference digests and strata estimators.
Continuation for multi part IBFs.
#define GNUNET_log(kind,...)
struct OperationState * state
Operation-specific operation state.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
Here is the call graph for this function:

◆ check_union_p2p_elements()

int check_union_p2p_elements ( void *  cls,
const struct GNUNET_SET_ElementMessage emsg 
)

Check an element message from a remote peer.

Parameters
clsthe union operation
emsgthe message

Definition at line 1475 of file gnunet-service-set_union.c.

References OperationState::demanded_hashes, GNUNET_break_op, GNUNET_CONTAINER_multihashmap_size(), GNUNET_OK, GNUNET_SET_OPERATION_UNION, GNUNET_SYSERR, op, Set::operation, Operation::set, and Operation::state.

1477 {
1478  struct Operation *op = cls;
1479 
1481  {
1482  GNUNET_break_op (0);
1483  return GNUNET_SYSERR;
1484  }
1486  {
1487  GNUNET_break_op (0);
1488  return GNUNET_SYSERR;
1489  }
1490  return GNUNET_OK;
1491 }
struct Set * set
Set associated with the operation, NULL until the spec has been associated with a set...
unsigned int GNUNET_CONTAINER_multihashmap_size(const struct GNUNET_CONTAINER_MultiHashMap *map)
Get the number of key-value pairs in the map.
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
#define GNUNET_SYSERR
Definition: gnunet_common.h:79
enum GNUNET_SET_OperationType operation
Type of operation supported for this set.
Operation context used to execute a set operation.
struct GNUNET_CONTAINER_MultiHashMap * demanded_hashes
Hashes for elements that we have demanded from the other peer.
struct OperationState * state
Operation-specific operation state.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
Set union, return all elements that are in at least one of the sets.
Here is the call graph for this function:

◆ handle_union_p2p_elements()

void handle_union_p2p_elements ( void *  cls,
const struct GNUNET_SET_ElementMessage emsg 
)

Handle an element message from a remote peer.

Sent by the other peer either because we decoded an IBF and placed a demand, or because the other peer switched to full set transmission.

Parameters
clsthe union operation
emsgthe message

Definition at line 1503 of file gnunet-service-set_union.c.

References _GSS_statistics, Operation::channel, GNUNET_SET_Element::data, OperationState::demanded_hashes, ElementEntry::element, ElementEntry::element_hash, element_size, GNUNET_SET_Element::element_type, GNUNET_SET_ElementMessage::element_type, fail_union_operation(), GNUNET_break, GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_CONTAINER_multihashmap_remove(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_h2s(), GNUNET_malloc, GNUNET_memcpy, GNUNET_NO, GNUNET_SET_element_hash(), GNUNET_SET_RESULT_ADDED, GNUNET_SET_RESULT_SYMMETRIC, GNUNET_SET_STATUS_ADD_LOCAL, GNUNET_SET_STATUS_OK, GNUNET_STATISTICS_update(), GNUNET_YES, GNUNET_SET_ElementMessage::header, LOG, maybe_finish(), op, op_get_element(), op_register_element(), KeyEntry::received, OperationState::received_fresh, OperationState::received_total, ElementEntry::remote, Operation::result_mode, send_client_element(), GNUNET_SET_Element::size, GNUNET_MessageHeader::size, and Operation::state.

1505 {
1506  struct Operation *op = cls;
1507  struct ElementEntry *ee;
1508  struct KeyEntry *ke;
1509  uint16_t element_size;
1510 
1511  element_size = ntohs (emsg->header.size) - sizeof (struct GNUNET_SET_ElementMessage);
1512  ee = GNUNET_malloc (sizeof (struct ElementEntry) + element_size);
1513  GNUNET_memcpy (&ee[1],
1514  &emsg[1],
1515  element_size);
1516  ee->element.size = element_size;
1517  ee->element.data = &ee[1];
1518  ee->element.element_type = ntohs (emsg->element_type);
1519  ee->remote = GNUNET_YES;
1521  &ee->element_hash);
1522  if (GNUNET_NO ==
1524  &ee->element_hash,
1525  NULL))
1526  {
1527  /* We got something we didn't demand, since it's not in our map. */
1528  GNUNET_break_op (0);
1529  fail_union_operation (op);
1530  return;
1531  }
1532 
1534  "Got element (size %u, hash %s) from peer\n",
1535  (unsigned int) element_size,
1536  GNUNET_h2s (&ee->element_hash));
1537 
1539  "# received elements",
1540  1,
1541  GNUNET_NO);
1543  "# exchanged elements",
1544  1,
1545  GNUNET_NO);
1546 
1547  op->state->received_total++;
1548 
1549  ke = op_get_element (op, &ee->element_hash);
1550  if (NULL != ke)
1551  {
1552  /* Got repeated element. Should not happen since
1553  * we track demands. */
1555  "# repeated elements",
1556  1,
1557  GNUNET_NO);
1558  ke->received = GNUNET_YES;
1559  GNUNET_free (ee);
1560  }
1561  else
1562  {
1564  "Registering new element from remote peer\n");
1565  op->state->received_fresh++;
1566  op_register_element (op, ee, GNUNET_YES);
1567  /* only send results immediately if the client wants it */
1568  switch (op->result_mode)
1569  {
1572  break;
1575  break;
1576  default:
1577  /* Result mode not supported, should have been caught earlier. */
1578  GNUNET_break (0);
1579  break;
1580  }
1581  }
1582 
1583  if ( (op->state->received_total > 8) &&
1584  (op->state->received_fresh < op->state->received_total / 3) )
1585  {
1586  /* The other peer gave us lots of old elements, there's something wrong. */
1587  GNUNET_break_op (0);
1588  fail_union_operation (op);
1589  return;
1590  }
1592  maybe_finish (op);
1593 }
Client gets only elements that have been added to the set.
#define LOG(kind,...)
enum GNUNET_SET_ResultMode result_mode
When are elements sent to the client, and which elements are sent?
uint32_t received_fresh
Number of elements we received from the other peer that were not in the local set yet...
static unsigned int element_size
int received
Did we receive this element? Even if element->is_foreign is false, we might have received the element...
struct GNUNET_HashCode element_hash
Hash of the element.
Element should be added to the result set of the local peer, i.e.
struct GNUNET_CADET_Channel * channel
Channel to the peer.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SET_ADD or GNUNET_MESSAGE_TYPE_SET_REMOVE.
Definition: set.h:288
#define GNUNET_NO
Definition: gnunet_common.h:81
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
void GNUNET_SET_element_hash(const struct GNUNET_SET_Element *element, struct GNUNET_HashCode *ret_hash)
Hash a set element.
Definition: set_api.c:1242
uint16_t element_type
Type of the element to add or remove.
Definition: set.h:293
const void * data
Actual data of the element.
struct GNUNET_STATISTICS_Handle * _GSS_statistics
Statistics handle.
The key entry is used to associate an ibf key with an element.
uint32_t received_total
Total number of elements received from the other peer.
#define GNUNET_memcpy(dst, src, n)
Information about an element element in the set.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
Everything went ok, we are transmitting an element of the result (in set, or to be removed from set...
int remote
GNUNET_YES if the element is a remote element, and does not belong to the operation&#39;s set...
int GNUNET_CONTAINER_multihashmap_remove(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, const void *value)
Remove the given key-value pair from the map.
Client gets notified of the required changes for both the local and the remote set.
static void fail_union_operation(struct Operation *op)
Inform the client that the union operation has failed, and proceed to destroy the evaluate operation...
static void op_register_element(struct Operation *op, struct ElementEntry *ee, int received)
Insert an element into the union operation&#39;s key-to-element mapping.
static struct KeyEntry * op_get_element(struct Operation *op, const struct GNUNET_HashCode *element_hash)
Determine whether the given element is already in the operation&#39;s element set.
Operation context used to execute a set operation.
static void send_client_element(struct Operation *op, struct GNUNET_SET_Element *element, int status)
Send a result message to the client indicating that there is a new element.
void GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel)
Send an ack on the channel to confirm the processing of a message.
Definition: cadet_api.c:973
static void maybe_finish(struct Operation *op)
Tests if the operation is finished, and if so notify.
uint16_t size
Number of bytes in the buffer pointed to by data.
Message sent by client to the service to add or remove an element to/from the set.
Definition: set.h:282
struct GNUNET_SET_Element element
The actual element.
#define GNUNET_YES
Definition: gnunet_common.h:80
struct GNUNET_CONTAINER_MultiHashMap * demanded_hashes
Hashes for elements that we have demanded from the other peer.
struct OperationState * state
Operation-specific operation state.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
uint16_t element_type
Application-specific element type.
Here is the call graph for this function:

◆ check_union_p2p_full_element()

int check_union_p2p_full_element ( void *  cls,
const struct GNUNET_SET_ElementMessage emsg 
)

Check a full element message from a remote peer.

Parameters
clsthe union operation
emsgthe message

Definition at line 1603 of file gnunet-service-set_union.c.

References GNUNET_break_op, GNUNET_OK, GNUNET_SET_OPERATION_UNION, GNUNET_SYSERR, op, Set::operation, and Operation::set.

1605 {
1606  struct Operation *op = cls;
1607 
1609  {
1610  GNUNET_break_op (0);
1611  return GNUNET_SYSERR;
1612  }
1613  // FIXME: check that we expect full elements here?
1614  return GNUNET_OK;
1615 }
struct Set * set
Set associated with the operation, NULL until the spec has been associated with a set...
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
#define GNUNET_SYSERR
Definition: gnunet_common.h:79
enum GNUNET_SET_OperationType operation
Type of operation supported for this set.
Operation context used to execute a set operation.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
Set union, return all elements that are in at least one of the sets.

◆ handle_union_p2p_full_element()

void handle_union_p2p_full_element ( void *  cls,
const struct GNUNET_SET_ElementMessage emsg 
)

Handle an element message from a remote peer.

Parameters
clsthe union operation
emsgthe message

Definition at line 1625 of file gnunet-service-set_union.c.

References _GSS_statistics, Operation::byzantine, Operation::channel, GNUNET_SET_Element::data, ElementEntry::element, ElementEntry::element_hash, element_size, GNUNET_SET_Element::element_type, GNUNET_SET_ElementMessage::element_type, fail_union_operation(), GNUNET_break, GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_h2s(), GNUNET_malloc, GNUNET_memcpy, GNUNET_NO, GNUNET_SET_element_hash(), GNUNET_SET_RESULT_ADDED, GNUNET_SET_RESULT_SYMMETRIC, GNUNET_SET_STATUS_ADD_LOCAL, GNUNET_SET_STATUS_OK, GNUNET_STATISTICS_update(), GNUNET_YES, GNUNET_SET_ElementMessage::header, LOG, op, op_get_element(), op_register_element(), KeyEntry::received, OperationState::received_fresh, OperationState::received_total, ElementEntry::remote, Operation::result_mode, send_client_element(), GNUNET_SET_Element::size, GNUNET_MessageHeader::size, and Operation::state.

1627 {
1628  struct Operation *op = cls;
1629  struct ElementEntry *ee;
1630  struct KeyEntry *ke;
1631  uint16_t element_size;
1632 
1633  element_size = ntohs (emsg->header.size) - sizeof (struct GNUNET_SET_ElementMessage);
1634  ee = GNUNET_malloc (sizeof (struct ElementEntry) + element_size);
1635  GNUNET_memcpy (&ee[1], &emsg[1], element_size);
1636  ee->element.size = element_size;
1637  ee->element.data = &ee[1];
1638  ee->element.element_type = ntohs (emsg->element_type);
1639  ee->remote = GNUNET_YES;
1641 
1643  "Got element (full diff, size %u, hash %s) from peer\n",
1644  (unsigned int) element_size,
1645  GNUNET_h2s (&ee->element_hash));
1646 
1648  "# received elements",
1649  1,
1650  GNUNET_NO);
1652  "# exchanged elements",
1653  1,
1654  GNUNET_NO);
1655 
1656  op->state->received_total++;
1657 
1658  ke = op_get_element (op, &ee->element_hash);
1659  if (NULL != ke)
1660  {
1661  /* Got repeated element. Should not happen since
1662  * we track demands. */
1664  "# repeated elements",
1665  1,
1666  GNUNET_NO);
1667  ke->received = GNUNET_YES;
1668  GNUNET_free (ee);
1669  }
1670  else
1671  {
1673  "Registering new element from remote peer\n");
1674  op->state->received_fresh++;
1675  op_register_element (op, ee, GNUNET_YES);
1676  /* only send results immediately if the client wants it */
1677  switch (op->result_mode)
1678  {
1681  break;
1684  break;
1685  default:
1686  /* Result mode not supported, should have been caught earlier. */
1687  GNUNET_break (0);
1688  break;
1689  }
1690  }
1691 
1692  if ( (GNUNET_YES == op->byzantine) &&
1693  (op->state->received_total > 384 + op->state->received_fresh * 4) &&
1694  (op->state->received_fresh < op->state->received_total / 6) )
1695  {
1696  /* The other peer gave us lots of old elements, there's something wrong. */
1698  "Other peer sent only %llu/%llu fresh elements, failing operation\n",
1699  (unsigned long long) op->state->received_fresh,
1700  (unsigned long long) op->state->received_total);
1701  GNUNET_break_op (0);
1702  fail_union_operation (op);
1703  return;
1704  }
1706 }
Client gets only elements that have been added to the set.
#define LOG(kind,...)
enum GNUNET_SET_ResultMode result_mode
When are elements sent to the client, and which elements are sent?
uint32_t received_fresh
Number of elements we received from the other peer that were not in the local set yet...
static unsigned int element_size
int received
Did we receive this element? Even if element->is_foreign is false, we might have received the element...
struct GNUNET_HashCode element_hash
Hash of the element.
Element should be added to the result set of the local peer, i.e.
struct GNUNET_CADET_Channel * channel
Channel to the peer.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SET_ADD or GNUNET_MESSAGE_TYPE_SET_REMOVE.
Definition: set.h:288
#define GNUNET_NO
Definition: gnunet_common.h:81
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
void GNUNET_SET_element_hash(const struct GNUNET_SET_Element *element, struct GNUNET_HashCode *ret_hash)
Hash a set element.
Definition: set_api.c:1242
uint16_t element_type
Type of the element to add or remove.
Definition: set.h:293
const void * data
Actual data of the element.
struct GNUNET_STATISTICS_Handle * _GSS_statistics
Statistics handle.
The key entry is used to associate an ibf key with an element.
uint32_t received_total
Total number of elements received from the other peer.
#define GNUNET_memcpy(dst, src, n)
Information about an element element in the set.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
Everything went ok, we are transmitting an element of the result (in set, or to be removed from set...
int remote
GNUNET_YES if the element is a remote element, and does not belong to the operation&#39;s set...
Client gets notified of the required changes for both the local and the remote set.
static void fail_union_operation(struct Operation *op)
Inform the client that the union operation has failed, and proceed to destroy the evaluate operation...
static void op_register_element(struct Operation *op, struct ElementEntry *ee, int received)
Insert an element into the union operation&#39;s key-to-element mapping.
int byzantine
GNUNET_YES to fail operations where Byzantine faults are suspected
static struct KeyEntry * op_get_element(struct Operation *op, const struct GNUNET_HashCode *element_hash)
Determine whether the given element is already in the operation&#39;s element set.
Operation context used to execute a set operation.
static void send_client_element(struct Operation *op, struct GNUNET_SET_Element *element, int status)
Send a result message to the client indicating that there is a new element.
void GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel)
Send an ack on the channel to confirm the processing of a message.
Definition: cadet_api.c:973
uint16_t size
Number of bytes in the buffer pointed to by data.
Message sent by client to the service to add or remove an element to/from the set.
Definition: set.h:282
struct GNUNET_SET_Element element
The actual element.
#define GNUNET_YES
Definition: gnunet_common.h:80
struct OperationState * state
Operation-specific operation state.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
uint16_t element_type
Application-specific element type.
Here is the call graph for this function:

◆ check_union_p2p_inquiry()

int check_union_p2p_inquiry ( void *  cls,
const struct InquiryMessage msg 
)

Send offers (for GNUNET_Hash-es) in response to inquiries (for IBF_Key-s).

Parameters
clsthe union operation
msgthe message

Definition at line 1717 of file gnunet-service-set_union.c.

References GNUNET_break_op, GNUNET_OK, GNUNET_SET_OPERATION_UNION, GNUNET_SYSERR, InquiryMessage::header, op, Set::operation, OperationState::phase, PHASE_INVENTORY_PASSIVE, Operation::set, GNUNET_MessageHeader::size, and Operation::state.

1719 {
1720  struct Operation *op = cls;
1721  unsigned int num_keys;
1722 
1724  {
1725  GNUNET_break_op (0);
1726  return GNUNET_SYSERR;
1727  }
1728  if (op->state->phase != PHASE_INVENTORY_PASSIVE)
1729  {
1730  GNUNET_break_op (0);
1731  return GNUNET_SYSERR;
1732  }
1733  num_keys = (ntohs (msg->header.size) - sizeof (struct InquiryMessage))
1734  / sizeof (struct IBF_Key);
1735  if ((ntohs (msg->header.size) - sizeof (struct InquiryMessage))
1736  != num_keys * sizeof (struct IBF_Key))
1737  {
1738  GNUNET_break_op (0);
1739  return GNUNET_SYSERR;
1740  }
1741  return GNUNET_OK;
1742 }
The other peer is decoding the IBF we just sent.
struct Set * set
Set associated with the operation, NULL until the spec has been associated with a set...
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
enum IntersectionOperationPhase phase
Current state of the operation.
#define GNUNET_SYSERR
Definition: gnunet_common.h:79
enum GNUNET_SET_OperationType operation
Type of operation supported for this set.
Operation context used to execute a set operation.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SET_UNION_P2P_IBF.
struct OperationState * state
Operation-specific operation state.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
Keys that can be inserted into and removed from an IBF.
Definition: ibf.h:45
Set union, return all elements that are in at least one of the sets.

◆ handle_union_p2p_inquiry()

void handle_union_p2p_inquiry ( void *  cls,
const struct InquiryMessage msg 
)

Send offers (for GNUNET_Hash-es) in response to inquiries (for IBF_Key-s).

Parameters
clsthe union operation
msgthe message

Definition at line 1753 of file gnunet-service-set_union.c.

References Operation::channel, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, InquiryMessage::header, LOG, op, InquiryMessage::salt, send_offers_for_key(), GNUNET_MessageHeader::size, and unsalt_key().

1755 {
1756  struct Operation *op = cls;
1757  const struct IBF_Key *ibf_key;
1758  unsigned int num_keys;
1759 
1761  "Received union inquiry\n");
1762  num_keys = (ntohs (msg->header.size) - sizeof (struct InquiryMessage))
1763  / sizeof (struct IBF_Key);
1764  ibf_key = (const struct IBF_Key *) &msg[1];
1765  while (0 != num_keys--)
1766  {
1767  struct IBF_Key unsalted_key;
1768 
1769  unsalt_key (ibf_key,
1770  ntohl (msg->salt),
1771  &unsalted_key);
1772  send_offers_for_key (op,
1773  unsalted_key);
1774  ibf_key++;
1775  }
1777 }
#define LOG(kind,...)
struct GNUNET_CADET_Channel * channel
Channel to the peer.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
static void send_offers_for_key(struct Operation *op, struct IBF_Key ibf_key)
Send offers (in the form of GNUNET_Hash-es) to the remote peer for the given IBF key.
Operation context used to execute a set operation.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SET_UNION_P2P_IBF.
void GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel)
Send an ack on the channel to confirm the processing of a message.
Definition: cadet_api.c:973
static void unsalt_key(const struct IBF_Key *k_in, uint32_t salt, struct IBF_Key *k_out)
FIXME.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
Keys that can be inserted into and removed from an IBF.
Definition: ibf.h:45
uint32_t salt
Salt used when hashing elements for this inquiry.
Here is the call graph for this function:

◆ handle_union_p2p_request_full()

void handle_union_p2p_request_full ( void *  cls,
const struct GNUNET_MessageHeader mh 
)

Handle a request for full set transmission.

cls closure, a set union operation

Parameters
mhthe demand message

Definition at line 1823 of file gnunet-service-set_union.c.

References Operation::channel, fail_union_operation(), GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_SET_OPERATION_UNION, LOG, op, Set::operation, OperationState::phase, PHASE_EXPECT_IBF, send_full_set(), Operation::set, and Operation::state.

1825 {
1826  struct Operation *op = cls;
1827 
1829  "Received request for full set transmission\n");
1831  {
1832  GNUNET_break_op (0);
1833  fail_union_operation (op);
1834  return;
1835  }
1836  if (PHASE_EXPECT_IBF != op->state->phase)
1837  {
1838  GNUNET_break_op (0);
1839  fail_union_operation (op);
1840  return;
1841  }
1842 
1843  // FIXME: we need to check that our set is larger than the
1844  // byzantine_lower_bound by some threshold
1845  send_full_set (op);
1847 }
We sent the strata estimator, and expect an IBF.
#define LOG(kind,...)
struct Set * set
Set associated with the operation, NULL until the spec has been associated with a set...
struct GNUNET_CADET_Channel * channel
Channel to the peer.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
enum IntersectionOperationPhase phase
Current state of the operation.
static void fail_union_operation(struct Operation *op)
Inform the client that the union operation has failed, and proceed to destroy the evaluate operation...
enum GNUNET_SET_OperationType operation
Type of operation supported for this set.
Operation context used to execute a set operation.
void GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel)
Send an ack on the channel to confirm the processing of a message.
Definition: cadet_api.c:973
static void send_full_set(struct Operation *op)
Switch to full set transmission for op.
struct OperationState * state
Operation-specific operation state.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
Set union, return all elements that are in at least one of the sets.
Here is the call graph for this function:

◆ handle_union_p2p_full_done()

void handle_union_p2p_full_done ( void *  cls,
const struct GNUNET_MessageHeader mh 
)

Handle a "full done" message.

cls closure, a set union operation

Parameters
mhthe demand message

Definition at line 1857 of file gnunet-service-set_union.c.

References _GSS_operation_destroy2(), Operation::channel, fail_union_operation(), GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_CONTAINER_multihashmap32_iterate(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_SET_UNION_P2P_FULL_DONE, GNUNET_MQ_msg_header, GNUNET_MQ_send(), OperationState::key_to_element, LOG, Operation::mq, op, OperationState::phase, PHASE_DONE, PHASE_EXPECT_IBF, PHASE_FULL_SENDING, send_client_done(), send_missing_full_elements_iter(), and Operation::state.

1859 {
1860  struct Operation *op = cls;
1861 
1862  switch (op->state->phase)
1863  {
1864  case PHASE_EXPECT_IBF:
1865  {
1866  struct GNUNET_MQ_Envelope *ev;
1867 
1869  "got FULL DONE, sending elements that other peer is missing\n");
1870 
1871  /* send all the elements that did not come from the remote peer */
1874  op);
1875 
1877  GNUNET_MQ_send (op->mq,
1878  ev);
1879  op->state->phase = PHASE_DONE;
1880  /* we now wait until the other peer sends us the OVER message*/
1881  }
1882  break;
1883  case PHASE_FULL_SENDING:
1884  {
1886  "got FULL DONE, finishing\n");
1887  /* We sent the full set, and got the response for that. We're done. */
1888  op->state->phase = PHASE_DONE;
1890  send_client_done (op);
1892  return;
1893  }
1894  break;
1895  default:
1897  "Handle full done phase is %u\n",
1898  (unsigned) op->state->phase);
1899  GNUNET_break_op (0);
1900  fail_union_operation (op);
1901  return;
1902  }
1904 }
We sent the strata estimator, and expect an IBF.
struct GNUNET_CONTAINER_MultiHashMap32 * key_to_element
Maps unsalted IBF-Keys to elements.
#define LOG(kind,...)
struct GNUNET_CADET_Channel * channel
Channel to the peer.
static int send_missing_full_elements_iter(void *cls, uint32_t key, void *value)
Iterator over hash map entries, called to destroy the linked list of colliding ibf key entries...
static void send_client_done(void *cls)
Signal to the client that the operation has finished and destroy the operation.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
enum IntersectionOperationPhase phase
Current state of the operation.
static void fail_union_operation(struct Operation *op)
Inform the client that the union operation has failed, and proceed to destroy the evaluate operation...
Operation context used to execute a set operation.
int GNUNET_CONTAINER_multihashmap32_iterate(struct GNUNET_CONTAINER_MultiHashMap32 *map, GNUNET_CONTAINER_HashMapIterator32 it, void *it_cls)
Iterate over all entries in the map.
#define GNUNET_MQ_msg_header(type)
Allocate a GNUNET_MQ_Envelope, where the message only consists of a header.
Definition: gnunet_mq_lib.h:76
void GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel)
Send an ack on the channel to confirm the processing of a message.
Definition: cadet_api.c:973
struct GNUNET_MQ_Handle * mq
Message queue for the channel.
#define GNUNET_log(kind,...)
#define GNUNET_MESSAGE_TYPE_SET_UNION_P2P_FULL_DONE
Request all missing elements from the other peer, based on their sets and the elements we previously ...
void _GSS_operation_destroy2(struct Operation *op)
This function probably should not exist and be replaced by inlining more specific logic in the variou...
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:353
struct OperationState * state
Operation-specific operation state.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
In the ultimate phase, we wait until our demands are satisfied and then quit (sending another DONE me...
After sending the full set, wait for responses with the elements that the local peer is missing...
Here is the call graph for this function:

◆ check_union_p2p_demand()

int check_union_p2p_demand ( void *  cls,
const struct GNUNET_MessageHeader mh 
)

Check a demand by the other peer for elements based on a list of struct GNUNET_HashCodes.

cls closure, a set union operation

Parameters
mhthe demand message
Returns
GNUNET_OK if mh is well-formed

Definition at line 1916 of file gnunet-service-set_union.c.

References GNUNET_break_op, GNUNET_OK, GNUNET_SET_OPERATION_UNION, GNUNET_SYSERR, op, Set::operation, Operation::set, and GNUNET_MessageHeader::size.

1918 {
1919  struct Operation *op = cls;
1920  unsigned int num_hashes;
1921 
1923  {
1924  GNUNET_break_op (0);
1925  return GNUNET_SYSERR;
1926  }
1927  num_hashes = (ntohs (mh->size) - sizeof (struct GNUNET_MessageHeader))
1928  / sizeof (struct GNUNET_HashCode);
1929  if ((ntohs (mh->size) - sizeof (struct GNUNET_MessageHeader))
1930  != num_hashes * sizeof (struct GNUNET_HashCode))
1931  {
1932  GNUNET_break_op (0);
1933  return GNUNET_SYSERR;
1934  }
1935  return GNUNET_OK;
1936 }
struct Set * set
Set associated with the operation, NULL until the spec has been associated with a set...
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
A 512-bit hashcode.
#define GNUNET_SYSERR
Definition: gnunet_common.h:79
enum GNUNET_SET_OperationType operation
Type of operation supported for this set.
Operation context used to execute a set operation.
Header for all communications.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
Set union, return all elements that are in at least one of the sets.

◆ handle_union_p2p_demand()

void handle_union_p2p_demand ( void *  cls,
const struct GNUNET_MessageHeader mh 
)

Handle a demand by the other peer for elements based on a list of struct GNUNET_HashCodes.

cls closure, a set union operation

Parameters
mhthe demand message

Definition at line 1947 of file gnunet-service-set_union.c.

References _GSS_is_element_of_operation(), _GSS_statistics, Operation::channel, Set::content, GNUNET_SET_Element::data, ElementEntry::element, ElementEntry::element_hash, GNUNET_SET_Element::element_type, GNUNET_SET_ElementMessage::element_type, SetContent::elements, fail_union_operation(), GNUNET_break, GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_CONTAINER_multihashmap_get(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_memcpy, GNUNET_MESSAGE_TYPE_SET_P2P_ELEMENTS, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_NO, GNUNET_SET_RESULT_ADDED, GNUNET_SET_RESULT_SYMMETRIC, GNUNET_SET_STATUS_ADD_REMOTE, GNUNET_STATISTICS_update(), LOG, op, GNUNET_SET_ElementMessage::reserved, send_client_element(), Operation::set, GNUNET_SET_Element::size, and GNUNET_MessageHeader::size.

1949 {
1950  struct Operation *op = cls;
1951  struct ElementEntry *ee;
1952  struct GNUNET_SET_ElementMessage *emsg;
1953  const struct GNUNET_HashCode *hash;
1954  unsigned int num_hashes;
1955  struct GNUNET_MQ_Envelope *ev;
1956 
1957  num_hashes = (ntohs (mh->size) - sizeof (struct GNUNET_MessageHeader))
1958  / sizeof (struct GNUNET_HashCode);
1959  for (hash = (const struct GNUNET_HashCode *) &mh[1];
1960  num_hashes > 0;
1961  hash++, num_hashes--)
1962  {
1964  hash);
1965  if (NULL == ee)
1966  {
1967  /* Demand for non-existing element. */
1968  GNUNET_break_op (0);
1969  fail_union_operation (op);
1970  return;
1971  }
1972  if (GNUNET_NO == _GSS_is_element_of_operation (ee, op))
1973  {
1974  /* Probably confused lazily copied sets. */
1975  GNUNET_break_op (0);
1976  fail_union_operation (op);
1977  return;
1978  }
1980  GNUNET_memcpy (&emsg[1], ee->element.data, ee->element.size);
1981  emsg->reserved = htons (0);
1982  emsg->element_type = htons (ee->element.element_type);
1984  "[OP %x] Sending demanded element (size %u, hash %s) to peer\n",
1985  (void *) op,
1986  (unsigned int) ee->element.size,
1987  GNUNET_h2s (&ee->element_hash));
1988  GNUNET_MQ_send (op->mq, ev);
1990  "# exchanged elements",
1991  1,
1992  GNUNET_NO);
1993 
1994  switch (op->result_mode)
1995  {
1997  /* Nothing to do. */
1998  break;
2001  break;
2002  default:
2003  /* Result mode not supported, should have been caught earlier. */
2004  GNUNET_break (0);
2005  break;
2006  }
2007  }
2008  GNUNET_CADET_receive_done (op->channel);
2009 }
Client gets only elements that have been added to the set.
#define LOG(kind,...)
#define GNUNET_MESSAGE_TYPE_SET_P2P_ELEMENTS
Actual set elements.
struct Set * set
Set associated with the operation, NULL until the spec has been associated with a set...
int _GSS_is_element_of_operation(struct ElementEntry *ee, struct Operation *op)
Is element ee part of the set used by op?
Element should be added to the result set of the remote peer, i.e.
struct GNUNET_HashCode element_hash
Hash of the element.
#define GNUNET_NO
Definition: gnunet_common.h:81
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
uint16_t element_type
Type of the element to add or remove.
Definition: set.h:293
const void * data
Actual data of the element.
void * GNUNET_CONTAINER_multihashmap_get(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Given a key find a value in the map matching the key.
struct GNUNET_STATISTICS_Handle * _GSS_statistics
Statistics handle.
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
Definition: gnunet_mq_lib.h:52
#define GNUNET_memcpy(dst, src, n)
Information about an element element in the set.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
A 512-bit hashcode.
Client gets notified of the required changes for both the local and the remote set.
static void fail_union_operation(struct Operation *op)
Inform the client that the union operation has failed, and proceed to destroy the evaluate operation...
Operation context used to execute a set operation.
static void send_client_element(struct Operation *op, struct GNUNET_SET_Element *element, int status)
Send a result message to the client indicating that there is a new element.
void GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel)
Send an ack on the channel to confirm the processing of a message.
Definition: cadet_api.c:973
uint16_t reserved
For alignment, always zero.
Definition: set.h:298
uint16_t size
Number of bytes in the buffer pointed to by data.
Message sent by client to the service to add or remove an element to/from the set.
Definition: set.h:282
struct GNUNET_SET_Element element
The actual element.
struct GNUNET_CONTAINER_MultiHashMap * elements
Maps struct GNUNET_HashCode * to struct ElementEntry *.
Header for all communications.
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:353
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
uint16_t element_type
Application-specific element type.
struct SetContent * content
Content, possibly shared by multiple sets, and thus reference counted.
Here is the call graph for this function:

◆ check_union_p2p_offer()

int check_union_p2p_offer ( void *  cls,
const struct GNUNET_MessageHeader mh 
)

Check offer (of struct GNUNET_HashCodes).

Parameters
clsthe union operation
mhthe message
Returns
GNUNET_OK if mh is well-formed

Definition at line 2020 of file gnunet-service-set_union.c.

References GNUNET_break_op, GNUNET_OK, GNUNET_SET_OPERATION_UNION, GNUNET_SYSERR, op, Set::operation, OperationState::phase, PHASE_INVENTORY_ACTIVE, PHASE_INVENTORY_PASSIVE, Operation::set, GNUNET_MessageHeader::size, and Operation::state.

2022 {
2023  struct Operation *op = cls;
2024  unsigned int num_hashes;
2025 
2027  {
2028  GNUNET_break_op (0);
2029  return GNUNET_SYSERR;
2030  }
2031  /* look up elements and send them */
2032  if ( (op->state->phase != PHASE_INVENTORY_PASSIVE) &&
2034  {
2035  GNUNET_break_op (0);
2036  return GNUNET_SYSERR;
2037  }
2038  num_hashes = (ntohs (mh->size) - sizeof (struct GNUNET_MessageHeader))
2039  / sizeof (struct GNUNET_HashCode);
2040  if ((ntohs (mh->size) - sizeof (struct GNUNET_MessageHeader)) !=
2041  num_hashes * sizeof (struct GNUNET_HashCode))
2042  {
2043  GNUNET_break_op (0);
2044  return GNUNET_SYSERR;
2045  }
2046  return GNUNET_OK;
2047 }
The other peer is decoding the IBF we just sent.
struct Set * set
Set associated with the operation, NULL until the spec has been associated with a set...
We are decoding an IBF.
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
enum IntersectionOperationPhase phase
Current state of the operation.
A 512-bit hashcode.
#define GNUNET_SYSERR
Definition: gnunet_common.h:79
enum GNUNET_SET_OperationType operation
Type of operation supported for this set.
Operation context used to execute a set operation.
Header for all communications.
struct OperationState * state
Operation-specific operation state.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
Set union, return all elements that are in at least one of the sets.

◆ handle_union_p2p_offer()

void handle_union_p2p_offer ( void *  cls,
const struct GNUNET_MessageHeader mh 
)

Handle offers (of struct GNUNET_HashCodes) and respond with demands (of struct GNUNET_HashCodes).

Parameters
clsthe union operation
mhthe message

Definition at line 2058 of file gnunet-service-set_union.c.

References _GSS_is_element_of_operation(), Operation::channel, Set::content, OperationState::demanded_hashes, SetContent::elements, GNUNET_assert, GNUNET_CADET_receive_done(), GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_get(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_memcpy, GNUNET_MESSAGE_TYPE_SET_UNION_P2P_DEMAND, GNUNET_MQ_msg_header_extra, GNUNET_MQ_send(), GNUNET_OK, GNUNET_YES, LOG, op, Operation::set, GNUNET_MessageHeader::size, and Operation::state.

2060 {
2061  struct Operation *op = cls;
2062  const struct GNUNET_HashCode *hash;
2063  unsigned int num_hashes;
2064 
2065  num_hashes = (ntohs (mh->size) - sizeof (struct GNUNET_MessageHeader))
2066  / sizeof (struct GNUNET_HashCode);
2067  for (hash = (const struct GNUNET_HashCode *) &mh[1];
2068  num_hashes > 0;
2069  hash++, num_hashes--)
2070  {
2071  struct ElementEntry *ee;
2072  struct GNUNET_MessageHeader *demands;
2073  struct GNUNET_MQ_Envelope *ev;
2074 
2076  hash);
2077  if (NULL != ee)
2078  if (GNUNET_YES == _GSS_is_element_of_operation (ee, op))
2079  continue;
2080 
2081  if (GNUNET_YES ==
2083  hash))
2084  {
2086  "Skipped sending duplicate demand\n");
2087  continue;
2088  }
2089 
2092  hash,
2093  NULL,
2095 
2097  "[OP %x] Requesting element (hash %s)\n",
2098  (void *) op, GNUNET_h2s (hash));
2099  ev = GNUNET_MQ_msg_header_extra (demands,
2100  sizeof (struct GNUNET_HashCode),
2102  GNUNET_memcpy (&demands[1],
2103  hash,
2104  sizeof (struct GNUNET_HashCode));
2105  GNUNET_MQ_send (op->mq, ev);
2106  }
2107  GNUNET_CADET_receive_done (op->channel);
2108 }
#define LOG(kind,...)
struct Set * set
Set associated with the operation, NULL until the spec has been associated with a set...
int _GSS_is_element_of_operation(struct ElementEntry *ee, struct Operation *op)
Is element ee part of the set used by op?
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
int GNUNET_CONTAINER_multihashmap_contains(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Check if the map contains any value under the given key (including values that are NULL)...
void * GNUNET_CONTAINER_multihashmap_get(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Given a key find a value in the map matching the key.
#define GNUNET_memcpy(dst, src, n)
, &#39; bother checking if a value already exists (faster than GNUNET_CONTAINER_MULTIHASHMAPOPTION_...
Information about an element element in the set.
A 512-bit hashcode.
#define GNUNET_MQ_msg_header_extra(mh, esize, type)
Allocate a GNUNET_MQ_Envelope, where the message only consists of a header and extra space...
Definition: gnunet_mq_lib.h:88
Operation context used to execute a set operation.
int GNUNET_CONTAINER_multihashmap_put(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
void GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel)
Send an ack on the channel to confirm the processing of a message.
Definition: cadet_api.c:973
struct GNUNET_CONTAINER_MultiHashMap * elements
Maps struct GNUNET_HashCode * to struct ElementEntry *.
Header for all communications.
#define GNUNET_YES
Definition: gnunet_common.h:80
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:353
struct GNUNET_CONTAINER_MultiHashMap * demanded_hashes
Hashes for elements that we have demanded from the other peer.
struct OperationState * state
Operation-specific operation state.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
#define GNUNET_MESSAGE_TYPE_SET_UNION_P2P_DEMAND
Demand the whole element from the other peer, given only the hash code.
struct SetContent * content
Content, possibly shared by multiple sets, and thus reference counted.
Here is the call graph for this function:

◆ handle_union_p2p_done()

void handle_union_p2p_done ( void *  cls,
const struct GNUNET_MessageHeader mh 
)

Handle a done message from a remote peer.

Parameters
clsthe union operation
mhthe message

Definition at line 2118 of file gnunet-service-set_union.c.

References Operation::channel, fail_union_operation(), GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_SET_OPERATION_UNION, LOG, maybe_finish(), op, Set::operation, OperationState::phase, PHASE_FINISH_CLOSING, PHASE_FINISH_WAITING, PHASE_INVENTORY_ACTIVE, PHASE_INVENTORY_PASSIVE, Operation::set, and Operation::state.

2120 {
2121  struct Operation *op = cls;
2122 
2124  {
2125  GNUNET_break_op (0);
2126  fail_union_operation (op);
2127  return;
2128  }
2129  switch (op->state->phase)
2130  {
2132  /* We got all requests, but still have to send our elements in response. */
2134 
2136  "got DONE (as passive partner), waiting for our demands to be satisfied\n");
2137  /* The active peer is done sending offers
2138  * and inquiries. This means that all
2139  * our responses to that (demands and offers)
2140  * must be in flight (queued or in mesh).
2141  *
2142  * We should notify the active peer once
2143  * all our demands are satisfied, so that the active
2144  * peer can quit if we gave it everything.
2145  */
2147  maybe_finish (op);
2148  return;
2151  "got DONE (as active partner), waiting to finish\n");
2152  /* All demands of the other peer are satisfied,
2153  * and we processed all offers, thus we know
2154  * exactly what our demands must be.
2155  *
2156  * We'll close the channel
2157  * to the other peer once our demands are met.
2158  */
2161  maybe_finish (op);
2162  return;
2163  default:
2164  GNUNET_break_op (0);
2165  fail_union_operation (op);
2166  return;
2167  }
2168 }
The other peer is decoding the IBF we just sent.
#define LOG(kind,...)
struct Set * set
Set associated with the operation, NULL until the spec has been associated with a set...
We are decoding an IBF.
struct GNUNET_CADET_Channel * channel
Channel to the peer.
The protocol is almost finished, but we still have to flush our message queue and/or expect some elem...
In the penultimate phase, we wait until all our demands are satisfied.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
enum IntersectionOperationPhase phase
Current state of the operation.
static void fail_union_operation(struct Operation *op)
Inform the client that the union operation has failed, and proceed to destroy the evaluate operation...
enum GNUNET_SET_OperationType operation
Type of operation supported for this set.
Operation context used to execute a set operation.
void GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel)
Send an ack on the channel to confirm the processing of a message.
Definition: cadet_api.c:973
static void maybe_finish(struct Operation *op)
Tests if the operation is finished, and if so notify.
struct OperationState * state
Operation-specific operation state.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:139
Set union, return all elements that are in at least one of the sets.
Here is the call graph for this function:

◆ handle_union_p2p_over()

void handle_union_p2p_over ( void *  cls,
const struct GNUNET_MessageHeader mh 
)

Handle an over message from a remote peer.

Parameters
clsthe union operation
mhthe message

Handle an over message from a remote peer.

Parameters
clsthe union operation
mhthe message

Definition at line 2177 of file gnunet-service-set_union.c.

References send_client_done().

2179 {
2180  send_client_done (cls);
2181 }
static void send_client_done(void *cls)
Signal to the client that the operation has finished and destroy the operation.
Here is the call graph for this function: