util.h revision 316098
1118611Snjl/* $FreeBSD: stable/11/lib/libnetbsd/util.h 316098 2017-03-28 13:39:04Z vangyzen $ */ 2118611Snjl 3118611Snjl/*- 4118611Snjl * Copyright (c) 2012 SRI International 5151937Sjkim * Copyright (c) 1995 6118611Snjl * The Regents of the University of California. All rights reserved. 7118611Snjl * 8118611Snjl * Redistribution and use in source and binary forms, with or without 9118611Snjl * modification, are permitted provided that the following conditions 10118611Snjl * are met: 11118611Snjl * 1. Redistributions of source code must retain the above copyright 12118611Snjl * notice, this list of conditions and the following disclaimer. 13151937Sjkim * 2. Redistributions in binary form must reproduce the above copyright 14118611Snjl * notice, this list of conditions and the following disclaimer in the 15118611Snjl * documentation and/or other materials provided with the distribution. 16118611Snjl * 3. Neither the name of the University nor the names of its contributors 17118611Snjl * may be used to endorse or promote products derived from this software 18118611Snjl * without specific prior written permission. 19118611Snjl * 20118611Snjl * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21118611Snjl * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22118611Snjl * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23118611Snjl * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24118611Snjl * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25118611Snjl * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26118611Snjl * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27118611Snjl * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28118611Snjl * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29118611Snjl * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30118611Snjl * SUCH DAMAGE. 31118611Snjl */ 32118611Snjl 33118611Snjl#ifndef _LIBNETBSD_UTIL_H_ 34118611Snjl#define _LIBNETBSD_UTIL_H_ 35118611Snjl 36118611Snjl#include <sys/types.h> 37118611Snjl#include <libutil.h> 38118611Snjl 39118611Snjlchar *flags_to_string(u_long flags, const char *def); 40118611Snjlint sockaddr_snprintf(char *, size_t, const char *, 41118611Snjl const struct sockaddr *); 42118611Snjlint string_to_flags(char **stringp, u_long *setp, u_long *clrp); 43118611Snjl 44118611Snjl#endif 45118611Snjl