summaryrefslogtreecommitdiff
path: root/include/stack.h
diff options
context:
space:
mode:
authorGaurav Sinha <gaurav.sinha@vyatta.com>2012-06-10 15:03:35 -0700
committerGaurav Sinha <gaurav.sinha@vyatta.com>2012-06-10 15:03:35 -0700
commit48056fa49608bedc4c076181478485569fec7d5f (patch)
tree3d60586d43ec504d7018af00ba7cf1d895e3f099 /include/stack.h
parent4decf5460114e222532147ccc97fbec05bc5cccb (diff)
parent5bbd235a4a30b26f477b73b2779619a5f20ad73b (diff)
downloadconntrack-tools-48056fa49608bedc4c076181478485569fec7d5f.tar.gz
conntrack-tools-48056fa49608bedc4c076181478485569fec7d5f.zip
Merge branch 'pacifica' into oxnard
Conflicts: .frlog debian/changelog
Diffstat (limited to 'include/stack.h')
-rw-r--r--include/stack.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/stack.h b/include/stack.h
new file mode 100644
index 0000000..512a30f
--- /dev/null
+++ b/include/stack.h
@@ -0,0 +1,28 @@
+#ifndef _STACK_H_
+#define _STACK_H_
+
+#include "linux_list.h"
+
+struct stack {
+ struct list_head list;
+ int items;
+};
+
+static inline void stack_init(struct stack *s)
+{
+ INIT_LIST_HEAD(&s->list);
+}
+
+struct stack_item {
+ struct list_head head;
+ int type;
+ int data_len;
+ char data[0];
+};
+
+struct stack_item *stack_item_alloc(int type, size_t data_len);
+void stack_item_free(struct stack_item *e);
+void stack_item_push(struct stack *s, struct stack_item *e);
+struct stack_item *stack_item_pop(struct stack *s, int type);
+
+#endif