xref: /freebsd/lib/libradius/radlib_vs.h (revision cc68614da8232d8baaca0ae0d0dd8f890f06623e)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2002 Brian Somers <brian@Awfulhak.org>
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
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.
15  *
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
26  * SUCH DAMAGE.
27  *
28  * $FreeBSD$
29  */
30 
31 #ifndef _RADLIB_VS_H_
32 #define _RADLIB_VS_H_
33 
34 #include <sys/types.h>
35 #include <netinet/in.h>
36 
37 #define	RAD_VENDOR_MICROSOFT	311		/* rfc2548 */
38 	#define	RAD_MICROSOFT_MS_CHAP_RESPONSE			1
39 	#define	RAD_MICROSOFT_MS_CHAP_ERROR			2
40 	#define	RAD_MICROSOFT_MS_CHAP_PW_1			3
41 	#define	RAD_MICROSOFT_MS_CHAP_PW_2			4
42 	#define	RAD_MICROSOFT_MS_CHAP_LM_ENC_PW			5
43 	#define	RAD_MICROSOFT_MS_CHAP_NT_ENC_PW			6
44 	#define	RAD_MICROSOFT_MS_MPPE_ENCRYPTION_POLICY		7
45 	#define	RAD_MICROSOFT_MS_MPPE_ENCRYPTION_TYPES		8
46 	#define	RAD_MICROSOFT_MS_RAS_VENDOR			9
47 	#define	RAD_MICROSOFT_MS_CHAP_DOMAIN			10
48 	#define	RAD_MICROSOFT_MS_CHAP_CHALLENGE			11
49 	#define	RAD_MICROSOFT_MS_CHAP_MPPE_KEYS			12
50 	#define	RAD_MICROSOFT_MS_BAP_USAGE			13
51 	#define	RAD_MICROSOFT_MS_LINK_UTILIZATION_THRESHOLD	14
52 	#define	RAD_MICROSOFT_MS_LINK_DROP_TIME_LIMIT		15
53 	#define	RAD_MICROSOFT_MS_MPPE_SEND_KEY			16
54 	#define	RAD_MICROSOFT_MS_MPPE_RECV_KEY			17
55 	#define	RAD_MICROSOFT_MS_RAS_VERSION			18
56 	#define	RAD_MICROSOFT_MS_OLD_ARAP_PASSWORD		19
57 	#define	RAD_MICROSOFT_MS_NEW_ARAP_PASSWORD		20
58 	#define	RAD_MICROSOFT_MS_ARAP_PASSWORD_CHANGE_REASON	21
59 	#define	RAD_MICROSOFT_MS_FILTER				22
60 	#define	RAD_MICROSOFT_MS_ACCT_AUTH_TYPE			23
61 	#define	RAD_MICROSOFT_MS_ACCT_EAP_TYPE			24
62 	#define	RAD_MICROSOFT_MS_CHAP2_RESPONSE			25
63 	#define	RAD_MICROSOFT_MS_CHAP2_SUCCESS			26
64 	#define	RAD_MICROSOFT_MS_CHAP2_PW			27
65 	#define	RAD_MICROSOFT_MS_PRIMARY_DNS_SERVER		28
66 	#define	RAD_MICROSOFT_MS_SECONDARY_DNS_SERVER		29
67 	#define	RAD_MICROSOFT_MS_PRIMARY_NBNS_SERVER		30
68 	#define	RAD_MICROSOFT_MS_SECONDARY_NBNS_SERVER		31
69 	#define	RAD_MICROSOFT_MS_ARAP_CHALLENGE			33
70 
71 #define SALT_LEN    2
72 
73 struct rad_handle;
74 
75 __BEGIN_DECLS
76 int	 rad_get_vendor_attr(u_int32_t *, const void **, size_t *);
77 int	 rad_put_vendor_addr(struct rad_handle *, int, int, struct in_addr);
78 int	 rad_put_vendor_addr6(struct rad_handle *, int, int, struct in6_addr);
79 int	 rad_put_vendor_attr(struct rad_handle *, int, int, const void *,
80 	    size_t);
81 int	 rad_put_vendor_int(struct rad_handle *, int, int, u_int32_t);
82 int	 rad_put_vendor_string(struct rad_handle *, int, int, const char *);
83 u_char	*rad_demangle_mppe_key(struct rad_handle *, const void *, size_t,
84 	    size_t *);
85 __END_DECLS
86 
87 #endif /* _RADLIB_VS_H_ */
88