Extended constructor for packet_t added (takes src, dst and data)

This commit is contained in:
Tobias Brunner
2012-08-08 15:41:02 +02:00
parent 5764a9b355
commit ec486e9433
2 changed files with 24 additions and 3 deletions
+14 -3
View File
@@ -126,10 +126,10 @@ METHOD(packet_t, clone_, packet_t*,
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;
@@ -145,8 +145,19 @@ packet_t *packet_create()
.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);
}