From 026bfdef366253645c5bea8bed130a0f6900be77 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 7 Oct 2011 10:53:18 +0000 Subject: [PATCH] hxing --- src/core/gnunet-service-core-new.c | 127 +------------------------ src/core/gnunet-service-core.h | 5 +- src/core/gnunet-service-core_typemap.c | 5 +- 3 files changed, 9 insertions(+), 128 deletions(-) diff --git a/src/core/gnunet-service-core-new.c b/src/core/gnunet-service-core-new.c index 94783ecee..d094817a0 100644 --- a/src/core/gnunet-service-core-new.c +++ b/src/core/gnunet-service-core-new.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - (C) 2009, 2010 Christian Grothoff (and other contributing authors) + (C) 2009, 2010, 2011 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 @@ -22,25 +22,9 @@ * @file core/gnunet-service-core.c * @brief high-level P2P messaging * @author Christian Grothoff - * - * Type map implementation: - * - track type maps for neighbours (can wait) - * - only notify clients about peers with matching type maps (can wait) - * - * Considerations for later: - * - check that hostkey used by transport (for HELLOs) is the - * same as the hostkey that we are using! */ #include "platform.h" -#include -#include "gnunet_constants.h" #include "gnunet_util_lib.h" -#include "gnunet_hello_lib.h" -#include "gnunet_peerinfo_service.h" -#include "gnunet_protocols.h" -#include "gnunet_signatures.h" -#include "gnunet_statistics_service.h" -#include "gnunet_transport_service.h" #include "gnunet-service-core.h" #include "gnunet-service-core_clients.h" #include "gnunet-service-core_kx.h" @@ -49,115 +33,6 @@ #include "gnunet-service-core_typemap.h" -#define DEBUG_HANDSHAKE GNUNET_EXTRA_LOGGING - -#define DEBUG_CORE_QUOTA GNUNET_EXTRA_LOGGING - -/** - * Receive and send buffer windows grow over time. For - * how long can 'unused' bandwidth accumulate before we - * need to cap it? (specified in seconds). - */ -#define MAX_WINDOW_TIME_S (5 * 60) - -/** - * How many messages do we queue up at most for optional - * notifications to a client? (this can cause notifications - * about outgoing messages to be dropped). - */ -#define MAX_NOTIFY_QUEUE 1024 - -/** - * Minimum bandwidth (out) to assign to any connected peer. - * Should be rather low; values larger than DEFAULT_BW_IN_OUT make no - * sense. - */ -#define MIN_BANDWIDTH_PER_PEER GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT - -/** - * After how much time past the "official" expiration time do - * we discard messages? Should not be zero since we may - * intentionally defer transmission until close to the deadline - * and then may be slightly past the deadline due to inaccuracy - * in sleep and our own CPU consumption. - */ -#define PAST_EXPIRATION_DISCARD_TIME GNUNET_TIME_UNIT_SECONDS - -/** - * What is the maximum delay for a SET_KEY message? - */ -#define MAX_SET_KEY_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) - -/** - * How long do we wait for SET_KEY confirmation initially? - */ -#define INITIAL_SET_KEY_RETRY_FREQUENCY GNUNET_TIME_relative_multiply (MAX_SET_KEY_DELAY, 1) - -/** - * What is the maximum delay for a PING message? - */ -#define MAX_PING_DELAY GNUNET_TIME_relative_multiply (MAX_SET_KEY_DELAY, 2) - -/** - * What is the maximum delay for a PONG message? - */ -#define MAX_PONG_DELAY GNUNET_TIME_relative_multiply (MAX_PING_DELAY, 2) - -/** - * What is the minimum frequency for a PING message? - */ -#define MIN_PING_FREQUENCY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) - -/** - * How often do we recalculate bandwidth quotas? - */ -#define QUOTA_UPDATE_FREQUENCY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) - -/** - * What is the priority for a SET_KEY message? - */ -#define SET_KEY_PRIORITY 0xFFFFFF - -/** - * What is the priority for a PING message? - */ -#define PING_PRIORITY 0xFFFFFF - -/** - * What is the priority for a PONG message? - */ -#define PONG_PRIORITY 0xFFFFFF - -/** - * How many messages do we queue per peer at most? Must be at - * least two. - */ -#define MAX_PEER_QUEUE_SIZE 16 - -/** - * How many non-mandatory messages do we queue per client at most? - */ -#define MAX_CLIENT_QUEUE_SIZE 32 - -/** - * What is the maximum age of a message for us to consider - * processing it? Note that this looks at the timestamp used - * by the other peer, so clock skew between machines does - * come into play here. So this should be picked high enough - * so that a little bit of clock skew does not prevent peers - * from connecting to us. - */ -#define MAX_MESSAGE_AGE GNUNET_TIME_UNIT_DAYS - - - -/** - * Number of bytes (at the beginning) of "struct EncryptedMessage" - * that are NOT encrypted. - */ -#define ENCRYPTED_HEADER_SIZE (offsetof(struct EncryptedMessage, sequence_number)) - - /** * Our identity. */ diff --git a/src/core/gnunet-service-core.h b/src/core/gnunet-service-core.h index 5153640ea..9068e7c3d 100644 --- a/src/core/gnunet-service-core.h +++ b/src/core/gnunet-service-core.h @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - (C) 2009, 2010 Christian Grothoff (and other contributing authors) + (C) 2009, 2010, 2011 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 @@ -26,8 +26,11 @@ #ifndef GNUNET_SERVICE_CORE_H #define GNUNET_SERVICE_CORE_H +#include "gnunet_statistics_service.h" +#define DEBUG_CORE GNUNET_EXTRA_LOGGING + /** * Opaque handle to a client. */ diff --git a/src/core/gnunet-service-core_typemap.c b/src/core/gnunet-service-core_typemap.c index 079611de6..0ef9a6236 100644 --- a/src/core/gnunet-service-core_typemap.c +++ b/src/core/gnunet-service-core_typemap.c @@ -26,7 +26,10 @@ #include "platform.h" #include "gnunet_util_lib.h" #include "gnunet_transport_service.h" -#include "gnunet_service_core.h" +#include "gnunet-service-core.h" +#include "gnunet-service-core_sessions.h" +#include "gnunet-service-core_typemap.h" +#include /** -- 2.25.1