* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
- * $Id: kernel_routes.c,v 1.2 2004/11/15 12:18:49 tlopatic Exp $
+ * $Id: kernel_routes.c,v 1.3 2004/11/20 15:40:52 tlopatic Exp $
*
*/
{
return 0;
}
-
-int add_tunnel_route(union olsr_ip_addr *gw)
-{
- return 0;
-}
-
-int delete_tunnel_route()
-{
- return 0;
-}
-
--- /dev/null
+/*
+ * OLSR ad-hoc routing table management protocol
+ * Copyright (C) 2004 Thomas Lopatic (thomas@lopatic.de)
+ *
+ * This file is part of the olsr.org OLSR daemon.
+ *
+ * olsr.org 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 2 of the License, or
+ * (at your option) any later version.
+ *
+ * olsr.org 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 olsr.org; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: misc.h,v 1.1 2004/11/20 15:40:52 tlopatic Exp $
+ *
+ */
+
+void clear_console(void);
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
- * $Id: olsr.c,v 1.22 2004/11/15 15:50:08 tlopatic Exp $
+ * $Id: olsr.c,v 1.23 2004/11/20 15:40:52 tlopatic Exp $
*
*/
#include "scheduler.h"
#include "generate_msg.h"
#include "apm.h"
+#include "misc.h"
#include <stdarg.h>
#include <signal.h>
!changes_hna)
return;
+ if (olsr_cnf->debug_level > 0)
+ {
+ clear_console();
+ printf("<<<< %s (%s) >>>>\n", SOFTWARE_VERSION, __DATE__);
+ }
+
if(changes_neighborhood)
{
/* Calculate new mprs, HNA and routing table */
--- /dev/null
+/*
+ * OLSR ad-hoc routing table management protocol
+ * Copyright (C) 2004 Thomas Lopatic (thomas@lopatic.de)
+ *
+ * This file is part of the olsr.org OLSR daemon.
+ *
+ * olsr.org 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 2 of the License, or
+ * (at your option) any later version.
+ *
+ * olsr.org 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 olsr.org; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: misc.c,v 1.1 2004/11/20 15:40:52 tlopatic Exp $
+ *
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+
+void clear_console(void)
+{
+ FILE *pipe;
+ static int first_time = 1;
+ static char clear_buff[100];
+ static int len = 0;
+ int c;
+ int i;
+
+ if (first_time != 0)
+ {
+ first_time = 0;
+
+ pipe = popen("clear", "r");
+
+ for (len = 0; len < sizeof (clear_buff); len++)
+ {
+ c = fgetc(pipe);
+
+ if (c == EOF)
+ break;
+
+ clear_buff[len] = (char)c;
+ }
+
+ pclose(pipe);
+ }
+
+ for (i = 0; i < len; i++)
+ fputc(clear_buff[i], stdout);
+
+ fflush(stdout);
+}
* along with olsr.org; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: kernel_routes.c,v 1.9 2004/11/14 20:48:03 tlopatic Exp $
+ * $Id: kernel_routes.c,v 1.10 2004/11/20 15:40:52 tlopatic Exp $
*
*/
{
return 0;
}
-
-// XXX - to be implemented
-
-int delete_tunnel_route()
-{
- return 0;
-}
--- /dev/null
+/*
+ * OLSR ad-hoc routing table management protocol
+ * Copyright (C) 2004 Thomas Lopatic (thomas@lopatic.de)
+ *
+ * This file is part of the olsr.org OLSR daemon.
+ *
+ * olsr.org 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 2 of the License, or
+ * (at your option) any later version.
+ *
+ * olsr.org 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 olsr.org; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: misc.c,v 1.1 2004/11/20 15:40:52 tlopatic Exp $
+ *
+ */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef interface
+
+void clear_console(void)
+{
+ HANDLE Hand;
+ CONSOLE_SCREEN_BUFFER_INFO Info;
+ unsigned long Written;
+ static COORD Home = { 0, 0 };
+
+ Hand = GetStdHandle(STD_OUTPUT_HANDLE);
+
+ if (Hand == INVALID_HANDLE_VALUE)
+ return;
+
+ if(!GetConsoleScreenBufferInfo(Hand, &Info))
+ return;
+
+ if(!FillConsoleOutputCharacter(Hand, ' ',
+ Info.dwSize.X * Info.dwSize.Y, Home,
+ &Written))
+ return;
+
+ if(!FillConsoleOutputAttribute(Hand, Info.wAttributes,
+ Info.dwSize.X * Info.dwSize.Y, Home,
+ &Written))
+ return;
+
+ SetConsoleCursorPosition(Hand, Home);
+}