mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 15:17:15 +00:00
[zebra] fix inconsistencies in ifstat_update_* declarations and definitions
2006-08-06 Paul Jakma <paul.jakma@sun.com> * interface.h: (ifstat_update_proc) declaration should match ifstat_update_sysctl really, which is to not return status, as such status is not used anywhere. * if_{proc,sysctl}.c: Make ifstat_update_* definitions and return values consistent with each other and their declarations, ie: (void) (*) (void).
This commit is contained in:
parent
1f742f21a9
commit
f28b0e57bd
@ -1,3 +1,12 @@
|
|||||||
|
2006-08-06 Paul Jakma <paul.jakma@sun.com>
|
||||||
|
|
||||||
|
* interface.h: (ifstat_update_proc) declaration should match
|
||||||
|
ifstat_update_sysctl really, which is to not return status, as
|
||||||
|
such status is not used anywhere.
|
||||||
|
* if_{proc,sysctl}.c: Make ifstat_update_* definitions and return values
|
||||||
|
consistent with each other and their declarations, ie:
|
||||||
|
(void) (*) (void).
|
||||||
|
|
||||||
2006-08-04 Paul Jakma <paul.jakma@sun.com>
|
2006-08-04 Paul Jakma <paul.jakma@sun.com>
|
||||||
|
|
||||||
* misc_null.c: Add ifstat_update_sysctl, add another required
|
* misc_null.c: Add ifstat_update_sysctl, add another required
|
||||||
|
@ -123,8 +123,8 @@ ifstat_dev_fields (int version, char *buf, struct interface *ifp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Update interface's statistics. */
|
/* Update interface's statistics. */
|
||||||
int
|
void
|
||||||
ifstat_update_proc ()
|
ifstat_update_proc (void)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char buf[PROCBUFSIZ];
|
char buf[PROCBUFSIZ];
|
||||||
@ -139,7 +139,7 @@ ifstat_update_proc ()
|
|||||||
{
|
{
|
||||||
zlog_warn ("Can't open proc file %s: %s",
|
zlog_warn ("Can't open proc file %s: %s",
|
||||||
_PATH_PROC_NET_DEV, safe_strerror (errno));
|
_PATH_PROC_NET_DEV, safe_strerror (errno));
|
||||||
return -1;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Drop header lines. */
|
/* Drop header lines. */
|
||||||
@ -162,7 +162,7 @@ ifstat_update_proc ()
|
|||||||
ifstat_dev_fields (version, stat, ifp);
|
ifstat_dev_fields (version, stat, ifp);
|
||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Interface structure allocation by proc filesystem. */
|
/* Interface structure allocation by proc filesystem. */
|
||||||
|
@ -33,8 +33,8 @@
|
|||||||
#include "zebra/rt.h"
|
#include "zebra/rt.h"
|
||||||
#include "zebra/kernel_socket.h"
|
#include "zebra/kernel_socket.h"
|
||||||
|
|
||||||
int
|
void
|
||||||
ifstat_update_sysctl ()
|
ifstat_update_sysctl (void)
|
||||||
{
|
{
|
||||||
caddr_t ref, buf, end;
|
caddr_t ref, buf, end;
|
||||||
size_t bufsiz;
|
size_t bufsiz;
|
||||||
@ -56,7 +56,7 @@ ifstat_update_sysctl ()
|
|||||||
if (sysctl (mib, MIBSIZ, NULL, &bufsiz, NULL, 0) < 0)
|
if (sysctl (mib, MIBSIZ, NULL, &bufsiz, NULL, 0) < 0)
|
||||||
{
|
{
|
||||||
zlog_warn ("sysctl() error by %s", safe_strerror (errno));
|
zlog_warn ("sysctl() error by %s", safe_strerror (errno));
|
||||||
return -1;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We free this memory at the end of this function. */
|
/* We free this memory at the end of this function. */
|
||||||
@ -66,7 +66,7 @@ ifstat_update_sysctl ()
|
|||||||
if (sysctl (mib, MIBSIZ, buf, &bufsiz, NULL, 0) < 0)
|
if (sysctl (mib, MIBSIZ, buf, &bufsiz, NULL, 0) < 0)
|
||||||
{
|
{
|
||||||
zlog (NULL, LOG_WARNING, "sysctl error by %s", safe_strerror (errno));
|
zlog (NULL, LOG_WARNING, "sysctl error by %s", safe_strerror (errno));
|
||||||
return -1;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse both interfaces and addresses. */
|
/* Parse both interfaces and addresses. */
|
||||||
@ -84,7 +84,7 @@ ifstat_update_sysctl ()
|
|||||||
/* Free sysctl buffer. */
|
/* Free sysctl buffer. */
|
||||||
XFREE (MTYPE_TMP, ref);
|
XFREE (MTYPE_TMP, ref);
|
||||||
|
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Interface listing up function using sysctl(). */
|
/* Interface listing up function using sysctl(). */
|
||||||
|
@ -221,7 +221,7 @@ extern int if_subnet_add (struct interface *, struct connected *);
|
|||||||
extern int if_subnet_delete (struct interface *, struct connected *);
|
extern int if_subnet_delete (struct interface *, struct connected *);
|
||||||
|
|
||||||
#ifdef HAVE_PROC_NET_DEV
|
#ifdef HAVE_PROC_NET_DEV
|
||||||
extern int ifstat_update_proc (void);
|
extern void ifstat_update_proc (void);
|
||||||
#endif /* HAVE_PROC_NET_DEV */
|
#endif /* HAVE_PROC_NET_DEV */
|
||||||
#ifdef HAVE_NET_RT_IFLIST
|
#ifdef HAVE_NET_RT_IFLIST
|
||||||
extern void ifstat_update_sysctl (void);
|
extern void ifstat_update_sysctl (void);
|
||||||
|
Loading…
Reference in New Issue
Block a user