ikev1: Move fragment generation to message_t

This commit is contained in:
Tobias Brunner
2014-10-10 09:30:26 +02:00
parent 147fe503af
commit 127a98dc90
5 changed files with 253 additions and 141 deletions
+20 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2006-2011 Tobias Brunner
* Copyright (C) 2006-2014 Tobias Brunner
* Copyright (C) 2005-2009 Martin Willi
* Copyright (C) 2006 Daniel Roethlisberger
* Copyright (C) 2005 Jan Hutter
@@ -264,6 +264,25 @@ struct message_t {
*/
bool (*is_encoded)(message_t *this);
/**
* Split the (generated) message into fragments of the given size (total IP
* datagram length).
*
* @note Only supported for IKEv1 at the moment.
*
* @param frag_len fragment length (maximum total IP datagram length), 0
* for default value depending on address family
* @param fragments receives an enumerator with message_t* (not generated),
* which are owned by the enumerator
* @return
* - SUCCESS if message could be fragmented
* - ALREADY_DONE if message does not need to be fragmented
* - INVALID_STATE if message was not generated or is IKEv2
* - FAILED if fragmentation failed
*/
status_t (*fragment)(message_t *this, size_t frag_len,
enumerator_t **fragments);
/**
* Gets the source host informations.
*