00001
00002 #ifndef __AWHANDLER_WEBSMCP_PAGES__
00003 #define __AWHANDLER_WEBSMCP_PAGES__
00004
00005 #include "session.h"
00006
00007
00008
00009 #define SET_MBR_TEXT(xtn, key, mbr) \
00010 { \
00011 byte_t const *val = aw_wwwhandler_get_cgiarg( (xtn), (key)); \
00012 if ( val != NULL ) strncpy((mbr), val, sizeof((mbr))-1); \
00013 }
00014 #define SET_MBR_BOOLEAN(xtn, key, mbr) \
00015 { \
00016 byte_t const *val = aw_wwwhandler_get_cgiarg( (xtn), (key)); \
00017 if ( val != NULL ) mbr = 1; else mbr = 0; \
00018 }
00019 #define SET_MBR_INTEGER(xtn, key, mbr) \
00020 { \
00021 byte_t const *val = aw_wwwhandler_get_cgiarg( (xtn), (key)); \
00022 if ( val != NULL ) mbr = atoi(val); \
00023 }
00024
00025
00026
00027
00028 int32_t aw_websmcphandler_headeri(aw_wwwhandler_xtn_t *xtn, aw_websmcphandler_session_t *session,
00029 const byte_t *head,
00030 const byte_t *pagetitle,
00031 const byte_t *helpcmd, int32_t menu);
00032 int32_t aw_websmcphandler_footeri(aw_wwwhandler_xtn_t *xtn,
00033 aw_websmcphandler_session_t *session);
00034
00035
00036 aw_wwwhandler_io_code_t aw_websmcphandler_login(aw_handler_args_t *args, aw_wwwhandler_xtn_t *xtn) ;
00037 aw_wwwhandler_io_code_t aw_websmcphandler_loginx(aw_handler_args_t *args, aw_wwwhandler_xtn_t *xtn) ;
00038 aw_wwwhandler_io_code_t aw_websmcphandler_logoutx(aw_handler_args_t *args, aw_wwwhandler_xtn_t *xtn) ;
00039 aw_wwwhandler_io_code_t aw_websmcphandler_loginp(aw_handler_args_t *args, aw_wwwhandler_xtn_t *xtn,
00040 aw_websmcphandler_session_t *session, byte_t *message );
00041
00042 aw_wwwhandler_io_code_t aw_websmcphandler_home(aw_handler_args_t *args, aw_wwwhandler_xtn_t *xtn);
00043 aw_wwwhandler_io_code_t aw_websmcphandler_homep(aw_handler_args_t *args, aw_wwwhandler_xtn_t *xtn,
00044 aw_websmcphandler_session_t *session );
00045
00046
00047 aw_wwwhandler_io_code_t aw_websmcphandler_nodes(aw_handler_args_t *args, aw_wwwhandler_xtn_t *xtn);
00048
00049
00050 aw_wwwhandler_io_code_t aw_websmcphandler_service_list(aw_handler_args_t *args, aw_wwwhandler_xtn_t *xtn);
00051
00052
00053 aw_wwwhandler_io_code_t aw_websmcphandler_alerts(aw_handler_args_t *args, aw_wwwhandler_xtn_t *xtn);
00054
00055
00056 aw_wwwhandler_io_code_t aw_websmcphandler_tools(aw_handler_args_t *args, aw_wwwhandler_xtn_t *xtn);
00057 aw_wwwhandler_io_code_t aw_websmcphandler_tools_ping(aw_handler_args_t *args, aw_wwwhandler_xtn_t *xtn);
00058 aw_wwwhandler_io_code_t aw_websmcphandler_tools_pingframe(aw_handler_args_t *args, aw_wwwhandler_xtn_t *xtn);
00059 aw_wwwhandler_io_code_t aw_websmcphandler_tools_traceroute(aw_handler_args_t *args, aw_wwwhandler_xtn_t *xtn);
00060 aw_wwwhandler_io_code_t aw_websmcphandler_tools_tracerouteframe(aw_handler_args_t *args, aw_wwwhandler_xtn_t *xtn);
00061 aw_wwwhandler_io_code_t aw_websmcphandler_tools_dnslookup(aw_handler_args_t *args, aw_wwwhandler_xtn_t *xtn);
00062 aw_wwwhandler_io_code_t aw_websmcphandler_tools_dnslookupframe(aw_handler_args_t *args, aw_wwwhandler_xtn_t *xtn);
00063
00064
00065 aw_wwwhandler_io_code_t aw_websmcphandler_admin(aw_handler_args_t *args, aw_wwwhandler_xtn_t *xtn);
00066
00068 #define VALIDATE_SESSION(args, xtn, session) \
00069 { \
00070 if (session == NULL || ! session->authenticated || session->clientip.ip.addr != xtn->clientip.ip.addr ) \
00071 return aw_websmcphandler_loginp(args, xtn, session, "<font color=red>Your session has expired</font>"); \
00072 \
00073 xtn->appendlog = strdup(session->loginid); \
00074 }
00075
00076 #endif