summaryrefslogtreecommitdiff
path: root/usr.sbin/radiusd/radiusd.h
blob: 267d51ed81f719885ac562622163ea7275b6496b (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: radiusd.h,v 1.2 2015/07/27 08:58:09 yasuoka Exp $	*/

#ifndef	RADIUSD_H
#define	RADIUSD_H 1
/*
 * Copyright (c) 2013 Internet Initiative Japan Inc.
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */
#include <stdbool.h>

#define	RADIUSD_MODULE_NAME_LEN		32
#define	RADIUSD_SECRET_MAX		128
#define	RADIUSD_USER			"_radiusd"

enum imsg_type {
	IMSG_NONE = 0,
	IMSG_OK,
	IMSG_NG,
	IMSG_RADIUSD_MODULE_LOAD,
	IMSG_RADIUSD_MODULE_SET_CONFIG,
	IMSG_RADIUSD_MODULE_START,
	IMSG_RADIUSD_MODULE_NOTIFY_SECRET,
	IMSG_RADIUSD_MODULE_USERPASS,
	IMSG_RADIUSD_MODULE_USERPASS_OK,
	IMSG_RADIUSD_MODULE_USERPASS_FAIL,
	IMSG_RADIUSD_MODULE_ACCSREQ,
	/* Check the response's authenticator if the module doesn't */
	IMSG_RADIUSD_MODULE_ACCSREQ_ANSWER,
	IMSG_RADIUSD_MODULE_ACCSREQ_ABORTED,
	IMSG_RADIUSD_MODULE_STOP
};

/* Module sends LOAD when it becomes ready */
struct radiusd_module_load_arg {
	uint32_t	cap;	/* module capabity bits */
#define RADIUSD_MODULE_CAP_USERPASS	0x1
#define RADIUSD_MODULE_CAP_ACCSREQ	0x2
};

struct radiusd_module_object {
	size_t	size;
};

struct radiusd_module_set_arg {
	char	paramname[32];
	u_int	nparamval;
};

struct radiusd_module_userpass_arg {
	u_int	q_id;
	bool	has_pass;
	char	user[256];
	char	pass[256];
};

struct radiusd_module_radpkt_arg {
	u_int	q_id;
	bool	final;
	int	modified;
	int	datalen;
};

#endif