loginclass.h revision 225736
1351278Sdim/*- 2351278Sdim * Copyright (c) 2011 The FreeBSD Foundation 3351278Sdim * All rights reserved. 4351278Sdim * 5351278Sdim * This software was developed by Edward Tomasz Napierala under sponsorship 6351278Sdim * from the FreeBSD Foundation. 7351278Sdim * 8351278Sdim * Redistribution and use in source and binary forms, with or without 9351278Sdim * modification, are permitted provided that the following conditions 10351278Sdim * are met: 11351278Sdim * 1. Redistributions of source code must retain the above copyright 12351278Sdim * notice, this list of conditions and the following disclaimer. 13360784Sdim * 2. Redistributions in binary form must reproduce the above copyright 14360784Sdim * notice, this list of conditions and the following disclaimer in the 15351278Sdim * documentation and/or other materials provided with the distribution. 16351278Sdim * 17360784Sdim * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18360784Sdim * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19351278Sdim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20351278Sdim * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21360784Sdim * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22360784Sdim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23360784Sdim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24351278Sdim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25360784Sdim * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26360784Sdim * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27351278Sdim * SUCH DAMAGE. 28351278Sdim * 29360784Sdim * $FreeBSD: stable/9/sys/sys/loginclass.h 220137 2011-03-29 17:47:25Z trasz $ 30360784Sdim */ 31360784Sdim 32360784Sdim#ifndef _SYS_LOGINCLASS_H_ 33360784Sdim#define _SYS_LOGINCLASS_H_ 34360784Sdim 35360784Sdimstruct racct; 36360784Sdim 37360784Sdim/* 38360784Sdim * Exactly one of these structures exists per login class. 39360784Sdim */ 40360784Sdimstruct loginclass { 41360784Sdim LIST_ENTRY(loginclass) lc_next; 42360784Sdim char lc_name[MAXLOGNAME]; 43360784Sdim u_int lc_refcount; 44351278Sdim struct racct *lc_racct; 45351278Sdim}; 46360784Sdim 47360784Sdimvoid loginclass_hold(struct loginclass *lc); 48360784Sdimvoid loginclass_free(struct loginclass *lc); 49360784Sdimstruct loginclass *loginclass_find(const char *name); 50360784Sdimvoid loginclass_racct_foreach(void (*callback)(struct racct *racct, 51360784Sdim void *arg2, void *arg3), void *arg2, void *arg3); 52360784Sdim 53360784Sdim#endif /* !_SYS_LOGINCLASS_H_ */ 54360784Sdim