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