[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r19106 - gnunet/src/ats
From: |
gnunet |
Subject: |
[GNUnet-SVN] r19106 - gnunet/src/ats |
Date: |
Thu, 12 Jan 2012 14:23:14 +0100 |
Author: wachs
Date: 2012-01-12 14:23:14 +0100 (Thu, 12 Jan 2012)
New Revision: 19106
Added:
gnunet/src/ats/gnunet-service-ats_addresses_mlp.c
gnunet/src/ats/gnunet-service-ats_addresses_mlp.h
Modified:
gnunet/src/ats/Makefile.am
gnunet/src/ats/gnunet-service-ats_addresses.c
Log:
- fundamentals for mlp implementation
Modified: gnunet/src/ats/Makefile.am
===================================================================
--- gnunet/src/ats/Makefile.am 2012-01-12 12:56:04 UTC (rev 19105)
+++ gnunet/src/ats/Makefile.am 2012-01-12 13:23:14 UTC (rev 19106)
@@ -15,6 +15,7 @@
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
@@ -37,6 +38,7 @@
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
Modified: gnunet/src/ats/gnunet-service-ats_addresses.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses.c 2012-01-12 12:56:04 UTC
(rev 19105)
+++ gnunet/src/ats/gnunet-service-ats_addresses.c 2012-01-12 13:23:14 UTC
(rev 19106)
@@ -28,6 +28,7 @@
#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"
@@ -506,6 +507,7 @@
break;
#else
ats_mode = MLP;
+ GAS_mlp_init ();
#endif
break;
/* MLP = NO */
@@ -560,6 +562,10 @@
GAS_addresses_destroy_all ();
GNUNET_CONTAINER_multihashmap_destroy (addresses);
addresses = NULL;
+ if (ats_mode == MLP)
+ {
+ GAS_mlp_done ();
+ }
}
Added: gnunet/src/ats/gnunet-service-ats_addresses_mlp.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses_mlp.c
(rev 0)
+++ gnunet/src/ats/gnunet-service-ats_addresses_mlp.c 2012-01-12 13:23:14 UTC
(rev 19106)
@@ -0,0 +1,56 @@
+/*
+ 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 */
Added: gnunet/src/ats/gnunet-service-ats_addresses_mlp.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses_mlp.h
(rev 0)
+++ gnunet/src/ats/gnunet-service-ats_addresses_mlp.h 2012-01-12 13:23:14 UTC
(rev 19106)
@@ -0,0 +1,61 @@
+/*
+ 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 */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r19106 - gnunet/src/ats,
gnunet <=