iscsiadm: only do auto iface setup when iface mode is run
[open-iscsi.git] / usr / log.h
blob23b388e2c4524f046d38756000150421e090f823
1 /*
2 * iSCSI Safe Logging and Tracing Library
4 * Copyright (C) 2004 Dmitry Yusupov, Alex Aizman
5 * maintained by open-iscsi@googlegroups.com
7 * circular buffer code based on log.c from dm-multipath project
9 * heavily based on code from log.c:
10 * Copyright (C) 2002-2003 Ardis Technolgies <roman@ardistech.com>,
11 * licensed under the terms of the GNU GPL v2.0,
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published
15 * by the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * General Public License for more details.
23 * See the file COPYING included with this distribution for more details.
26 #ifndef LOG_H
27 #define LOG_H
29 #include "iscsid.h"
31 union semun {
32 int val;
33 struct semid_ds *buf;
34 unsigned short int *array;
35 struct seminfo *__buf;
37 #include <sys/sem.h>
39 #define DEFAULT_AREA_SIZE 16384
40 #define MAX_MSG_SIZE 256
42 extern int log_daemon;
43 extern int log_level;
45 struct logmsg {
46 short int prio;
47 void *next;
48 char *str;
51 struct logarea {
52 int shmid;
53 int shmid_msg;
54 int shmid_buff;
55 int empty;
56 void *head;
57 void *tail;
58 void *start;
59 void *end;
60 char *buff;
61 struct sembuf ops[1];
62 int semid;
63 union semun semarg;
66 struct logarea *la;
68 extern int log_init (char * progname, int size);
69 extern void log_close (pid_t pid);
70 extern void dump_logmsg (void *);
71 extern void log_warning(const char *fmt, ...)
72 __attribute__ ((format (printf, 1, 2)));
73 extern void log_error(const char *fmt, ...)
74 __attribute__ ((format (printf, 1, 2)));
75 extern void log_debug(int level, const char *fmt, ...)
76 __attribute__ ((format (printf, 2, 3)));
78 #endif /* LOG_H */