]> git.proxmox.com Git - mirror_frr.git/blob - tests/isisd/test_common.h
Merge pull request #7137 from kssoman/ospf
[mirror_frr.git] / tests / isisd / test_common.h
1 /*
2 * Copyright (C) 2020 NetDEF, Inc.
3 * Renato Westphal
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the Free
7 * Software Foundation; either version 2 of the License, or (at your option)
8 * any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; see the file COPYING; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #ifndef _COMMON_ISIS_H
21 #define _COMMON_ISIS_H
22
23 #include "isisd/isisd.h"
24 #include "isisd/isis_spf.h"
25 #include "isisd/isis_spf_private.h"
26
27 #define MAX_HOSTNAME 16
28 #define MAX_NETWORKS 8
29 #define MAX_ADJACENCIES 8
30 #define MAX_NODES 12
31
32 #define SRGB_DFTL_LOWER_BOUND 16000
33 #define SRGB_DFTL_RANGE_SIZE 8000
34
35 struct isis_test_adj {
36 char hostname[MAX_HOSTNAME];
37 uint8_t pseudonode_id;
38 uint32_t metric;
39 };
40
41 struct isis_test_node {
42 char hostname[MAX_HOSTNAME];
43 uint8_t sysid[ISIS_SYS_ID_LEN];
44 uint8_t pseudonode_id;
45 int level;
46 struct {
47 bool ipv4;
48 bool ipv6;
49 } protocols;
50 const char *router_id;
51 struct {
52 uint32_t lower_bound;
53 uint32_t range_size;
54 } srgb;
55 const char *networks[MAX_NETWORKS + 1];
56 struct isis_test_adj adjacencies[MAX_ADJACENCIES + 1];
57 uint8_t flags;
58 };
59 #define F_ISIS_TEST_NODE_SR 0x01
60
61 struct isis_topology {
62 uint16_t number;
63 struct isis_test_node nodes[MAX_NODES + 1];
64 };
65
66 /* Prototypes. */
67 extern int isis_sock_init(struct isis_circuit *circuit);
68 extern const struct isis_test_node *
69 test_topology_find_node(const struct isis_topology *topology,
70 const char *hostname, uint8_t pseudonode_id);
71 extern const struct isis_topology *
72 test_topology_find(struct isis_topology *test_topologies, uint16_t number);
73 extern int test_topology_load(const struct isis_topology *topology,
74 struct isis_area *area,
75 struct lspdb_head lspdb[]);
76
77 /* Global variables. */
78 extern struct thread_master *master;
79 extern struct zebra_privs_t isisd_privs;
80 extern struct isis_topology test_topologies[];
81
82 #endif /* _COMMON_ISIS_H */