diff options
author | Martin Willi <martin@revosec.ch> | 2013-02-06 11:56:27 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2013-02-06 15:20:32 +0100 |
commit | 1116689944422a0080043e8dc06110c7e702c0cd (patch) | |
tree | e32395b8eba8d3ecbd5885ecc8b4c2bb7c612dc9 /src/libstrongswan/networking/packet.c | |
parent | 6c37daaa3b7cc773249cbce6efeca1c4cc56220c (diff) | |
download | strongswan-1116689944422a0080043e8dc06110c7e702c0cd.tar.bz2 strongswan-1116689944422a0080043e8dc06110c7e702c0cd.tar.xz |
Add a DSCP value with getter/setter on packet_t
Diffstat (limited to 'src/libstrongswan/networking/packet.c')
-rw-r--r-- | src/libstrongswan/networking/packet.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libstrongswan/networking/packet.c b/src/libstrongswan/networking/packet.c index a2c329d60..4ff7fc48b 100644 --- a/src/libstrongswan/networking/packet.c +++ b/src/libstrongswan/networking/packet.c @@ -39,6 +39,11 @@ struct private_packet_t { */ host_t *destination; + /** + * DSCP value on packet + */ + u_int8_t dscp; + /** * message data */ @@ -89,6 +94,17 @@ METHOD(packet_t, set_data, void, this->adjusted_data = this->data = data; } +METHOD(packet_t, get_dscp, u_int8_t, + private_packet_t *this) +{ + return this->dscp; +} +METHOD(packet_t, set_dscp, void, + private_packet_t *this, u_int8_t value) +{ + this->dscp = value; +} + METHOD(packet_t, skip_bytes, void, private_packet_t *this, size_t bytes) { @@ -123,6 +139,7 @@ METHOD(packet_t, clone_, packet_t*, { other->set_data(other, chunk_clone(this->adjusted_data)); } + other->set_dscp(other, this->dscp); return other; } @@ -141,6 +158,8 @@ packet_t *packet_create_from_data(host_t *src, host_t *dst, chunk_t data) .get_source = _get_source, .set_destination = _set_destination, .get_destination = _get_destination, + .get_dscp = _get_dscp, + .set_dscp = _set_dscp, .skip_bytes = _skip_bytes, .clone = _clone_, .destroy = _destroy, |