*/
#include <zebra.h>
-#include "zebra/rib.h"
#include "log.h"
#include "prefix.h"
#include "thread.h"
#include "prefix.h"
#include "vty.h"
+#include "lib_errors.h"
#include "pimd.h"
#include "pim_iface.h"
{
zlookup = zclient_new_notify(master, &zclient_options_default);
if (!zlookup) {
- zlog_err("%s: zclient_new() failure", __PRETTY_FUNCTION__);
+ flog_err(EC_LIB_ZAPI_SOCKET, "%s: zclient_new() failure",
+ __PRETTY_FUNCTION__);
return;
}
err = zclient_read_header(s, zlookup->sock, &length, &marker,
&version, &vrf_id, &command);
if (err < 0) {
- zlog_err("%s: zclient_read_header() failed",
+ flog_err(EC_LIB_ZAPI_MISSMATCH,
+ "%s: zclient_read_header() failed",
__PRETTY_FUNCTION__);
zclient_lookup_failed(zlookup);
return -1;
/* Check socket. */
if (zlookup->sock < 0) {
- zlog_err("%s: zclient lookup socket is not connected",
+ flog_err(EC_LIB_ZAPI_SOCKET,
+ "%s: zclient lookup socket is not connected",
__PRETTY_FUNCTION__);
zclient_lookup_failed(zlookup);
return -1;
}
if (pim->vrf->vrf_id == VRF_UNKNOWN) {
- zlog_err(
+ zlog_notice(
"%s: VRF: %s does not fully exist yet, delaying lookup",
__PRETTY_FUNCTION__, pim->vrf->name);
return -1;
ret = writen(zlookup->sock, s->data, stream_get_endp(s));
if (ret < 0) {
- zlog_err(
+ flog_err(
+ EC_LIB_SOCKET,
"%s: writen() failure: %d writing to zclient lookup socket",
__PRETTY_FUNCTION__, errno);
zclient_lookup_failed(zlookup);
return -2;
}
if (ret == 0) {
- zlog_err("%s: connection closed on zclient lookup socket",
- __PRETTY_FUNCTION__);
+ flog_err_sys(EC_LIB_SOCKET,
+ "%s: connection closed on zclient lookup socket",
+ __PRETTY_FUNCTION__);
zclient_lookup_failed(zlookup);
return -3;
}
count = stream_get_endp(s);
ret = writen(zlookup->sock, s->data, count);
if (ret <= 0) {
- zlog_err(
+ flog_err(
+ EC_LIB_SOCKET,
"%s: writen() failure: %d writing to zclient lookup socket",
__PRETTY_FUNCTION__, errno);
return -1;
err = zclient_read_header(s, zlookup->sock, &length, &marker,
&version, &vrf_id, &command);
if (err < 0) {
- zlog_err("%s: zclient_read_header() failed",
+ flog_err(EC_LIB_ZAPI_MISSMATCH,
+ "%s: zclient_read_header() failed",
__PRETTY_FUNCTION__);
zclient_lookup_failed(zlookup);
return -1;
more.src = c_oil->oil.mfcc_origin;
more.grp = c_oil->oil.mfcc_mcastgrp;
- zlog_err(
+ flog_err(
+ EC_LIB_ZAPI_MISSMATCH,
"%s: Received wrong %s(%s) information requested",
__PRETTY_FUNCTION__, pim_str_sg_dump(&more),
c_oil->pim->vrf->name);