objects in source documentation renamed from xy-object to xy object

This commit is contained in:
Jan Hutter 2005-11-10 09:35:28 +00:00
parent c7748338f2
commit c3dc6f1aae
20 changed files with 272 additions and 272 deletions

View File

@ -1,8 +1,8 @@
/**
* @file event_queue.h
*
*
* @brief Event-Queue based on class linked_list_t
*
*
*/
/*
@ -31,16 +31,16 @@
/**
* @brief Event-Queue used to store timed events.
*
* Although the event-queue is based on a linked_list_t
* Although the event-queue is based on a linked_list_t
* all access functions are thread-save implemented.
*/
typedef struct event_queue_s event_queue_t;
struct event_queue_s {
/**
* @brief Returns number of events in queue.
*
*
* @param event_queue calling object
* @return number of events in queue
*/
@ -48,39 +48,39 @@ struct event_queue_s {
/**
* @brief Get the next job from the event-queue.
*
*
* If no event is pending, this function blocks until a job can be returned.
*
*
* @param event_queue calling object
* @param[out] job pointer to a job pointer where to job is returned to
* @return - SUCCESS if succeeded
* - FAILED otherwisesa
*/
status_t (*get) (event_queue_t *event_queue, job_t **job);
/**
* @brief Adds a event to the queue, using a relative time.
*
*
* This function is non blocking and adds a job_t at a specific time to the list.
* The specific job-object has to get destroyed by the thread which
* The specific job object has to get destroyed by the thread which
* removes the job.
*
*
* @param event_queue calling object
* @param[in] job job to add to the queue (job is not copied)
* @param[in] time relative time, when the event has to get fired
* @returns
* @returns
* - SUCCESS if succeeded
* - FAILED otherwise
*/
status_t (*add_relative) (event_queue_t *event_queue, job_t *job, u_int32_t ms);
/**
* @brief Adds a event to the queue, using an absolute time.
*
*
* This function is non blocking and adds a job_t at a specific time to the list.
* The specific job-object has to get destroyed by the thread which
* The specific job object has to get destroyed by the thread which
* removes the job.
*
*
* @param event_queue calling object
* @param[in] job job to add to the queue (job is not copied)
* @param[in] absolute time time, when the event has to get fired
@ -92,11 +92,11 @@ struct event_queue_s {
/**
* @brief Destroys a event_queue object.
*
*
* @warning The caller of this function has to make sure
* that no thread is going to add or get an event from the event_queue
* after calling this function.
*
*
* @param event_queue calling object
* @returns always SUCCESS
*/
@ -105,8 +105,8 @@ struct event_queue_s {
/**
* @brief Creates an empty event_queue
*
* @returns
*
* @returns
* - Empty event_queue_t object
* - NULL if memory allocation failed
*/

View File

@ -37,51 +37,51 @@ typedef struct generator_infos_s generator_infos_t;
struct generator_infos_s {
/**
* Buffer used to generate to
* Buffer used to generate to
*/
u_int8_t *buffer;
/**
* current write position in buffer (one byte alligned)
*/
u_int8_t *out_position;
/**
* position of last byte in buffer
*/
u_int8_t *roof_position;
/**
* Current bit writing to
*/
size_t current_bit;
/**
* Associated data struct to read informations from
*/
void * data_struct;
/**
* @brief Destroys a generator_infos_t object
*
*
* @param generator_infos_t generator_infos_t object
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/
status_t (*destroy) (generator_infos_t *this);
/**
* Checks if enough space is available in buffer and if not,
* the buffer size is increased until at least the asked amount of space
* the buffer size is increased until at least the asked amount of space
* is available
*
*
* @param bits number of bits to make at leas available in buffer
* @param generator_infos_t generator_infos_t object
* @return SUCCESSFUL if succeeded, OUT_OF_RES otherwise
*/
status_t (*make_space_available) (generator_infos_t *this,size_t bits);
status_t (*write_bytes_to_buffer) (generator_infos_t *this,void * bytes,size_t number_of_bytes);
status_t (*write_chunk) (generator_infos_t *this,chunk_t *data);
status_t (*write_chunk) (generator_infos_t *this,chunk_t *data);
};
/**
@ -101,9 +101,9 @@ static status_t generator_info_make_space_available (generator_infos_t *this, si
{
return OUT_OF_RES;
}
this->buffer = new_buffer;
this->out_position = (this->buffer + out_position_offset);
this->roof_position = (this->buffer + new_buffer_size);
@ -117,14 +117,14 @@ static status_t generator_info_write_bytes_to_buffer (generator_infos_t *this,vo
u_int8_t *read_position = (u_int8_t *) bytes;
int i;
status_t status;
status = this->make_space_available(this,number_of_bytes * 8);
if (status != SUCCESS)
{
return status;
}
for (i = 0; i < number_of_bytes; i++)
{
*(this->out_position) = *(read_position);
@ -163,9 +163,9 @@ static status_t generator_infos_destroy (generator_infos_t *this)
}
/**
* Creates a generator_infos_t-object holding necessary informations
* Creates a generator_infos_t object holding necessary informations
* for generating (buffer, data_struct, etc)
*
*
* @param data_struct where to read the data out
*/
generator_infos_t * generator_infos_create(void *data_struct)
@ -190,7 +190,7 @@ generator_infos_t * generator_infos_create(void *data_struct)
allocator_free(this);
return NULL;
}
/* set private data */
this->out_position = this->buffer;
this->roof_position = this->buffer + GENERATOR_DATA_BUFFER_SIZE;
@ -219,7 +219,7 @@ struct private_generator_s {
*
* items are bytewhise written
*
* @param this private_generator_t-object
* @param this private_generator_t object
* @param data_struct data_struct to read data from
* @param encoding_rules pointer to first encoding_rule of encoding rules array
* @param encoding_rules_count number of encoding rules in encoding rules array
@ -249,7 +249,7 @@ static status_t generate_u_int_type (private_generator_t *this,encoding_type_t i
{
size_t number_of_bits = 0;
status_t status;
switch (int_type)
{
@ -276,9 +276,9 @@ static status_t generate_u_int_type (private_generator_t *this,encoding_type_t i
/* current bit has to be zero for values greater then 4 bits */
return FAILED;
}
status = generator_infos->make_space_available(generator_infos,number_of_bits);
if (status != SUCCESS)
{
return status;
@ -289,10 +289,10 @@ static status_t generate_u_int_type (private_generator_t *this,encoding_type_t i
case U_INT_4:
{
if (generator_infos->current_bit == 0)
{
{
u_int8_t high_val = *((u_int8_t *)(generator_infos->data_struct + offset)) << 4;
u_int8_t low_val = *(generator_infos->out_position) & 0x0F;
*(generator_infos->out_position) = high_val | low_val;
/* write position is not changed, just bit position is moved */
generator_infos->current_bit = 4;
@ -304,7 +304,7 @@ static status_t generate_u_int_type (private_generator_t *this,encoding_type_t i
*(generator_infos->out_position) = high_val | low_val;
generator_infos->out_position++;
generator_infos->current_bit = 0;
}
else
{
@ -313,39 +313,39 @@ static status_t generate_u_int_type (private_generator_t *this,encoding_type_t i
};
break;
}
case U_INT_8:
{
*generator_infos->out_position = *((u_int8_t *)(generator_infos->data_struct + offset));
generator_infos->out_position++;
break;
}
case U_INT_16:
{
u_int16_t int16_val = htons(*((u_int16_t*)(generator_infos->data_struct + offset)));
generator_infos->write_bytes_to_buffer(generator_infos,&int16_val,sizeof(u_int16_t));
break;
}
case U_INT_32:
{
u_int32_t int32_val = htonl(*((u_int32_t*)(generator_infos->data_struct + offset)));
u_int32_t int32_val = htonl(*((u_int32_t*)(generator_infos->data_struct + offset)));
generator_infos->write_bytes_to_buffer(generator_infos,&int32_val,sizeof(u_int32_t));
break;
}
case U_INT_64:
{
u_int32_t int32_val_low = htonl(*((u_int32_t*)(generator_infos->data_struct + offset)));
u_int32_t int32_val_high = htonl(*((u_int32_t*)(generator_infos->data_struct + offset) + 1));
generator_infos->write_bytes_to_buffer(generator_infos,&int32_val_high,sizeof(u_int32_t));
generator_infos->write_bytes_to_buffer(generator_infos,&int32_val_low,sizeof(u_int32_t));
u_int32_t int32_val_high = htonl(*((u_int32_t*)(generator_infos->data_struct + offset) + 1));
generator_infos->write_bytes_to_buffer(generator_infos,&int32_val_high,sizeof(u_int32_t));
generator_infos->write_bytes_to_buffer(generator_infos,&int32_val_low,sizeof(u_int32_t));
break;
}
default:
return FAILED;
}
return SUCCESS;
@ -358,8 +358,8 @@ static status_t generate (private_generator_t *this,void * data_struct,encoding_
{
int i;
status_t status;
generator_infos_t *infos = generator_infos_create(data_struct);
if (infos == NULL)
@ -387,7 +387,7 @@ static status_t generate (private_generator_t *this,void * data_struct,encoding_
u_int8_t reserved_bit = ~(1 << (7 - infos->current_bit));
*(infos->out_position) = *(infos->out_position) & reserved_bit;
infos->current_bit++;
if (infos->current_bit >= 8)
{
@ -411,9 +411,9 @@ static status_t generate (private_generator_t *this,void * data_struct,encoding_
{
u_int8_t flag_value = (*((bool *) (infos->data_struct + encoding_rules[i].offset))) ? 1 : 0;
u_int8_t flag = (flag_value << (7 - infos->current_bit));
*(infos->out_position) = *(infos->out_position) | flag;
infos->current_bit++;
if (infos->current_bit >= 8)
{

View File

@ -1,8 +1,8 @@
/**
* @file generator.h
*
*
* @brief Generic generator class used to generate IKEv2-header and payloads.
*
*
*/
/*
@ -38,17 +38,17 @@
#define GENERATOR_DATA_BUFFER_INCREASE_VALUE 1000
/**
* @brief A generator_t-object which generates payloads of specific type
* @brief A generator_t object which generates payloads of specific type
*/
typedef struct generator_s generator_t;
struct generator_s {
struct generator_s {
/**
* @brief Generates a specific payload from given data struct
*
*
* Remember: Header and substructures are also seen as payloads
*
*
* @param generator generator object
* @param payload_type payload type to generate using the given data struct
* @param[in] data_struct Data struct where the needed data for generating are stored
@ -61,7 +61,7 @@ struct generator_s {
/**
* @brief Destroys a generator object
*
*
* @param generator generator object
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/
@ -70,7 +70,7 @@ struct generator_s {
/**
* Constructor to create a generator
*
*
* @param payload_infos pointer to the payload_info_t-array containing
* all the payload informations needed to automatic generate a specific payload
*/

View File

@ -2,7 +2,7 @@
* @file ike_sa.c
*
* @brief Class ike_sa_t. An object of this type is managed by an
* ike_sa_manager_t-object and represents an IKE_SA
* ike_sa_manager_t object and represents an IKE_SA
*
*/

View File

@ -1,9 +1,9 @@
/**
* @file ike_sa.h
*
*
* @brief Class ike_sa_t. An object of this type is managed by an
* ike_sa_manager_t-object and represents an IKE_SA
*
* ike_sa_manager_t object and represents an IKE_SA
*
*/
/*
@ -31,35 +31,35 @@
/**
* @brief This class is used to represent an IKE_SA
*
*
*/
typedef struct ike_sa_s ike_sa_t;
struct ike_sa_s {
struct ike_sa_s {
/**
* @brief Processes a incoming IKEv2-Message of type message_t
*
* @param this ike_sa_t-object object
* @param[in] message message_t-object to process
*
* @param this ike_sa_t object object
* @param[in] message message_t object to process
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/
status_t (*process_message) (ike_sa_t *this,message_t *message);
/**
* @brief Processes a specific configuration
*
*
* This function is called when a new IKE_SA is created
*
*
* @param this ike_sa_t-message_t object object
* @param[in] message message_t-object to process
* @param[in] message message_t object to process
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/
status_t (*process_configuration) (ike_sa_t *this,configuration_t *configuration);
/**
* @brief Get the id of the SA
*
*
* @param this ike_sa_t-message_t object object
* @return ike_sa's ike_sa_id_t
*/
@ -67,7 +67,7 @@ struct ike_sa_s {
/**
* @brief Destroys a ike_sa_t object
*
*
* @param this ike_sa_t object
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/
@ -75,13 +75,13 @@ struct ike_sa_s {
};
/**
* Creates an ike_sa_t-object with a specific ike_sa_id_t-object
*
* @param[in] ike_sa_id ike_sa_id_t-object to associate with new IKE_SA.
* The object is internal getting cloned
* Creates an ike_sa_t object with a specific ike_sa_id_t object
*
* @param[in] ike_sa_id ike_sa_id_t object to associate with new IKE_SA.
* The object is internal getting cloned
* and so has to be destroyed by the caller.
*
* @warning the Content of internal ike_sa_id_t-Object can change over time
* @warning the Content of internal ike_sa_id_t object can change over time
* e.g. when a IKE_SA_INIT has been finished
*
* @return created ike_sa_t object

View File

@ -1,8 +1,8 @@
/**
* @file ike_sa_id.h
*
*
* @brief Class for identification of an IKE_SA
*
*
*/
/*
@ -28,31 +28,31 @@
/**
* @brief This class is used to identify an IKE_SA.
*
*
* An IKE_SA is identified by its initiator and responder spi's.
* Additionaly it contains the role of the actual running IKEv2-Daemon
* Additionaly it contains the role of the actual running IKEv2-Daemon
* for the specific IKE_SA.
*/
typedef struct ike_sa_id_s ike_sa_id_t;
struct ike_sa_id_s {
struct ike_sa_id_s {
/**
* @brief Sets the SPI of the responder.
*
*
* This function is called when a request or reply of a IKE_SA_INIT is received.
*
* @param this ike_sa_id_t-object
*
* @param this ike_sa_id_t object
* @param responder_spi SPI of responder to set
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/
status_t (*set_responder_spi) (ike_sa_id_t *this, spi_t responder_spi);
/**
* @brief Sets the SPI of the initiator.
*
*
* @param this ike_sa_id_t-object
*
*
* @param this ike_sa_id_t object
* @param initiator_spi SPI to set
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/
@ -60,73 +60,73 @@ struct ike_sa_id_s {
/**
* @brief Returns TRUE if the initiator spi is set (not zero)
*
* @param this ike_sa_id_t-object
*
* @param this ike_sa_id_t object
* @return TRUE if the initiator spi is set, FALSE otherwise
*/
bool (*initiator_spi_is_set) (ike_sa_id_t *this);
/**
* @brief Returns TRUE if the responder spi is set (not zero)
*
* @param this ike_sa_id_t-object
*
* @param this ike_sa_id_t object
* @return TRUE if the responder spi is set, FALSE otherwise
*/
bool (*responder_spi_is_set) (ike_sa_id_t *this);
/**
* @brief Check if two ike_sa_ids are equal
*
* @param this ike_sa_id_t-object
*
* @param this ike_sa_id_t object
* @param other ike_sa_id object to check if equal
* @param are_equal is set to TRUE, if given ike_sa_ids are equal, FALSE otherwise
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/
status_t (*equals) (ike_sa_id_t *this,ike_sa_id_t *other, bool *are_equal);
/**
* @brief Replace the values of a given ike_sa_id_t-object with values
* from another ike_sa_id_t-Object
*
* @param this ike_sa_id_t-object
* @brief Replace the values of a given ike_sa_id_t object with values
* from another ike_sa_id_t object
*
* @param this ike_sa_id_t object
* @param other ike_sa_id_t object which values will be taken
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/
status_t (*replace_values) (ike_sa_id_t *this,ike_sa_id_t *other);
status_t (*replace_values) (ike_sa_id_t *this,ike_sa_id_t *other);
/**
* @brief get spis and role of an ike_sa_id
*
* @param this ike_sa_id_t-object
*
* @param this ike_sa_id_t object
* @param initiator address to write initator spi
* @param responder address to write responder spi
* @param role address to write role
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/
status_t (*get_values) (ike_sa_id_t *this, spi_t *initiator, spi_t *responder, ike_sa_role_t *role);
status_t (*get_values) (ike_sa_id_t *this, spi_t *initiator, spi_t *responder, ike_sa_role_t *role);
/**
* @brief Clones a given ike_sa_id_t-object
*
* @param this ike_sa_id_t-object
* @param clone_of_this ike_sa_id_t-object which will be created
* @brief Clones a given ike_sa_id_t object
*
* @param this ike_sa_id_t object
* @param clone_of_this ike_sa_id_t object which will be created
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/
status_t (*clone) (ike_sa_id_t *this,ike_sa_id_t **clone_of_this);
status_t (*clone) (ike_sa_id_t *this,ike_sa_id_t **clone_of_this);
/**
* @brief Destroys a ike_sa_id_tobject
*
* @param this ike_sa_id_t-object
*
* @param this ike_sa_id_t object
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/
status_t (*destroy) (ike_sa_id_t *this);
};
/**
* Creates an ike_sa_id_t-object with specific spi's and defined role
*
* @warning The initiator SPI and role is not changeable after initiating a ike_sa_id-object
* Creates an ike_sa_id_t object with specific spi's and defined role
*
* @warning The initiator SPI and role is not changeable after initiating a ike_sa_id object
*/
ike_sa_id_t * ike_sa_id_create(spi_t initiator_spi, spi_t responder_spi,ike_sa_role_t role);

View File

@ -1,8 +1,8 @@
/**
* @file job_queue.h
*
*
* @brief Job-Queue based on linked_list_t
*
*
*/
/*
@ -29,16 +29,16 @@
/**
* @brief Job-Queue
*
* Although the job-queue is based on a linked_list_t
* Although the job-queue is based on a linked_list_t
* all access functions are thread-save implemented
*/
typedef struct job_queue_s job_queue_t;
struct job_queue_s {
/**
* @brief returns number of jobs in queue
*
*
* @param job_queue_t calling object
* @returns number of items in queue
*/
@ -46,24 +46,24 @@ struct job_queue_s {
/**
* @brief get the next job from the queue
*
*
* If the queue is empty, this function blocks until a job can be returned.
*
*
* After using, the returned job has to get destroyed by the caller.
*
*
* @param job_queue_t calling object
* @param[out] job pointer to a job pointer where to job is returned to
* @returns SUCCESS if succeeded, FAILED otherwise
*/
status_t (*get) (job_queue_t *job_queue, job_t **job);
/**
* @brief adds a job to the queue
*
*
* This function is non blocking and adds a job_t to the list.
* The specific job-object has to get destroyed by the thread which
* The specific job object has to get destroyed by the thread which
* removes the job.
*
*
* @param job_queue_t calling object
* @param[in] job job to add to the queue (job is not copied)
* @returns SUCCESS if succeeded, FAILED otherwise
@ -72,11 +72,11 @@ struct job_queue_s {
/**
* @brief destroys a job_queue object
*
*
* @warning The caller of this function has to make sure
* that no thread is going to add or get a job from the job_queue
* after calling this function.
*
*
* @param job_queue_t calling object
* @returns SUCCESS if succeeded, FAILED otherwise
*/
@ -85,7 +85,7 @@ struct job_queue_s {
/**
* @brief Creates an empty job_queue
*
*
* @return job_queue_t empty job_queue
*/
job_queue_t *job_queue_create();

View File

@ -1,8 +1,8 @@
/**
* @file logger.h
*
*
* @brief Logger object, allows fine-controlled logging
*
*
*/
/*
@ -52,77 +52,77 @@ enum logger_level_e {
* @brief The logger object
*/
typedef struct logger_s logger_t;
struct logger_s {
struct logger_s {
/**
* @brief Log an entry, using printf()-like params.
*
*
* The specefied loglevels must ALL be activated that
* the log is done.
*
* @param this logger_t-object
*
* @param this logger_t object
* @param loglevel or'ed set of loglevels
* @param format printf like format string
* @param ... printf like parameters
* @return
* @param ... printf like parameters
* @return
* - SUCCESS in any case
*/
status_t (*log) (logger_t *this, logger_level_t log_level, char *format, ...);
/**
* @brief Log some bytes, useful for debugging.
*
*
* The specefied loglevels must ALL be activated that
* the log is done.
*
* @param this logger_t-object
*
* @param this logger_t object
* @param loglevel or'ed set of loglevels
* @param label a labeling name, logged with the bytes
* @param bytes pointer to the bytes to dump
* @param len number of bytes to dump
* @return
* @return
* - SUCCESS in any case
*/
status_t (*log_bytes) (logger_t *this, logger_level_t loglevel, char *label, char *bytes, size_t len);
/**
* @brief Log a chunk, useful for debugging.
*
*
* The specefied loglevels must ALL be activated that
* the log is done.
*
* @param this logger_t-object
*
* @param this logger_t object
* @param loglevel or'ed set of loglevels
* @param label a labeling name, logged with the bytes
* @param chunk pointer to a chunk to log
* @return
* @return
* - SUCCESS in any case
*/
status_t (*log_chunk) (logger_t *this, logger_level_t loglevel, char *label, chunk_t *chunk);
/**
* @brief Enables a loglevel for the current logger_t-object.
*
* @param this logger_t-object
* @brief Enables a loglevel for the current logger_t object.
*
* @param this logger_t object
* @param log_level loglevel to enable
* @return
* @return
* - SUCCESS in any case
*/
status_t (*enable_level) (logger_t *this, logger_level_t log_level);
/**
* @brief Disables a loglevel for the current logger_t-object.
*
* @param this logger_t-object
* @brief Disables a loglevel for the current logger_t object.
*
* @param this logger_t object
* @param log_level loglevel to enable
* @return
* @return
* - SUCCESS in any case
*/
status_t (*disable_level) (logger_t *this, logger_level_t log_level);
/**
* @brief destroys a logger_t object.
*
*
* @param this logger_t object
* @return
* - SUCCESS in any case
@ -131,11 +131,11 @@ struct logger_s {
};
/**
* @brief Constructor to create a logger_t-object.
*
* @param logger_name Name for the logger_t-object
* @param log_level or'ed set of log_levels to assign to the new logger_t-object
* @return logger_t-object or NULL if failed
* @brief Constructor to create a logger_t object.
*
* @param logger_name Name for the logger_t object
* @param log_level or'ed set of log_levels to assign to the new logger_t object
* @return logger_t object or NULL if failed
*/
logger_t *logger_create(char *logger_name, logger_level_t log_level);

View File

@ -1,8 +1,8 @@
/**
* @file message.h
*
*
* @brief Class message_t. Object of this type represents an IKEv2-Message
*
*
*/
/*
@ -27,16 +27,16 @@
/**
* @brief This class is used to represent an IKEv2-Message.
*
*
* An IKEv2-Message is either a request or response.
*/
typedef struct message_s message_t;
struct message_s {
struct message_s {
/**
* @brief Destroys a message object
*
*
* @param this message_t object
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/
@ -44,8 +44,8 @@ struct message_s {
};
/**
* Creates an message_t-object
*
* Creates an message_t object
*
* @return created message_t object
*/
message_t * message_create();

View File

@ -1,8 +1,8 @@
/**
* @file parser.h
*
*
* @brief Generic parser class used to parse IKEv2-Header and Payload
*
*
*/
/*
@ -29,17 +29,17 @@
/**
* @brief A parser_t-object which parses payloads of specific type
* @brief A parser_t object which parses payloads of specific type
*/
typedef struct parser_s parser_t;
struct parser_s {
struct parser_s {
/**
* @brief Generates a specific payload from given data struct
*
*
* Remember: Header and substructures are also seen as payloads
*
*
* @param generator generator object
* @return SUCCESSFUL if succeeded,
* NOT_SUPPORTED if payload_type is not supported
@ -49,7 +49,7 @@ struct parser_s {
/**
* @brief Destroys a generator object
*
*
* @param generator generator object
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/
@ -58,7 +58,7 @@ struct parser_s {
/**
* Constructor to create a parser
*
*
*/
parser_t *parser_create(payload_info_t ** payload_infos);

View File

@ -1,7 +1,7 @@
/**
* @file receiver.c
*
* @brief Implements the Receiver Thread encapsulated in the receiver_t-object
* @brief Implements the Receiver Thread encapsulated in the receiver_t object
*
*/
@ -43,7 +43,7 @@ struct private_receiver_s {
receiver_t public;
/**
* Assigned thread to the receiver_t-object
* Assigned thread to the receiver_t object
*/
pthread_t assigned_thread;

View File

@ -1,8 +1,8 @@
/**
* @file receiver.h
*
* @brief Implements the Receiver Thread encapsulated in the receiver_t-object
*
*
* @brief Implements the Receiver Thread encapsulated in the receiver_t object
*
*/
/*
@ -30,11 +30,11 @@
*/
typedef struct receiver_s receiver_t;
struct receiver_s {
struct receiver_s {
/**
* @brief Destroys a receiver object
*
*
* @param receiver receiver object
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/

View File

@ -40,7 +40,7 @@ struct private_scheduler_s {
scheduler_t public;
/**
* Assigned thread to the scheduler_t-object
* Assigned thread to the scheduler_t object
*/
pthread_t assigned_thread;

View File

@ -1,8 +1,8 @@
/**
* @file send_queue.h
*
*
* @brief Send-Queue based on linked_list_t
*
*
*/
/*
@ -29,16 +29,16 @@
/**
* @brief Send-Queue
*
* Although the send-queue is based on a linked_list_t
* Although the send-queue is based on a linked_list_t
* all access functions are thread-save implemented
*/
typedef struct send_queue_s send_queue_t;
struct send_queue_s {
/**
* @brief returns number of packets in queue
*
*
* @param send_queue_t calling object
* @param[out] count integer pointer to store the count in
* @returns number of items in queue
@ -47,24 +47,24 @@ struct send_queue_s {
/**
* @brief get the next packet from the queue
*
*
* If the queue is empty, this function blocks until a packet can be returned.
*
*
* After using, the returned packet has to get destroyed by the caller.
*
*
* @param send_queue_t calling object
* @param[out] packet pointer to a packet_t pointer where to packet is returned to
* @returns SUCCESS if succeeded, FAILED otherwise
*/
status_t (*get) (send_queue_t *send_queue, packet_t **packet);
/**
* @brief adds a packet to the queue
*
*
* This function is non blocking and adds a packet_t to the list.
* The specific packet-object has to get destroyed by the thread which
* The specific packet object has to get destroyed by the thread which
* removes the packet.
*
*
* @param send_queue_t calling object
* @param[in] packet packet_t to add to the queue (packet is not copied)
* @returns SUCCESS if succeeded, FAILED otherwise
@ -73,11 +73,11 @@ struct send_queue_s {
/**
* @brief destroys a send_queue object
*
*
* @warning The caller of this function has to make sure
* that no thread is going to add or get a packet from the send_queue
* after calling this function.
*
*
* @param send_queue_t calling object
* @returns SUCCESS if succeeded, FAILED otherwise
*/
@ -86,7 +86,7 @@ struct send_queue_s {
/**
* @brief Creates an empty send_queue_t
*
*
* @return send_queue_t empty send_queue_t
*/
send_queue_t *send_queue_create();

View File

@ -1,7 +1,7 @@
/**
* @file sender.c
*
* @brief Implements the Sender Thread encapsulated in the sender_t-object
* @brief Implements the Sender Thread encapsulated in the sender_t object
*
*/
@ -42,7 +42,7 @@ struct private_sender_s {
sender_t public;
/**
* Assigned thread to the sender_t-object
* Assigned thread to the sender_t object
*/
pthread_t assigned_thread;

View File

@ -1,8 +1,8 @@
/**
* @file sender.h
*
* @brief Implements the Sender Thread encapsulated in the sender_t-object
*
*
* @brief Implements the Sender Thread encapsulated in the sender_t object
*
*/
/*
@ -30,11 +30,11 @@
*/
typedef struct sender_s sender_t;
struct sender_s {
struct sender_s {
/**
* @brief Destroys a sender object
*
*
* @param sender sender object
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/

View File

@ -1,8 +1,8 @@
/**
* @file tester.h
*
*
* @brief Test module for automatic testing
*
*
*/
/*
@ -21,7 +21,7 @@
*/
#ifndef TESTER_H_
#define TESTER_H_
#define TESTER_H_
#include <stdio.h>
@ -44,55 +44,55 @@ struct test_s{
};
struct tester_s {
/**
* @brief Tests all testcases in array tests with specific tester object
*
*
* @param tester tester object
* @param pointer to a array of test_t-pointers.
* the last item has to be NULL.
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/
status_t (*perform_tests) (tester_t *tester,test_t **tests);
/**
* @brief run a specific test case
*
*
* @param this tester object
* @param test pointer to a test_t-object which will be performed
* @param test pointer to a test_t object which will be performed
* @param Name of the Test
*/
status_t (*perform_test) (tester_t *tester, test_t *test);
/**
* @brief is called in a testcase to check a specific situation for TRUE
*
*
* Log-Values to the tester output are protected from multiple access
*
*
* @warning this function should only be called in a test_function
*
*
* @param this tester object
* @param to_be_true assert which has to be TRUE
* @param Name of the assertion
*/
void (*assert_true) (tester_t *tester, bool to_be_true, char *assert_name);
void (*assert_true) (tester_t *tester, bool to_be_true, char *assert_name);
/**
* @brief is called in a testcase to check a specific situation for FALSE
*
*
* Log-Values to the tester output are protected from multiple access
*
*
* @warning this function should only be called in a test_function
*
*
* @param this tester object
* @param to_be_false assert which has to be FALSE
* @param Name of the assertion
*/
void (*assert_false) (tester_t *tester, bool to_be_false, char *assert_name);
void (*assert_false) (tester_t *tester, bool to_be_false, char *assert_name);
/**
* @brief Destroys a tester object
*
*
* @param tester tester object
* @return SUCCESSFUL if succeeded, FAILED otherwise
*/
@ -105,7 +105,7 @@ struct tester_s {
* @param output test output is written to this output
* @param display_succeeded_asserts has to be TRUE, if all asserts should be displayed,
* else otherwise
*
*
* @return tester object
*/
tester_t *tester_create(FILE *output, bool display_succeeded_asserts);

View File

@ -1,8 +1,8 @@
/**
* @file ike_sa_manager_test.c
*
*
* @brief Tests to test the IKE_SA-Manager type ike_sa_manager_t
*
*
*/
/*
@ -27,9 +27,9 @@
/**
* @brief Test function used to test the ike_sa_manager_t functionality
*
*
* @param tester associated tester_t-object
*
* @param tester associated tester_t object
*/
void test_ike_sa_manager(tester_t *tester);

View File

@ -1,8 +1,8 @@
/**
* @file ike_sa_test.h
*
*
* @brief Tests to test the IKE_SA type ike_sa_t
*
*
*/
/*
@ -27,9 +27,9 @@
/**
* @brief Test function used to test the ike_sa_t functionality
*
*
* @param tester associated tester_t-object
*
* @param tester associated tester_t object
*/
void test_ike_sa(tester_t *tester);

View File

@ -1,8 +1,8 @@
/**
* @file send_queue_test.c
*
*
* @brief Tests to test the Send-Queue type send_queue_t
*
*
*/
/*
@ -29,17 +29,17 @@
/**
* @brief Informations for the involved test-thread used in this test
*
*
*/
typedef struct send_queue_test_s send_queue_test_t;
struct send_queue_test_s{
/**
* Associated tester_t-Object
* Associated tester_t object
*/
tester_t *tester;
/**
* Queue to test
*/
@ -48,23 +48,23 @@ struct send_queue_test_s{
/**
* number of items to be inserted in the send-queue by each thread
*/
int insert_item_count;
int insert_item_count;
/**
* number of items to be removed by each
* receiver thread from the send-queue
* number of items to be removed by each
* receiver thread from the send-queue
*/
int remove_item_count;
int remove_item_count;
};
/**
* @brief sender thread used in the the send_queue test function
*
*
* @param testinfo informations for the specific thread.
*/
static void test_send_queue_sender(send_queue_test_t * testinfo)
{
int i;
int i;
for (i = 0; i < testinfo->insert_item_count; i++)
{
packet_t *packet = packet_create(AF_INET);
@ -75,7 +75,7 @@ static void test_send_queue_sender(send_queue_test_t * testinfo)
/**
* @brief receiver thread used in the the send_queue test function
*
*
* @param testinfo informations for the specific thread.
*/
static void test_send_queue_receiver(send_queue_test_t * testinfo)
@ -87,7 +87,7 @@ static void test_send_queue_receiver(send_queue_test_t * testinfo)
testinfo->tester->assert_true(testinfo->tester,(testinfo->send_queue->get(testinfo->send_queue,&packet) == SUCCESS), "get packet call check");
testinfo->tester->assert_true(testinfo->tester,( packet != NULL), "packet not NULL call check");
testinfo->tester->assert_true(testinfo->tester,( packet->destroy(packet) == SUCCESS), "packet destroy call check");
}
}
@ -109,22 +109,22 @@ void test_send_queue(tester_t *tester)
test_infos.send_queue = send_queue;
test_infos.insert_item_count = 10000;
test_infos.remove_item_count = 10000;
desired_value = test_infos.insert_item_count * sender_count -
desired_value = test_infos.insert_item_count * sender_count -
test_infos.remove_item_count * receiver_count;
for (i = 0; i < receiver_count;i++)
{
pthread_create( &receiver_threads[i], NULL,(void*(*)(void*)) &test_send_queue_receiver, (void*) &test_infos);
}
for (i = 0; i < sender_count;i++)
{
pthread_create( &sender_threads[i], NULL,(void*(*)(void*)) &test_send_queue_sender, (void*) &test_infos);
}
/* Wait for all threads */
for (i = 0; i < sender_count;i++)
{
@ -134,8 +134,8 @@ void test_send_queue(tester_t *tester)
{
pthread_join(receiver_threads[i], NULL);
}
/* the send-queue has to have diserd_value count entries*/
tester->assert_true(tester,(send_queue->get_count(send_queue) == desired_value), "count value check");
tester->assert_true(tester,(send_queue->destroy(send_queue) == SUCCESS), "destroy call check");