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