Deleted Added
full compact
mibII.c (156066) mibII.c (163799)
1/*
2 * Copyright (c) 2001-2003
3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4 * All rights reserved.
5 *
6 * Author: Harti Brandt <harti@freebsd.org>
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*
2 * Copyright (c) 2001-2003
3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4 * All rights reserved.
5 *
6 * Author: Harti Brandt <harti@freebsd.org>
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $Begemot: bsnmp/snmp_mibII/mibII.c,v 1.24 2006/02/14 09:04:18 brandt_h Exp $
29 * $Begemot: mibII.c 516 2006-10-27 15:54:02Z brandt_h $
30 *
31 * Implementation of the standard interfaces and ip MIB.
32 */
33#include "mibII.h"
34#include "mibII_oid.h"
30 *
31 * Implementation of the standard interfaces and ip MIB.
32 */
33#include "mibII.h"
34#include "mibII_oid.h"
35#include <net/if.h>
35#include <net/if_types.h>
36
37
38/*****************************/
39
40/* our module */
41static struct lmodule *module;
42

--- 328 unchanged lines hidden (view full) ---

371 * Recompute the poll timer for the HC counters
372 */
373void
374mibif_reset_hc_timer(void)
375{
376 u_int ticks;
377
378 if ((ticks = mibif_force_hc_update_interval) == 0) {
36#include <net/if_types.h>
37
38
39/*****************************/
40
41/* our module */
42static struct lmodule *module;
43

--- 328 unchanged lines hidden (view full) ---

372 * Recompute the poll timer for the HC counters
373 */
374void
375mibif_reset_hc_timer(void)
376{
377 u_int ticks;
378
379 if ((ticks = mibif_force_hc_update_interval) == 0) {
379 if (mibif_maxspeed <= 10000000) {
380 if (mibif_maxspeed <= IF_Mbps(10)) {
380 /* at 10Mbps overflow needs 3436 seconds */
381 ticks = 3000 * 100; /* 50 minutes */
381 /* at 10Mbps overflow needs 3436 seconds */
382 ticks = 3000 * 100; /* 50 minutes */
382 } else if (mibif_maxspeed <= 100000000) {
383 } else if (mibif_maxspeed <= IF_Mbps(100)) {
383 /* at 100Mbps overflow needs 343 seconds */
384 ticks = 300 * 100; /* 5 minutes */
384 /* at 100Mbps overflow needs 343 seconds */
385 ticks = 300 * 100; /* 5 minutes */
385 } else if (mibif_maxspeed < 650000000) {
386 } else if (mibif_maxspeed < IF_Mbps(622)) {
386 /* at 622Mbps overflow needs 53 seconds */
387 ticks = 40 * 100; /* 40 seconds */
387 /* at 622Mbps overflow needs 53 seconds */
388 ticks = 40 * 100; /* 40 seconds */
388 } else if (mibif_maxspeed <= 1000000000) {
389 } else if (mibif_maxspeed <= IF_Mbps(1000)) {
389 /* at 1Gbps overflow needs 34 seconds */
390 ticks = 20 * 100; /* 20 seconds */
391 } else {
392 /* at 10Gbps overflow needs 3.4 seconds */
393 ticks = 100; /* 1 seconds */
394 }
395 }
396

--- 1393 unchanged lines hidden ---
390 /* at 1Gbps overflow needs 34 seconds */
391 ticks = 20 * 100; /* 20 seconds */
392 } else {
393 /* at 10Gbps overflow needs 3.4 seconds */
394 ticks = 100; /* 1 seconds */
395 }
396 }
397

--- 1393 unchanged lines hidden ---