summaryrefslogtreecommitdiff
path: root/accel-pppd/ipdb.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2011-01-05 15:18:59 +0300
committerDmitry Kozlov <xeb@mail.ru>2011-01-05 15:18:59 +0300
commitf28cb1b0a926f1ea98700b7871537ad1793511fd (patch)
treebaf35570bc6b38b6fab5b6524e8f19f58f71e57f /accel-pppd/ipdb.c
parent2fdf3586c13a72c36f9530084962e29d57dc0329 (diff)
downloadaccel-ppp-f28cb1b0a926f1ea98700b7871537ad1793511fd.tar.gz
accel-ppp-f28cb1b0a926f1ea98700b7871537ad1793511fd.zip
rename accel-pptp to accel-ppp
Diffstat (limited to 'accel-pppd/ipdb.c')
-rw-r--r--accel-pppd/ipdb.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/accel-pppd/ipdb.c b/accel-pppd/ipdb.c
new file mode 100644
index 00000000..a08d3be2
--- /dev/null
+++ b/accel-pppd/ipdb.c
@@ -0,0 +1,31 @@
+#include "triton.h"
+#include "ipdb.h"
+
+#include "memdebug.h"
+
+static LIST_HEAD(ipdb_handlers);
+
+__export struct ipdb_item_t *ipdb_get(struct ppp_t *ppp)
+{
+ struct ipdb_t *ipdb;
+ struct ipdb_item_t *it;
+
+ list_for_each_entry(ipdb, &ipdb_handlers, entry) {
+ it = ipdb->get(ppp);
+ if (it)
+ return it;
+ }
+
+ return NULL;
+}
+
+void __export ipdb_put(struct ppp_t *ppp, struct ipdb_item_t *it)
+{
+ if (it->owner->put)
+ it->owner->put(ppp, it);
+}
+
+void __export ipdb_register(struct ipdb_t *ipdb)
+{
+ list_add_tail(&ipdb->entry, &ipdb_handlers);
+}