jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * IS-IS Rout(e)ing protocol - isis_constants.h |
| 3 | * |
| 4 | * Copyright (C) 2001,2002 Sampo Saaristo |
| 5 | * Tampere University of Technology |
| 6 | * Institute of Communications Engineering |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public Licenseas published by the Free |
| 10 | * Software Foundation; either version 2 of the License, or (at your option) |
| 11 | * any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful,but WITHOUT |
| 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 16 | * more details. |
| 17 | |
| 18 | * You should have received a copy of the GNU General Public License along |
| 19 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 20 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 21 | */ |
| 22 | |
| 23 | #ifndef ISIS_CONSTANTS_H |
| 24 | #define ISIS_CONSTANTS_H |
| 25 | |
| 26 | /* |
| 27 | * Architectural constant values from p. 35 of ISO/IEC 10589 |
| 28 | */ |
| 29 | |
| 30 | #define MAX_LINK_METRIC 63 |
| 31 | #define MAX_PATH_METRIC 1023 |
| 32 | #define ISO_SAP 0xFE |
| 33 | #define INTRADOMAIN_ROUTEING_SELECTOR 0 |
| 34 | #define SEQUENCE_MODULUS 4294967296 |
| 35 | #define RECEIVE_LSP_BUFFER_SIZE 1492 |
| 36 | |
| 37 | /* |
| 38 | * implementation specific jitter values |
| 39 | */ |
| 40 | |
| 41 | #define IIH_JITTER 25 /* % */ |
| 42 | #define MAX_AGE_JITTER 5 /* % */ |
| 43 | #define MAX_LSP_GEN_JITTER 5 /* % */ |
| 44 | #define CSNP_JITTER 10 /* % */ |
| 45 | #define PSNP_JITTER 10 /* % */ |
| 46 | |
| 47 | #define RANDOM_SPREAD 100000.0 |
| 48 | |
| 49 | /* |
| 50 | * Default values |
| 51 | * ISO - 10589 |
| 52 | * Section 7.3.21 - Parameters |
| 53 | */ |
| 54 | #define MAX_AGE 1200 |
| 55 | #define ZERO_AGE_LIFETIME 60 |
| 56 | #define MAX_LSP_GEN_INTERVAL 900 |
| 57 | #define MIN_LSP_GEN_INTERVAL 30 |
| 58 | #define MIN_LSP_TRANS_INTERVAL 5 |
| 59 | #define ISIS_MIN_LSP_LIFETIME 380 |
| 60 | #define CSNP_INTERVAL 10 |
| 61 | #define PSNP_INTERVAL 2 |
| 62 | #define ISIS_MAX_PATH_SPLITS 3 |
| 63 | |
| 64 | #define ISIS_LEVELS 2 |
| 65 | #define ISIS_LEVEL1 1 |
| 66 | #define ISIS_LEVEL2 2 |
| 67 | |
| 68 | #define HELLO_INTERVAL 1 |
| 69 | #define HELLO_MINIMAL HELLO_INTERVAL |
| 70 | #define HELLO_MULTIPLIER 3 |
| 71 | #define DEFAULT_PRIORITY 64 |
| 72 | /* different vendors implement different values 5-10 on average */ |
| 73 | #define LSP_GEN_INTERVAL_DEFAULT 10 |
| 74 | #define LSP_INTERVAL 33 /* msecs */ |
| 75 | #define DEFAULT_CIRCUIT_METRICS 10 |
| 76 | #define METRICS_UNSUPPORTED 0x80 |
| 77 | #define PERIODIC_SPF_INTERVAL 60 /* at the top of my head */ |
| 78 | #define MINIMUM_SPF_INTERVAL 5 /* .. same here */ |
| 79 | |
| 80 | /* |
| 81 | * NLPID values |
| 82 | */ |
| 83 | #define NLPID_IP 204 |
| 84 | #define NLPID_IPV6 142 |
| 85 | |
| 86 | /* |
| 87 | * Return values for functions |
| 88 | */ |
| 89 | #define ISIS_OK 0 |
| 90 | #define ISIS_WARNING 1 |
| 91 | #define ISIS_ERROR 2 |
| 92 | #define ISIS_CRITICAL 3 |
| 93 | |
| 94 | /* |
| 95 | * IS-IS Circuit Types |
| 96 | */ |
| 97 | |
| 98 | #define IS_LEVEL_1 1 |
| 99 | #define IS_LEVEL_2 2 |
| 100 | #define IS_LEVEL_1_AND_2 3 |
| 101 | |
| 102 | #define SNPA_ADDRSTRLEN 18 |
| 103 | #define ISIS_SYS_ID_LEN 6 |
| 104 | #define SYSID_STRLEN 24 |
| 105 | |
| 106 | /* |
| 107 | * LSP bit masks |
| 108 | */ |
| 109 | #define LSPBIT_P 0x80 |
| 110 | #define LSPBIT_ATT 0x78 |
| 111 | #define LSPBIT_OL 0x04 |
| 112 | #define LSPBIT_IST 0x03 |
| 113 | |
| 114 | /* |
| 115 | * LSP bit masking macros |
| 116 | * taken from tcpdumps |
| 117 | * print-isoclns.c |
| 118 | */ |
| 119 | |
| 120 | #define ISIS_MASK_LSP_OL_BIT(x) ((x)&0x4) |
| 121 | #define ISIS_MASK_LSP_IS_L1_BIT(x) ((x)&0x1) |
| 122 | #define ISIS_MASK_LSP_IS_L2_BIT(x) ((x)&0x2) |
| 123 | #define ISIS_MASK_LSP_PARTITION_BIT(x) ((x)&0x80) |
| 124 | #define ISIS_MASK_LSP_ATT_BITS(x) ((x)&0x78) |
| 125 | #define ISIS_MASK_LSP_ATT_ERROR_BIT(x) ((x)&0x40) |
| 126 | #define ISIS_MASK_LSP_ATT_EXPENSE_BIT(x) ((x)&0x20) |
| 127 | #define ISIS_MASK_LSP_ATT_DELAY_BIT(x) ((x)&0x10) |
| 128 | #define ISIS_MASK_LSP_ATT_DEFAULT_BIT(x) ((x)&0x8) |
| 129 | |
| 130 | #define LLC_LEN 3 |
| 131 | |
| 132 | /* we need to be aware of the fact we are using ISO sized |
| 133 | * packets, using isomtu = mtu - LLC_LEN |
| 134 | */ |
| 135 | #define ISO_MTU(C) \ |
| 136 | (C->circ_type==CIRCUIT_T_BROADCAST) ? \ |
| 137 | (C->interface->mtu - LLC_LEN) : (C->interface->mtu) |
| 138 | |
| 139 | #ifndef ETH_ALEN |
| 140 | #define ETH_ALEN 6 |
| 141 | #endif |
| 142 | |
| 143 | #endif /* ISIS_CONSTANTS_H */ |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |