diff options
Diffstat (limited to 'accel-pptpd/radius/radius.h')
-rw-r--r-- | accel-pptpd/radius/radius.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/accel-pptpd/radius/radius.h b/accel-pptpd/radius/radius.h index 40b8320..c167151 100644 --- a/accel-pptpd/radius/radius.h +++ b/accel-pptpd/radius/radius.h @@ -18,11 +18,20 @@ #define CODE_ACCESS_REJECT 3 #define CODE_ACCESS_CHALLENGE 11 +#define CODE_ACCOUNTING_REQUEST 4 +#define CODE_ACCOUNTING_RESPONSE 5 + + struct radius_pd_t { struct ppp_pd_t pd; struct ppp_t *ppp; + + struct rad_req_t *acct_req; + struct triton_timer_t acct_interim_timer; + in_addr_t ipaddr; + int acct_interim_interval; }; typedef union @@ -92,8 +101,13 @@ extern int conf_timeout; extern int conf_verbose; extern char *conf_nas_identifier; extern char *conf_nas_ip_address; +extern char *conf_gw_ip_address; extern char *conf_auth_server; +extern char *conf_auth_server_secret; +extern int conf_auth_server_port; extern char *conf_acct_server; +extern char *conf_acct_server_secret; +extern int conf_acct_server_port; int rad_dict_load(const char *fname); void rad_dict_free(struct rad_dict_t *dict); @@ -103,12 +117,16 @@ struct rad_dict_value_t *rad_dict_find_val_name(struct rad_dict_attr_t *, const struct rad_dict_value_t *rad_dict_find_val(struct rad_dict_attr_t *, rad_value_t val); struct rad_req_t *rad_req_alloc(struct radius_pd_t *rpd, int code, const char *username); +int rad_req_acct_fill(struct rad_req_t *); void rad_req_free(struct rad_req_t *); int rad_req_send(struct rad_req_t *); int rad_req_wait(struct rad_req_t *, int); +struct rad_req_attr_t *rad_req_find_attr(struct rad_req_t *req, const char *name); int rad_req_add_int(struct rad_req_t *req, const char *name, int val); int rad_req_add_val(struct rad_req_t *req, const char *name, const char *val, int len); int rad_req_add_str(struct rad_req_t *req, const char *name, const char *val, int len, int printable); +int rad_req_change_int(struct rad_req_t *req, const char *name, int val); +int rad_req_change_val(struct rad_req_t *req, const char *name, const char *val, int len); struct rad_packet_t *rad_packet_alloc(int code); int rad_packet_build(struct rad_packet_t *pack, uint8_t *RA); @@ -116,6 +134,16 @@ struct rad_packet_t *rad_packet_recv(int fd); void rad_packet_free(struct rad_packet_t *); void rad_packet_print(struct rad_packet_t *pack, void (*print)(const char *fmt, ...)); +struct radius_pd_t *find_pd(struct ppp_t *ppp); +void rad_proc_attrs(struct rad_req_t *req); + +int rad_auth_pap(struct radius_pd_t *rpd, const char *username, va_list args); +int rad_auth_chap_md5(struct radius_pd_t *rpd, const char *username, va_list args); +int rad_auth_mschap_v1(struct radius_pd_t *rpd, const char *username, va_list args); +int rad_auth_mschap_v2(struct radius_pd_t *rpd, const char *username, va_list args); + +int rad_acct_start(struct radius_pd_t *rpd); +void rad_acct_stop(struct radius_pd_t *rpd); #endif |