summaryrefslogtreecommitdiff
path: root/accel-pptpd/radius/radius.h
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2010-09-08 15:51:29 +0400
committerKozlov Dmitry <dima@server>2010-09-08 15:51:29 +0400
commit4c6469a9fd820db713251a645ac2499782f796ed (patch)
treefd7c4926eb2a3e2aa047bd14da429f3d6a5f8e6f /accel-pptpd/radius/radius.h
parentec759f72fcf7d517fdfe8d043c75d0218363bc78 (diff)
downloadaccel-ppp-4c6469a9fd820db713251a645ac2499782f796ed.tar.gz
accel-ppp-4c6469a9fd820db713251a645ac2499782f796ed.zip
radius: implemented packet exchange
radius: implemented PAP authorization radius: implemented IP assigning triton: implemented userspace context switching and other stuff
Diffstat (limited to 'accel-pptpd/radius/radius.h')
-rw-r--r--accel-pptpd/radius/radius.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/accel-pptpd/radius/radius.h b/accel-pptpd/radius/radius.h
index 109981a..40b8320 100644
--- a/accel-pptpd/radius/radius.h
+++ b/accel-pptpd/radius/radius.h
@@ -1,6 +1,7 @@
#ifndef __RADIUS_H
#define __RADIUS_H
+#include <stdint.h>
#include <netinet/in.h>
#include "triton.h"
#include "ppp.h"
@@ -13,17 +14,21 @@
#define ATTR_TYPE_IPADDR 3
#define CODE_ACCESS_REQUEST 1
+#define CODE_ACCESS_ACCEPT 2
+#define CODE_ACCESS_REJECT 3
+#define CODE_ACCESS_CHALLENGE 11
struct radius_pd_t
{
struct ppp_pd_t pd;
struct ppp_t *ppp;
+ in_addr_t ipaddr;
};
typedef union
{
int integer;
- const char *string;
+ char *string;
time_t date;
in_addr_t ipaddr;
} rad_value_t;
@@ -56,6 +61,7 @@ struct rad_req_attr_t
//struct rad_dict_value_t *val;
rad_value_t val;
int len;
+ int printable:1;
};
struct rad_packet_t
@@ -68,9 +74,11 @@ struct rad_packet_t
};
struct rad_req_t
{
+ struct triton_context_t ctx;
struct triton_md_handler_t hnd;
struct triton_timer_t timeout;
- struct rad_packet_t pack;
+ uint8_t RA[16];
+ struct rad_packet_t *pack;
struct rad_packet_t *reply;
const char *server_name;
int server_port;
@@ -81,14 +89,18 @@ struct rad_req_t
extern int conf_max_try;
extern int conf_timeout;
+extern int conf_verbose;
extern char *conf_nas_identifier;
extern char *conf_nas_ip_address;
+extern char *conf_auth_server;
+extern char *conf_acct_server;
int rad_dict_load(const char *fname);
void rad_dict_free(struct rad_dict_t *dict);
struct rad_dict_attr_t *rad_dict_find_attr(const char *name);
-struct rad_dict_attr_t *rad_dict_find_attr_type(int type);
-struct rad_dict_value_t *rad_dict_find_val(struct rad_dict_attr_t *, const char *name);
+struct rad_dict_attr_t *rad_dict_find_attr_id(int type);
+struct rad_dict_value_t *rad_dict_find_val_name(struct rad_dict_attr_t *, const char *name);
+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);
void rad_req_free(struct rad_req_t *);
@@ -96,11 +108,13 @@ int rad_req_send(struct rad_req_t *);
int rad_req_wait(struct rad_req_t *, int);
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 rad_req_add_str(struct rad_req_t *req, const char *name, const char *val, int len, int printable);
-int rad_packet_build(struct rad_packet_t *pack);
+struct rad_packet_t *rad_packet_alloc(int code);
+int rad_packet_build(struct rad_packet_t *pack, uint8_t *RA);
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, ...));
#endif