| 
									
										
										
										
											2004-08-23 20:38:10 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2009-02-13 10:55:45 +00:00
										 |  |  |  *  Copyright (C) 2007-2009 Sourcefire, Inc. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  Authors: Tomasz Kojm | 
					
						
							| 
									
										
										
										
											2004-08-23 20:38:10 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  *  This program is free software; you can redistribute it and/or modify | 
					
						
							| 
									
										
										
										
											2007-03-31 20:31:04 +00:00
										 |  |  |  *  it under the terms of the GNU General Public License version 2 as | 
					
						
							|  |  |  |  *  published by the Free Software Foundation. | 
					
						
							| 
									
										
										
										
											2004-08-23 20:38:10 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  *  This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  *  but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |  *  GNU General Public License for more details. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  |  *  along with this program; if not, write to the Free Software | 
					
						
							| 
									
										
										
										
											2006-04-09 19:59:28 +00:00
										 |  |  |  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | 
					
						
							|  |  |  |  *  MA 02110-1301, USA. | 
					
						
							| 
									
										
										
										
											2004-08-23 20:38:10 +00:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef __MISC_H
 | 
					
						
							|  |  |  | #define __MISC_H
 | 
					
						
							| 
									
										
										
										
											2009-09-24 19:23:21 +02:00
										 |  |  | #ifndef _WIN32
 | 
					
						
							| 
									
										
										
										
											2009-10-06 22:53:45 +02:00
										 |  |  | #include <sys/types.h>
 | 
					
						
							| 
									
										
										
										
											2009-02-12 21:14:51 +00:00
										 |  |  | #include <netdb.h>
 | 
					
						
							|  |  |  | #include <netinet/in.h>
 | 
					
						
							| 
									
										
										
										
											2009-09-24 19:23:21 +02:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2009-02-12 21:29:42 +00:00
										 |  |  | #include "optparser.h"
 | 
					
						
							| 
									
										
										
										
											2006-10-29 13:41:24 +00:00
										 |  |  | /* Maximum filenames under various systems - njh */ | 
					
						
							|  |  |  | #ifndef	NAME_MAX	/* e.g. Linux */
 | 
					
						
							|  |  |  | # ifdef	MAXNAMELEN	/* e.g. Solaris */
 | 
					
						
							|  |  |  | #   define	NAME_MAX	MAXNAMELEN
 | 
					
						
							|  |  |  | # else
 | 
					
						
							|  |  |  | #   ifdef	FILENAME_MAX	/* e.g. SCO */
 | 
					
						
							|  |  |  | #     define	NAME_MAX	FILENAME_MAX
 | 
					
						
							|  |  |  | #   endif
 | 
					
						
							|  |  |  | # endif
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-02-13 11:05:14 +00:00
										 |  |  | #include <limits.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef PATH_MAX
 | 
					
						
							|  |  |  | #define PATH_MAX 1024
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-01-26 14:15:04 +00:00
										 |  |  | char *freshdbdir(void); | 
					
						
							| 
									
										
										
										
											2008-01-22 10:42:30 +00:00
										 |  |  | void print_version(const char *dbdir); | 
					
						
							| 
									
										
										
										
											2010-05-10 17:05:16 +02:00
										 |  |  | int check_flevel(void); | 
					
						
							| 
									
										
										
										
											2009-05-21 13:43:05 +00:00
										 |  |  | const char *filelist(const struct optstruct *opts, int *err); | 
					
						
							| 
									
										
										
										
											2004-11-28 23:26:29 +00:00
										 |  |  | int filecopy(const char *src, const char *dest); | 
					
						
							| 
									
										
										
										
											2008-01-22 17:47:15 +00:00
										 |  |  | int daemonize(void); | 
					
						
							| 
									
										
										
										
											2008-08-04 10:38:24 +00:00
										 |  |  | const char *get_version(void); | 
					
						
							| 
									
										
										
										
											2008-08-21 20:21:43 +00:00
										 |  |  | int match_regex(const char *filename, const char *pattern); | 
					
						
							| 
									
										
										
										
											2009-09-25 00:09:13 +02:00
										 |  |  | int cli_is_abspath(const char *path); | 
					
						
							| 
									
										
										
										
											2010-09-16 14:37:43 +02:00
										 |  |  | unsigned int countlines(const char *filename); | 
					
						
							| 
									
										
										
										
											2009-09-25 00:09:13 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-08-23 20:38:10 +00:00
										 |  |  | #endif
 |