Mike Frysinger | 7031f62 | 2006-05-08 03:20:50 +0000 | [diff] [blame] | 1 | /* common.h |
| 2 | * |
| 3 | * Russ Dill <Russ.Dill@asu.edu> September 2001 |
| 4 | * Rewritten by Vladimir Oleynik <dzo@simtreas.ru> (C) 2003 |
| 5 | * |
Rob Landley | 3f78561 | 2006-05-28 01:06:36 +0000 | [diff] [blame] | 6 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
Mike Frysinger | 7031f62 | 2006-05-08 03:20:50 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef _COMMON_H |
| 10 | #define _COMMON_H |
| 11 | |
Mike Frysinger | 7031f62 | 2006-05-08 03:20:50 +0000 | [diff] [blame] | 12 | #include "libbb_udhcp.h" |
| 13 | |
| 14 | |
Mike Frysinger | 7031f62 | 2006-05-08 03:20:50 +0000 | [diff] [blame] | 15 | enum syslog_levels { |
| 16 | LOG_EMERG = 0, |
| 17 | LOG_ALERT, |
| 18 | LOG_CRIT, |
| 19 | LOG_WARNING, |
| 20 | LOG_ERR, |
| 21 | LOG_INFO, |
| 22 | LOG_DEBUG |
| 23 | }; |
Mike Frysinger | 7031f62 | 2006-05-08 03:20:50 +0000 | [diff] [blame] | 24 | #include <syslog.h> |
Mike Frysinger | 7031f62 | 2006-05-08 03:20:50 +0000 | [diff] [blame] | 25 | |
| 26 | long uptime(void); |
Mike Frysinger | 7031f62 | 2006-05-08 03:20:50 +0000 | [diff] [blame] | 27 | |
| 28 | #define LOG(level, str, args...) udhcp_logging(level, str, ## args) |
| 29 | |
Rob Landley | 3f78561 | 2006-05-28 01:06:36 +0000 | [diff] [blame] | 30 | #if ENABLE_FEATURE_UDHCP_DEBUG |
Mike Frysinger | 7031f62 | 2006-05-08 03:20:50 +0000 | [diff] [blame] | 31 | # define DEBUG(level, str, args...) LOG(level, str, ## args) |
| 32 | #else |
| 33 | # define DEBUG(level, str, args...) do {;} while(0) |
| 34 | #endif |
| 35 | |
| 36 | #endif |