]> git.proxmox.com Git - mirror_frr.git/blobdiff - babeld/babel_interface.c
lib: add frr-isisd to the native models
[mirror_frr.git] / babeld / babel_interface.c
index d4958ddf249e35c15d56c7f108510c127492d5a8..7121ca28d4097f04a686e2e5e23b6c12f6428e7a 100644 (file)
@@ -27,6 +27,7 @@ THE SOFTWARE.
 #include "prefix.h"
 #include "vector.h"
 #include "distribute.h"
+#include "lib_errors.h"
 
 #include "babel_main.h"
 #include "util.h"
@@ -39,6 +40,7 @@ THE SOFTWARE.
 #include "route.h"
 #include "xroute.h"
 #include "babel_memory.h"
+#include "babel_errors.h"
 
 #define IS_ENABLE(ifp) (babel_enable_if_lookup(ifp->name) >= 0)
 
@@ -167,7 +169,7 @@ babel_interface_address_add (int cmd, struct zclient *client,
         if (babel_ifp->ipv4 == NULL) {
             babel_ifp->ipv4 = malloc(4);
             if (babel_ifp->ipv4 == NULL) {
-                zlog_err("not einough memory");
+                flog_err(EC_BABEL_MEMORY, "not enough memory");
             } else {
                 memcpy(babel_ifp->ipv4, &prefix->u.prefix4, 4);
             }
@@ -707,7 +709,7 @@ interface_recalculate(struct interface *ifp)
     tmp = babel_ifp->sendbuf;
     babel_ifp->sendbuf = realloc(babel_ifp->sendbuf, babel_ifp->bufsize);
     if(babel_ifp->sendbuf == NULL) {
-        zlog_err("Couldn't reallocate sendbuf.");
+        flog_err(EC_BABEL_MEMORY, "Couldn't reallocate sendbuf.");
         free(tmp);
         babel_ifp->bufsize = 0;
         return -1;
@@ -727,8 +729,9 @@ interface_recalculate(struct interface *ifp)
     rc = setsockopt(protocol_socket, IPPROTO_IPV6, IPV6_JOIN_GROUP,
                     (char*)&mreq, sizeof(mreq));
     if(rc < 0) {
-        zlog_err("setsockopt(IPV6_JOIN_GROUP) on interface '%s': %s",
-                 ifp->name, safe_strerror(errno));
+        flog_err_sys(EC_LIB_SOCKET,
+                 "setsockopt(IPV6_JOIN_GROUP) on interface '%s': %s",
+                  ifp->name, safe_strerror(errno));
         /* This is probably due to a missing link-local address,
          so down this interface, and wait until the main loop
          tries to up it again. */
@@ -790,8 +793,9 @@ interface_reset(struct interface *ifp)
         rc = setsockopt(protocol_socket, IPPROTO_IPV6, IPV6_LEAVE_GROUP,
                         (char*)&mreq, sizeof(mreq));
         if(rc < 0)
-            zlog_err("setsockopt(IPV6_LEAVE_GROUP) on interface '%s': %s",
-                     ifp->name, safe_strerror(errno));
+            flog_err_sys(EC_LIB_SOCKET,
+                     "setsockopt(IPV6_LEAVE_GROUP) on interface '%s': %s",
+                      ifp->name, safe_strerror(errno));
     }
 
     update_interface_metric(ifp);
@@ -1001,7 +1005,7 @@ show_babel_routes_sub(struct babel_route *route, struct vty *vty,
                 break;
             if(k > 0)
                 channels[j++] = ',';
-            snprintf(channels + j, 100 - j, "%d", route->channels[k]);
+            snprintf(channels + j, 100 - j, "%u", route->channels[k]);
             j = strlen(channels);
         }
         snprintf(channels + j, 100 - j, ")");
@@ -1056,7 +1060,7 @@ DEFUN (show_babel_route,
         }
         route_stream_done(routes);
     } else {
-        zlog_err("Couldn't allocate route stream.");
+        flog_err(EC_BABEL_MEMORY, "Couldn't allocate route stream.");
     }
     xroutes = xroute_stream();
     if(xroutes) {
@@ -1068,7 +1072,7 @@ DEFUN (show_babel_route,
         }
         xroute_stream_done(xroutes);
     } else {
-        zlog_err("Couldn't allocate route stream.");
+        flog_err(EC_BABEL_MEMORY, "Couldn't allocate route stream.");
     }
     return CMD_SUCCESS;
 }
@@ -1103,7 +1107,7 @@ DEFUN (show_babel_route_prefix,
         }
         route_stream_done(routes);
     } else {
-        zlog_err("Couldn't allocate route stream.");
+        flog_err(EC_BABEL_MEMORY, "Couldn't allocate route stream.");
     }
     xroutes = xroute_stream();
     if(xroutes) {
@@ -1115,7 +1119,7 @@ DEFUN (show_babel_route_prefix,
         }
         xroute_stream_done(xroutes);
     } else {
-        zlog_err("Couldn't allocate route stream.");
+        flog_err(EC_BABEL_MEMORY, "Couldn't allocate route stream.");
     }
     return CMD_SUCCESS;
 }
@@ -1161,7 +1165,7 @@ DEFUN (show_babel_route_addr,
         }
         route_stream_done(routes);
     } else {
-        zlog_err("Couldn't allocate route stream.");
+        flog_err(EC_BABEL_MEMORY, "Couldn't allocate route stream.");
     }
     xroutes = xroute_stream();
     if(xroutes) {
@@ -1173,7 +1177,7 @@ DEFUN (show_babel_route_addr,
         }
         xroute_stream_done(xroutes);
     } else {
-        zlog_err("Couldn't allocate route stream.");
+        flog_err(EC_BABEL_MEMORY, "Couldn't allocate route stream.");
     }
     return CMD_SUCCESS;
 }
@@ -1220,7 +1224,7 @@ DEFUN (show_babel_route_addr6,
         }
         route_stream_done(routes);
     } else {
-        zlog_err("Couldn't allocate route stream.");
+        flog_err(EC_BABEL_MEMORY, "Couldn't allocate route stream.");
     }
     xroutes = xroute_stream();
     if(xroutes) {
@@ -1232,7 +1236,7 @@ DEFUN (show_babel_route_addr6,
         }
         xroute_stream_done(xroutes);
     } else {
-        zlog_err("Couldn't allocate route stream.");
+        flog_err(EC_BABEL_MEMORY, "Couldn't allocate route stream.");
     }
     return CMD_SUCCESS;
 }