]>
Commit | Line | Data |
---|---|---|
e9f1847e DS |
1 | /* |
2 | * EIGRP Metric Math Functions. | |
3 | * Copyright (C) 2013-2016 | |
4 | * Authors: | |
5 | * Donnie Savage | |
6 | * | |
7 | * This file is part of GNU Zebra. | |
8 | * | |
9 | * GNU Zebra is free software; you can redistribute it and/or modify it | |
10 | * under the terms of the GNU General Public License as published by the | |
11 | * Free Software Foundation; either version 2, or (at your option) any | |
12 | * later version. | |
13 | * | |
14 | * GNU Zebra is distributed in the hope that it will be useful, but | |
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 | * General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License along | |
20 | * with this program; see the file COPYING; if not, write to the Free Software | |
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
22 | */ | |
23 | ||
24 | #ifndef _ZEBRA_EIGRP_METRIC_H_ | |
25 | #define _ZEBRA_EIGRP_METRIC_H_ | |
26 | ||
27 | /* Constants */ | |
28 | #define EIGRP_BANDWIDTH_MIN 0x1ull /* 1 */ | |
29 | #define EIGRP_BANDWIDTH_SCALER 10000000ull /* Inversion value */ | |
30 | #define EIGRP_BANDWIDTH_MAX 0xffffffffffffffffull /* 1.84467441x10^19 */ | |
31 | ||
32 | #define EIGRP_DELAY_MIN 0x1ull /* 1 */ | |
33 | #define EIGRP_DELAY_PICO 1000000ull | |
34 | #define EIGRP_DELAY_MAX 0xffffffffffffffffull /* 1.84467441x10^19 */ | |
35 | ||
36 | #define EIGRP_MAX_LOAD 256 | |
37 | #define EIGRP_MAX_HOPS 100 | |
38 | ||
39 | #define EIGRP_INACCESSIBLE 0xFFFFFFFFFFFFFFFFull | |
40 | ||
41 | #define EIGRP_METRIC_MAX 0xffffffffffffffffull /* 1.84467441x10^19 */ | |
42 | #define EIGRP_METRIC_MAX_CLASSIC 0xffffffff | |
43 | #define EIGRP_METRIC_SCALER 65536 /* CLASSIC to WIDE conversion */ | |
44 | ||
45 | #define EIGRP_CLASSIC_MAX 0xffffffff /* 4294967295 */ | |
46 | #define EIGRP_CLASSIC_SCALER 256 /* IGRP to EIGRP conversion */ | |
47 | ||
48 | ||
49 | /* Prototypes */ | |
50 | extern eigrp_scaled_t eigrp_bandwidth_to_scaled(eigrp_bandwidth_t bw); | |
51 | extern eigrp_bandwidth_t eigrp_scaled_to_bandwidth(eigrp_scaled_t scale); | |
52 | extern eigrp_scaled_t eigrp_delay_to_scaled(eigrp_delay_t delay); | |
53 | extern eigrp_delay_t eigrp_scaled_to_delay(eigrp_scaled_t scale); | |
54 | ||
55 | extern eigrp_metric_t eigrp_calculate_metrics(struct eigrp *eigrp, | |
56 | struct eigrp_metrics metric); | |
57 | extern eigrp_metric_t | |
58 | eigrp_calculate_total_metrics(struct eigrp *eigrp, | |
59 | struct eigrp_route_descriptor *rd); | |
60 | extern bool eigrp_metrics_is_same(struct eigrp_metrics m1, | |
61 | struct eigrp_metrics m2); | |
62 | ||
63 | #endif /* _ZEBRA_EIGRP_METRIC_H_ */ |