"Interface's name\n"
VRF_CMD_HELP_STR)
+static void
+interface_update_stats (void)
+{
+#ifdef HAVE_PROC_NET_DEV
+ /* If system has interface statistics via proc file system, update
+ statistics. */
+ ifstat_update_proc ();
+#endif /* HAVE_PROC_NET_DEV */
+#ifdef HAVE_NET_RT_IFLIST
+ ifstat_update_sysctl ();
+#endif /* HAVE_NET_RT_IFLIST */
+}
+
struct cmd_node interface_node =
{
INTERFACE_NODE,
struct interface *ifp;
vrf_id_t vrf_id = VRF_DEFAULT;
-#ifdef HAVE_PROC_NET_DEV
- /* If system has interface statistics via proc file system, update
- statistics. */
- ifstat_update_proc ();
-#endif /* HAVE_PROC_NET_DEV */
-#ifdef HAVE_NET_RT_IFLIST
- ifstat_update_sysctl ();
-#endif /* HAVE_NET_RT_IFLIST */
+ interface_update_stats ();
if (argc > 0)
VRF_GET_ID (vrf_id, argv[0]);
struct interface *ifp;
vrf_iter_t iter;
-#ifdef HAVE_PROC_NET_DEV
- /* If system has interface statistics via proc file system, update
- statistics. */
- ifstat_update_proc ();
-#endif /* HAVE_PROC_NET_DEV */
-#ifdef HAVE_NET_RT_IFLIST
- ifstat_update_sysctl ();
-#endif /* HAVE_NET_RT_IFLIST */
+ interface_update_stats ();
/* All interface print. */
for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
struct interface *ifp;
vrf_id_t vrf_id = VRF_DEFAULT;
-#ifdef HAVE_PROC_NET_DEV
- /* If system has interface statistics via proc file system, update
- statistics. */
- ifstat_update_proc ();
-#endif /* HAVE_PROC_NET_DEV */
-#ifdef HAVE_NET_RT_IFLIST
- ifstat_update_sysctl ();
-#endif /* HAVE_NET_RT_IFLIST */
+ interface_update_stats ();
if (argc > 1)
VRF_GET_ID (vrf_id, argv[1]);
vrf_iter_t iter;
int found = 0;
-#ifdef HAVE_PROC_NET_DEV
- /* If system has interface statistics via proc file system, update
- statistics. */
- ifstat_update_proc ();
-#endif /* HAVE_PROC_NET_DEV */
-#ifdef HAVE_NET_RT_IFLIST
- ifstat_update_sysctl ();
-#endif /* HAVE_NET_RT_IFLIST */
+ interface_update_stats ();
/* All interface print. */
for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))