xref: /freebsd/lib/libypclnt/ypclnt.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
123d232d7SDag-Erling Smørgrav /*-
2*5e53a4f9SPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
3*5e53a4f9SPedro F. Giffuni  *
423d232d7SDag-Erling Smørgrav  * Copyright (c) 2002 Networks Associates Technology, Inc.
523d232d7SDag-Erling Smørgrav  * All rights reserved.
623d232d7SDag-Erling Smørgrav  *
723d232d7SDag-Erling Smørgrav  * This software was developed for the FreeBSD Project by ThinkSec AS and
823d232d7SDag-Erling Smørgrav  * NAI Labs, the Security Research Division of Network Associates, Inc.
923d232d7SDag-Erling Smørgrav  * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
1023d232d7SDag-Erling Smørgrav  * DARPA CHATS research program.
1123d232d7SDag-Erling Smørgrav  *
1223d232d7SDag-Erling Smørgrav  * Redistribution and use in source and binary forms, with or without
1323d232d7SDag-Erling Smørgrav  * modification, are permitted provided that the following conditions
1423d232d7SDag-Erling Smørgrav  * are met:
1523d232d7SDag-Erling Smørgrav  * 1. Redistributions of source code must retain the above copyright
1623d232d7SDag-Erling Smørgrav  *    notice, this list of conditions and the following disclaimer.
1723d232d7SDag-Erling Smørgrav  * 2. Redistributions in binary form must reproduce the above copyright
1823d232d7SDag-Erling Smørgrav  *    notice, this list of conditions and the following disclaimer in the
1923d232d7SDag-Erling Smørgrav  *    documentation and/or other materials provided with the distribution.
2023d232d7SDag-Erling Smørgrav  * 3. The name of the author may not be used to endorse or promote
2123d232d7SDag-Erling Smørgrav  *    products derived from this software without specific prior written
2223d232d7SDag-Erling Smørgrav  *    permission.
2323d232d7SDag-Erling Smørgrav  *
2423d232d7SDag-Erling Smørgrav  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
2523d232d7SDag-Erling Smørgrav  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2623d232d7SDag-Erling Smørgrav  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2723d232d7SDag-Erling Smørgrav  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2823d232d7SDag-Erling Smørgrav  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2923d232d7SDag-Erling Smørgrav  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3023d232d7SDag-Erling Smørgrav  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3123d232d7SDag-Erling Smørgrav  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3223d232d7SDag-Erling Smørgrav  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3323d232d7SDag-Erling Smørgrav  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3423d232d7SDag-Erling Smørgrav  * SUCH DAMAGE.
3523d232d7SDag-Erling Smørgrav  */
3623d232d7SDag-Erling Smørgrav 
3723d232d7SDag-Erling Smørgrav #ifndef _YPCLNT_H_INCLUDED
3823d232d7SDag-Erling Smørgrav 
3923d232d7SDag-Erling Smørgrav typedef struct ypclnt ypclnt_t;
4023d232d7SDag-Erling Smørgrav struct ypclnt {
4123d232d7SDag-Erling Smørgrav 	char	*domain;	/* Domain name */
4223d232d7SDag-Erling Smørgrav 	char	*map;		/* Map name */
4323d232d7SDag-Erling Smørgrav 	char	*server;	/* Server name */
4423d232d7SDag-Erling Smørgrav 	char	*error;		/* Error message */
4523d232d7SDag-Erling Smørgrav };
4623d232d7SDag-Erling Smørgrav 
4723d232d7SDag-Erling Smørgrav struct passwd;
4823d232d7SDag-Erling Smørgrav 
4923d232d7SDag-Erling Smørgrav ypclnt_t	*ypclnt_new(const char *, const char *, const char *);
5023d232d7SDag-Erling Smørgrav void		 ypclnt_free(ypclnt_t *);
5123d232d7SDag-Erling Smørgrav void		 ypclnt_error(ypclnt_t *, const char *, const char *, ...);
5223d232d7SDag-Erling Smørgrav int		 ypclnt_connect(ypclnt_t *);
53c744e752SDag-Erling Smørgrav int		 ypclnt_havepasswdd(ypclnt_t *);
5423d232d7SDag-Erling Smørgrav int		 ypclnt_passwd(ypclnt_t *, const struct passwd *, const char *);
5523d232d7SDag-Erling Smørgrav 
5623d232d7SDag-Erling Smørgrav #endif
57