Added Module-Return-Code
authoraland <aland>
Sun, 16 Mar 2008 17:59:28 +0000 (17:59 +0000)
committeraland <aland>
Sun, 16 Mar 2008 17:59:28 +0000 (17:59 +0000)
share/dictionary.freeradius.internal
src/include/radius.h
src/main/modcall.c
src/main/xlat.c

index efa6410..37f5d7a 100644 (file)
@@ -155,6 +155,19 @@ VALUE      EAP-IKEv2-AuthType              secret                  1
 VALUE  EAP-IKEv2-AuthType              cert                    2
 VALUE  EAP-IKEv2-AuthType              both                    3
 
+ATTRIBUTE      Module-Return-Code                      1108    integer
+
+VALUE  Module-Return-Code              reject                  0
+VALUE  Module-Return-Code              fail                    1
+VALUE  Module-Return-Code              ok                      2
+VALUE  Module-Return-Code              handled                 3
+VALUE  Module-Return-Code              invalid                 4
+VALUE  Module-Return-Code              userlock                5
+VALUE  Module-Return-Code              notfound                6
+VALUE  Module-Return-Code              noop                    7
+VALUE  Module-Return-Code              updated                 8
+
+
 #
 #      Range:  1200-1279
 #              EAP-SIM (and other EAP type) weirdness.
index 38651b3..f19a007 100644 (file)
 #define PW_VIRTUAL_SERVER              1099
 #define PW_CLEARTEXT_PASSWORD          1100
 #define PW_PASSWORD_WITH_HEADER                1101
+#define PW_MODULE_RETURN_CODE          1108
 
 /*
  *     Integer Translations
index 6cd584e..f6d284e 100644 (file)
@@ -585,6 +585,11 @@ int modcall(int component, modcallable *c, REQUEST *request)
                       child->name ? child->name : "",
                       fr_int2str(rcode_table, myresult, "??"));
 
+               /*
+                *      This is a bit of a hack...
+                */
+               if (component != RLM_COMPONENT_SESS) request->simul_max = myresult;
+
 
                /*
                 *      FIXME: Allow modules to push a modcallable
index add8cdc..721b0c9 100644 (file)
@@ -345,6 +345,15 @@ static size_t xlat_packet(void *instance, REQUEST *request,
                                return strlen(out);
                                break;
 
+                       case PW_MODULE_RETURN_CODE:
+                               localvp.attribute = da->attr;
+
+                               /*
+                                *      See modcall.c for a bit of a hack.
+                                */
+                               localvp.vp_integer = request->simul_max;
+                               break;
+
                        default:
                                return 0; /* not found */
                                break;