123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- /*
- This file is part of GNUnet
- Copyright (C) 2013-2017 GNUnet e.V.
- GNUnet is free software: you can redistribute it and/or modify it
- under the terms of the GNU Affero General Public License as published
- by the Free Software Foundation, either version 3 of the License,
- or (at your option) any later version.
- GNUnet is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- SPDX-License-Identifier: AGPL3.0-or-later
- */
- /**
- * @file set/gnunet-service-set_union.h
- * @brief two-peer set operations
- * @author Florian Dold
- * @author Christian Grothoff
- */
- #ifndef GNUNET_SERVICE_SET_UNION_H
- #define GNUNET_SERVICE_SET_UNION_H
- #include "gnunet-service-set.h"
- #include "gnunet-service-set_protocol.h"
- /**
- * Handle a strata estimator from a remote peer
- *
- * @param cls the union operation
- * @param msg the message
- */
- int
- check_union_p2p_strata_estimator (void *cls,
- const struct StrataEstimatorMessage *msg);
- /**
- * Handle a strata estimator from a remote peer
- *
- * @param cls the union operation
- * @param msg the message
- */
- void
- handle_union_p2p_strata_estimator (void *cls,
- const struct StrataEstimatorMessage *msg);
- /**
- * Check an IBF message from a remote peer.
- *
- * Reassemble the IBF from multiple pieces, and
- * process the whole IBF once possible.
- *
- * @param cls the union operation
- * @param msg the header of the message
- * @return #GNUNET_OK if @a msg is well-formed
- */
- int
- check_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.
- *
- * @param cls the union operation
- * @param msg the header of the message
- */
- void
- handle_union_p2p_ibf (void *cls,
- const struct IBFMessage *msg);
- /**
- * Check an element message from a remote peer.
- *
- * @param cls the union operation
- * @param emsg the message
- */
- int
- check_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.
- *
- * @param cls the union operation
- * @param emsg the message
- */
- void
- handle_union_p2p_elements (void *cls,
- const struct GNUNET_SET_ElementMessage *emsg);
- /**
- * Check a full element message from a remote peer.
- *
- * @param cls the union operation
- * @param emsg the message
- */
- int
- check_union_p2p_full_element (void *cls,
- const struct GNUNET_SET_ElementMessage *emsg);
- /**
- * Handle an element message from a remote peer.
- *
- * @param cls the union operation
- * @param emsg the message
- */
- void
- handle_union_p2p_full_element (void *cls,
- const struct GNUNET_SET_ElementMessage *emsg);
- /**
- * Send offers (for GNUNET_Hash-es) in response
- * to inquiries (for IBF_Key-s).
- *
- * @param cls the union operation
- * @param msg the message
- */
- 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).
- *
- * @param cls the union operation
- * @param msg the message
- */
- void
- handle_union_p2p_inquiry (void *cls,
- const struct InquiryMessage *msg);
- /**
- * Handle a request for full set transmission.
- *
- * @parem cls closure, a set union operation
- * @param mh the demand message
- */
- void
- handle_union_p2p_request_full (void *cls,
- const struct GNUNET_MessageHeader *mh);
- /**
- * Handle a "full done" message.
- *
- * @parem cls closure, a set union operation
- * @param mh the demand message
- */
- void
- handle_union_p2p_full_done (void *cls,
- const struct GNUNET_MessageHeader *mh);
- /**
- * Check a demand by the other peer for elements based on a list
- * of `struct GNUNET_HashCode`s.
- *
- * @parem cls closure, a set union operation
- * @param mh the demand message
- * @return #GNUNET_OK if @a mh is well-formed
- */
- int
- check_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_HashCode`s.
- *
- * @parem cls closure, a set union operation
- * @param mh the demand message
- */
- void
- handle_union_p2p_demand (void *cls,
- const struct GNUNET_MessageHeader *mh);
- /**
- * Check offer (of `struct GNUNET_HashCode`s).
- *
- * @param cls the union operation
- * @param mh the message
- * @return #GNUNET_OK if @a mh is well-formed
- */
- int
- check_union_p2p_offer (void *cls,
- const struct GNUNET_MessageHeader *mh);
- /**
- * Handle offers (of `struct GNUNET_HashCode`s) and
- * respond with demands (of `struct GNUNET_HashCode`s).
- *
- * @param cls the union operation
- * @param mh the message
- */
- void
- handle_union_p2p_offer (void *cls,
- const struct GNUNET_MessageHeader *mh);
- /**
- * Handle a done message from a remote peer
- *
- * @param cls the union operation
- * @param mh the message
- */
- void
- handle_union_p2p_done (void *cls,
- const struct GNUNET_MessageHeader *mh);
- /**
- * Handle an over message from a remote peer
- *
- * @param cls the union operation
- * @param mh the message
- */
- void
- handle_union_p2p_over (void *cls,
- const struct GNUNET_MessageHeader *mh);
- #endif
|