#ifndef ADMIN_H
#define ADMIN_H
#include "../public/nsapi.h"
#include "webui.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct admin_page Page;
typedef struct admin_request AdminRequest;
typedef int (*admin_service_f)(Page *, AdminRequest *);
struct admin_page {
char *name;
Page *parent;
Page *next;
Page *children;
int (*service)(Page *page, AdminRequest *rq);
void *data;
};
struct admin_request {
Session *sn;
Request *rq;
char *name;
};
int admin_init(pblock *pb, Session *sn, Request *rq);
int admin_service(pblock *pb, Session *sn, Request *rq);
int admin_root(Page *page, AdminRequest *rq);
int adm_listener(Page *page, AdminRequest *rq);
int adm_cfglistener(Page *page, AdminRequest *rq);
int adm_auth(Page *page, AdminRequest *rq);
Page* admin_page_create(
pool_handle_t *pool,
char *name, admin_service_f f);
void admin_add_page(Page *parent, Page *child);
#ifdef __cplusplus
}
#endif
#endif