1219304Strasz/*-
2219304Strasz * Copyright (c) 2011 The FreeBSD Foundation
3219304Strasz * All rights reserved.
4219304Strasz *
5219304Strasz * This software was developed by Edward Tomasz Napierala under sponsorship
6219304Strasz * from the FreeBSD Foundation.
7219304Strasz *
8219304Strasz * Redistribution and use in source and binary forms, with or without
9219304Strasz * modification, are permitted provided that the following conditions
10219304Strasz * are met:
11219304Strasz * 1. Redistributions of source code must retain the above copyright
12219304Strasz *    notice, this list of conditions and the following disclaimer.
13219304Strasz * 2. Redistributions in binary form must reproduce the above copyright
14219304Strasz *    notice, this list of conditions and the following disclaimer in the
15219304Strasz *    documentation and/or other materials provided with the distribution.
16219304Strasz *
17219304Strasz * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18219304Strasz * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19219304Strasz * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20219304Strasz * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21219304Strasz * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22219304Strasz * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23219304Strasz * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24219304Strasz * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25219304Strasz * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26219304Strasz * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27219304Strasz * SUCH DAMAGE.
28219304Strasz *
29219304Strasz * $FreeBSD$
30219304Strasz */
31219304Strasz
32219304Strasz#ifndef _SYS_LOGINCLASS_H_
33219304Strasz#define	_SYS_LOGINCLASS_H_
34219304Strasz
35220137Straszstruct racct;
36220137Strasz
37219304Strasz/*
38219304Strasz * Exactly one of these structures exists per login class.
39219304Strasz */
40219304Straszstruct loginclass {
41219304Strasz	LIST_ENTRY(loginclass)	lc_next;
42219304Strasz	char			lc_name[MAXLOGNAME];
43219304Strasz	u_int			lc_refcount;
44220137Strasz	struct racct		*lc_racct;
45219304Strasz};
46219304Strasz
47219304Straszvoid	loginclass_hold(struct loginclass *lc);
48219304Straszvoid	loginclass_free(struct loginclass *lc);
49219304Straszstruct loginclass	*loginclass_find(const char *name);
50220137Straszvoid	loginclass_racct_foreach(void (*callback)(struct racct *racct,
51220137Strasz	    void *arg2, void *arg3), void *arg2, void *arg3);
52219304Strasz
53219304Strasz#endif /* !_SYS_LOGINCLASS_H_ */
54