DEFAULT_SITES = default inner-tunnel
DEFAULT_MODULES = acct_unique always attr_filter attr_rewrite chap checkval \
- counter cui detail detail.log digest dynamic_clients eap \
+ counter cui detail detail.log digest dhcp dynamic_clients eap \
echo exec expiration expr files inner-eap linelog logintime \
mschap ntlm_auth pap passwd preprocess radutmp realm \
replicate soh sradutmp unix utf8 wimax
expr
#
+ # The DHCP module currently just registers some DHCP related
+ # expansions, but will eventually contain all the code necessary
+ # for encoding and decoding DHCP packets.
+ #
+ dhcp
+
+
+ #
# We add the counter module here so that it registers
# the check-name attribute before any module which sets
# it
#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/rad_assert.h>
#include <freeradius-devel/base64.h>
-#include <freeradius-devel/dhcp.h>
#include <ctype.h>
return enc;
}
-static size_t xlat_dhcp_options(UNUSED void *instance, REQUEST *request,
- const char *fmt, char *out, size_t outlen)
-{
- VALUE_PAIR *vp, *head = NULL, *next;
- int decoded = 0;
-
- while (isspace((int) *fmt)) fmt++;
-
- if (!radius_get_vp(request, fmt, &vp) || !vp) {
- *out = '\0';
-
- return 0;
- }
-
- if ((fr_dhcp_decode_options(vp->vp_octets, vp->length, &head) < 0) ||
- (head == NULL)) {
- RDEBUG("WARNING: DHCP option decoding failed");
- goto fail;
- }
-
- next = head;
-
- do {
- next = next->next;
- decoded++;
- } while (next);
-
- pairmove(&(request->packet->vps), &head);
-
- fail:
-
- snprintf(out, outlen, "%i", decoded);
-
- return strlen(out);
-}
-
/**
* @brief Prints the current module processing the request
*/
XLAT_REGISTER(integer);
XLAT_REGISTER(hex);
XLAT_REGISTER(base64);
- XLAT_REGISTER(dhcp_options);
XLAT_REGISTER(string);
XLAT_REGISTER(module);