0573f04ece30ebbb018ba1e4bdbe7350e942f8bf
[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 * Object representing an RETRANSMIT_REQUEST Job.
35 *
36 * @ingroup jobs
37 */
38 struct retransmit_request_job_t {
39 /**
40 * The job_t interface.
41 */
42 job_t job_interface;
43
44 /**
45 * @brief Returns the retransmit count for a specific request.
46 *
47 * @param this calling retransmit_request_job_t object
48 * @return retransmit count of request
49 */
50 u_int32_t (*get_retransmit_count) (retransmit_request_job_t *this);
51
52 /**
53 * @brief Increases number of retransmitt attemps.
54 *
55 * @param this calling retransmit_request_job_t object
56 */
57 void (*increase_retransmit_count) (retransmit_request_job_t *this);
58
59 /**
60 * @brief Returns the message_id of the request to be resent
61 *
62 * @param this calling retransmit_request_job_t object
63 * @return message id of the request to resend
64 */
65 u_int32_t (*get_message_id) (retransmit_request_job_t *this);
66
67 /**
68 * @brief Returns the ike_sa_id_t object of the IKE_SA
69 * which the request belongs to
70 *
71 * @warning returned ike_sa_id_t object is getting destroyed in
72 * retransmit_request_job_t.destroy.
73 *
74 * @param this calling retransmit_request_job_t object
75 * @return ike_sa_id_t object to identify IKE_SA (gets NOT cloned)
76 */
77 ike_sa_id_t *(*get_ike_sa_id) (retransmit_request_job_t *this);
78
79 /**
80 * @brief Destroys an retransmit_request_job_t object.
81 *
82 * @param this retransmit_request_job_t object to destroy
83 */
84 void (*destroy) (retransmit_request_job_t *this);
85 };
86
87 /**
88 * @brief Creates a job of type RETRANSMIT_REQUEST.
89 *
90 * @param message_id message_id of the request to resend
91 * @param ike_sa_id identification of the ike_sa as ike_sa_id_t object (gets cloned)
92 * @return retransmit_request_job_t object
93 *
94 * @ingroup jobs
95 */
96 retransmit_request_job_t *retransmit_request_job_create(u_int32_t message_id,ike_sa_id_t *ike_sa_id);
97
98 #endif //_RESEND_MESSAGE_JOB_H_