aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/packet.c
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2005-11-04 16:27:45 +0000
committerMartin Willi <martin@strongswan.org>2005-11-04 16:27:45 +0000
commit45a07212877a11ee691609a834ce9d203d7893ab (patch)
tree5f586c89897625f05944871935892d6e7cfa6558 /Source/charon/packet.c
parentae758c7934c1472b3dc94768fb619b7ad2482d99 (diff)
downloadstrongswan-45a07212877a11ee691609a834ce9d203d7893ab.tar.bz2
strongswan-45a07212877a11ee691609a834ce9d203d7893ab.tar.xz
- first attempt of socket abstraction (more to do)
Diffstat (limited to 'Source/charon/packet.c')
-rw-r--r--Source/charon/packet.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/Source/charon/packet.c b/Source/charon/packet.c
new file mode 100644
index 000000000..ac559ffb4
--- /dev/null
+++ b/Source/charon/packet.c
@@ -0,0 +1,44 @@
+/**
+ * @file packet.h
+ *
+ * @brief UDP-Packet, contains data, sender and receiver
+ *
+ */
+
+/*
+ * Copyright (C) 2005 Jan Hutter, Martin Willi
+ * Hochschule fuer Technik Rapperswil
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+#include "packet.h"
+
+
+
+
+status_t destroy(packet_t *this)
+{
+ pfree(this->data.ptr);
+ pfree(this);
+ return SUCCESS;
+}
+
+
+packet_t *packet_create()
+{
+ packet_t *this = alloc_thing(packet_t, "packet_t");
+
+ this->data.len = 0;
+ this->data.ptr = NULL;
+ return this;
+
+}