]>
Commit | Line | Data |
---|---|---|
1 | // SPDX-License-Identifier: GPL-2.0-or-later | |
2 | /* OSPF VTY interface. | |
3 | * Copyright (C) 2000 Toshiaki Takada | |
4 | */ | |
5 | ||
6 | #ifndef _QUAGGA_OSPF_VTY_H | |
7 | #define _QUAGGA_OSPF_VTY_H | |
8 | ||
9 | /* Macros. */ | |
10 | #define VTY_GET_OSPF_AREA_ID(V, F, STR) \ | |
11 | { \ | |
12 | int retv; \ | |
13 | retv = str2area_id((STR), &(V), &(F)); \ | |
14 | if (retv < 0) { \ | |
15 | vty_out(vty, "%% Invalid OSPF area ID\n"); \ | |
16 | return CMD_WARNING; \ | |
17 | } \ | |
18 | } | |
19 | ||
20 | #define VTY_GET_OSPF_AREA_ID_NO_BB(NAME, V, F, STR) \ | |
21 | { \ | |
22 | int retv; \ | |
23 | retv = str2area_id((STR), &(V), &(F)); \ | |
24 | if (retv < 0) { \ | |
25 | vty_out(vty, "%% Invalid OSPF area ID\n"); \ | |
26 | return CMD_WARNING; \ | |
27 | } \ | |
28 | if (OSPF_IS_AREA_ID_BACKBONE((V))) { \ | |
29 | vty_out(vty, \ | |
30 | "%% You can't configure %s to backbone\n", \ | |
31 | NAME); \ | |
32 | return CMD_WARNING; \ | |
33 | } \ | |
34 | } | |
35 | ||
36 | /* Prototypes. */ | |
37 | extern void ospf_vty_init(void); | |
38 | extern void ospf_vty_show_init(void); | |
39 | extern void ospf_vty_clear_init(void); | |
40 | extern int str2area_id(const char *, struct in_addr *, int *); | |
41 | ||
42 | /* unit tests */ | |
43 | void show_ip_ospf_database_summary(struct vty *vty, struct ospf *ospf, int self, | |
44 | json_object *json); | |
45 | ||
46 | #endif /* _QUAGGA_OSPF_VTY_H */ |