Add more NULL's to module data structures, in preparation for
[freeradius.git] / src / modules / rlm_dictionary / rlm_dictionary.c
1 /*
2  * rlm_dictionary.c     
3  *
4  * Version:     $Id$
5  *
6  *   This program is free software; you can redistribute it and/or modify
7  *   it under the terms of the GNU General Public License as published by
8  *   the Free Software Foundation; either version 2 of the License, or
9  *   (at your option) any later version.
10  *
11  *   This program is distributed in the hope that it will be useful,
12  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *   GNU General Public License for more details.
15  *
16  *   You should have received a copy of the GNU General Public License
17  *   along with this program; if not, write to the Free Software
18  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  * Copyright 2000  The FreeRADIUS server project
21  * Copyright 2000  Alan Curry <pacman@world.std.com>
22  */
23
24 #include "autoconf.h"
25 #include <stdio.h>
26 #include <stdlib.h>
27
28 #include "radiusd.h"
29 #include "modules.h"
30 #include "conffile.h"
31
32 static const char rcsid[] = "$Id$";
33
34 /*
35  *      Do any per-module initialization.  e.g. set up connections
36  *      to external databases, read configuration files, set up
37  *      dictionary entries, etc.
38  *
39  */
40 static int radius_init(void)
41 {
42         /* Initialize the dictionary */
43         if (dict_init(radius_dir, RADIUS_DICTIONARY) != 0) {
44                 radlog(L_ERR|L_CONS, "Errors reading dictionary %s/%s: %s",
45                     radius_dir, RADIUS_DICTIONARY, librad_errstr);
46                 return -1;
47         }
48
49         /*
50          *      Everything's OK, return without an error.
51          */
52         return 0;
53 }
54
55 /* globally exported name */
56 module_t rlm_dictionary = {
57         "dictionary",
58         0,                              /* type: reserved */
59         radius_init,                    /* initialization */
60         NULL,                           /* instantiation */
61         {
62                 NULL,                   /* authentication */
63                 NULL,                   /* authorization */
64                 NULL,                   /* preaccounting */
65                 NULL,                   /* accounting */
66                 NULL,                   /* checksimul */
67                 NULL,                   /* pre-proxy */
68                 NULL,                   /* post-proxy */
69                 NULL                    /* post-auth */
70         },
71         NULL,                           /* detach */
72         NULL                            /* destroy */
73 };