blob: adc58407174ab91a848f516f780755c50095f957 [file] [log] [blame]
jjakoa760e322003-04-11 09:43:22 +00001/*
2 * Syslog functions.
jjakobd937b72004-12-30 16:22:42 +00003 * Copyright (C) 2003, 2004 Mondru AB.
jjakoa760e322003-04-11 09:43:22 +00004 *
5 * The contents of this file may be used under the terms of the GNU
6 * General Public License Version 2, provided that the above copyright
7 * notice and this permission notice is included in all copies or
8 * substantial portions of the software.
9 *
jjakoa760e322003-04-11 09:43:22 +000010 */
11
12#ifndef _SYSERR_H
13#define _SYSERR_H
14
Holger Hans Peter Freyther9c7fd8e2014-12-04 16:32:37 +010015#include <osmocom/core/logging.h>
jjakoa760e322003-04-11 09:43:22 +000016
Holger Hans Peter Freyther9c7fd8e2014-12-04 16:32:37 +010017enum {
18 DIP,
19 DTUN,
20 DGGSN,
21 DSGSN,
Harald Welted46bcd22017-08-08 23:27:22 +020022 DICMP6,
Holger Hans Peter Freyther9c7fd8e2014-12-04 16:32:37 +010023};
Holger Hans Peter Freyther9c0ff4f2014-03-23 10:07:26 +010024
Holger Hans Peter Freyther9c7fd8e2014-12-04 16:32:37 +010025#define SYS_ERR(sub, pri, en, fmt, args...) \
26 if (en) { \
27 logp2(sub, pri, __FILE__, __LINE__, 0, \
28 "errno=%d/%s " fmt "\n", en, strerror(en), \
29 ##args); \
30 } else { \
31 logp2(sub, pri, __FILE__, __LINE__, 0, \
32 fmt "\n", ##args); \
33 }
34
35extern const struct log_info log_info;
jjakoa760e322003-04-11 09:43:22 +000036
Harald Weltebed35df2011-11-02 13:06:18 +010037#endif /* !_SYSERR_H */