summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ospf6d/ospf6_message.c36
-rw-r--r--ospf6d/ospf6_message.h13
2 files changed, 42 insertions, 7 deletions
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c
index 8f9ae7b0c4..70ad735764 100644
--- a/ospf6d/ospf6_message.c
+++ b/ospf6d/ospf6_message.c
@@ -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)
diff --git a/ospf6d/ospf6_message.h b/ospf6d/ospf6_message.h
index 4069e10486..c7a5434e59 100644
--- a/ospf6d/ospf6_message.h
+++ b/ospf6d/ospf6_message.h
@@ -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);