diff options
author | Chris Hall <GMCH@hestia.halldom.com> | 2010-04-17 16:11:13 +0100 |
---|---|---|
committer | Chris Hall <GMCH@hestia.halldom.com> | 2010-04-17 16:11:13 +0100 |
commit | 825f338d44433fc2d351c08d41272f52a15329db (patch) | |
tree | 927c6a37e8dbf4c425d845895500b59ac997fbfb /zebra/if_proc.c | |
parent | 68297cc9dc2eb920dd6e956d0d55098ea9edaafc (diff) | |
download | quagga-825f338d44433fc2d351c08d41272f52a15329db.tar.bz2 quagga-825f338d44433fc2d351c08d41272f52a15329db.tar.xz |
Fixing declarations to eliminate compiler warnings in zebra.
Only parts of zebra/*.c are compiled and linked, depending on what
was chosen at "configure" time. A subset of that is compiled and
linked for testzebra.
Some things were not declared, or not declared everywhere they
were required... leading to a number of compiler warnings.
These changes are intended to tidy that up.
Diffstat (limited to 'zebra/if_proc.c')
-rw-r--r-- | zebra/if_proc.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/zebra/if_proc.c b/zebra/if_proc.c index 3aec530b..bb83b993 100644 --- a/zebra/if_proc.c +++ b/zebra/if_proc.c @@ -19,6 +19,16 @@ * 02111-1307, USA. */ +/* This is compiled and linked if found to be required at "configure" time. + * + * HAVE_PROC_NET_DEV => /proc/net/dev exists + * HAVE_PROC_NET_IF_INET6 => /proc/net/if_inet6 exists + * + * One or both of this will be the case if this is being compiled. + * + * Appears NOT to be used if netlink is available. + */ + #include <zebra.h> #include "if.h" @@ -29,6 +39,16 @@ #include "zebra/connected.h" #include "zebra/interface.h" +/* zebra/interface.h declares the extern functions for if_proc.c + * + * The following are not declared if HAVE_PROC_NET_DEV is not defined. + * So declare them here if required, in order to suppress warnings. + */ +#ifndef HAVE_PROC_NET_DEV +extern void ifstat_update_proc (void); +extern int interface_list_proc (void); +#endif + /* Proc filesystem one line buffer. */ #define PROCBUFSIZ 1024 @@ -123,8 +143,8 @@ ifstat_dev_fields (int version, char *buf, struct interface *ifp) } /* Update interface's statistics. */ -void -ifstat_update_proc (void) +extern void +ifstat_update_proc (void) /* declared in interface.h */ { FILE *fp; char buf[PROCBUFSIZ]; @@ -166,8 +186,8 @@ ifstat_update_proc (void) } /* Interface structure allocation by proc filesystem. */ -int -interface_list_proc () +extern int +interface_list_proc () /* declared in interface.h */ { FILE *fp; char buf[PROCBUFSIZ]; @@ -205,8 +225,8 @@ interface_list_proc () #define _PATH_PROC_NET_IF_INET6 "/proc/net/if_inet6" #endif /* _PATH_PROC_NET_IF_INET6 */ -int -ifaddr_proc_ipv6 () +extern int +ifaddr_proc_ipv6 () /* declared in interface.h */ { FILE *fp; char buf[PROCBUFSIZ]; |