]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospf6d/ospf6_proto.c
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / ospf6d / ospf6_proto.c
index d0ab6765516503aa647832e02f22d4dab426b664..864974c9a4c3d952723a1a9a6dede2e786c685ab 100644 (file)
 
 #include "ospf6_proto.h"
 
+void ospf6_prefix_in6_addr(struct in6_addr *in6, const void *prefix_buf,
+                          const struct ospf6_prefix *p)
+{
+       ptrdiff_t in6_off = (caddr_t)p->addr - (caddr_t)prefix_buf;
+
+       memset(in6, 0, sizeof(struct in6_addr));
+       memcpy(in6, (uint8_t *)prefix_buf + in6_off,
+              OSPF6_PREFIX_SPACE(p->prefix_length));
+}
+
 void ospf6_prefix_apply_mask(struct ospf6_prefix *op)
 {
-       u_char *pnt, mask;
+       uint8_t *pnt, mask;
        int index, offset;
 
-       pnt = (u_char *)((caddr_t)op + sizeof(struct ospf6_prefix));
+       pnt = (uint8_t *)((caddr_t)op + sizeof(struct ospf6_prefix));
        index = op->prefix_length / 8;
        offset = op->prefix_length % 8;
        mask = 0xff << (8 - offset);
@@ -48,7 +58,7 @@ void ospf6_prefix_apply_mask(struct ospf6_prefix *op)
                pnt[index++] = 0;
 }
 
-void ospf6_prefix_options_printbuf(u_int8_t prefix_options, char *buf, int size)
+void ospf6_prefix_options_printbuf(uint8_t prefix_options, char *buf, int size)
 {
        snprintf(buf, size, "xxx");
 }
@@ -63,7 +73,7 @@ void ospf6_capability_printbuf(char capability, char *buf, int size)
        snprintf(buf, size, "----%c%c%c%c", w, v, e, b);
 }
 
-void ospf6_options_printbuf(u_char *options, char *buf, int size)
+void ospf6_options_printbuf(uint8_t *options, char *buf, int size)
 {
        const char *dc, *r, *n, *mc, *e, *v6;
        dc = (OSPF6_OPT_ISSET(options, OSPF6_OPT_DC) ? "DC" : "--");