X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fos_maild%2Fmaild.h;fp=src%2Fos_maild%2Fmaild.h;h=8aeda521de79a1c48ccd8ddb8fda3b5ba2f7686e;hp=ed0a0a87a0063dfb88f6ce72955e1e70bc8d764b;hb=3f728675941dc69d4e544d3a880a56240a6e394a;hpb=927951d1c1ad45ba9e7325f07d996154a91c911b diff --git a/src/os_maild/maild.h b/src/os_maild/maild.h old mode 100755 new mode 100644 index ed0a0a8..8aeda52 --- a/src/os_maild/maild.h +++ b/src/os_maild/maild.h @@ -1,6 +1,3 @@ -/* @(#) $Id: ./src/os_maild/maild.h, 2011/09/08 dcid Exp $ - */ - /* Copyright (C) 2009 Trend Micro Inc. * All rights reserved. * @@ -8,24 +5,20 @@ * and/or modify it under the terms of the GNU General Public * License (version 2) as published by the FSF - Free Software * Foundation. - * - * License details at the LICENSE file included with OSSEC or - * online at: http://www.ossec.net/en/licensing.html */ - #ifndef _MAILD_H #define _MAILD_H #define MAIL_LIST_SIZE 96 /* Max number of emails to be saved */ -#define MAXCHILDPROCESS 6 /* Maximum simultaneos childs */ +#define MAXCHILDPROCESS 6 /* Maximum simultaneous children */ /* Each timeout is x * 5 */ #define NEXTMAIL_TIMEOUT 2 /* Time to check for next msg - 5 */ #define DEFAULT_TIMEOUT 18 /* socket read timeout - 18 (*5)*/ #define SUBJECT_SIZE 128 /* Maximum subject size */ - /* Maximum body size */ +/* Maximum body size */ #define BODY_SIZE OS_MAXSTR + OS_SIZE_1024 #define SMS_SUBJECT "OSSEC %d - %d - %s" @@ -37,12 +30,13 @@ #define MAIL_SUBJECT_FULL2 "%d - %s - %s" #endif -#ifdef GEOIP +#ifdef LIBGEOIP_ENABLED #define MAIL_BODY "\r\nOSSEC HIDS Notification.\r\n" \ "%s\r\n\r\n" \ "Received From: %s\r\n" \ "Rule: %d fired (level %d) -> \"%s\"\r\n" \ - "%s" \ + "%s" \ + "%s" \ "%s" \ "Portion of the log(s):\r\n\r\n%s\r\n" \ "\r\n\r\n --END OF NOTIFICATION\r\n\r\n\r\n" @@ -51,42 +45,37 @@ "%s\r\n\r\n" \ "Received From: %s\r\n" \ "Rule: %d fired (level %d) -> \"%s\"\r\n" \ + "%s" \ "Portion of the log(s):\r\n\r\n%s\r\n" \ "\r\n\r\n --END OF NOTIFICATION\r\n\r\n\r\n" #endif /* Mail msg structure */ -typedef struct _MailMsg -{ - char *subject; - char *body; -}MailMsg; +typedef struct _MailMsg { + char *subject; + char *body; +} MailMsg; #include "shared.h" #include "config/mail-config.h" - /* Config function */ -int MailConf(int test_config, char *cfgfile, MailConfig *Mail); - +int MailConf(int test_config, const char *cfgfile, MailConfig *Mail) __attribute__((nonnull)); /* Receive the e-mail message */ MailMsg *OS_RecvMailQ(file_queue *fileq, struct tm *p, MailConfig *mail, - MailMsg **msg_sms); - -/* Sends an email */ -int OS_Sendmail(MailConfig *mail, struct tm *p); -int OS_Sendsms(MailConfig *mail, struct tm *p, MailMsg *sms_msg); -int OS_SendCustomEmail(char **to, char *subject, char *smtpserver, char *from, char *idsname, FILE *fp, struct tm *p); + MailMsg **msg_sms) __attribute__((nonnull)); +/* Send an email */ +int OS_Sendmail(MailConfig *mail, struct tm *p) __attribute__((nonnull)); +int OS_SendCustomEmail(char **to, char *subject, char *smtpserver, char *from, char *idsname, char *fname, const struct tm *p); /* Mail timeout used by the file-queue */ -int mail_timeout; - +extern unsigned int mail_timeout; /* Global var for highest level on mail subjects */ -int _g_subject_level; -char _g_subject[SUBJECT_SIZE +2]; - +extern unsigned int _g_subject_level; +extern char _g_subject[SUBJECT_SIZE + 2]; #endif +