File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / mpd / src / radius.h
Revision 1.1.1.6 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Mar 17 00:39:23 2021 UTC (4 years ago) by misho
Branches: mpd, MAIN
CVS tags: v5_9p16, v5_9, HEAD
mpd 5.9

    1: /*
    2:  * See ``COPYRIGHT.mpd''
    3:  *
    4:  * $Id: radius.h,v 1.1.1.6 2021/03/17 00:39:23 misho Exp $
    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: #ifndef RAD_FRAMED_IPV6_ADDRESS
   91: #define RAD_FRAMED_IPV6_ADDRESS	168
   92: #endif
   93: 
   94: /* for mppe-keys */
   95: #define AUTH_LEN		16
   96: #define SALT_LEN		2
   97: 
   98: /* max. length of RAD_ACCT_SESSION_ID, RAD_ACCT_MULTI_SESSION_ID */
   99: #define RAD_ACCT_MAX_SESSIONID	256
  100: 
  101: #define RAD_VENDOR_MPD		12341
  102: #define RAD_MPD_RULE		1
  103: #define RAD_MPD_PIPE		2
  104: #define RAD_MPD_QUEUE		3
  105: #define RAD_MPD_TABLE		4
  106: #define RAD_MPD_TABLE_STATIC	5
  107: #define RAD_MPD_FILTER		6
  108: #define RAD_MPD_LIMIT		7
  109: #define RAD_MPD_INPUT_OCTETS	8
  110: #define RAD_MPD_INPUT_PACKETS	9
  111: #define RAD_MPD_OUTPUT_OCTETS	10
  112: #define RAD_MPD_OUTPUT_PACKETS	11
  113: #define RAD_MPD_LINK		12
  114: #define RAD_MPD_BUNDLE		13
  115: #define RAD_MPD_IFACE		14
  116: #define RAD_MPD_IFACE_INDEX	15
  117: #define RAD_MPD_INPUT_ACCT	16
  118: #define RAD_MPD_OUTPUT_ACCT	17
  119: #define RAD_MPD_ACTION		18
  120: #define RAD_MPD_PEER_IDENT	19
  121: #define RAD_MPD_IFACE_NAME	20
  122: #define RAD_MPD_IFACE_DESCR	21
  123: #define RAD_MPD_IFACE_GROUP	22
  124: #define RAD_MPD_DROP_USER	154
  125: 
  126: /* Configuration options */
  127: enum {
  128: 	RADIUS_CONF_MESSAGE_AUTHENTIC
  129: };
  130: 
  131: extern const struct cmdtab RadiusSetCmds[];
  132: extern const struct cmdtab RadiusUnSetCmds[];
  133: 
  134: /* Configuration for a radius server */
  135: struct radiusserver_conf {
  136: 	char	*hostname;
  137: 	char	*sharedsecret;
  138: 	in_port_t auth_port;
  139: 	in_port_t acct_port;
  140: 	struct	radiusserver_conf *next;
  141: };
  142: typedef struct radiusserver_conf *RadServe_Conf;
  143: 
  144: struct radiusconf {
  145: 	int	radius_timeout;
  146: 	int	radius_retries;
  147: #ifdef HAVE_RAD_BIND
  148: 	struct	in_addr src_addr;
  149: #endif
  150: 	struct	in_addr radius_me;
  151: 	struct	u_addr radius_mev6;
  152: 	char	*identifier;
  153: 	char	*file;
  154: 	struct	radiusserver_conf *server;
  155: 	struct	optinfo options;		/* Configured options */
  156: };
  157: typedef struct radiusconf *RadConf;
  158: 
  159: struct rad_chapvalue {
  160: 	u_char	ident;
  161: 	u_char	response[CHAP_MAX_VAL];
  162: };
  163: 
  164: struct rad_mschapvalue {
  165: 	u_char	ident;
  166: 	u_char	flags;
  167: 	u_char	lm_response[24];
  168: 	u_char	nt_response[24];
  169: };
  170: 
  171: struct rad_mschapv2value {
  172: 	u_char	ident;
  173: 	u_char	flags;
  174: 	u_char	pchallenge[16];
  175: 	u_char	reserved[8];
  176: 	u_char	response[24];
  177: };
  178: 
  179: struct authdata;
  180: 
  181: /*
  182:  * FUNCTIONS
  183:  */
  184: 
  185: extern void RadiusInit(Link l);
  186: extern int RadiusAuthenticate(struct authdata *auth);
  187: extern int RadiusAccount(struct authdata *auth);
  188: extern void RadiusClose(struct authdata *auth);
  189: extern void RadiusEapProxy(void *arg);
  190: extern int RadStat(Context ctx, int ac, const char *const av[], const void *arg);
  191: 
  192: #endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>