1 /* $OpenBSD: parser.h,v 1.18 2008/06/07 18:14:41 henning Exp $ */ 2 3 /* 4 * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> 5 * 6 * Permission to use, copy, modify, and distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 #include <sys/types.h> 20 21 #include "bgpd.h" 22 23 enum actions { 24 NONE, 25 SHOW, 26 SHOW_SUMMARY, 27 SHOW_SUMMARY_TERSE, 28 SHOW_NEIGHBOR, 29 SHOW_NEIGHBOR_TIMERS, 30 SHOW_NEIGHBOR_TERSE, 31 SHOW_FIB, 32 SHOW_RIB, 33 SHOW_RIB_MEM, 34 SHOW_NEXTHOP, 35 SHOW_INTERFACE, 36 RELOAD, 37 FIB, 38 FIB_COUPLE, 39 FIB_DECOUPLE, 40 NEIGHBOR, 41 NEIGHBOR_UP, 42 NEIGHBOR_DOWN, 43 NEIGHBOR_CLEAR, 44 NEIGHBOR_RREFRESH, 45 NETWORK_ADD, 46 NETWORK_REMOVE, 47 NETWORK_FLUSH, 48 NETWORK_SHOW, 49 IRRFILTER 50 }; 51 52 struct parse_result { 53 struct bgpd_addr addr; 54 struct bgpd_addr peeraddr; 55 struct filter_as as; 56 struct filter_set_head set; 57 struct filter_community community; 58 char peerdesc[PEER_DESCR_LEN]; 59 char *irr_outdir; 60 int flags; 61 enum actions action; 62 u_int8_t prefixlen; 63 sa_family_t af; 64 }; 65 66 __dead void usage(void); 67 struct parse_result *parse(int, char *[]); 68