Massively cleaned up #include's, so they're in a consistent
[freeradius.git] / src / modules / rlm_sim_files / rlm_sim_files.c
index c3fdecb..c7f5bc3 100644 (file)
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  *
  * Copyright 2004  Michael Richardson <mcr@sandelman.ottawa.on.ca>
+ * Copyright 2006  The FreeRADIUS server project
  *
  * (Adapted from rlm_files/rlm_files.c )
  */
  */
 
 
-static const char rcsid[] = "$Id$";
+#include       <freeradius-devel/ident.h>
+RCSID("$Id$")
 
-#include       "autoconf.h"
-#include       "libradius.h"
+#include       <freeradius-devel/radiusd.h>
+#include       <freeradius-devel/modules.h>
 
 #include       <sys/stat.h>
-
-#include       <stdlib.h>
-#include       <string.h>
-#include       <netdb.h>
 #include       <ctype.h>
 #include       <fcntl.h>
 #include       <limits.h>
 
-#include       "radiusd.h"
-#include       "modules.h"
 #include        "../rlm_eap/libeap/eap_sim.h"
 
 struct sim_file_instance {
@@ -134,7 +130,7 @@ static int sim_file_authorize(void *instance, REQUEST *request)
         *      Grab the canonical user name.
         */
        namepair = request->username;
-       name = namepair ? (char *) namepair->strvalue : "NONE";
+       name = namepair ? (char *) namepair->vp_strvalue : "NONE";
 
        triplets = fopen(inst->file, "r");
 
@@ -275,10 +271,11 @@ static int sim_file_detach(void *instance)
 
 /* globally exported name */
 module_t rlm_sim_files = {
+       RLM_MODULE_INIT,
        "sim_files",
        0,                              /* type: reserved */
-       NULL,                           /* initialization */
        sim_file_instantiate,           /* instantiation */
+       sim_file_detach,                /* detach */
        {
                NULL,                   /* authentication */
                sim_file_authorize,     /* authorization */
@@ -289,7 +286,5 @@ module_t rlm_sim_files = {
                NULL,                   /* post-proxy */
                NULL                    /* post-auth */
        },
-       sim_file_detach,                /* detach */
-       NULL                            /* destroy */
 };