summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Hall <GMCH@hestia.halldom.com>2010-04-16 13:20:15 +0100
committerChris Hall <GMCH@hestia.halldom.com>2010-04-16 13:20:15 +0100
commitd6f1bd7b60fc94488dc6a0493a6ec17346a03b2d (patch)
tree8e28278ad541429d029a874afc56a18c522df104
parenta4fd3b60cc59751abd189687ac9c6fe9e4fd89a0 (diff)
downloadquagga-d6f1bd7b60fc94488dc6a0493a6ec17346a03b2d.tar.bz2
quagga-d6f1bd7b60fc94488dc6a0493a6ec17346a03b2d.tar.xz
Compile all daemons, except vtysh, clean but with warnings.
Now compiles with all daemons enabled. Split command.h to separate out the functions whish are only used durring command execution -- that is, those used in vty.c and family and in vtysh.
-rw-r--r--lib/Makefile.am3
-rw-r--r--lib/command.c2
-rw-r--r--lib/command.h61
-rw-r--r--lib/command_execute.h79
-rw-r--r--lib/command_queue.c1
-rw-r--r--lib/vty_cli.c1
-rw-r--r--ospfd/ospf_vty.c1
-rw-r--r--ospfd/ospf_zebra.c4
-rw-r--r--ripd/rip_zebra.c1
9 files changed, 93 insertions, 60 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 09a2e3b8..e88c5998 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -36,7 +36,8 @@ pkginclude_HEADERS = \
command_queue.h qlib_init.h qafi_safi.h \
confirm.h miyagi.h pthread_safe.h list_util.h node_type.h uty.h \
vty_io.h vty_cli.h keystroke.h qstring.h vio_fifo.h vio_lines.h \
- qiovec.h qfstring.h errno_names.h
+ qiovec.h qfstring.h errno_names.h \
+ route_types.h command_execute.h
EXTRA_DIST = regex.c regex-gnu.h memtypes.awk route_types.awk route_types.txt
diff --git a/lib/command.c b/lib/command.c
index f67d0f8b..6fe54d13 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -33,7 +33,7 @@ Boston, MA 02111-1307, USA. */
#include "uty.h"
#include "qstring.h"
#include "command.h"
-//#include "lib/route_types.h"
+#include "command_execute.h"
#include "workqueue.h"
#include "command_queue.h"
diff --git a/lib/command.h b/lib/command.h
index bd1ad99c..1c66c083 100644
--- a/lib/command.h
+++ b/lib/command.h
@@ -375,6 +375,11 @@ enum {
#endif /* HAVE_IPV6 */
/* Prototypes. */
+extern void cmd_init (int);
+extern void cmd_terminate (void);
+
+extern void print_version (const char *);
+
extern void install_node (struct cmd_node *, int (*) (struct vty *));
extern void install_default (enum node_type);
extern void install_element (enum node_type, struct cmd_element *);
@@ -385,63 +390,7 @@ extern void sort_node (void);
XMALLOC(MTYPE_TMP)). Returns NULL if shift >= argc. */
extern char *argv_concat (const char* const* argv, int argc, int shift);
-extern vector cmd_make_strvec (const char *);
-extern vector cmd_add_to_strvec (vector v, const char* str) ;
-extern void cmd_free_strvec (vector);
-extern vector cmd_describe_command (vector, int, int *status);
-extern vector cmd_complete_command (vector, int, int *status);
-extern const char *cmd_prompt (enum node_type);
-extern enum cmd_return_code
-config_from_file (struct vty* vty, FILE *fp, struct cmd_element* first_cmd,
- qstring buf, bool stop_on_warning) ;
-extern enum node_type node_parent (enum node_type);
-extern enum cmd_return_code cmd_execute_command (struct vty *vty,
- enum cmd_parse_type type, struct cmd_element **cmd) ;
-extern enum cmd_return_code cmd_execute_command_strict (struct vty *vty,
- enum cmd_parse_type type, struct cmd_element **cmd) ;
-
-extern cmd_parsed cmd_parse_init_new(cmd_parsed parsed) ;
-extern cmd_parsed cmd_parse_reset(cmd_parsed parsed, bool free_structure) ;
-extern enum cmd_return_code cmd_parse_command(struct vty* vty,
- enum cmd_parse_type type) ;
-extern enum cmd_return_code cmd_dispatch(struct vty* vty, bool no_queue) ;
-
-Inline enum cmd_return_code
-cmd_dispatch_call(struct vty* vty)
-{
- cmd_parsed parsed = vty->parsed ;
- return (*(parsed->cmd->func))(parsed->cmd, vty,
- vector_length(&parsed->vline),
- (const char * const*)vector_body(&parsed->vline)) ;
-} ;
-
-#define cmd_parse_reset_keep(parsed) cmd_parse_reset(parsed, 0)
-#define cmd_parse_reset_free(parsed) cmd_parse_reset(parsed, 1)
-
-extern void config_replace_string (struct cmd_element *, char *, ...);
-
-extern void cmd_init (int);
-extern void cmd_terminate (void);
-
-/* Export typical functions. */
-extern struct cmd_element config_end_cmd;
-extern struct cmd_element config_exit_cmd;
-extern struct cmd_element config_quit_cmd;
-extern struct cmd_element config_help_cmd;
-extern struct cmd_element config_list_cmd;
-extern char *host_config_file (void);
-extern void host_config_set (char *);
-
-extern void print_version (const char *);
-
/* struct host global, ick */
extern struct host host;
-/* "<cr>" global */
-extern char *command_cr;
-
-#ifdef QDEBUG
-extern const char *debug_banner;
-#endif
-
#endif /* _ZEBRA_COMMAND_H */
diff --git a/lib/command_execute.h b/lib/command_execute.h
new file mode 100644
index 00000000..a5a807c8
--- /dev/null
+++ b/lib/command_execute.h
@@ -0,0 +1,79 @@
+/*
+ * Zebra configuration command interface routine
+ * Copyright (C) 1997, 98 Kunihiro Ishiguro
+ *
+ * This file is part of GNU Zebra.
+ *
+ * GNU Zebra 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, or (at your
+ * option) any later version.
+ *
+ * GNU Zebra 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 GNU Zebra; see the file COPYING. If not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef _ZEBRA_COMMAND_EXECUTE_H
+#define _ZEBRA_COMMAND_EXECUTE_H
+
+#include "command.h"
+
+extern vector cmd_make_strvec (const char *);
+extern vector cmd_add_to_strvec (vector v, const char* str) ;
+extern void cmd_free_strvec (vector);
+extern vector cmd_describe_command (vector, int, int *status);
+extern vector cmd_complete_command (vector, int, int *status);
+extern const char *cmd_prompt (enum node_type);
+extern enum cmd_return_code
+config_from_file (struct vty* vty, FILE *fp, struct cmd_element* first_cmd,
+ qstring buf, bool stop_on_warning) ;
+extern enum node_type node_parent (enum node_type);
+extern enum cmd_return_code cmd_execute_command (struct vty *vty,
+ enum cmd_parse_type type, struct cmd_element **cmd) ;
+extern enum cmd_return_code cmd_execute_command_strict (struct vty *vty,
+ enum cmd_parse_type type, struct cmd_element **cmd) ;
+
+extern cmd_parsed cmd_parse_init_new(cmd_parsed parsed) ;
+extern cmd_parsed cmd_parse_reset(cmd_parsed parsed, bool free_structure) ;
+extern enum cmd_return_code cmd_parse_command(struct vty* vty,
+ enum cmd_parse_type type) ;
+extern enum cmd_return_code cmd_dispatch(struct vty* vty, bool no_queue) ;
+
+Inline enum cmd_return_code
+cmd_dispatch_call(struct vty* vty)
+{
+ cmd_parsed parsed = vty->parsed ;
+ return (*(parsed->cmd->func))(parsed->cmd, vty,
+ vector_length(&parsed->vline),
+ (const char * const*)vector_body(&parsed->vline)) ;
+} ;
+
+#define cmd_parse_reset_keep(parsed) cmd_parse_reset(parsed, 0)
+#define cmd_parse_reset_free(parsed) cmd_parse_reset(parsed, 1)
+
+extern void config_replace_string (struct cmd_element *, char *, ...);
+
+/* Export typical functions. */
+extern struct cmd_element config_end_cmd;
+extern struct cmd_element config_exit_cmd;
+extern struct cmd_element config_quit_cmd;
+extern struct cmd_element config_help_cmd;
+extern struct cmd_element config_list_cmd;
+extern char *host_config_file (void);
+extern void host_config_set (char *);
+
+/* "<cr>" global */
+extern char *command_cr;
+
+#ifdef QDEBUG
+extern const char *debug_banner;
+#endif
+
+#endif /* _ZEBRA_COMMAND_EXECUTE_H */
diff --git a/lib/command_queue.c b/lib/command_queue.c
index ea8ac469..18144844 100644
--- a/lib/command_queue.c
+++ b/lib/command_queue.c
@@ -25,6 +25,7 @@
#include "qpnexus.h"
#include "memory.h"
#include "command_queue.h"
+#include "command_execute.h"
#include "vty.h"
#include "uty.h"
#include "vector.h"
diff --git a/lib/vty_cli.c b/lib/vty_cli.c
index 53d64716..ff86b558 100644
--- a/lib/vty_cli.c
+++ b/lib/vty_cli.c
@@ -31,6 +31,7 @@
#include "vio_lines.h"
#include "command.h"
+#include "command_execute.h"
#include "command_queue.h"
#include "memory.h"
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index adc822a7..0401f38e 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -28,6 +28,7 @@
#include "table.h"
#include "vty.h"
#include "command.h"
+#include "lib/route_types.h"
#include "plist.h"
#include "log.h"
#include "zclient.h"
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index 6f0a71ff..513d04d9 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -1086,7 +1086,7 @@ ospf_prefix_list_update (struct prefix_list *plist)
{
/* Update filter-list in. */
if (PREFIX_NAME_IN (area))
- if (strcmp (PREFIX_NAME_IN (area), plist->name) == 0)
+ if (strcmp (PREFIX_NAME_IN (area), prefix_list_get_name(plist)) == 0)
{
PREFIX_LIST_IN (area) =
prefix_list_lookup (AFI_IP, PREFIX_NAME_IN (area));
@@ -1095,7 +1095,7 @@ ospf_prefix_list_update (struct prefix_list *plist)
/* Update filter-list out. */
if (PREFIX_NAME_OUT (area))
- if (strcmp (PREFIX_NAME_OUT (area), plist->name) == 0)
+ if (strcmp (PREFIX_NAME_OUT (area), prefix_list_get_name(plist)) == 0)
{
PREFIX_LIST_IN (area) =
prefix_list_lookup (AFI_IP, PREFIX_NAME_OUT (area));
diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c
index c476d8f4..326ea658 100644
--- a/ripd/rip_zebra.c
+++ b/ripd/rip_zebra.c
@@ -22,6 +22,7 @@
#include <zebra.h>
#include "command.h"
+#include "lib/route_types.h"
#include "prefix.h"
#include "stream.h"
#include "routemap.h"