#include "command.h"
#include "thread.h"
#include "linklist.h"
+#include "lib_errors.h"
#include "ospf6_proto.h"
#include "ospf6_lsa.h"
/* receive message */
len = ospf6_recvmsg(&src, &dst, &ifindex, iovector);
if (len > iobuflen) {
- zlog_err("Excess message read");
+ zlog_ferr(LIB_ERR_DEVELOPMENT,
+ "Excess message read");
return 0;
}
/* send message */
len = ospf6_sendmsg(src, dst, &oi->interface->ifindex, iovector);
if (len != ntohs(oh->length))
- zlog_err("Could not send entire message");
+ zlog_ferr(LIB_ERR_DEVELOPMENT, "Could not send entire message");
}
static uint32_t ospf6_packet_max(struct ospf6_interface *oi)
#include "sockunion.h"
#include "sockopt.h"
#include "privs.h"
+#include "lib_errors.h"
#include "libospf.h"
#include "ospf6_proto.h"
int ospf6_serv_sock(void)
{
if (ospf6d_privs.change(ZPRIVS_RAISE))
- zlog_err("ospf6_serv_sock: could not raise privs");
+ zlog_ferr(LIB_ERR_PRIVILEGES,
+ "ospf6_serv_sock: could not raise privs");
ospf6_sock = socket(AF_INET6, SOCK_RAW, IPPROTO_OSPFIGP);
if (ospf6_sock < 0) {
zlog_warn("Network: can't create OSPF6 socket.");
if (ospf6d_privs.change(ZPRIVS_LOWER))
- zlog_err("ospf_sock_init: could not lower privs");
+ zlog_ferr(LIB_ERR_PRIVILEGES,
+ "ospf_sock_init: could not lower privs");
return -1;
}
if (ospf6d_privs.change(ZPRIVS_LOWER))
- zlog_err("ospf_sock_init: could not lower privs");
+ zlog_ferr(LIB_ERR_PRIVILEGES,
+ "ospf_sock_init: could not lower privs");
/* set socket options */
#if 1
ret = setsockopt(ospf6_sock, IPPROTO_IPV6, option, &mreq6,
sizeof(mreq6));
if (ret < 0) {
- zlog_err("Network: setsockopt (%d) on ifindex %d failed: %s",
- option, ifindex, safe_strerror(errno));
+ zlog_ferr(LIB_ERR_SOCKET,
+ "Network: setsockopt (%d) on ifindex %d failed: %s",
+ option, ifindex, safe_strerror(errno));
return ret;
}
if (link_error == 0 && num == table->count)
return;
- zlog_err("PANIC !!");
- zlog_err("Something has gone wrong with ospf6_route_table[%p]", table);
+ zlog_ferr(LIB_ERR_DEVELOPMENT, "PANIC !!");
+ zlog_ferr(LIB_ERR_DEVELOPMENT, "Something has gone wrong with ospf6_route_table[%p]", table);
zlog_debug("table count = %d, real number = %d", table->count, num);
zlog_debug("DUMP START");
for (r = ospf6_route_head(table); r; r = ospf6_route_next(r)) {
#include "pqueue.h"
#include "linklist.h"
#include "thread.h"
+#include "lib_errors.h"
#include "ospf6_lsa.h"
#include "ospf6_lsdb.h"
ifindex = (VERTEX_IS_TYPE(NETWORK, v) ? ospf6_spf_get_ifindex_from_nh(v)
: ROUTER_LSDESC_GET_IFID(lsdesc));
if (ifindex == 0) {
- zlog_err("No nexthop ifindex at vertex %s", v->name);
+ zlog_ferr(LIB_ERR_DEVELOPMENT,
+ "No nexthop ifindex at vertex %s", v->name);
return;
}
#include "zclient.h"
#include "memory.h"
#include "lib/bfd.h"
+#include "lib_errors.h"
#include "ospf6_proto.h"
#include "ospf6_top.h"
ret = zclient_route_send(ZEBRA_ROUTE_ADD, zclient, &api);
if (ret < 0)
- zlog_err("zclient_route_send() %s failed: %s",
- (type == REM ? "delete" : "add"),
- safe_strerror(errno));
+ zlog_ferr(LIB_ERR_ZAPI_SOCKET,
+ "zclient_route_send() %s failed: %s",
+ (type == REM ? "delete" : "add"),
+ safe_strerror(errno));
return;
}