2 * @file retransmit_request_job.h
4 * @brief Interface of retransmit_request_job_t.
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 #ifndef RESEND_MESSAGE_JOB_H_
24 #define RESEND_MESSAGE_JOB_H_
27 #include <queues/jobs/job.h>
28 #include <sa/ike_sa_id.h>
31 typedef struct retransmit_request_job_t retransmit_request_job_t
;
34 * @brief Class representing an RETRANSMIT_REQUEST Job.
36 * This job is scheduled every time a request is sent over the
37 * wire. If the response to the request is not received at schedule
38 * time, the retransmission will be initiated.
41 * - retransmit_request_job_create()
45 struct retransmit_request_job_t
{
47 * The job_t interface.
52 * @brief Returns the retransmit count for a specific request.
54 * @param this calling retransmit_request_job_t object
55 * @return retransmit count of request
57 u_int32_t (*get_retransmit_count
) (retransmit_request_job_t
*this);
60 * @brief Increases number of retransmitt attemps.
62 * @param this calling retransmit_request_job_t object
64 void (*increase_retransmit_count
) (retransmit_request_job_t
*this);
67 * @brief Returns the message_id of the request to be resent
69 * @param this calling retransmit_request_job_t object
70 * @return message id of the request to resend
72 u_int32_t (*get_message_id
) (retransmit_request_job_t
*this);
75 * @brief Returns the ike_sa_id_t object of the IKE_SA
76 * which the request belongs to
78 * @warning returned ike_sa_id_t object is getting destroyed in
79 * retransmit_request_job_t.destroy.
81 * @param this calling retransmit_request_job_t object
82 * @return ike_sa_id_t object to identify IKE_SA (gets NOT cloned)
84 ike_sa_id_t
*(*get_ike_sa_id
) (retransmit_request_job_t
*this);
87 * @brief Destroys an retransmit_request_job_t object.
89 * @param this retransmit_request_job_t object to destroy
91 void (*destroy
) (retransmit_request_job_t
*this);
95 * @brief Creates a job of type RETRANSMIT_REQUEST.
97 * @param message_id message_id of the request to resend
98 * @param ike_sa_id identification of the ike_sa as ike_sa_id_t object (gets cloned)
99 * @return retransmit_request_job_t object
103 retransmit_request_job_t
*retransmit_request_job_create(u_int32_t message_id
,ike_sa_id_t
*ike_sa_id
);
105 #endif /* RESEND_MESSAGE_JOB_H_ */