File: utils.h

package info (click to toggle)
labrea 2.5-stable-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 944 kB
  • ctags: 589
  • sloc: ansic: 5,604; sh: 3,286; makefile: 76
file content (81 lines) | stat: -rw-r--r-- 2,214 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/* utils.h
 * This file is part of the LaBrea package
 *
 * Copyright (C) 2001, 2002 Tom Liston <tliston@premmag.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * 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
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * $Id: utils.h,v 1.2 2003/09/12 21:23:39 lorgor Exp $
*/

#ifndef UTILS_H
#define UTILS_H
//Modified for work in Debian
//#include <dnet.h>
#include <dumbnet.h>
 
/* Degree of verbosity in logging */
typedef enum {QUIET, NORMAL, VERBOSE, VERY_VERBOSE} amt_log_t;


/* Output / logging control structure */
struct outp_s {

  /* flags */
  uint16_t 		output;
#define FL_OUTP_STDOUT_EPOCH	0x0001 	/* -O */
#define FL_OUTP_STDOUT		0x0002	/* -o */



  /* globals */
  amt_log_t		verbose;	/* Degree of verbosity in logging */
  int			savedatalog;	/* Save old logging level when logging turned off */
  int			syslog_open;	/* TRUE if syslog open */
};

typedef struct outp_s outp_t;
extern outp_t outp;



void		util_init(void);
void		util_open_syslog(char *ident);
void		util_print(const amt_log_t verbosity_msg, const char *fmt, ...);
void		util_clean_exit(int err);
int		util_nk_new (const ip_addr_t offset, const time_t culltime,
			     const uint8_t *mac);
void		util_nk_free( const ip_addr_t offset );
void		util_detach (void);

void		util_set_signal_handlers(void);
void		util_quit (void);
void		util_restart (void);
#ifndef WIN32
void		util_toggle_logging(void);
#endif

#ifdef WIN32
DWORD WINAPI	util_timer(LPVOID lpAintGonnaUseThis);
#else
void		util_timer(void);
#endif

int		util_check_version_win98(void);
int		util_check_version_winNT(void);



#endif /* UTILS_H */