diff options
author | Kozlov Dmitry <dima@server> | 2010-09-08 15:51:29 +0400 |
---|---|---|
committer | Kozlov Dmitry <dima@server> | 2010-09-08 15:51:29 +0400 |
commit | 4c6469a9fd820db713251a645ac2499782f796ed (patch) | |
tree | fd7c4926eb2a3e2aa047bd14da429f3d6a5f8e6f /accel-pptpd/ipdb.c | |
parent | ec759f72fcf7d517fdfe8d043c75d0218363bc78 (diff) | |
download | accel-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/ipdb.c')
-rw-r--r-- | accel-pptpd/ipdb.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/accel-pptpd/ipdb.c b/accel-pptpd/ipdb.c index 8ac86cb6..7b679dc7 100644 --- a/accel-pptpd/ipdb.c +++ b/accel-pptpd/ipdb.c @@ -1,11 +1,28 @@ #include "triton.h" #include "ipdb.h" -int __export ipdb_get(in_addr_t *addr, in_addr_t *peer_addr) +static LIST_HEAD(ipdb_handlers); + +int __export ipdb_get(struct ppp_t *ppp, in_addr_t *addr, in_addr_t *peer_addr) { - *addr=inet_addr("192.168.200.100"); - *peer_addr=inet_addr("192.168.200.200"); + struct ipdb_t *ipdb; + + list_for_each_entry(ipdb, &ipdb_handlers, entry) + if (!ipdb->get(ppp, addr, peer_addr)) + return 0; - return 0; + return -1; } +void __export ipdb_put(struct ppp_t *ppp, in_addr_t addr, in_addr_t peer_addr) +{ + struct ipdb_t *ipdb; + list_for_each_entry(ipdb, &ipdb_handlers, entry) + if (ipdb->put) + ipdb->put(ppp, addr, peer_addr); +} + +void __export ipdb_register(struct ipdb_t *ipdb) +{ + list_add_tail(&ipdb->entry, &ipdb_handlers); +} |