141 |
/* Forward declarations */ |
/* Forward declarations */ |
142 |
static RETSIGTYPE sig_handler(int sig); |
static RETSIGTYPE sig_handler(int sig); |
143 |
void radiusd_main_loop(); |
void radiusd_main_loop(); |
144 |
|
static size_t radius_count_channels(); |
145 |
|
|
146 |
struct cfg_stmt config_syntax[]; |
struct cfg_stmt config_syntax[]; |
147 |
|
|
148 |
|
|
301 |
rpp_kill(-1, SIGTERM); |
rpp_kill(-1, SIGTERM); |
302 |
sleep(2); |
sleep(2); |
303 |
radiusd_cleanup(); |
radiusd_cleanup(); |
304 |
|
if (rpp_count()) { |
305 |
|
rpp_kill(-1, SIGKILL); |
306 |
|
radiusd_cleanup(); |
307 |
|
} |
308 |
input_close_channels(radius_input); |
input_close_channels(radius_input); |
309 |
} |
} |
310 |
|
|
311 |
static void |
static void |
312 |
radiusd_postconfig_hook(void *a ARG_UNUSED, void *b ARG_UNUSED) |
radiusd_postconfig_hook(void *a ARG_UNUSED, void *b ARG_UNUSED) |
313 |
{ |
{ |
314 |
/*FIXME: Emit the warning: |
if (radius_count_channels() == 0) { |
315 |
radlog(L_ALERT, |
radlog(L_ALERT, |
316 |
_("Radiusd is not listening on any port. |
_("Radiusd is not listening on any port. Trying to continue anyway...")); |
317 |
Trying to continue anyway...")); |
} |
|
|
|
|
If necessary..*/ |
|
318 |
} |
} |
319 |
|
|
320 |
void |
void |
1134 |
return 0; |
return 0; |
1135 |
} |
} |
1136 |
|
|
1137 |
|
static int |
1138 |
|
channel_counter(void *item, void *data) |
1139 |
|
{ |
1140 |
|
struct udp_data *p = item; |
1141 |
|
if (p->type == R_AUTH || p->type == R_ACCT) |
1142 |
|
++*(size_t*)data; |
1143 |
|
return 0; |
1144 |
|
} |
1145 |
|
|
1146 |
|
static size_t |
1147 |
|
radius_count_channels() |
1148 |
|
{ |
1149 |
|
size_t count = 0; |
1150 |
|
|
1151 |
|
input_iterate_channels(radius_input, "udp", channel_counter, &count); |
1152 |
|
return count; |
1153 |
|
} |
1154 |
|
|
1155 |
|
|
1156 |
/* ************************************************************************* */ |
/* ************************************************************************* */ |
1157 |
|
|