1 |
/* This file is part of GNU RADIUS. |
/* This file is part of GNU Radius. |
2 |
Copyright (C) 2001, Sergey Poznyakoff |
Copyright (C) 2001,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 Foundation, |
along with GNU Radius; if not, write to the Free Software Foundation, |
16 |
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
17 |
|
|
18 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
53 |
|
|
54 |
|
|
55 |
int |
int |
56 |
sym_counter(closure, sym) |
sym_counter(void *closure, User_symbol *sym) |
|
void *closure; |
|
|
User_symbol *sym; |
|
57 |
{ |
{ |
58 |
sym->ordnum = (*(int*)closure)++; |
sym->ordnum = (*(int*)closure)++; |
59 |
return 0; |
return 0; |
60 |
} |
} |
61 |
|
|
62 |
void |
void |
63 |
radck_setbit(r, rowsize, row, col) |
radck_setbit(unsigned *r, unsigned rowsize, unsigned row, unsigned col) |
|
unsigned *r, rowsize, row, col; |
|
64 |
{ |
{ |
65 |
SETBIT(r + rowsize * row, col); |
SETBIT(r + rowsize * row, col); |
66 |
} |
} |
67 |
|
|
68 |
int |
int |
69 |
radck_bitisset(r, rowsize, row, col) |
radck_bitisset(unsigned *r, unsigned rowsize, unsigned row, unsigned col) |
|
unsigned *r, rowsize, row, col; |
|
70 |
{ |
{ |
71 |
return BITISSET(r + rowsize * row, col); |
return BITISSET(r + rowsize * row, col); |
72 |
} |
} |
73 |
|
|
74 |
void |
void |
75 |
mark_profile(datum, sym, target_name) |
mark_profile(struct check_datum *datum, User_symbol *sym, char *target_name) |
|
struct check_datum *datum; |
|
|
User_symbol *sym; |
|
|
char *target_name; |
|
76 |
{ |
{ |
77 |
User_symbol *target = (User_symbol*)sym_lookup(datum->symtab, target_name); |
User_symbol *target = (User_symbol*)sym_lookup(datum->symtab, target_name); |
78 |
|
|
91 |
} |
} |
92 |
|
|
93 |
void |
void |
94 |
mark_list(datum, sym, list) |
mark_list(struct check_datum *datum, User_symbol *sym, VALUE_PAIR *list) |
|
struct check_datum *datum; |
|
|
User_symbol *sym; |
|
|
VALUE_PAIR *list; |
|
95 |
{ |
{ |
96 |
VALUE_PAIR *p; |
VALUE_PAIR *p; |
97 |
|
|
104 |
} |
} |
105 |
|
|
106 |
int |
int |
107 |
pass1(datum, sym) |
pass1(struct check_datum *datum, User_symbol *sym) |
|
struct check_datum *datum; |
|
|
User_symbol *sym; |
|
108 |
{ |
{ |
109 |
mark_list(datum, sym, sym->check); |
mark_list(datum, sym, sym->check); |
110 |
mark_list(datum, sym, sym->reply); |
mark_list(datum, sym, sym->reply); |
113 |
} |
} |
114 |
|
|
115 |
int |
int |
116 |
pass2(datum, sym) |
pass2(struct check_datum *datum, User_symbol *sym) |
|
struct check_datum *datum; |
|
|
User_symbol *sym; |
|
117 |
{ |
{ |
118 |
if (radck_bitisset(datum->r, datum->rlen, sym->ordnum, sym->ordnum)) { |
if (radck_bitisset(datum->r, datum->rlen, sym->ordnum, sym->ordnum)) { |
119 |
radlog(L_ERR, |
radlog(L_ERR, |
173 |
} |
} |
174 |
|
|
175 |
void |
void |
176 |
check_dup_attr(prev, ptr, line) |
check_dup_attr(VALUE_PAIR **prev, VALUE_PAIR *ptr, int line) |
|
VALUE_PAIR **prev; |
|
|
VALUE_PAIR *ptr; |
|
|
int line; |
|
177 |
{ |
{ |
178 |
if (*prev) { |
if (*prev) { |
179 |
radlog(L_WARN, |
radlog(L_WARN, |
185 |
|
|
186 |
/*ARGSUSED*/ |
/*ARGSUSED*/ |
187 |
int |
int |
188 |
fix_check_pairs(cf_file, filename, line, name, pairs) |
fix_check_pairs(int cf_file, char *filename, int line, char *name, |
189 |
int cf_file; |
VALUE_PAIR **pairs) |
|
char *filename; |
|
|
int line; |
|
|
char *name; |
|
|
VALUE_PAIR **pairs; |
|
190 |
{ |
{ |
191 |
VALUE_PAIR *p; |
VALUE_PAIR *p; |
192 |
VALUE_PAIR *auth_type = NULL; |
VALUE_PAIR *auth_type = NULL; |
366 |
} |
} |
367 |
|
|
368 |
int |
int |
369 |
fix_reply_pairs(cf_file, filename, line, name, pairs) |
fix_reply_pairs(int cf_file, char *filename, int line, |
370 |
int cf_file; |
char *name, VALUE_PAIR **pairs) |
|
char *filename; |
|
|
int line; |
|
|
char *name; |
|
|
VALUE_PAIR **pairs; |
|
371 |
{ |
{ |
372 |
VALUE_PAIR *p; |
VALUE_PAIR *p; |
373 |
int fall_through = 0; |
int fall_through = 0; |
407 |
to be the transitive closure of what was given. */ |
to be the transitive closure of what was given. */ |
408 |
|
|
409 |
void |
void |
410 |
TC(R, n) |
TC(unsigned *R, int n) |
|
unsigned *R; |
|
|
int n; |
|
411 |
{ |
{ |
412 |
register int rowsize; |
register int rowsize; |
413 |
register unsigned mask; |
register unsigned mask; |