5bd608f616329cb973db7f66f7d2ca02e4a75527
[ossec-hids.git] / src / win32 / ui / os_win32ui.h
1 /* @(#) $Id$ */
2
3 /* Copyright (C) 2009 Trend Micro Inc.
4  * All rights reserved.
5  *
6  * This program is a free software; you can redistribute it
7  * and/or modify it under the terms of the GNU General Public
8  * License (version 2) as published by the FSF - Free Software
9  * Foundation.
10  *
11  * License details at the LICENSE file included with OSSEC or 
12  * online at: http://www.ossec.net/en/licensing.html
13  */
14
15
16
17 #ifndef WIN_32UI_H
18 #define WIN_32UI_H
19
20 #include <stdio.h>
21 #include <unistd.h>
22 #include <windows.h>
23 #include <winresrc.h>
24
25
26
27 /* Default values */
28 #define CONFIG          "ossec.conf"
29 #define NEWCONFIG       "new-ossec.conf"
30 #define LASTCONFIG      "last-ossec.conf"
31 #define VERSION_FILE    "VERSION.txt"
32 #define OSSECLOGS       "ossec.log"
33 #define HELPTXT         "help.txt"
34 #define AUTH_FILE       "client.keys"
35 #define SENDER_FILE     "rids\\sender_counter"
36 #define DEFDIR          "C:\\Program Files\\ossec-agent"
37
38
39 /* Status messages */
40 #define ST_RUNNING          "Running..."
41 #define ST_RUNNING_RESTART  "Running (pending restart)"
42 #define ST_STOPPED          "Stopped."
43 #define ST_UNKNOWN          "Unknown."
44 #define ST_NOTSET           "0"
45 #define ST_MISSING_IMPORT   "Require import of authentication key.\r\n" \
46                             "            - Not Running..."
47 #define ST_MISSING_SERVER   "Require OSSEC Server IP address.\r\n" \
48                             "            - Not Running..."
49 #define ST_MISSING_ALL      "Require import of authentication key.\r\n" \
50                             "            Missing OSSEC Server IP address.\r\n" \
51                             "            - Not Running..."
52                         
53
54
55 /* Pre-def fields */
56 #define FL_NOKEY        "<insert_auth_key_here>"
57 #define FL_NOSERVER     "<insert_server_ip_here>"
58 #define SERVER_IP_USED      1
59 #define SERVER_HOST_USED    2
60
61
62 /* Prototypes */
63 char *decode_base64(const char *src);
64 char *encode_base64(int size, char *src);
65
66
67 /* Global ossec config structure */
68 typedef struct _ossec_config
69 {
70     unsigned short int server_type;
71     unsigned short int admin_access;
72     unsigned long int msg_sent;
73     char *dir;
74     char *config;
75     char *key;
76     char *server;
77
78     char *agentid;
79     char *agentname;
80     char *agentip;
81
82     char *version;
83     char *install_date;
84     char *status;
85 }ossec_config;
86
87
88 /** Global variables **/
89
90 /* Agent status */
91 char ui_server_info[2048 +1];
92
93 /* Configuration */
94 ossec_config config_inst;
95
96 /* Status bar */
97 HWND hStatus;
98
99
100
101 /* Ossec icon */
102 #define IDI_OSSECICON  201
103 #define UI_MANIFEST_ID 202
104
105 /* User input */
106 #define UI_SERVER_TEXT      1501
107 #define UI_SERVER_AUTH      1502
108 #define UI_SERVER_MSG       1503
109 #define UI_SERVER_TOP       1504
110 #define UI_SERVER_INFO      1505
111 #define UI_ID_CLOSE         1510
112
113
114 /* Menu values */
115 #define UI_MENU_MANAGE_STOP     1601
116 #define UI_MENU_MANAGE_START    1602
117 #define UI_MENU_MANAGE_STATUS   1603
118 #define UI_MENU_MANAGE_RESTART  1604
119 #define UI_MENU_MANAGE_EXIT     1605
120 #define UI_MENU_VIEW_LOGS       1606
121 #define UI_MENU_VIEW_CONFIG     1607
122 #define UI_MENU_HELP_HELP       1608
123 #define UI_MENU_HELP_ABOUT      1609
124 #define UI_MENU_NONE            1610
125
126
127 #define IDD_MAIN                1700
128 #define IDC_MAIN_STATUS         1701
129 #define IDC_ADD                 1702
130 #define IDC_CANCEL              1703
131 #define IDD_ABOUT               1704
132 #define IDC_STATIC -1
133
134
135 /** Prototypes **/
136
137 /* Generate server info */
138 int gen_server_info(HWND hwnd);
139
140 /* cat file */
141 char *cat_file(char *file, FILE *fp2);
142
143 /* is_file present */
144 int is_file(char *file);
145
146 /* Reads ossec config */
147 int config_read(HWND hwnd);
148
149 /* Initializes the config */
150 void init_config();
151
152 /* Set OSSEC Server IP */
153 int set_ossec_server(char *ip, HWND hwnd);
154
155 /* Get OSSEC Server IP */
156 int get_ossec_server();
157
158
159 #endif
160
161 /* EOF */