1 /* Copyright (C) 2009 Trend Micro Inc.
4 * This program is a free software; you can redistribute it
5 * and/or modify it under the terms of the GNU General Public
6 * License (version 2) as published by the FSF - Free Software
20 #define CONFIG "ossec.conf"
21 #define LASTCONFIG "last-ossec.conf"
22 #define VERSION_FILE "VERSION.txt"
23 #define OSSECLOGS "ossec.log"
24 #define HELPTXT "help.txt"
25 #define SENDER_FILE "rids\\sender_counter"
26 #define DEFDIR "C:\\Program Files\\ossec-agent"
29 #define ST_RUNNING "Running"
30 #define ST_RUNNING_RESTART "Running (pending restart)"
31 #define ST_STOPPED "Stopped"
32 #define ST_UNKNOWN "Unknown"
34 #define ST_MISSING_IMPORT "Require import of authentication key.\r\n" \
36 #define ST_MISSING_SERVER "Require OSSEC Server IP address.\r\n" \
38 #define ST_MISSING_ALL "Require import of authentication key.\r\n" \
39 " Missing OSSEC Server IP address.\r\n" \
43 #define FL_NOKEY "<insert_auth_key_here>"
44 #define FL_NOSERVER "<insert_server_ip_here>"
45 #define SERVER_IP_USED 1
46 #define SERVER_HOST_USED 2
49 char *decode_base64(const char *src);
50 char *encode_base64(int size, char *src);
52 /* Global ossec config structure */
53 typedef struct _ossec_config {
54 unsigned short int server_type;
55 unsigned short int admin_access;
56 unsigned long int msg_sent;
72 /** Global variables **/
75 char ui_server_info[2048 + 1];
78 ossec_config config_inst;
84 #define IDI_OSSECICON 201
85 #define UI_MANIFEST_ID 202
88 #define UI_SERVER_TEXT 1501
89 #define UI_SERVER_AUTH 1502
90 #define UI_SERVER_MSG 1503
91 #define UI_SERVER_TOP 1504
92 #define UI_SERVER_INFO 1505
93 #define UI_ID_CLOSE 1510
96 #define UI_MENU_MANAGE_STOP 1601
97 #define UI_MENU_MANAGE_START 1602
98 #define UI_MENU_MANAGE_STATUS 1603
99 #define UI_MENU_MANAGE_RESTART 1604
100 #define UI_MENU_MANAGE_EXIT 1605
101 #define UI_MENU_VIEW_LOGS 1606
102 #define UI_MENU_VIEW_CONFIG 1607
103 #define UI_MENU_HELP_HELP 1608
104 #define UI_MENU_HELP_ABOUT 1609
105 #define UI_MENU_NONE 1610
107 #define IDD_MAIN 1700
108 #define IDC_MAIN_STATUS 1701
110 #define IDC_CANCEL 1703
111 #define IDD_ABOUT 1704
112 #define IDC_STATIC -1
116 /* Generate server info */
117 int gen_server_info(HWND hwnd);
119 char *cat_file(char *file, FILE *fp2);
121 int is_file(char *file);
123 /* Reads ossec config */
124 int config_read(HWND hwnd);
126 /* Initializes the config */
129 /* Run command using cmd.exe */
130 int run_cmd(char *cmd, HWND hwnd);
132 /* Set OSSEC Server IP */
133 int set_ossec_server(char *ip, HWND hwnd);
135 /* Set OSSEC Auth Key */
136 int set_ossec_key(char *key, HWND hwnd);
138 /* Get OSSEC Server IP */
139 int get_ossec_server();