version 1.1.1.3, 2016/11/01 09:56:12
|
version 1.1.1.6.2.1, 2023/09/27 11:08:01
|
Line 5
|
Line 5
|
* |
* |
*/ |
*/ |
|
|
|
#ifndef _RADIUS_H_ |
|
#define _RADIUS_H_ |
|
|
|
#include "defs.h" |
|
|
|
#ifdef USE_RADIUS |
|
|
#ifdef CCP_MPPC |
#ifdef CCP_MPPC |
#include <netgraph/ng_mppc.h> |
#include <netgraph/ng_mppc.h> |
#endif |
#endif |
Line 15
|
Line 22
|
|
|
#include "iface.h" |
#include "iface.h" |
|
|
#ifndef _RADIUS_H_ |
|
#define _RADIUS_H_ |
|
|
|
/* |
/* |
* DEFINITIONS |
* DEFINITIONS |
*/ |
*/ |
|
|
#define RADIUS_CHAP 1 | #define RADIUS_CHAP 1 |
#define RADIUS_PAP 2 | #define RADIUS_PAP 2 |
#define RADIUS_EAP 3 | #define RADIUS_EAP 3 |
#define RADIUS_MAX_SERVERS 10 | #define RADIUS_MAX_SERVERS 10 |
|
|
#ifndef RAD_UPDATE | #ifndef RAD_UPDATE |
#define RAD_UPDATE 3 | #define RAD_UPDATE 3 |
#endif | #endif |
|
|
#ifndef RAD_ACCT_INPUT_GIGAWORDS | #ifndef RAD_ACCT_INPUT_GIGAWORDS |
#define RAD_ACCT_INPUT_GIGAWORDS 52 | #define RAD_ACCT_INPUT_GIGAWORDS 52 |
#endif | #endif |
|
|
#ifndef RAD_ACCT_OUTPUT_GIGAWORDS | #ifndef RAD_ACCT_OUTPUT_GIGAWORDS |
#define RAD_ACCT_OUTPUT_GIGAWORDS 53 | #define RAD_ACCT_OUTPUT_GIGAWORDS 53 |
#endif | #endif |
|
|
#ifndef RAD_TUNNEL_TYPE | #ifndef RAD_TUNNEL_TYPE |
#define RAD_TUNNEL_TYPE 64 | #define RAD_TUNNEL_TYPE 64 |
#endif | #endif |
|
|
#ifndef RAD_TUNNEL_MEDIUM_TYPE | #ifndef RAD_TUNNEL_MEDIUM_TYPE |
#define RAD_TUNNEL_MEDIUM_TYPE 65 | #define RAD_TUNNEL_MEDIUM_TYPE 65 |
#endif | #endif |
|
|
#ifndef RAD_TUNNEL_CLIENT_ENDPOINT | #ifndef RAD_TUNNEL_CLIENT_ENDPOINT |
#define RAD_TUNNEL_CLIENT_ENDPOINT 66 | #define RAD_TUNNEL_CLIENT_ENDPOINT 66 |
#endif | #endif |
|
|
#ifndef RAD_TUNNEL_SERVER_ENDPOINT | #ifndef RAD_TUNNEL_SERVER_ENDPOINT |
#define RAD_TUNNEL_SERVER_ENDPOINT 67 | #define RAD_TUNNEL_SERVER_ENDPOINT 67 |
#endif | #endif |
|
|
#ifndef RAD_EAP_MESSAGE | #ifndef RAD_EAP_MESSAGE |
#define RAD_EAP_MESSAGE 79 | #define RAD_EAP_MESSAGE 79 |
#endif | #endif |
|
|
#ifndef RAD_MESSAGE_AUTHENTIC | #ifndef RAD_MESSAGE_AUTHENTIC |
#define RAD_MESSAGE_AUTHENTIC 80 | #define RAD_MESSAGE_AUTHENTIC 80 |
#endif | #endif |
|
|
#ifndef RAD_ACCT_INTERIM_INTERVAL | #ifndef RAD_ACCT_INTERIM_INTERVAL |
#define RAD_ACCT_INTERIM_INTERVAL 85 | #define RAD_ACCT_INTERIM_INTERVAL 85 |
#endif | #endif |
|
|
#ifndef RAD_NAS_PORT_ID | #ifndef RAD_NAS_PORT_ID |
#define RAD_NAS_PORT_ID 87 | #define RAD_NAS_PORT_ID 87 |
#endif | #endif |
|
|
#ifndef RAD_FRAMED_POOL | #ifndef RAD_FRAMED_POOL |
#define RAD_FRAMED_POOL 88 | #define RAD_FRAMED_POOL 88 |
#endif | #endif |
|
|
#ifndef RAD_TUNNEL_CLIENT_AUTH_ID | #ifndef RAD_TUNNEL_CLIENT_AUTH_ID |
#define RAD_TUNNEL_CLIENT_AUTH_ID 90 | #define RAD_TUNNEL_CLIENT_AUTH_ID 90 |
#endif | #endif |
|
|
#ifndef RAD_TUNNEL_SERVER_AUTH_ID | #ifndef RAD_TUNNEL_SERVER_AUTH_ID |
#define RAD_TUNNEL_SERVER_AUTH_ID 91 | #define RAD_TUNNEL_SERVER_AUTH_ID 91 |
#endif | #endif |
|
|
#ifndef RAD_MAX_ATTR_LEN | #ifndef RAD_MAX_ATTR_LEN |
#define RAD_MAX_ATTR_LEN 253 | #define RAD_MAX_ATTR_LEN 253 |
#endif | #endif |
|
|
#ifndef RAD_FRAMED_IPV6_ADDRESS | #ifndef RAD_FRAMED_IPV6_ADDRESS |
#define RAD_FRAMED_IPV6_ADDRESS 168 | #define RAD_FRAMED_IPV6_ADDRESS 168 |
#endif | #endif |
|
|
/* for mppe-keys */ | /* for mppe-keys */ |
#define AUTH_LEN 16 | #define AUTH_LEN 16 |
#define SALT_LEN 2 | #define SALT_LEN 2 |
|
|
/* max. length of RAD_ACCT_SESSION_ID, RAD_ACCT_MULTI_SESSION_ID */ | /* max. length of RAD_ACCT_SESSION_ID, RAD_ACCT_MULTI_SESSION_ID */ |
#define RAD_ACCT_MAX_SESSIONID 256 | #define RAD_ACCT_MAX_SESSIONID 256 |
|
|
#define RAD_VENDOR_MPD 12341 | #define RAD_VENDOR_MPD 12341 |
#define RAD_MPD_RULE 1 | #define RAD_MPD_RULE 1 |
#define RAD_MPD_PIPE 2 | #define RAD_MPD_PIPE 2 |
#define RAD_MPD_QUEUE 3 | #define RAD_MPD_QUEUE 3 |
#define RAD_MPD_TABLE 4 | #define RAD_MPD_TABLE 4 |
#define RAD_MPD_TABLE_STATIC 5 | #define RAD_MPD_TABLE_STATIC 5 |
#define RAD_MPD_FILTER 6 | #define RAD_MPD_FILTER 6 |
#define RAD_MPD_LIMIT 7 | #define RAD_MPD_LIMIT 7 |
#define RAD_MPD_INPUT_OCTETS 8 | #define RAD_MPD_INPUT_OCTETS 8 |
#define RAD_MPD_INPUT_PACKETS 9 | #define RAD_MPD_INPUT_PACKETS 9 |
#define RAD_MPD_OUTPUT_OCTETS 10 | #define RAD_MPD_OUTPUT_OCTETS 10 |
#define RAD_MPD_OUTPUT_PACKETS 11 | #define RAD_MPD_OUTPUT_PACKETS 11 |
#define RAD_MPD_LINK 12 | #define RAD_MPD_LINK 12 |
#define RAD_MPD_BUNDLE 13 | #define RAD_MPD_BUNDLE 13 |
#define RAD_MPD_IFACE 14 | #define RAD_MPD_IFACE 14 |
#define RAD_MPD_IFACE_INDEX 15 | #define RAD_MPD_IFACE_INDEX 15 |
#define RAD_MPD_INPUT_ACCT 16 | #define RAD_MPD_INPUT_ACCT 16 |
#define RAD_MPD_OUTPUT_ACCT 17 | #define RAD_MPD_OUTPUT_ACCT 17 |
#define RAD_MPD_ACTION 18 | #define RAD_MPD_ACTION 18 |
#define RAD_MPD_PEER_IDENT 19 | #define RAD_MPD_PEER_IDENT 19 |
#define RAD_MPD_IFACE_NAME 20 | #define RAD_MPD_IFACE_NAME 20 |
#define RAD_MPD_IFACE_DESCR 21 | #define RAD_MPD_IFACE_DESCR 21 |
#define RAD_MPD_IFACE_GROUP 22 | #define RAD_MPD_IFACE_GROUP 22 |
#define RAD_MPD_DROP_USER 154 | #define RAD_MPD_DROP_USER 154 |
|
|
/* Configuration options */ | /* Configuration options */ |
enum { | enum { |
RADIUS_CONF_MESSAGE_AUTHENTIC | RADIUS_CONF_MESSAGE_AUTHENTIC |
}; | }; |
|
|
extern const struct cmdtab RadiusSetCmds[]; | extern const struct cmdtab RadiusSetCmds[]; |
extern const struct cmdtab RadiusUnSetCmds[]; | extern const struct cmdtab RadiusUnSetCmds[]; |
|
|
/* Configuration for a radius server */ | /* Configuration for a radius server */ |
struct radiusserver_conf { | struct radiusserver_conf { |
char *hostname; | char *hostname; |
char *sharedsecret; | char *sharedsecret; |
in_port_t auth_port; | in_port_t auth_port; |
in_port_t acct_port; | in_port_t acct_port; |
struct radiusserver_conf *next; | struct radiusserver_conf *next; |
}; | }; |
typedef struct radiusserver_conf *RadServe_Conf; | typedef struct radiusserver_conf *RadServe_Conf; |
|
|
struct radiusconf { | struct radiusconf { |
int radius_timeout; | int radius_timeout; |
int radius_retries; | int radius_retries; |
#ifdef HAVE_RAD_BIND |
#ifdef HAVE_RAD_BIND |
struct in_addr src_addr; | struct in_addr src_addr; |
#endif |
#endif |
struct in_addr radius_me; | struct in_addr radius_me; |
struct u_addr radius_mev6; | struct u_addr radius_mev6; |
char *identifier; | char *identifier; |
char *file; | char *file; |
struct radiusserver_conf *server; | struct radiusserver_conf *server; |
struct optinfo options; /* Configured options */ | struct optinfo options; /* Configured options */ |
}; | }; |
typedef struct radiusconf *RadConf; | typedef struct radiusconf *RadConf; |
|
|
struct rad_chapvalue { | struct rad_chapvalue { |
u_char ident; | u_char ident; |
u_char response[CHAP_MAX_VAL]; | u_char response[CHAP_MAX_VAL]; |
}; | }; |
|
|
struct rad_mschapvalue { | struct rad_mschapvalue { |
u_char ident; | u_char ident; |
u_char flags; | u_char flags; |
u_char lm_response[24]; | u_char lm_response[24]; |
u_char nt_response[24]; | u_char nt_response[24]; |
}; | }; |
|
|
struct rad_mschapv2value { | struct rad_mschapv2value { |
u_char ident; | u_char ident; |
u_char flags; | u_char flags; |
u_char pchallenge[16]; | u_char pchallenge[16]; |
u_char reserved[8]; | u_char reserved[8]; |
u_char response[24]; | u_char response[24]; |
}; | }; |
|
|
struct authdata; | struct authdata; |
|
|
/* |
/* |
* FUNCTIONS |
* FUNCTIONS |
*/ |
*/ |
|
|
extern void RadiusInit(Link l); | extern void RadiusInit(Link l); |
extern int RadiusAuthenticate(struct authdata *auth); | extern int RadiusAuthenticate(struct authdata *auth); |
extern int RadiusAccount(struct authdata *auth); | extern int RadiusAccount(struct authdata *auth); |
extern void RadiusClose(struct authdata *auth); | extern void RadiusClose(struct authdata *auth); |
extern void RadiusEapProxy(void *arg); | extern void RadiusEapProxy(void *arg); |
extern int RadStat(Context ctx, int ac, char *av[], void *arg); | extern int RadStat(Context ctx, int ac, const char *const av[], const void *arg); |
|
|
|
#endif /* USE_RADIUS */ |
#endif |
#endif |