enum rtadv_event {RTADV_START, RTADV_STOP, RTADV_TIMER,
RTADV_TIMER_MSEC, RTADV_READ};
-void rtadv_event (enum rtadv_event, int);
+static void rtadv_event (enum rtadv_event, int);
-int if_join_all_router (int, struct interface *);
-int if_leave_all_router (int, struct interface *);
+static int if_join_all_router (int, struct interface *);
+static int if_leave_all_router (int, struct interface *);
\f
/* Structure which hold status of router advertisement. */
struct rtadv
struct rtadv *rtadv = NULL;
\f
-struct rtadv *
-rtadv_new ()
+static struct rtadv *
+rtadv_new (void)
{
struct rtadv *new;
new = XMALLOC (MTYPE_TMP, sizeof (struct rtadv));
return new;
}
-void
+static void
rtadv_free (struct rtadv *rtadv)
{
XFREE (MTYPE_TMP, rtadv);
}
-int
+static int
rtadv_recv_packet (int sock, u_char *buf, int buflen,
struct sockaddr_in6 *from, unsigned int *ifindex,
int *hoplimit)
#define RTADV_MSG_SIZE 4096
/* Send router advertisement packet. */
-void
+static void
rtadv_send_packet (int sock, struct interface *ifp)
{
struct msghdr msg;
struct cmsghdr *cmsgptr;
struct in6_pktinfo *pkt;
struct sockaddr_in6 addr;
-#ifdef HAVE_SOCKADDR_DL
+#ifdef HAVE_STRUCT_SOCKADDR_DL
struct sockaddr_dl *sdl;
-#endif /* HAVE_SOCKADDR_DL */
+#endif /* HAVE_STRUCT_SOCKADDR_DL */
static void *adata = NULL;
unsigned char buf[RTADV_MSG_SIZE];
struct nd_router_advert *rtadv;
}
/* Hardware address. */
-#ifdef HAVE_SOCKADDR_DL
+#ifdef HAVE_STRUCT_SOCKADDR_DL
sdl = &ifp->sdl;
if (sdl != NULL && sdl->sdl_alen != 0)
{
memcpy (buf + len, ifp->hw_addr, ifp->hw_addr_len);
len += ifp->hw_addr_len;
}
-#endif /* HAVE_SOCKADDR_DL */
+#endif /* HAVE_STRUCT_SOCKADDR_DL */
msg.msg_name = (void *) &addr;
msg.msg_namelen = sizeof (struct sockaddr_in6);
}
}
-int
+static int
rtadv_timer (struct thread *thread)
{
struct listnode *node, *nnode;
return 0;
}
-void
+static void
rtadv_process_solicit (struct interface *ifp)
{
zlog_info ("Router solicitation received on %s", ifp->name);
rtadv_send_packet (rtadv->sock, ifp);
}
-void
-rtadv_process_advert ()
+static void
+rtadv_process_advert (void)
{
zlog_info ("Router advertisement received");
}
-void
+static void
rtadv_process_packet (u_char *buf, unsigned int len, unsigned int ifindex, int hoplimit)
{
struct icmp6_hdr *icmph;
return;
}
-int
+static int
rtadv_read (struct thread *thread)
{
int sock;
return 0;
}
-int
+static int
rtadv_make_socket (void)
{
int sock;
return sock;
}
\f
-struct rtadv_prefix *
+static struct rtadv_prefix *
rtadv_prefix_new ()
{
struct rtadv_prefix *new;
return new;
}
-void
+static void
rtadv_prefix_free (struct rtadv_prefix *rtadv_prefix)
{
XFREE (MTYPE_RTADV_PREFIX, rtadv_prefix);
}
-struct rtadv_prefix *
+static struct rtadv_prefix *
rtadv_prefix_lookup (struct list *rplist, struct prefix *p)
{
struct listnode *node;
return NULL;
}
-struct rtadv_prefix *
+static struct rtadv_prefix *
rtadv_prefix_get (struct list *rplist, struct prefix *p)
{
struct rtadv_prefix *rprefix;
return rprefix;
}
-void
+static void
rtadv_prefix_set (struct zebra_if *zif, struct rtadv_prefix *rp)
{
struct rtadv_prefix *rprefix;
rprefix->AdvRouterAddressFlag = rp->AdvRouterAddressFlag;
}
-int
+static int
rtadv_prefix_reset (struct zebra_if *zif, struct rtadv_prefix *rp)
{
struct rtadv_prefix *rprefix;
}
-void
+static void
rtadv_event (enum rtadv_event event, int val)
{
switch (event)
}
void
-rtadv_init ()
+rtadv_init (void)
{
int sock;
install_element (INTERFACE_NODE, &no_ipv6_nd_prefix_cmd);
}
-int
+static int
if_join_all_router (int sock, struct interface *ifp)
{
int ret;
return 0;
}
-int
+static int
if_leave_all_router (int sock, struct interface *ifp)
{
int ret;
#else
void
-rtadv_init ()
+rtadv_init (void)
{
/* Empty.*/;
}