#include "thread.h"
#include "zbuf.h"
#include "log.h"
-#include "nhrpd.h"
+#include "lib_errors.h"
+#include "nhrpd.h"
#include "vici.h"
+#include "nhrp_errors.h"
#define ERRNO_IO_RETRY(EN) (((EN) == EAGAIN) || ((EN) == EWOULDBLOCK) || ((EN) == EINTR))
if (str2sockunion(buf,
&sactx->local.host)
< 0)
- zlog_err(
- "VICI: bad strongSwan local-host: %s",
- buf);
+ zlog_ferr(NHRP_ERR_SWAN,
+ "VICI: bad strongSwan local-host: %s",
+ buf);
} else if (blob_equal(key, "local-id")
&& ctx->nsections == 1) {
sactx->local.id = *val;
if (str2sockunion(buf,
&sactx->remote.host)
< 0)
- zlog_err(
- "VICI: bad strongSwan remote-host: %s",
- buf);
+ zlog_ferr(NHRP_ERR_SWAN,
+ "VICI: bad strongSwan remote-host: %s",
+ buf);
} else if (blob_equal(key, "remote-id")
&& ctx->nsections == 1) {
sactx->remote.id = *val;
case VICI_KEY_VALUE:
if (blob_equal(key, "errmsg")
&& blob2buf(val, buf, sizeof(buf)))
- zlog_err("VICI: strongSwan: %s", buf);
+ zlog_ferr(NHRP_ERR_SWAN, "VICI: strongSwan: %s", buf);
break;
default:
break;
break;
case VICI_EVENT_UNKNOWN:
case VICI_CMD_UNKNOWN:
- zlog_err(
+ zlog_ferr(NHRP_ERR_SWAN,
"VICI: StrongSwan does not support mandatory events (unpatched?)");
break;
case VICI_EVENT_CONFIRM: