This allows radius plugin to handle additional radius attributes:
- Filter-ID (sets RADIUS_FILTER_ID env. var.)
- Framed-Route (sets RADIUS_FRAMED_ROUTE env. var.)
- Idle-Timeout
- NAS-IP-Address
- MS-Primary-DNS-Server
- MS-Secondary-DNS-Server
- MS-Primary-NBNS-Server
- MS-Secondary-NBNS-Server
[paulus@samba.org: Fixed formatting and simplified code making
dns-1 and dns-2 default to each other, similarly wins-1 and wins-2]
Signed-off-by: Paul Mackerras <paulus@samba.org>
static char *config_file = NULL;
static int add_avp(char **);
static struct avpopt {
static char *config_file = NULL;
static int add_avp(char **);
static struct avpopt {
int mppe_enc_policy = 0;
int mppe_enc_types = 0;
#endif
int mppe_enc_policy = 0;
int mppe_enc_types = 0;
#endif
+#ifdef MSDNS
+ ipcp_options *wo = &ipcp_wantoptions[0];
+ ipcp_options *ao = &ipcp_allowoptions[0];
+ int got_msdns_1 = 0;
+ int got_msdns_2 = 0;
+ int got_wins_1 = 0;
+ int got_wins_2 = 0;
+#endif
/* Send RADIUS attributes to anyone else who might be interested */
if (radius_attributes_hook) {
/* Send RADIUS attributes to anyone else who might be interested */
if (radius_attributes_hook) {
/* Session timeout */
maxconnect = vp->lvalue;
break;
/* Session timeout */
maxconnect = vp->lvalue;
break;
+ case PW_FILTER_ID:
+ /* packet filter, will be handled via ip-(up|down) script */
+ script_setenv("RADIUS_FILTER_ID", vp->strvalue, 1);
+ break;
+ case PW_FRAMED_ROUTE:
+ /* route, will be handled via ip-(up|down) script */
+ script_setenv("RADIUS_FRAMED_ROUTE", vp->strvalue, 1);
+ break;
+ case PW_IDLE_TIMEOUT:
+ /* idle parameter */
+ idle_time_limit = vp->lvalue;
+ break;
#ifdef MAXOCTETS
case PW_SESSION_OCTETS_LIMIT:
/* Session traffic limit */
#ifdef MAXOCTETS
case PW_SESSION_OCTETS_LIMIT:
/* Session traffic limit */
rstate.ip_addr = remote;
}
break;
rstate.ip_addr = remote;
}
break;
+ case PW_NAS_IP_ADDRESS:
+ wo->ouraddr = htonl(vp->lvalue);
+ break;
case PW_CLASS:
/* Save Class attribute to pass it in accounting request */
if (vp->lvalue <= MAXCLASSLEN) {
case PW_CLASS:
/* Save Class attribute to pass it in accounting request */
if (vp->lvalue <= MAXCLASSLEN) {
} else if (vp->vendorcode == VENDOR_MICROSOFT) {
} else if (vp->vendorcode == VENDOR_MICROSOFT) {
switch (vp->attribute) {
case PW_MS_CHAP2_SUCCESS:
if ((vp->lvalue != 43) || strncmp(vp->strvalue + 1, "S=", 2)) {
switch (vp->attribute) {
case PW_MS_CHAP2_SUCCESS:
if ((vp->lvalue != 43) || strncmp(vp->strvalue + 1, "S=", 2)) {
case PW_MS_PRIMARY_DNS_SERVER:
case PW_MS_PRIMARY_DNS_SERVER:
+ ao->dnsaddr[0] = htonl(vp->lvalue);
+ got_msdns_1 = 1;
+ if (!got_msdns_2)
+ ao->dnsaddr[1] = ao->dnsaddr[0];
+ break;
case PW_MS_SECONDARY_DNS_SERVER:
case PW_MS_SECONDARY_DNS_SERVER:
+ ao->dnsaddr[1] = htonl(vp->lvalue);
+ got_msdns_2 = 1;
+ if (!got_msdns_1)
+ ao->dnsaddr[0] = ao->dnsaddr[1];
+ break;
case PW_MS_PRIMARY_NBNS_SERVER:
case PW_MS_PRIMARY_NBNS_SERVER:
+ ao->winsaddr[0] = htonl(vp->lvalue);
+ got_wins_1 = 1;
+ if (!got_wins_2)
+ ao->winsaddr[1] = ao->winsaddr[0];
+ break;
case PW_MS_SECONDARY_NBNS_SERVER:
case PW_MS_SECONDARY_NBNS_SERVER:
+ ao->winsaddr[1] = htonl(vp->lvalue);
+ got_wins_2 = 1;
+ if (!got_wins_1)
+ ao->winsaddr[0] = ao->winsaddr[1];
#define PW_MS_CHAP_MPPE_KEYS 12 /* string */
#define PW_MS_MPPE_SEND_KEY 16 /* string */
#define PW_MS_MPPE_RECV_KEY 17 /* string */
#define PW_MS_CHAP_MPPE_KEYS 12 /* string */
#define PW_MS_MPPE_SEND_KEY 16 /* string */
#define PW_MS_MPPE_RECV_KEY 17 /* string */
+#define PW_MS_PRIMARY_DNS_SERVER 28 /* ipaddr */
+#define PW_MS_SECONDARY_DNS_SERVER 29 /* ipaddr */
+#define PW_MS_PRIMARY_NBNS_SERVER 30 /* ipaddr */
+#define PW_MS_SECONDARY_NBNS_SERVER 31 /* ipaddr */