1 /*-
2  * Copyright (c) 2002 Brian Somers <brian@Awfulhak.org>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24  * SUCH DAMAGE.
25  *
26  * $FreeBSD: src/lib/libradius/radlib_vs.h,v 1.3 2004/04/27 15:00:29 ru Exp $
27  */
28 
29 #ifndef _RADLIB_VS_H_
30 #define _RADLIB_VS_H_
31 
32 #include <sys/types.h>
33 #include <netinet/in.h>
34 
35 #define	RAD_VENDOR_MICROSOFT	311		/* rfc2548 */
36 	#define	RAD_MICROSOFT_MS_CHAP_RESPONSE			1
37 	#define	RAD_MICROSOFT_MS_CHAP_ERROR			2
38 	#define	RAD_MICROSOFT_MS_CHAP_PW_1			3
39 	#define	RAD_MICROSOFT_MS_CHAP_PW_2			4
40 	#define	RAD_MICROSOFT_MS_CHAP_LM_ENC_PW			5
41 	#define	RAD_MICROSOFT_MS_CHAP_NT_ENC_PW			6
42 	#define	RAD_MICROSOFT_MS_MPPE_ENCRYPTION_POLICY		7
43 	#define	RAD_MICROSOFT_MS_MPPE_ENCRYPTION_TYPES		8
44 	#define	RAD_MICROSOFT_MS_RAS_VENDOR			9
45 	#define	RAD_MICROSOFT_MS_CHAP_DOMAIN			10
46 	#define	RAD_MICROSOFT_MS_CHAP_CHALLENGE			11
47 	#define	RAD_MICROSOFT_MS_CHAP_MPPE_KEYS			12
48 	#define	RAD_MICROSOFT_MS_BAP_USAGE			13
49 	#define	RAD_MICROSOFT_MS_LINK_UTILIZATION_THRESHOLD	14
50 	#define	RAD_MICROSOFT_MS_LINK_DROP_TIME_LIMIT		15
51 	#define	RAD_MICROSOFT_MS_MPPE_SEND_KEY			16
52 	#define	RAD_MICROSOFT_MS_MPPE_RECV_KEY			17
53 	#define	RAD_MICROSOFT_MS_RAS_VERSION			18
54 	#define	RAD_MICROSOFT_MS_OLD_ARAP_PASSWORD		19
55 	#define	RAD_MICROSOFT_MS_NEW_ARAP_PASSWORD		20
56 	#define	RAD_MICROSOFT_MS_ARAP_PASSWORD_CHANGE_REASON	21
57 	#define	RAD_MICROSOFT_MS_FILTER				22
58 	#define	RAD_MICROSOFT_MS_ACCT_AUTH_TYPE			23
59 	#define	RAD_MICROSOFT_MS_ACCT_EAP_TYPE			24
60 	#define	RAD_MICROSOFT_MS_CHAP2_RESPONSE			25
61 	#define	RAD_MICROSOFT_MS_CHAP2_SUCCESS			26
62 	#define	RAD_MICROSOFT_MS_CHAP2_PW			27
63 	#define	RAD_MICROSOFT_MS_PRIMARY_DNS_SERVER		28
64 	#define	RAD_MICROSOFT_MS_SECONDARY_DNS_SERVER		29
65 	#define	RAD_MICROSOFT_MS_PRIMARY_NBNS_SERVER		30
66 	#define	RAD_MICROSOFT_MS_SECONDARY_NBNS_SERVER		31
67 	#define	RAD_MICROSOFT_MS_ARAP_CHALLENGE			33
68 
69 #define SALT_LEN    2
70 
71 struct rad_handle;
72 
73 __BEGIN_DECLS
74 int	 rad_get_vendor_attr(u_int32_t *, const void **, size_t *);
75 int	 rad_put_vendor_addr(struct rad_handle *, int, int, struct in_addr);
76 int	 rad_put_vendor_addr6(struct rad_handle *, int, int, struct in6_addr);
77 int	 rad_put_vendor_attr(struct rad_handle *, int, int, const void *,
78 	    size_t);
79 int	 rad_put_vendor_int(struct rad_handle *, int, int, u_int32_t);
80 int	 rad_put_vendor_string(struct rad_handle *, int, int, const char *);
81 u_char	*rad_demangle_mppe_key(struct rad_handle *, const void *, size_t,
82 	    size_t *);
83 __END_DECLS
84 
85 #endif /* _RADLIB_VS_H_ */
86