/[radius]/radius/lib/nas.c
ViewVC logotype

Diff of /radius/lib/nas.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by gray, Tue Apr 29 13:57:59 2003 UTC revision 1.6 by gray, Wed Apr 30 08:38:29 2003 UTC
# Line 1  Line 1 
1  /* This file is part of GNU RADIUS.  /* This file is part of GNU Radius.
2     Copyright (C) 2001, Free Software Foundation     Copyright (C) 2000,2001,2002,2003 Sergey Poznyakoff
3        
4     This program is free software; you can redistribute it and/or modify     GNU Radius is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.     (at your option) any later version.
8        
9     This program is distributed in the hope that it will be useful,     GNU Radius is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.     GNU General Public License for more details.
13        
14     You should have received a copy of the GNU General Public License     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software     along with GNU Radius; if not, write to the Free Software Foundation,
16     Foundation, Inc., 59 Temple Place - Suite 330, Boston,     Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
    MA 02111-1307, USA. */  
17    
18  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
19  # include <config.h>  # include <config.h>
# Line 33  static int read_naslist_entry(); Line 32  static int read_naslist_entry();
32    
33  /* Free a NAS list */  /* Free a NAS list */
34  void  void
35  nas_free_list(list)  nas_free_list(NAS *list)
         NAS *list;  
36  {  {
37          NAS *next;          NAS *next;
38    
# Line 51  nas_free_list(list) Line 49  nas_free_list(list)
49   */   */
50  /*ARGSUSED*/  /*ARGSUSED*/
51  int  int
52  read_naslist_entry(unused, fc, fv, file, lineno)  read_naslist_entry(void *unused, int fc, char **fv, char *file,
53          void *unused;                     int lineno)
         int fc;  
         char **fv;  
         char *file;  
         int lineno;  
54  {  {
55          NAS nas, *nasp;          NAS nas, *nasp;
56    
# Line 95  read_naslist_entry(unused, fc, fv, file, Line 89  read_naslist_entry(unused, fc, fv, file,
89   * Read naslist file   * Read naslist file
90   */   */
91  int  int
92  nas_read_file(file)  nas_read_file(char *file)
         char *file;  
93  {  {
94          nas_free_list(naslist);          nas_free_list(naslist);
95          naslist = NULL;          naslist = NULL;
# Line 109  nas_read_file(file) Line 102  nas_read_file(file)
102   */   */
103    
104  NAS *  NAS *
105  nas_lookup_name(name)  nas_lookup_name(char *name)
         char *name;  
106  {  {
107          NAS *nas;          NAS *nas;
108          NAS *defnas = NULL;          NAS *defnas = NULL;
# Line 127  nas_lookup_name(name) Line 119  nas_lookup_name(name)
119    
120  /* Find a nas in the NAS list */  /* Find a nas in the NAS list */
121  NAS *  NAS *
122  nas_lookup_ip(ipaddr)  nas_lookup_ip(UINT4 ipaddr)
         UINT4 ipaddr;  
123  {  {
124          NAS *nas;          NAS *nas;
125          NAS *defnas = NULL;          NAS *defnas = NULL;
# Line 145  nas_lookup_ip(ipaddr) Line 136  nas_lookup_ip(ipaddr)
136    
137  /* Find the name of a nas (prefer short name) */  /* Find the name of a nas (prefer short name) */
138  char *  char *
139  nas_ip_to_name(ipaddr, buf, size)  nas_ip_to_name(UINT4 ipaddr, char *buf, size_t size)
         UINT4 ipaddr;  
         char *buf;  
         size_t size;  
140  {  {
141          NAS *nas;          NAS *nas;
142                    
# Line 163  nas_ip_to_name(ipaddr, buf, size) Line 151  nas_ip_to_name(ipaddr, buf, size)
151    
152  /* Find the name of a nas (prefer short name) based on the request */  /* Find the name of a nas (prefer short name) based on the request */
153  NAS *  NAS *
154  nas_request_to_nas(radreq)  nas_request_to_nas(RADIUS_REQ *radreq)
         RADIUS_REQ *radreq;  
155  {  {
156          UINT4 ipaddr;          UINT4 ipaddr;
157          VALUE_PAIR *pair;          VALUE_PAIR *pair;
# Line 178  nas_request_to_nas(radreq) Line 165  nas_request_to_nas(radreq)
165  }  }
166    
167  char *  char *
168  nas_request_to_name(radreq, buf, size)  nas_request_to_name(RADIUS_REQ *radreq, char *buf, size_t size)
         RADIUS_REQ *radreq;  
         char *buf;  
         size_t size;  
169  {  {
170          UINT4 ipaddr;          UINT4 ipaddr;
171          NAS *nas;          NAS *nas;
# Line 202  nas_request_to_name(radreq, buf, size) Line 186  nas_request_to_name(radreq, buf, size)
186  }  }
187    
188  NAS *  NAS *
189  nas_next(p)  nas_next(NAS *p)
         NAS *p;  
190  {  {
191          if (!p)          if (!p)
192                  return naslist;                  return naslist;

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26