From 7c577e23dde00c759db0cca0898809c3d278b37a Mon Sep 17 00:00:00 2001 From: Zhijiang Hu Date: Thu, 6 Apr 2017 23:21:42 -0400 Subject: jasmine(Just A Simple Multicast engINE) Initial merge Change-Id: I7a543019c8d92314ef549bf72369b7276f39577d Signed-off-by: Zhijiang Hu --- code/jasmine/tcp-queue.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 code/jasmine/tcp-queue.h (limited to 'code/jasmine/tcp-queue.h') diff --git a/code/jasmine/tcp-queue.h b/code/jasmine/tcp-queue.h new file mode 100755 index 00000000..4f096f85 --- /dev/null +++ b/code/jasmine/tcp-queue.h @@ -0,0 +1,35 @@ +/*############################################################################## +# Copyright (c) 2017 ZTE Coreporation and others. +# hu.zhijiang@zte.com.cn +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +##############################################################################*/ + +#ifndef _MCAST_TCP_QUEUE_H +#define _MCAST_TCP_QUEUE_H + +struct tcpq { + struct qmsg *head, *tail; + long count; /* message count in a queue */ + long size; /* Total data size of a queue */ +}; + +struct qmsg { + struct qmsg *next; + void *data; + long size; +}; + +struct tcpq * tcpq_queue_init(void); +void tcpq_queue_free(struct tcpq *q); +long tcpq_queue_dsize(struct tcpq *q); +void tcpq_queue_tail(struct tcpq *q, void *data, long size); +void tcpq_queue_head(struct tcpq *q, void *data, long size); +void * tcpq_dequeue_head(struct tcpq *q, long *size); +void * tcpq_queue_peek(struct tcpq *q, long *size); +void * tcpq_dqueue_flat(struct tcpq *q, long *size); +void * tcpq_queue_flat_peek(struct tcpq *q, long *size); + +#endif -- cgit 1.2.3-korg