changeset 251:e489577dda1a

Added structure for debug routing extension
author Sebastien Decugis <sdecugis@nict.go.jp>
date Fri, 05 Dec 2008 11:56:02 +0900
parents b1a387363d95
children 4bce2b5ab708
files configure.ac extensions/Makefile.am extensions/rt_debug/Makefile.am extensions/rt_debug/rt_debug.c
diffstat 4 files changed, 81 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Fri Dec 05 11:55:12 2008 +0900
+++ b/configure.ac	Fri Dec 05 11:56:02 2008 +0900
@@ -236,6 +236,7 @@
 AC_CONFIG_FILES([extensions/sample/Makefile])
 AC_CONFIG_FILES([extensions/sec_nosec/Makefile])
 AC_CONFIG_FILES([extensions/sec_tls_gnutls/Makefile])
+AC_CONFIG_FILES([extensions/rt_debug/Makefile])
 # Create these files from these files.in (created by automake from .am if any)
 # Contains all definitions made with AC_SUBST
 # AC_SUBST([XYZ]) are replaced into @XYZ@ in the files.
--- a/extensions/Makefile.am	Fri Dec 05 11:55:12 2008 +0900
+++ b/extensions/Makefile.am	Fri Dec 05 11:56:02 2008 +0900
@@ -15,3 +15,10 @@
 if !NOGNUTLS
 SUBDIRS += sec_tls_gnutls
 endif
+
+
+#######################
+# Routing  extensions #
+#######################
+SUBDIRS += rt_debug
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extensions/rt_debug/Makefile.am	Fri Dec 05 11:56:02 2008 +0900
@@ -0,0 +1,8 @@
+
+pkglib_LTLIBRARIES = rt_debug.la
+rt_debug_la_SOURCES = rt_debug.c 
+rt_debug_la_LDFLAGS = -module
+
+# Location of the API headers:
+AM_CPPFLAGS = -I$(srcdir)/../../include
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extensions/rt_debug/rt_debug.c	Fri Dec 05 11:56:02 2008 +0900
@@ -0,0 +1,65 @@
+/*********************************************************************************************************
+* Software License Agreement (BSD License)                                                               *
+* Author: Sebastien Decugis <sdecugis@nict.go.jp>							 *
+*													 *
+* Copyright (c) 2008, WIDE Project and NICT								 *
+* All rights reserved.											 *
+* 													 *
+* Redistribution and use of this software in source and binary forms, with or without modification, are  *
+* permitted provided that the following conditions are met:						 *
+* 													 *
+* * Redistributions of source code must retain the above 						 *
+*   copyright notice, this list of conditions and the 							 *
+*   following disclaimer.										 *
+*    													 *
+* * Redistributions in binary form must reproduce the above 						 *
+*   copyright notice, this list of conditions and the 							 *
+*   following disclaimer in the documentation and/or other						 *
+*   materials provided with the distribution.								 *
+* 													 *
+* * Neither the name of the WIDE Project or NICT nor the 						 *
+*   names of its contributors may be used to endorse or 						 *
+*   promote products derived from this software without 						 *
+*   specific prior written permission of WIDE Project and 						 *
+*   NICT.												 *
+* 													 *
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED *
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
+* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
+* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 	 *
+* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 	 *
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR *
+* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF   *
+* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.								 *
+*********************************************************************************************************/
+
+/* 
+ * Debug-only extension for routing module; will simply install a callback for all kind of
+ * routing callbacks and show the content of the message.
+ */
+
+#define IN_EXTENSION
+#define DECLARE_API_POINTERS
+#include <waaad/waaad.h>
+
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+
+static int log_this_message(msg_t * msg)
+{
+	
+	return 0;
+}
+
+
+
+
+static int entry(char * conffile)
+{
+	int ret = log_this_message(NULL);
+	
+	return ret;
+}
+
+EXTENSION_API_INIT(API_MODULE_MSG | API_MODULE_RT | API_MODULE_LOG, entry, "rt_debug");
"Welcome to our mercurial repository"