]> git.proxmox.com Git - mirror_frr.git/blame - tests/isisd/test_common.h
Merge pull request #12654 from Pdoijode/evpn-evi-detail-json-changes
[mirror_frr.git] / tests / isisd / test_common.h
CommitLineData
52a7c25e
RW
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
35struct isis_test_adj {
36 char hostname[MAX_HOSTNAME];
37 uint8_t pseudonode_id;
38 uint32_t metric;
39};
40
41struct 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
61struct isis_topology {
62 uint16_t number;
63 struct isis_test_node nodes[MAX_NODES + 1];
64};
65
66/* Prototypes. */
67extern int isis_sock_init(struct isis_circuit *circuit);
68extern const struct isis_test_node *
69test_topology_find_node(const struct isis_topology *topology,
70 const char *hostname, uint8_t pseudonode_id);
71extern const struct isis_topology *
72test_topology_find(struct isis_topology *test_topologies, uint16_t number);
c40de294
RW
73extern mpls_label_t
74test_topology_node_ldp_label(const struct isis_topology *topology,
75 struct in_addr router_id);
52a7c25e
RW
76extern int test_topology_load(const struct isis_topology *topology,
77 struct isis_area *area,
78 struct lspdb_head lspdb[]);
79
80/* Global variables. */
81extern struct thread_master *master;
82extern struct zebra_privs_t isisd_privs;
83extern struct isis_topology test_topologies[];
84
85#endif /* _COMMON_ISIS_H */