Annotation of embedaddon/mpd/src/radius.h, revision 1.1.1.2
1.1 misho 1: /*
2: * See ``COPYRIGHT.mpd''
3: *
1.1.1.2 ! misho 4: * $Id: radius.h,v 1.45 2012/03/19 08:30:45 amotin Exp $
1.1 misho 5: *
6: */
7:
8: #ifdef CCP_MPPC
9: #include <netgraph/ng_mppc.h>
10: #endif
11: #include <radlib.h>
12:
13: #include <net/if.h>
14: #include <net/if_types.h>
15:
16: #include "iface.h"
17:
18: #ifndef _RADIUS_H_
19: #define _RADIUS_H_
20:
21: /*
22: * DEFINITIONS
23: */
24:
25: #define RADIUS_CHAP 1
26: #define RADIUS_PAP 2
27: #define RADIUS_EAP 3
28: #define RADIUS_MAX_SERVERS 10
29:
30: #ifndef RAD_UPDATE
31: #define RAD_UPDATE 3
32: #endif
33:
34: #ifndef RAD_ACCT_INPUT_GIGAWORDS
35: #define RAD_ACCT_INPUT_GIGAWORDS 52
36: #endif
37:
38: #ifndef RAD_ACCT_OUTPUT_GIGAWORDS
39: #define RAD_ACCT_OUTPUT_GIGAWORDS 53
40: #endif
41:
42: #ifndef RAD_TUNNEL_TYPE
43: #define RAD_TUNNEL_TYPE 64
44: #endif
45:
46: #ifndef RAD_TUNNEL_MEDIUM_TYPE
47: #define RAD_TUNNEL_MEDIUM_TYPE 65
48: #endif
49:
50: #ifndef RAD_TUNNEL_CLIENT_ENDPOINT
51: #define RAD_TUNNEL_CLIENT_ENDPOINT 66
52: #endif
53:
54: #ifndef RAD_TUNNEL_SERVER_ENDPOINT
55: #define RAD_TUNNEL_SERVER_ENDPOINT 67
56: #endif
57:
58: #ifndef RAD_EAP_MESSAGE
59: #define RAD_EAP_MESSAGE 79
60: #endif
61:
62: #ifndef RAD_MESSAGE_AUTHENTIC
63: #define RAD_MESSAGE_AUTHENTIC 80
64: #endif
65:
66: #ifndef RAD_ACCT_INTERIM_INTERVAL
67: #define RAD_ACCT_INTERIM_INTERVAL 85
68: #endif
69:
70: #ifndef RAD_NAS_PORT_ID
71: #define RAD_NAS_PORT_ID 87
72: #endif
73:
74: #ifndef RAD_FRAMED_POOL
75: #define RAD_FRAMED_POOL 88
76: #endif
77:
78: #ifndef RAD_TUNNEL_CLIENT_AUTH_ID
79: #define RAD_TUNNEL_CLIENT_AUTH_ID 90
80: #endif
81:
82: #ifndef RAD_TUNNEL_SERVER_AUTH_ID
83: #define RAD_TUNNEL_SERVER_AUTH_ID 91
84: #endif
85:
86: #ifndef RAD_MAX_ATTR_LEN
87: #define RAD_MAX_ATTR_LEN 253
88: #endif
89:
90: /* for mppe-keys */
91: #define AUTH_LEN 16
92: #define SALT_LEN 2
93:
94: /* max. length of RAD_ACCT_SESSION_ID, RAD_ACCT_MULTI_SESSION_ID */
95: #define RAD_ACCT_MAX_SESSIONID 256
96:
97: #define RAD_VENDOR_MPD 12341
98: #define RAD_MPD_RULE 1
99: #define RAD_MPD_PIPE 2
100: #define RAD_MPD_QUEUE 3
101: #define RAD_MPD_TABLE 4
102: #define RAD_MPD_TABLE_STATIC 5
103: #define RAD_MPD_FILTER 6
104: #define RAD_MPD_LIMIT 7
105: #define RAD_MPD_INPUT_OCTETS 8
106: #define RAD_MPD_INPUT_PACKETS 9
107: #define RAD_MPD_OUTPUT_OCTETS 10
108: #define RAD_MPD_OUTPUT_PACKETS 11
109: #define RAD_MPD_LINK 12
110: #define RAD_MPD_BUNDLE 13
111: #define RAD_MPD_IFACE 14
112: #define RAD_MPD_IFACE_INDEX 15
113: #define RAD_MPD_INPUT_ACCT 16
114: #define RAD_MPD_OUTPUT_ACCT 17
115: #define RAD_MPD_ACTION 18
116: #define RAD_MPD_PEER_IDENT 19
117: #define RAD_MPD_IFACE_NAME 20
118: #define RAD_MPD_IFACE_DESCR 21
119: #define RAD_MPD_IFACE_GROUP 22
120: #define RAD_MPD_DROP_USER 154
121:
122: /* Configuration options */
123: enum {
124: RADIUS_CONF_MESSAGE_AUTHENTIC
125: };
126:
127: extern const struct cmdtab RadiusSetCmds[];
1.1.1.2 ! misho 128: extern const struct cmdtab RadiusUnSetCmds[];
1.1 misho 129:
130: /* Configuration for a radius server */
131: struct radiusserver_conf {
132: char *hostname;
133: char *sharedsecret;
134: in_port_t auth_port;
135: in_port_t acct_port;
136: struct radiusserver_conf *next;
137: };
138: typedef struct radiusserver_conf *RadServe_Conf;
139:
140: struct radiusconf {
141: int radius_timeout;
142: int radius_retries;
143: struct in_addr radius_me;
144: struct u_addr radius_mev6;
145: char *identifier;
146: char *file;
147: struct radiusserver_conf *server;
148: struct optinfo options; /* Configured options */
149: };
150: typedef struct radiusconf *RadConf;
151:
152: struct rad_chapvalue {
153: u_char ident;
154: u_char response[CHAP_MAX_VAL];
155: };
156:
157: struct rad_mschapvalue {
158: u_char ident;
159: u_char flags;
160: u_char lm_response[24];
161: u_char nt_response[24];
162: };
163:
164: struct rad_mschapv2value {
165: u_char ident;
166: u_char flags;
167: u_char pchallenge[16];
168: u_char reserved[8];
169: u_char response[24];
170: };
171:
172: struct authdata;
173:
174: /*
175: * FUNCTIONS
176: */
177:
178: extern void RadiusInit(Link l);
179: extern int RadiusAuthenticate(struct authdata *auth);
180: extern int RadiusAccount(struct authdata *auth);
181: extern void RadiusClose(struct authdata *auth);
182: extern void RadiusEapProxy(void *arg);
183: extern int RadStat(Context ctx, int ac, char *av[], void *arg);
184:
185: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>