1301169Slidl/* $NetBSD: conf.h,v 1.6 2015/01/27 19:40:36 christos Exp $ */ 2301169Slidl 3301169Slidl/*- 4301169Slidl * Copyright (c) 2015 The NetBSD Foundation, Inc. 5301169Slidl * All rights reserved. 6301169Slidl * 7301169Slidl * This code is derived from software contributed to The NetBSD Foundation 8301169Slidl * by Christos Zoulas. 9301169Slidl * 10301169Slidl * Redistribution and use in source and binary forms, with or without 11301169Slidl * modification, are permitted provided that the following conditions 12301169Slidl * are met: 13301169Slidl * 1. Redistributions of source code must retain the above copyright 14301169Slidl * notice, this list of conditions and the following disclaimer. 15301169Slidl * 2. Redistributions in binary form must reproduce the above copyright 16301169Slidl * notice, this list of conditions and the following disclaimer in the 17301169Slidl * documentation and/or other materials provided with the distribution. 18301169Slidl * 19301169Slidl * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20301169Slidl * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21301169Slidl * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22301169Slidl * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23301169Slidl * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24301169Slidl * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25301169Slidl * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26301169Slidl * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27301169Slidl * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28301169Slidl * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29301169Slidl * POSSIBILITY OF SUCH DAMAGE. 30301169Slidl */ 31301169Slidl#ifndef _CONF_H 32301169Slidl#define _CONF_H 33301169Slidl 34301169Slidl#include <sys/socket.h> 35301169Slidl 36301169Slidlstruct conf { 37301169Slidl struct sockaddr_storage c_ss; 38301169Slidl int c_lmask; 39301169Slidl int c_port; 40301169Slidl int c_proto; 41301169Slidl int c_family; 42301169Slidl int c_uid; 43301169Slidl int c_nfail; 44301169Slidl char c_name[128]; 45301169Slidl int c_rmask; 46301169Slidl int c_duration; 47301169Slidl}; 48301169Slidl 49301169Slidlstruct confset { 50301169Slidl struct conf *cs_c; 51301169Slidl size_t cs_n; 52301169Slidl size_t cs_m; 53301169Slidl}; 54301169Slidl 55301169Slidl#define CONFNAMESZ sizeof(((struct conf *)0)->c_name) 56301169Slidl 57301169Slidl__BEGIN_DECLS 58301169Slidlconst char *conf_print(char *, size_t, const char *, const char *, 59301169Slidl const struct conf *); 60301169Slidlvoid conf_parse(const char *); 61301169Slidlconst struct conf *conf_find(int, uid_t, const struct sockaddr_storage *, 62301169Slidl struct conf *); 63301169Slidl__END_DECLS 64301169Slidl 65301169Slidl#endif /* _CONF_H */ 66