1 /* $OpenBSD: npppd_auth_local.h,v 1.6 2012/09/18 13:14:08 yasuoka Exp $ */
4 * Copyright (c) 2009 Internet Initiative Japan Inc.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 struct _npppd_auth_base
{
31 char name
[NPPPD_GENERIC_NAME_LEN
];
32 /** reference indicated to parent npppd */
34 /** type of authentication realm */
41 /** whether initialized or not */
45 /** Is the radius configuration ready */
47 /** whether EAP capable or not */
49 /** whether force to strip Windows-NT domain or not */
51 /** whether force to strip after the '@' of PPP username or not */
57 /** path name of account list */
58 char users_file_path
[64];
63 #ifdef USE_NPPPD_RADIUS
64 struct _npppd_auth_radius
{
65 /** parent of npppd_auth_base */
66 npppd_auth_base nar_base
;
68 /** RADIUS authentication server setting */
69 radius_req_setting
*rad_auth_setting
;
71 /** RADIUS accounting server setting */
72 radius_req_setting
*rad_acct_setting
;
76 /** type of local authentication realm */
77 struct _npppd_auth_local
{
78 /* parent npppd_auth_base */
79 npppd_auth_base nal_base
;
82 static npppd_auth_user
*npppd_auth_get_user (npppd_auth_base
*, const char *);
83 static int npppd_auth_base_log (npppd_auth_base
*, int, const char *, ...);
85 #ifdef USE_NPPPD_RADIUS
86 enum RADIUS_SERVER_TYPE
{
87 RADIUS_SERVER_TYPE_AUTH
,
88 RADIUS_SERVER_TYPE_ACCT
91 static int npppd_auth_radius_reload (npppd_auth_base
*, struct authconf
*);
94 #ifdef NPPPD_AUTH_DEBUG
95 #define NPPPD_AUTH_DBG(x) npppd_auth_base_log x
96 #define NPPPD_AUTH_ASSERT(x) ASSERT(x)
98 #define NPPPD_AUTH_DBG(x)
99 #define NPPPD_AUTH_ASSERT(x)
102 #define DEFAULT_RADIUS_AUTH_PORT 1812
103 #define DEFAULT_RADIUS_ACCT_PORT 1813
104 #define DEFAULT_RADIUS_TIMEOUT 9
105 #define DEFAULT_RADIUS_MAX_TRIES 3
106 #define DEFAULT_RADIUS_MAX_FAILOVERS 1