1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #ifndef ADMIN_H
30 #define ADMIN_H
31
32 #include "../public/nsapi.h"
33 #include "webui.h"
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 typedef struct admin_page Page;
40 typedef struct admin_request AdminRequest;
41 typedef int (*admin_service_f)(Page *, AdminRequest *);
42
43 struct admin_page {
44
45
46
47
48
49 char *name;
50
51
52
53
54 Page *parent;
55
56
57
58
59 Page *next;
60
61
62
63
64 Page *children;
65
66
67
68
69
70
71 int (*service)(Page *page, AdminRequest *rq);
72
73
74
75
76 void *data;
77 };
78
79 struct admin_request {
80 Session *sn;
81 Request *rq;
82 char *name;
83 };
84
85 int admin_init(pblock *pb, Session *sn, Request *rq);
86 int admin_service(pblock *pb, Session *sn, Request *rq);
87
88 int admin_root(Page *page, AdminRequest *rq);
89 int adm_listener(Page *page, AdminRequest *rq);
90 int adm_cfglistener(Page *page, AdminRequest *rq);
91 int adm_auth(Page *page, AdminRequest *rq);
92
93 Page* admin_page_create(
pool_handle_t *pool,
char *name, admin_service_f f);
94 void admin_add_page(Page *parent, Page *child);
95
96
97 #ifdef __cplusplus
98 }
99 #endif
100
101 #endif
102
103