summaryrefslogtreecommitdiff
path: root/src/libimcv/pa_tnc/pa_tnc_msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libimcv/pa_tnc/pa_tnc_msg.c')
-rw-r--r--src/libimcv/pa_tnc/pa_tnc_msg.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libimcv/pa_tnc/pa_tnc_msg.c b/src/libimcv/pa_tnc/pa_tnc_msg.c
index ea4dee950..17c649dfd 100644
--- a/src/libimcv/pa_tnc/pa_tnc_msg.c
+++ b/src/libimcv/pa_tnc/pa_tnc_msg.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2014 Andreas Steffen
+ * Copyright (C) 2011-2015 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -92,6 +92,12 @@ METHOD(pa_tnc_msg_t, get_encoding, chunk_t,
return this->encoding;
}
+METHOD(pa_tnc_msg_t, get_space, size_t,
+ private_pa_tnc_msg_t *this)
+{
+ return this->max_msg_len ? this->max_msg_len - this->msg_len : 0;
+}
+
METHOD(pa_tnc_msg_t, add_attribute, bool,
private_pa_tnc_msg_t *this, pa_tnc_attr_t *attr)
{
@@ -389,6 +395,7 @@ pa_tnc_msg_t *pa_tnc_msg_create(size_t max_msg_len)
INIT(this,
.public = {
.get_encoding = _get_encoding,
+ .get_space = _get_space,
.add_attribute = _add_attribute,
.build = _build,
.process = _process,
@@ -416,6 +423,7 @@ pa_tnc_msg_t *pa_tnc_msg_create_from_data(chunk_t data)
INIT(this,
.public = {
.get_encoding = _get_encoding,
+ .get_space = _get_space,
.add_attribute = _add_attribute,
.build = _build,
.process = _process,