]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Move dhcp_options: xlat to rlm_dhcp module
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 1 Nov 2012 14:18:01 +0000 (14:18 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 1 Nov 2012 14:18:01 +0000 (14:18 +0000)
raddb/Makefile
raddb/radiusd.conf.in
src/main/xlat.c
src/modules/stable

index 23ecf371769b3257b6f99cf8c23955c3e6fe28c3..164c0b73c25038a2d93f6ed71f6dc642f015f79c 100644 (file)
@@ -18,7 +18,7 @@ FILES = acct_users attrs attrs.access_reject attrs.accounting_response        \
 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
index a79fed6a8085104dd0026a9089695ea86551f828..273d7494c48e1c3f3c4fa91be354d7f472503881 100644 (file)
@@ -797,6 +797,14 @@ instantiate {
        #
        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
index d941085e9bca3926add8b7307edb2e6d15030802..46419fd787b6648bb76de7167091d07c23951367 100644 (file)
@@ -28,7 +28,6 @@ RCSID("$Id$")
 #include       <freeradius-devel/radiusd.h>
 #include       <freeradius-devel/rad_assert.h>
 #include       <freeradius-devel/base64.h>
-#include       <freeradius-devel/dhcp.h>
 
 #include       <ctype.h>
 
@@ -598,42 +597,6 @@ static size_t xlat_base64(UNUSED void *instance, REQUEST *request,
        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
  */
@@ -868,7 +831,6 @@ int xlat_register(const char *module, RAD_XLAT_FUNC func, void *instance)
                XLAT_REGISTER(integer);
                XLAT_REGISTER(hex);
                XLAT_REGISTER(base64);
-               XLAT_REGISTER(dhcp_options);
                XLAT_REGISTER(string);
                XLAT_REGISTER(module);
 
index b8d32cae67bcb3b2b7dcdfdbe92dd94e91a6da65..c13de534a4641d9e408bcf5270a7d3992706414a 100644 (file)
@@ -9,6 +9,7 @@ rlm_copy_packet
 rlm_counter
 rlm_dbm
 rlm_detail
+rlm_dhcp
 rlm_digest
 rlm_dynamic_clients
 rlm_eap