Revision b5a2055f src/charon/encoding/payloads/cp_payload.h
| b/src/charon/encoding/payloads/cp_payload.h | ||
|---|---|---|
| 1 | 1 |
/* |
| 2 |
* Copyright (C) 2005-2006 Martin Willi |
|
| 2 |
* Copyright (C) 2005-2009 Martin Willi |
|
| 3 | 3 |
* Copyright (C) 2005 Jan Hutter |
| 4 | 4 |
* Hochschule fuer Technik Rapperswil |
| 5 | 5 |
* |
| ... | ... | |
| 28 | 28 |
#include <library.h> |
| 29 | 29 |
#include <encoding/payloads/payload.h> |
| 30 | 30 |
#include <encoding/payloads/configuration_attribute.h> |
| 31 |
#include <utils/linked_list.h> |
|
| 31 |
#include <utils/enumerator.h> |
|
| 32 | 32 |
|
| 33 | 33 |
/** |
| 34 | 34 |
* CP_PAYLOAD length in bytes without any proposal substructure. |
| ... | ... | |
| 56 | 56 |
* The CP Payload format is described in RFC section 3.15. |
| 57 | 57 |
*/ |
| 58 | 58 |
struct cp_payload_t {
|
| 59 |
|
|
| 59 | 60 |
/** |
| 60 | 61 |
* The payload_t interface. |
| 61 | 62 |
*/ |
| ... | ... | |
| 64 | 65 |
/** |
| 65 | 66 |
* Creates an iterator of stored configuration_attribute_t objects. |
| 66 | 67 |
* |
| 67 |
* When deleting an attribute using this iterator, the length of this |
|
| 68 |
* configuration_attribute_t has to be refreshed by calling get_length()! |
|
| 69 |
* |
|
| 70 |
* @return created iterator_t object |
|
| 68 |
* @return enumerator over configration_attribute_T |
|
| 71 | 69 |
*/ |
| 72 |
iterator_t *(*create_attribute_iterator) (cp_payload_t *this); |
|
| 70 |
enumerator_t *(*create_attribute_enumerator) (cp_payload_t *this); |
|
| 73 | 71 |
|
| 74 | 72 |
/** |
| 75 |
* Adds a configuration_attribute_t object to this object. |
|
| 76 |
* |
|
| 77 |
* The added configuration_attribute_t object is getting destroyed in |
|
| 78 |
* destroy function of cp_payload_t. |
|
| 73 |
* Adds a configuration attribute to the configuration payload. |
|
| 79 | 74 |
* |
| 80 |
* @param attribute configuration_attribute_t object to add |
|
| 75 |
* @param attribute attribute to add |
|
| 81 | 76 |
*/ |
| 82 |
void (*add_configuration_attribute) (cp_payload_t *this, configuration_attribute_t *attribute); |
|
| 77 |
void (*add_attribute)(cp_payload_t *this, |
|
| 78 |
configuration_attribute_t *attribute); |
|
| 83 | 79 |
|
| 84 | 80 |
/** |
| 85 |
* Set the config type. |
|
| 81 |
* Get the configuration payload type. |
|
| 86 | 82 |
* |
| 87 |
* @param config_type config_type_t to set |
|
| 83 |
* @return type of configuration payload |
|
| 88 | 84 |
*/ |
| 89 |
void (*set_config_type) (cp_payload_t *this,config_type_t config_type); |
|
| 90 |
|
|
| 91 |
/** |
|
| 92 |
* Get the config type. |
|
| 93 |
* |
|
| 94 |
* @return config_type_t |
|
| 95 |
*/ |
|
| 96 |
config_type_t (*get_config_type) (cp_payload_t *this); |
|
| 85 |
config_type_t (*get_type) (cp_payload_t *this); |
|
| 97 | 86 |
|
| 98 | 87 |
/** |
| 99 | 88 |
* Destroys an cp_payload_t object. |
| ... | ... | |
| 102 | 91 |
}; |
| 103 | 92 |
|
| 104 | 93 |
/** |
| 105 |
* Creates an empty cp_payload_t object |
|
| 94 |
* Creates an empty configuration payload |
|
| 95 |
* |
|
| 96 |
* @return empty configuration payload |
|
| 97 |
*/ |
|
| 98 |
cp_payload_t *cp_payload_create(); |
|
| 99 |
|
|
| 100 |
/** |
|
| 101 |
* Creates an cp_payload_t with type and value |
|
| 106 | 102 |
* |
| 107 |
* @return cp_payload_t object |
|
| 103 |
* @param type type of configuration payload to create |
|
| 104 |
* @return created configuration payload |
|
| 108 | 105 |
*/ |
| 109 |
cp_payload_t *cp_payload_create(void); |
|
| 106 |
cp_payload_t *cp_payload_create_type(config_type_t config_type); |
|
| 110 | 107 |
|
| 111 | 108 |
#endif /** CP_PAYLOAD_H_ @}*/ |
Also available in: Unified diff