summaryrefslogtreecommitdiff
path: root/accel-pptpd/ppp/ppp_notify.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pptpd/ppp/ppp_notify.c')
-rw-r--r--accel-pptpd/ppp/ppp_notify.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/accel-pptpd/ppp/ppp_notify.c b/accel-pptpd/ppp/ppp_notify.c
new file mode 100644
index 00000000..94ceb6d2
--- /dev/null
+++ b/accel-pptpd/ppp/ppp_notify.c
@@ -0,0 +1,34 @@
+#include "ppp.h"
+
+static LIST_HEAD(notified_list);
+
+void __export ppp_register_notified(struct ppp_notified_t *n)
+{
+ list_add_tail(&n->entry, &notified_list);
+}
+
+void __export ppp_unregister_notified(struct ppp_notified_t *n)
+{
+ list_del(&n->entry);
+}
+
+void ppp_notify_started(struct ppp_t *ppp)
+{
+ struct ppp_notified_t *n;
+
+ list_for_each_entry(n, &notified_list, entry) {
+ if (n->started)
+ n->started(n, ppp);
+ }
+}
+
+void ppp_notify_finished(struct ppp_t *ppp)
+{
+ struct ppp_notified_t *n;
+
+ list_for_each_entry(n, &notified_list, entry) {
+ if (n->finished)
+ n->finished(n, ppp);
+ }
+}
+