|
@@ -207,18 +207,18 @@ RadiusHostDataSource::getAll(const Host::IdentifierType& identifier_type,
|
|
|
|
|
|
fprintf(stderr, "\"%s\" RADIUS Authentication OK\n", identifier_hex);
|
|
|
|
|
|
- /* print the known attributes in the reply */
|
|
|
+ /* parse the known attributes in the reply */
|
|
|
while(vp != NULL) {
|
|
|
if (rc_avpair_tostr(rh, vp, name, sizeof(name), value, sizeof(value)) == 0) {
|
|
|
- fprintf(stderr, "%s:\t%s\n", name, value);
|
|
|
+ if (std::string(name) == "Framed-IP-Address") {
|
|
|
+ host.reset(new Host(identifier_begin, identifier_len,
|
|
|
+ identifier_type, SubnetID(),
|
|
|
+ SubnetID(), asiolink::IOAddress(value)));
|
|
|
+ result.push_back(host);
|
|
|
+ }
|
|
|
}
|
|
|
vp = vp->next;
|
|
|
}
|
|
|
- host.reset(new Host(identifier_begin, identifier_len,
|
|
|
- identifier_type, SubnetID(),
|
|
|
- // TODO: set real IP address
|
|
|
- SubnetID(), asiolink::IOAddress("10.42.42.42")));
|
|
|
- result.push_back(host);
|
|
|
} else {
|
|
|
fprintf(stderr, "\"%s\" RADIUS Authentication failure (RC=%i)\n", identifier_hex, res);
|
|
|
}
|