paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | /* OSPF VTY interface. |
| 2 | * Copyright (C) 2000 Toshiaki Takada |
| 3 | * |
| 4 | * This file is part of GNU Zebra. |
| 5 | * |
| 6 | * GNU Zebra is free software; you can redistribute it and/or modify it |
| 7 | * under the terms of the GNU General Public License as published by the |
| 8 | * Free Software Foundation; either version 2, or (at your option) any |
| 9 | * later version. |
| 10 | * |
| 11 | * GNU Zebra is distributed in the hope that it will be useful, but |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with GNU Zebra; see the file COPYING. If not, write to the Free |
| 18 | * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 19 | * 02111-1307, USA. |
| 20 | */ |
| 21 | |
paul | 4dadc29 | 2005-05-06 21:37:42 +0000 | [diff] [blame] | 22 | #ifndef _QUAGGA_OSPF_VTY_H |
| 23 | #define _QUAGGA_OSPF_VTY_H |
| 24 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 25 | /* Macros. */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 26 | #define VTY_GET_OSPF_AREA_ID(V,F,STR) \ |
| 27 | { \ |
| 28 | int retv; \ |
| 29 | retv = ospf_str2area_id ((STR), &(V), &(F)); \ |
| 30 | if (retv < 0) \ |
| 31 | { \ |
| 32 | vty_out (vty, "%% Invalid OSPF area ID%s", VTY_NEWLINE); \ |
| 33 | return CMD_WARNING; \ |
| 34 | } \ |
| 35 | } |
| 36 | |
| 37 | #define VTY_GET_OSPF_AREA_ID_NO_BB(NAME,V,F,STR) \ |
| 38 | { \ |
| 39 | int retv; \ |
| 40 | retv = ospf_str2area_id ((STR), &(V), &(F)); \ |
| 41 | if (retv < 0) \ |
| 42 | { \ |
| 43 | vty_out (vty, "%% Invalid OSPF area ID%s", VTY_NEWLINE); \ |
| 44 | return CMD_WARNING; \ |
| 45 | } \ |
| 46 | if (OSPF_IS_AREA_ID_BACKBONE ((V))) \ |
| 47 | { \ |
| 48 | vty_out (vty, "%% You can't configure %s to backbone%s", \ |
| 49 | NAME, VTY_NEWLINE); \ |
| 50 | } \ |
| 51 | } |
| 52 | |
| 53 | /* Prototypes. */ |
paul | 4dadc29 | 2005-05-06 21:37:42 +0000 | [diff] [blame] | 54 | extern void ospf_vty_init (void); |
| 55 | extern void ospf_vty_show_init (void); |
Olivier Dugeon | 29a1401 | 2016-04-19 18:42:40 +0200 | [diff] [blame] | 56 | extern int ospf_str2area_id (const char *, struct in_addr *, int *); |
Vipin Kumar | a90dc87 | 2015-05-19 17:58:13 -0700 | [diff] [blame] | 57 | extern void ospf_vty_clear_init (void); |
paul | 4dadc29 | 2005-05-06 21:37:42 +0000 | [diff] [blame] | 58 | |
| 59 | #endif /* _QUAGGA_OSPF_VTY_H */ |