/* Minimum (besides OSPF_LSA_HEADER_SIZE) lengths for LSAs of particular
types, offset is the "LSA type" field. */
static const uint16_t ospf_lsa_minlen[] = {
- 0,
- OSPF_ROUTER_LSA_MIN_SIZE,
- OSPF_NETWORK_LSA_MIN_SIZE,
- OSPF_SUMMARY_LSA_MIN_SIZE,
- OSPF_SUMMARY_LSA_MIN_SIZE,
- OSPF_AS_EXTERNAL_LSA_MIN_SIZE,
- 0,
- OSPF_AS_EXTERNAL_LSA_MIN_SIZE,
- 0,
- 0,
- 0,
- 0,
+ 0, /* OSPF_UNKNOWN_LSA */
+ OSPF_ROUTER_LSA_MIN_SIZE, /* OSPF_ROUTER_LSA */
+ OSPF_NETWORK_LSA_MIN_SIZE, /* OSPF_NETWORK_LSA */
+ OSPF_SUMMARY_LSA_MIN_SIZE, /* OSPF_SUMMARY_LSA */
+ OSPF_SUMMARY_LSA_MIN_SIZE, /* OSPF_ASBR_SUMMARY_LSA */
+ OSPF_AS_EXTERNAL_LSA_MIN_SIZE, /* OSPF_AS_EXTERNAL_LSA */
+ 0, /* Unsupported, OSPF_GROUP_MEMBER_LSA */
+ OSPF_AS_EXTERNAL_LSA_MIN_SIZE, /* OSPF_AS_NSSA_LSA */
+ 0, /* Unsupported, OSPF_EXTERNAL_ATTRIBURES_LSA */
+ OSPF_OPAQUE_LSA_MIN_SIZE, /* OSPF_OPAQUE_LINK_LSA */
+ OSPF_OPAQUE_LSA_MIN_SIZE, /* OSPF_OPAQUE_AREA_LSA */
+ OSPF_OPAQUE_LSA_MIN_SIZE, /* OSPF_OPAQUE_AS_LSA */
};
/* for ospf_check_auth() */
/* We do this here so when we dup a packet, we don't have to
waste CPU rewriting other headers.
- Note that quagga_time /deliberately/ is not used here */
+ Note that frr_time /deliberately/ is not used here */
t = (time(NULL) & 0xFFFFFFFF);
if (t > oi->crypt_seqnum)
oi->crypt_seqnum = t;
}
-static int ospf_ls_req_timer(struct thread *thread)
+static void ospf_ls_req_timer(struct thread *thread)
{
struct ospf_neighbor *nbr;
/* Set Link State Request retransmission timer. */
OSPF_NSM_TIMER_ON(nbr->t_ls_req, ospf_ls_req_timer, nbr->v_ls_req);
-
- return 0;
}
void ospf_ls_req_event(struct ospf_neighbor *nbr)
/* Cyclic timer function. Fist registered in ospf_nbr_new () in
ospf_neighbor.c */
-int ospf_ls_upd_timer(struct thread *thread)
+void ospf_ls_upd_timer(struct thread *thread)
{
struct ospf_neighbor *nbr;
/* Set LS Update retransmission timer. */
OSPF_NSM_TIMER_ON(nbr->t_ls_upd, ospf_ls_upd_timer, nbr->v_ls_upd);
-
- return 0;
}
-int ospf_ls_ack_timer(struct thread *thread)
+void ospf_ls_ack_timer(struct thread *thread)
{
struct ospf_interface *oi;
/* Set LS Ack timer. */
OSPF_ISM_TIMER_ON(oi->t_ls_ack, ospf_ls_ack_timer, oi->v_ls_ack);
-
- return 0;
}
#ifdef WANT_OSPF_WRITE_FRAGMENT
}
#endif /* WANT_OSPF_WRITE_FRAGMENT */
-static int ospf_write(struct thread *thread)
+static void ospf_write(struct thread *thread)
{
struct ospf *ospf = THREAD_ARG(thread);
struct ospf_interface *oi;
zlog_debug(
"ospf_write failed to send, fd %d, instance %u",
ospf->fd, ospf->oi_running);
- return -1;
+ return;
}
node = listhead(ospf->oi_write_q);
/* reset get pointer */
stream_set_getp(op->s, 0);
- memset(&iph, 0, sizeof(struct ip));
+ memset(&iph, 0, sizeof(iph));
memset(&sa_dst, 0, sizeof(sa_dst));
sa_dst.sin_family = AF_INET;
if (!list_isempty(ospf->oi_write_q))
thread_add_write(master, ospf_write, ospf, ospf->fd,
&ospf->t_write);
-
- return 0;
}
/* OSPF Hello message read -- RFC2328 Section 10.5. */
char buff[CMSG_SPACE(SOPT_SIZE_CMSG_IFINDEX_IPV4())];
struct msghdr msgh;
- memset(&msgh, 0, sizeof(struct msghdr));
+ memset(&msgh, 0, sizeof(msgh));
msgh.msg_iov = &iov;
msgh.msg_iovlen = 1;
msgh.msg_control = (caddr_t)buff;
}
}
- if (ospf->vrf_id == VRF_DEFAULT && ospf->vrf_id != ifp->vrf_id) {
+ if (ospf->vrf_id == VRF_DEFAULT && ospf->vrf_id != ifp->vrf->vrf_id) {
/*
* We may have a situation where l3mdev_accept == 1
* let's just kindly drop the packet and move on.
}
/* Starting point of packet process function. */
-int ospf_read(struct thread *thread)
+void ospf_read(struct thread *thread)
{
struct ospf *ospf;
int32_t count = 0;
ret = ospf_read_helper(ospf);
switch (ret) {
case OSPF_READ_ERROR:
- return -1;
+ return;
case OSPF_READ_CONTINUE:
break;
}
}
-
- return 0;
}
/* Make OSPF header. */
/* LS Request packet overflows interface MTU
* delta is just number of bytes required for 1 LS Req
* ospf_packet_max will return the number of bytes can
- * be accomodated without ospf header. So length+delta
+ * be accommodated without ospf header. So length+delta
* can be compared to ospf_packet_max
* to check if it can fit another lsreq in the same packet.
*/
zlog_debug("%s: List Iteration %d LSA[%s]", __func__,
count, dump_lsa_key(lsa));
- /* Will it fit? Minimum it has to fit atleast one */
+ /* Will it fit? Minimum it has to fit at least one */
if ((length + delta + ntohs(lsa->data->length) > size_noauth) &&
(count > 0))
break;
/* LS Ack packet overflows interface MTU
* delta is just number of bytes required for
* 1 LS Ack(1 LS Hdr) ospf_packet_max will return
- * the number of bytes can be accomodated without
+ * the number of bytes can be accommodated without
* ospf header. So length+delta can be compared
* against ospf_packet_max to check if it can fit
* another ls header in the same packet.
ospf_hello_send_sub(oi, nbr_nbma->addr.s_addr);
}
-int ospf_poll_timer(struct thread *thread)
+void ospf_poll_timer(struct thread *thread)
{
struct ospf_nbr_nbma *nbr_nbma;
if (nbr_nbma->v_poll > 0)
OSPF_POLL_TIMER_ON(nbr_nbma->t_poll, ospf_poll_timer,
nbr_nbma->v_poll);
-
- return 0;
}
-int ospf_hello_reply_timer(struct thread *thread)
+void ospf_hello_reply_timer(struct thread *thread)
{
struct ospf_neighbor *nbr;
IF_NAME(nbr->oi), &nbr->router_id);
ospf_hello_send_sub(nbr->oi, nbr->address.u.prefix4.s_addr);
-
- return 0;
}
/* Send OSPF Hello. */
list_delete(&update);
}
-/* Determine size for packet. Must be at least big enough to accomodate next
+/* Determine size for packet. Must be at least big enough to accommodate next
* LSA on list, which may be bigger than MTU size.
*
* Return pointer to new ospf_packet
}
}
-static int ospf_ls_upd_send_queue_event(struct thread *thread)
+static void ospf_ls_upd_send_queue_event(struct thread *thread)
{
struct ospf_interface *oi = THREAD_ARG(thread);
struct route_node *rn;
if (IS_DEBUG_OSPF_EVENT)
zlog_debug("ospf_ls_upd_send_queue stop");
-
- return 0;
}
void ospf_ls_upd_send(struct ospf_neighbor *nbr, struct list *update, int flag,
OSPF_ISM_WRITE_ON(oi->ospf);
}
-static int ospf_ls_ack_send_event(struct thread *thread)
+static void ospf_ls_ack_send_event(struct thread *thread)
{
struct ospf_interface *oi = THREAD_ARG(thread);
while (listcount(oi->ls_ack_direct.ls_ack))
ospf_ls_ack_send_list(oi, oi->ls_ack_direct.ls_ack,
oi->ls_ack_direct.dst);
-
- return 0;
}
void ospf_ls_ack_send(struct ospf_neighbor *nbr, struct ospf_lsa *lsa)