if HAVE_LIBGLPK
GN_LIBGLPK = -lglpk
+ GN_MLP_SRC = gnunet-service-ats_addresses_mlp.c gnunet-service-ats_addresses_mlp.h
endif
lib_LTLIBRARIES = libgnunetats.la
gnunet_service_ats_SOURCES = \
gnunet-service-ats.c gnunet-service-ats.h\
gnunet-service-ats_addresses.c gnunet-service-ats_addresses.h \
+ $(GN_MLP_SRC) \
gnunet-service-ats_performance.c gnunet-service-ats_performance.h \
gnunet-service-ats_scheduling.c gnunet-service-ats_scheduling.h \
gnunet-service-ats_reservations.c gnunet-service-ats_reservations.h
#include "gnunet_ats_service.h"
#include "gnunet-service-ats.h"
#include "gnunet-service-ats_addresses.h"
+#include "gnunet-service-ats_addresses_mlp.h"
#include "gnunet-service-ats_performance.h"
#include "gnunet-service-ats_scheduling.h"
#include "gnunet-service-ats_reservations.h"
break;
#else
ats_mode = MLP;
+ GAS_mlp_init ();
#endif
break;
/* MLP = NO */
GAS_addresses_destroy_all ();
GNUNET_CONTAINER_multihashmap_destroy (addresses);
addresses = NULL;
+ if (ats_mode == MLP)
+ {
+ GAS_mlp_done ();
+ }
}
--- /dev/null
+/*
+ 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_mlp.c
+ * @brief ats mlp problem solver
+ * @author Matthias Wachs
+ * @author Christian Grothoff
+ */
+#include "platform.h"
+#include "gnunet_util_lib.h"
+#include "gnunet-service-ats_addresses_mlp.h"
+#if HAVE_LIBGLPK
+#include "glpk.h"
+#endif
+
+struct GAS_MLP_Handle *GAS_mlp;
+
+/**
+ * Init the MLP problem solving component
+ */
+void
+GAS_mlp_init ()
+{
+ GAS_mlp = GNUNET_malloc (sizeof (struct GAS_MLP_Handle));
+ GAS_mlp->prob = NULL;
+}
+
+/**
+ * Shutdown the MLP problem solving component
+ */
+void
+GAS_mlp_done ()
+{
+ GNUNET_free (GAS_mlp);
+}
+
+
+/* end of gnunet-service-ats_addresses_mlp.c */
--- /dev/null
+/*
+ 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_mlp.h
+ * @brief ats mlp problem solver
+ * @author Matthias Wachs
+ * @author Christian Grothoff
+ */
+#include "platform.h"
+#if HAVE_LIBGLPK
+#include "glpk.h"
+#endif
+
+#ifndef GNUNET_SERVICE_ATS_ADDRESSES_MLP_H
+#define GNUNET_SERVICE_ATS_ADDRESSES_MLP_H
+
+struct GAS_MLP_Handle
+{
+ /**
+ * GLPK (MLP) problem object
+ */
+#if HAVE_LIBGLPK
+ glp_prob *prob;
+#else
+ void *prob;
+#endif
+
+};
+
+/**
+ * Init the MLP problem solving component
+ */
+void
+GAS_mlp_init ();
+
+/**
+ * Shutdown the MLP problem solving component
+ */
+void
+GAS_mlp_done ();
+
+#endif
+/* end of gnunet-service-ats_addresses_mlp.h */