return other;
}
-/*
- * Documented in header
+/**
+ * Described in header.
*/
-packet_t *packet_create()
+packet_t *packet_create_from_data(host_t *src, host_t *dst, chunk_t data)
{
private_packet_t *this;
.clone = _clone_,
.destroy = _destroy,
},
+ .source = src,
+ .destination = dst,
+ .adjusted_data = data,
+ .data = data,
);
return &this->public;
}
+/*
+ * Described in header.
+ */
+packet_t *packet_create()
+{
+ return packet_create_from_data(NULL, NULL, chunk_empty);
+}
*/
packet_t *packet_create();
+/**
+ * Create a packet from the supplied data
+ *
+ * @param src source address (gets owned)
+ * @param dst destination address (gets owned)
+ * @param data packet data (gets owned)
+ * @return packet_t object
+ */
+packet_t *packet_create_from_data(host_t *src, host_t *dst, chunk_t data);
+
#endif /** PACKET_H_ @}*/