- docs updated
[strongswan.git] / Source / charon / queues / jobs / retransmit_request_job.h
1 /**
2 * @file retransmit_request_job.c
3 *
4 * @brief Interface of retransmit_request_job_t.
5 *
6 */
7
8 /*
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
11 *
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>.
16 *
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
20 * for more details.
21 */
22
23 #ifndef _RESEND_MESSAGE_JOB_H_
24 #define _RESEND_MESSAGE_JOB_H_
25
26 #include <types.h>
27 #include <queues/jobs/job.h>
28 #include <sa/ike_sa_id.h>
29
30
31 typedef struct retransmit_request_job_t retransmit_request_job_t;
32
33 /**
34 * @brief Class representing an RETRANSMIT_REQUEST Job.
35 *
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.
39 *
40 * @b Constructors:
41 * - retransmit_request_job_create()
42 *
43 * @ingroup jobs
44 */
45 struct retransmit_request_job_t {
46 /**
47 * The job_t interface.
48 */
49 job_t job_interface;
50
51 /**
52 * @brief Returns the retransmit count for a specific request.
53 *
54 * @param this calling retransmit_request_job_t object
55 * @return retransmit count of request
56 */
57 u_int32_t (*get_retransmit_count) (retransmit_request_job_t *this);
58
59 /**
60 * @brief Increases number of retransmitt attemps.
61 *
62 * @param this calling retransmit_request_job_t object
63 */
64 void (*increase_retransmit_count) (retransmit_request_job_t *this);
65
66 /**
67 * @brief Returns the message_id of the request to be resent
68 *
69 * @param this calling retransmit_request_job_t object
70 * @return message id of the request to resend
71 */
72 u_int32_t (*get_message_id) (retransmit_request_job_t *this);
73
74 /**
75 * @brief Returns the ike_sa_id_t object of the IKE_SA
76 * which the request belongs to
77 *
78 * @warning returned ike_sa_id_t object is getting destroyed in
79 * retransmit_request_job_t.destroy.
80 *
81 * @param this calling retransmit_request_job_t object
82 * @return ike_sa_id_t object to identify IKE_SA (gets NOT cloned)
83 */
84 ike_sa_id_t *(*get_ike_sa_id) (retransmit_request_job_t *this);
85
86 /**
87 * @brief Destroys an retransmit_request_job_t object.
88 *
89 * @param this retransmit_request_job_t object to destroy
90 */
91 void (*destroy) (retransmit_request_job_t *this);
92 };
93
94 /**
95 * @brief Creates a job of type RETRANSMIT_REQUEST.
96 *
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
100 *
101 * @ingroup jobs
102 */
103 retransmit_request_job_t *retransmit_request_job_create(u_int32_t message_id,ike_sa_id_t *ike_sa_id);
104
105 #endif //_RESEND_MESSAGE_JOB_H_