mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 18:27:21 +00:00
ospf6d: add packet apis
Add APIs to create, queue and dequeue OSPFv3 packets Signed-off-by: Pat Ruddy <pat@voltanet.io>
This commit is contained in:
parent
4f7bf1ab05
commit
531f925b4d
@ -271,7 +271,7 @@ struct ospf6_fifo *ospf6_fifo_new(void)
|
||||
}
|
||||
|
||||
/* Add new packet to fifo. */
|
||||
void ospf6_fifo_push(struct ospf6_fifo *fifo, struct ospf6_packet *op)
|
||||
static void ospf6_fifo_push(struct ospf6_fifo *fifo, struct ospf6_packet *op)
|
||||
{
|
||||
if (fifo->tail)
|
||||
fifo->tail->next = op;
|
||||
@ -284,7 +284,8 @@ void ospf6_fifo_push(struct ospf6_fifo *fifo, struct ospf6_packet *op)
|
||||
}
|
||||
|
||||
/* Add new packet to head of fifo. */
|
||||
void ospf6_fifo_push_head(struct ospf6_fifo *fifo, struct ospf6_packet *op)
|
||||
static void ospf6_fifo_push_head(struct ospf6_fifo *fifo,
|
||||
struct ospf6_packet *op)
|
||||
{
|
||||
op->next = fifo->head;
|
||||
|
||||
@ -297,7 +298,7 @@ void ospf6_fifo_push_head(struct ospf6_fifo *fifo, struct ospf6_packet *op)
|
||||
}
|
||||
|
||||
/* Delete first packet from fifo. */
|
||||
struct ospf6_packet *ospf6_fifo_pop(struct ospf6_fifo *fifo)
|
||||
static struct ospf6_packet *ospf6_fifo_pop(struct ospf6_fifo *fifo)
|
||||
{
|
||||
struct ospf6_packet *op;
|
||||
|
||||
@ -343,6 +344,35 @@ void ospf6_fifo_free(struct ospf6_fifo *fifo)
|
||||
XFREE(MTYPE_OSPF6_FIFO, fifo);
|
||||
}
|
||||
|
||||
void ospf6_packet_add(struct ospf6_interface *oi, struct ospf6_packet *op)
|
||||
{
|
||||
/* Add packet to end of queue. */
|
||||
ospf6_fifo_push(oi->obuf, op);
|
||||
|
||||
/* Debug of packet fifo*/
|
||||
/* ospf_fifo_debug (oi->obuf); */
|
||||
}
|
||||
|
||||
void ospf6_packet_add_top(struct ospf6_interface *oi, struct ospf6_packet *op)
|
||||
{
|
||||
/* Add packet to head of queue. */
|
||||
ospf6_fifo_push_head(oi->obuf, op);
|
||||
|
||||
/* Debug of packet fifo*/
|
||||
/* ospf_fifo_debug (oi->obuf); */
|
||||
}
|
||||
|
||||
void ospf6_packet_delete(struct ospf6_interface *oi)
|
||||
{
|
||||
struct ospf6_packet *op;
|
||||
|
||||
op = ospf6_fifo_pop(oi->obuf);
|
||||
|
||||
if (op)
|
||||
ospf6_packet_free(op);
|
||||
}
|
||||
|
||||
|
||||
static void ospf6_hello_recv(struct in6_addr *src, struct in6_addr *dst,
|
||||
struct ospf6_interface *oi,
|
||||
struct ospf6_header *oh)
|
||||
|
@ -159,12 +159,17 @@ extern void ospf6_lsack_print(struct ospf6_header *, int action);
|
||||
|
||||
extern void ospf6_packet_free(struct ospf6_packet *op);
|
||||
extern struct ospf6_fifo *ospf6_fifo_new(void);
|
||||
extern void ospf6_fifo_push(struct ospf6_fifo *fifo, struct ospf6_packet *op);
|
||||
void ospf6_fifo_push_head(struct ospf6_fifo *fifo, struct ospf6_packet *op);
|
||||
extern struct ospf6_packet *ospf6_fifo_pop(struct ospf6_fifo *fifo);
|
||||
extern struct ospf6_packet *ospf6_fifo_head(struct ospf6_fifo *fifo);
|
||||
extern void ospf6_fifo_flush(struct ospf6_fifo *fifo);
|
||||
extern void ospf6_fifo_free(struct ospf6_fifo *fifo);
|
||||
struct ospf6_packet *ospf6_fifo_head(struct ospf6_fifo *fifo);
|
||||
|
||||
/* temporary inclusinon of ospf6_interface.h for compile will be removed */
|
||||
#include "ospf6_interface.h"
|
||||
extern void ospf6_packet_add(struct ospf6_interface *oi,
|
||||
struct ospf6_packet *op);
|
||||
extern void ospf6_packet_add_top(struct ospf6_interface *oi,
|
||||
struct ospf6_packet *op);
|
||||
extern void ospf6_packet_delete(struct ospf6_interface *oi);
|
||||
|
||||
extern int ospf6_iobuf_size(unsigned int size);
|
||||
extern void ospf6_message_terminate(void);
|
||||
|
Loading…
Reference in New Issue
Block a user