20 |
# include <config.h> |
# include <config.h> |
21 |
#endif |
#endif |
22 |
#include <sys/types.h> |
#include <sys/types.h> |
23 |
|
#include <sys/stat.h> |
24 |
#include <netinet/in.h> |
#include <netinet/in.h> |
25 |
#include <netdb.h> |
#include <netdb.h> |
26 |
#include <fcntl.h> |
#include <fcntl.h> |
35 |
#include <radargp.h> |
#include <radargp.h> |
36 |
#include <radutmp.h> |
#include <radutmp.h> |
37 |
#include <rewrite.h> |
#include <rewrite.h> |
38 |
|
#include <argcv.h> |
39 |
#include <snmp/asn1.h> |
#include <snmp/asn1.h> |
40 |
#include <snmp/snmp.h> |
#include <snmp/snmp.h> |
41 |
|
#ifdef USE_SQL |
42 |
|
# include <radsql.h> |
43 |
|
#endif |
44 |
|
|
45 |
const char *argp_program_version = "radiusd (" PACKAGE ") " VERSION; |
const char *argp_program_version = "radiusd (" PACKAGE ") " VERSION; |
46 |
static char doc[] = N_("GNU radius daemon"); |
static char doc[] = N_("GNU radius daemon"); |
151 |
void radiusd_main_loop(); |
void radiusd_main_loop(); |
152 |
static size_t radius_count_channels(); |
static size_t radius_count_channels(); |
153 |
void radiusd_run_preconfig_hooks(void *data); |
void radiusd_run_preconfig_hooks(void *data); |
154 |
|
static int test_shell(); |
155 |
struct cfg_stmt config_syntax[]; |
struct cfg_stmt config_syntax[]; |
156 |
|
|
157 |
|
|
317 |
static void |
static void |
318 |
terminate_subprocesses() |
terminate_subprocesses() |
319 |
{ |
{ |
|
int i; |
|
320 |
int kill_sent = 0; |
int kill_sent = 0; |
321 |
time_t t; |
time_t t; |
322 |
|
|
388 |
void |
void |
389 |
common_init() |
common_init() |
390 |
{ |
{ |
|
int i; |
|
|
|
|
391 |
radlog(L_INFO, _("Starting")); |
radlog(L_INFO, _("Starting")); |
392 |
|
|
393 |
radiusd_pid = getpid(); |
radiusd_pid = getpid(); |
417 |
void |
void |
418 |
radiusd_daemon() |
radiusd_daemon() |
419 |
{ |
{ |
|
FILE *fp; |
|
420 |
char *p; |
char *p; |
421 |
int i; |
int i; |
422 |
pid_t pid; |
pid_t pid; |
521 |
radiusd_start() |
radiusd_start() |
522 |
{ |
{ |
523 |
#ifdef USE_SERVER_GUILE |
#ifdef USE_SERVER_GUILE |
524 |
char *argv[] = { "radiusd", NULL }; |
scheme_main(); |
|
scm_boot_guile (1, argv, scheme_boot, NULL); |
|
525 |
#else |
#else |
526 |
radiusd_main(); |
radiusd_main(); |
527 |
#endif |
#endif |
582 |
|
|
583 |
case serv_shutdown: |
case serv_shutdown: |
584 |
return CMD_SHUTDOWN; |
return CMD_SHUTDOWN; |
585 |
|
|
586 |
|
case serv_other: |
587 |
|
/* nothing */; |
588 |
} |
} |
589 |
} |
} |
590 |
#endif |
#endif |
947 |
static char buf[128]; |
static char buf[128]; |
948 |
int doprompt; |
int doprompt; |
949 |
|
|
950 |
char * |
static char * |
951 |
moreinput(char *buf, size_t bufsize) |
moreinput(char *buf, size_t bufsize) |
952 |
{ |
{ |
953 |
if (doprompt) |
if (doprompt) |
955 |
return fgets(buf, bufsize, stdin); |
return fgets(buf, bufsize, stdin); |
956 |
} |
} |
957 |
|
|
958 |
int |
static int |
959 |
test_shell() |
test_shell() |
960 |
{ |
{ |
961 |
char *tok; |
char *tok; |
1041 |
printf("%d (%u)", datum.ival, |
printf("%d (%u)", datum.ival, |
1042 |
(unsigned) datum.ival); |
(unsigned) datum.ival); |
1043 |
break; |
break; |
1044 |
|
|
1045 |
case String: |
case String: |
1046 |
printf("%s", datum.sval); |
printf("%s", datum.sval); |
1047 |
break; |
break; |
1048 |
|
|
1049 |
|
case Undefined: |
1050 |
|
printf("Undefined"); |
1051 |
|
break; |
1052 |
|
|
1053 |
|
default: |
1054 |
|
abort(); |
1055 |
} |
} |
1056 |
printf("\n"); |
printf("\n"); |
1057 |
} |
} |
1141 |
rpp_forward_request : request_respond)) |
rpp_forward_request : request_respond)) |
1142 |
request_free(req); |
request_free(req); |
1143 |
} |
} |
1144 |
|
return 0; |
1145 |
} |
} |
1146 |
|
|
1147 |
int |
int |