- added new job type retransmit_request_job_t
[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 message_id of the request to be resent
46 *
47 * @param this calling retransmit_request_job_t object
48 * @return message id of the request to resend
49 */
50 u_int32_t (*get_message_id) (retransmit_request_job_t *this);
51
52 /**
53 * @brief Returns the ike_sa_id_t object of the IKE_SA
54 * which the request belongs to
55 *
56 * @warning returned ike_sa_id_t object is getting destroyed in
57 * retransmit_request_job_t.destroy.
58 *
59 * @param this calling retransmit_request_job_t object
60 * @return ike_sa_id_t object to identify IKE_SA (gets NOT cloned)
61 */
62 ike_sa_id_t *(*get_ike_sa_id) (retransmit_request_job_t *this);
63
64 /**
65 * @brief Destroys an retransmit_request_job_t object.
66 *
67 * @param this retransmit_request_job_t object to destroy
68 */
69 void (*destroy) (retransmit_request_job_t *this);
70 };
71
72 /**
73 * @brief Creates a job of type RETRANSMIT_REQUEST.
74 *
75 * @param message_id message_id of the request to resend
76 * @param ike_sa_id identification of the ike_sa as ike_sa_id_t object (gets cloned)
77 * @return retransmit_request_job_t object
78 *
79 * @ingroup jobs
80 */
81 retransmit_request_job_t *retransmit_request_job_create(u_int32_t message_id,ike_sa_id_t *ike_sa_id);
82
83 #endif //_RESEND_MESSAGE_JOB_H_