1*3f117ed9Srenato /* $OpenBSD: parser.h,v 1.10 2016/05/23 19:06:03 renato Exp $ */ 2ab0c2486Smichele 3ab0c2486Smichele /* 4ab0c2486Smichele * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> 5ab0c2486Smichele * Copyright (c) 2004 Esben Norby <norby@openbsd.org> 6ab0c2486Smichele * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> 7ab0c2486Smichele * 8ab0c2486Smichele * Permission to use, copy, modify, and distribute this software for any 9ab0c2486Smichele * purpose with or without fee is hereby granted, provided that the above 10ab0c2486Smichele * copyright notice and this permission notice appear in all copies. 11ab0c2486Smichele * 12ab0c2486Smichele * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 13ab0c2486Smichele * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 14ab0c2486Smichele * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 15ab0c2486Smichele * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 16ab0c2486Smichele * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 17ab0c2486Smichele * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 18ab0c2486Smichele * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19ab0c2486Smichele */ 20ab0c2486Smichele 21ab0c2486Smichele #ifndef _PARSER_H_ 22ab0c2486Smichele #define _PARSER_H_ 23ab0c2486Smichele 24ab0c2486Smichele #include <sys/types.h> 25ab0c2486Smichele #include <net/if.h> 26ab0c2486Smichele #include <netinet/in.h> 27ab0c2486Smichele 28ab0c2486Smichele enum actions { 29ab0c2486Smichele NONE, 3092dd8dc8Sclaudio FIB, 3192dd8dc8Sclaudio FIB_COUPLE, 3292dd8dc8Sclaudio FIB_DECOUPLE, 33c3319070Sclaudio LOG_VERBOSE, 34c3319070Sclaudio LOG_BRIEF, 35ab0c2486Smichele SHOW, 36d50436bbSclaudio SHOW_DISC, 37ab0c2486Smichele SHOW_IFACE, 38ab0c2486Smichele SHOW_NBR, 39ab0c2486Smichele SHOW_LIB, 4092dd8dc8Sclaudio SHOW_FIB, 4192dd8dc8Sclaudio SHOW_FIB_IFACE, 42a94c7fd0Srenato SHOW_L2VPN_PW, 43a94c7fd0Srenato SHOW_L2VPN_BINDING, 44*3f117ed9Srenato CLEAR_NBR, 45ab0c2486Smichele RELOAD 46ab0c2486Smichele }; 47ab0c2486Smichele 48ab0c2486Smichele struct parse_result { 496fb6d103Srenato int family; 506fb6d103Srenato union ldpd_addr addr; 51ab0c2486Smichele char ifname[IF_NAMESIZE]; 52ab0c2486Smichele int flags; 53ab0c2486Smichele enum actions action; 546c1e7e28Srenato uint8_t prefixlen; 55ab0c2486Smichele }; 56ab0c2486Smichele 57ab0c2486Smichele struct parse_result *parse(int, char *[]); 586fb6d103Srenato int parse_addr(const char *, int *, union ldpd_addr *); 59ab0c2486Smichele 60ab0c2486Smichele #endif /* _PARSER_H_ */ 61