Browse Source

zebra: make come rtadv function arguments const

*   rtadv_recv_packet()
*   rtadv_send_packet()
*   rtadv_process_solicit()
*   rtadv_process_packet()
*   rtadv_prefix_lookup()
*   rtadv_prefix_get()
*   rtadv_dns_lifetime_fits()
*   rtadv_event()
Denis Ovsienko 7 years ago
parent
commit
d7028a39bb
1 changed files with 10 additions and 10 deletions
  1. 10 10
      zebra/rtadv.c

+ 10 - 10
zebra/rtadv.c

@@ -98,7 +98,7 @@ rtadv_cp_enabled (const struct rtadvconf *conf)
 }
 
 static int
-rtadv_recv_packet (int sock, u_char *buf, int buflen,
+rtadv_recv_packet (const int sock, u_char *buf, const int buflen,
 		   struct sockaddr_in6 *from, ifindex_t *ifindex,
 		   int *hoplimit)
 {
@@ -254,7 +254,7 @@ rtadv_append_connprefix_tlvs (unsigned char *buf, const struct list *list,
 
 /* Send router advertisement packet. */
 static void
-rtadv_send_packet (int sock, struct interface *ifp)
+rtadv_send_packet (const int sock, const struct interface *ifp)
 {
   struct msghdr msg;
   struct iovec iov;
@@ -529,7 +529,7 @@ rtadv_timer (struct thread *thread)
 }
 
 static void
-rtadv_process_solicit (struct interface *ifp)
+rtadv_process_solicit (const struct interface *ifp)
 {
   struct zebra_vrf *zvrf = vrf_info_lookup (ifp->vrf_id);
 
@@ -545,8 +545,8 @@ rtadv_process_advert (void)
 }
 
 static void
-rtadv_process_packet (u_char *buf, unsigned int len, ifindex_t ifindex,
-    int hoplimit, vrf_id_t vrf_id)
+rtadv_process_packet (u_char *buf, size_t len, ifindex_t ifindex,
+                      const int hoplimit, vrf_id_t vrf_id)
 {
   struct icmp6_hdr *icmph;
   struct interface *ifp;
@@ -716,19 +716,19 @@ rtadv_prefix_free (struct rtadv_prefix *rtadv_prefix)
 }
 
 static struct rtadv_prefix *
-rtadv_prefix_lookup (struct list *rplist, struct prefix_ipv6 *p)
+rtadv_prefix_lookup (const struct list *rplist, const struct prefix_ipv6 *p)
 {
   struct listnode *node;
   struct rtadv_prefix *rprefix;
 
   for (ALL_LIST_ELEMENTS_RO (rplist, node, rprefix))
-    if (prefix_same ((struct prefix *) &rprefix->prefix, (struct prefix *) p))
+    if (IPV6_ADDR_SAME (&rprefix->prefix.prefix, &p->prefix))
       return rprefix;
   return NULL;
 }
 
 static struct rtadv_prefix *
-rtadv_prefix_get (struct list *rplist, struct prefix_ipv6 *p)
+rtadv_prefix_get (struct list *rplist, const struct prefix_ipv6 *p)
 {
   struct rtadv_prefix *rprefix;
   
@@ -777,7 +777,7 @@ rtadv_prefix_reset (struct zebra_if *zif, struct rtadv_prefix *rp)
 /* RFC6106 5.1, 5.2: Lifetime SHOULD be bounded as follows:
    MaxRtrAdvInterval <= Lifetime <= 2*MaxRtrAdvInterval */
 static u_char
-rtadv_dns_lifetime_fits (unsigned long lifetime_msec, int MaxRAI_msec)
+rtadv_dns_lifetime_fits (const unsigned long lifetime_msec, const unsigned MaxRAI_msec)
 {
   if
   (
@@ -2967,7 +2967,7 @@ top_rtadv_config_write (struct vty *vty)
 }
 
 static void
-rtadv_event (struct zebra_vrf *zvrf, enum rtadv_event event, int val)
+rtadv_event (struct zebra_vrf *zvrf, enum rtadv_event event, const int val)
 {
   struct rtadv *rtadv = &zvrf->rtadv;