aboutsummaryrefslogtreecommitdiff
path: root/src/ats/gnunet-service-ats_addresses_simplistic.h
blob: dcaf27b46a1e5e75ce80c323f0976ebb8b81f325 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
     This file is part of GNUnet.
     (C) 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
     by the Free Software Foundation; either version 3, 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 ats/gnunet-service-ats_addresses_simplistic.h
 * @brief ats mlp problem solver
 * @author Matthias Wachs
 * @author Christian Grothoff
 */
#include "platform.h"
#include "gnunet_statistics_service.h"
#include "gnunet-service-ats_addresses.h"

struct GAS_SIMPLISTIC_Handle;

/**
 * Init the simplistic problem solving component
 *
 * @param cfg configuration handle
 * @param stats the GNUNET_STATISTICS handle
 * @return struct GAS_SIMPLISTIC_Handle * on success, NULL on fail
 */
struct GAS_SIMPLISTIC_Handle *
GAS_simplistic_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
                     const struct GNUNET_STATISTICS_Handle *stats);

/**
 * Shutdown the simplistic problem solving component
 */
void
GAS_simplistic_done (struct GAS_SIMPLISTIC_Handle *);


/**
 * Updates a single address
 *
 * @param solver the solver Handle
 * @param addresses the address hashmap
 *        the address has to be already removed from the hashmap
 * @param address the address to update
 */
void
GAS_simplistic_address_update (struct GAS_SIMPLISTIC_Handle *solver, struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address);

/**
 * Changes the preferences for a peer in the  problem
 *
 * @param solver the solver handle
 * @param peer the peer
 * @param kind the kind to change the preference
 * @param score the score
 */
void
GAS_simplistic_address_change_preference (struct GAS_SIMPLISTIC_Handle *solver,
                                   const struct GNUNET_PeerIdentity *peer,
                                   enum GNUNET_ATS_PreferenceKind kind,
                                   float score);


/* end of gnunet-service-ats_addresses_simplistic.h */