summaryrefslogtreecommitdiff
path: root/usr.sbin/npppd/npppd/npppd_auth.h
blob: b3cf65bc04956fd26fc3297029f4db99fb479b18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* $OpenBSD: npppd_auth.h,v 1.3 2010/07/02 21:20:57 yasuoka Exp $ */

/*-
 * Copyright (c) 2009 Internet Initiative Japan Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */
#ifndef	NPPPD_AUTH_H
#define	NPPPD_AUTH_H 1

/** local authentication realm */
#define	NPPPD_AUTH_TYPE_LOCAL		1
/** RADIUS authentication realm */
#define	NPPPD_AUTH_TYPE_RADIUS		2

struct _npppd_auth_base;
struct _npppd_auth_radius;
struct _npppd_auth_local;

/** default type of local authentication realm */
typedef struct _npppd_auth_base npppd_auth_base;

/** type of RADIUS authentication realm */
typedef struct _npppd_auth_radius npppd_auth_radius;
typedef struct _npppd_auth_local npppd_auth_local;


#ifdef __cplusplus
extern "C" {
#endif

npppd_auth_base     *npppd_auth_create (int, const char *, void *);
void                npppd_auth_dispose (npppd_auth_base *);
void                npppd_auth_destroy (npppd_auth_base *);
int                 npppd_auth_reload (npppd_auth_base *);
int                 npppd_auth_get_user_password (npppd_auth_base *, const char *, char *, int *);
int                 npppd_auth_get_framed_ip (npppd_auth_base *, const char *, struct in_addr *, struct in_addr *);
int                 npppd_auth_get_calling_number (npppd_auth_base *, const char *, char *, int *);
int                 npppd_auth_get_type (npppd_auth_base *);
int                 npppd_auth_is_usable (npppd_auth_base *);
int                 npppd_auth_is_ready (npppd_auth_base *);
int                 npppd_auth_is_disposing (npppd_auth_base *);
int                 npppd_auth_is_eap_capable (npppd_auth_base *);
const char          *npppd_auth_get_label (npppd_auth_base *);
const char          *npppd_auth_get_name (npppd_auth_base *);
const char          *npppd_auth_get_suffix (npppd_auth_base *);
const char          *npppd_auth_username_for_auth (npppd_auth_base *, const char *, char *);
void                *npppd_auth_radius_get_radius_req_setting (npppd_auth_radius *);
void                npppd_auth_radius_server_failure_notify (npppd_auth_radius *, struct sockaddr *, const char *);

#ifdef __cplusplus
}
#endif
#endif