From bd742f26f08fed45b48eeb1567447acd7a77d350 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Thu, 16 Feb 2012 14:21:22 +0000 Subject: - added makefile, borrowed lots of code from dht for client handling --- src/gns/gns.h | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 src/gns/gns.h (limited to 'src/gns/gns.h') diff --git a/src/gns/gns.h b/src/gns/gns.h new file mode 100644 index 000000000..e35df7858 --- /dev/null +++ b/src/gns/gns.h @@ -0,0 +1,93 @@ +/* + This file is part of GNUnet + (C) 2012 Christian Grothoff (and other contributing authors) + + GNUnet is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNUnet; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + */ + +/** + * @file gns/gns.h + * @brief IPC messages between GNS API and GNS service + * @author Martin Schanzenbach + */ +#ifndef GNS_H +#define GNS_H + +GNUNET_NETWORK_STRUCT_BEGIN + + +/** + * Message from client to GNS service to lookup records. + */ +struct GNUNET_GNS_ClientLookupMessage +{ + /** + * Header of type GNUNET_MESSAGE_TYPE_GNS_CLIENT_LOOKUP + */ + struct GNUNET_MessageHeader header; + + /** + * Unique identifier for this request (for key collisions). + */ + uint64_t unique_id; + + /** + * the type of record to look up + */ + int type; + + /** + * Length of name to lookup + */ + uint32_t namelen; + + /* Followed by the name to look up */ +}; + + +/** + * Message from GNS service to client: new results. + */ +struct GNUNET_GNS_ClientResultMessage +{ + /** + * Header of type GNUNET_MESSAGE_TYPE_GNS_CLIENT_RESULT + */ + struct GNUNET_MessageHeader header; + + /** + * Unique identifier for this request (for key collisions). + */ + uint64_t unique_id; + + /** + * A key. TODO some uid + */ + GNUNET_HashCode key; + + /** + * The number of records contained in response + */ + uint32_t num_records; + + /* followed by num_records GNUNET_GNS_Records*/ + +}; + + +GNUNET_NETWORK_STRUCT_END + +#endif -- cgit v1.2.3