]> git.proxmox.com Git - mirror_frr.git/blob - tests/isisd/test_common.h
*: Convert `struct event_master` to `struct event_loop`
[mirror_frr.git] / tests / isisd / test_common.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Copyright (C) 2020 NetDEF, Inc.
4 * Renato Westphal
5 */
6
7 #ifndef _COMMON_ISIS_H
8 #define _COMMON_ISIS_H
9
10 #include "isisd/isisd.h"
11 #include "isisd/isis_spf.h"
12 #include "isisd/isis_spf_private.h"
13
14 #define MAX_HOSTNAME 16
15 #define MAX_NETWORKS 8
16 #define MAX_ADJACENCIES 8
17 #define MAX_NODES 12
18
19 #define SRGB_DFTL_LOWER_BOUND 16000
20 #define SRGB_DFTL_RANGE_SIZE 8000
21
22 struct isis_test_adj {
23 char hostname[MAX_HOSTNAME];
24 uint8_t pseudonode_id;
25 uint32_t metric;
26 };
27
28 struct isis_test_node {
29 char hostname[MAX_HOSTNAME];
30 uint8_t sysid[ISIS_SYS_ID_LEN];
31 uint8_t pseudonode_id;
32 int level;
33 struct {
34 bool ipv4;
35 bool ipv6;
36 } protocols;
37 const char *router_id;
38 struct {
39 uint32_t lower_bound;
40 uint32_t range_size;
41 } srgb;
42 const char *networks[MAX_NETWORKS + 1];
43 struct isis_test_adj adjacencies[MAX_ADJACENCIES + 1];
44 uint8_t flags;
45 };
46 #define F_ISIS_TEST_NODE_SR 0x01
47
48 struct isis_topology {
49 uint16_t number;
50 struct isis_test_node nodes[MAX_NODES + 1];
51 };
52
53 /* Prototypes. */
54 extern int isis_sock_init(struct isis_circuit *circuit);
55 extern const struct isis_test_node *
56 test_topology_find_node(const struct isis_topology *topology,
57 const char *hostname, uint8_t pseudonode_id);
58 extern const struct isis_topology *
59 test_topology_find(struct isis_topology *test_topologies, uint16_t number);
60 extern mpls_label_t
61 test_topology_node_ldp_label(const struct isis_topology *topology,
62 struct in_addr router_id);
63 extern int test_topology_load(const struct isis_topology *topology,
64 struct isis_area *area,
65 struct lspdb_head lspdb[]);
66
67 /* Global variables. */
68 extern struct event_loop *master;
69 extern struct zebra_privs_t isisd_privs;
70 extern struct isis_topology test_topologies[];
71
72 #endif /* _COMMON_ISIS_H */