d57809df0ea767458ecbc1e139c0c47e2c576794
[strongswan.git] / Source / charon / queues / jobs / incoming_packet_job.h
1 /**
2 * @file incoming_packet_job.h
3 *
4 * @brief Interface of incoming_packet_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 INCOMING_PACKET_JOB_H_
24 #define INCOMING_PACKET_JOB_H_
25
26 #include <types.h>
27 #include <network/packet.h>
28 #include <queues/jobs/job.h>
29
30
31 typedef struct incoming_packet_job_t incoming_packet_job_t;
32
33 /**
34 * @brief Object representing an INCOMING_PACKET Job.
35 *
36 * @ingroup jobs
37 */
38 struct incoming_packet_job_t {
39 /**
40 * implements job_t interface
41 */
42 job_t job_interface;
43
44 /**
45 * @brief Returns the assigned packet_t object
46 *
47 * @warning Returned packet is not cloned and has to get destroyed by the caller.
48 *
49 * @param this calling incoming_packet_job_t object
50 * @return assigned packet
51 */
52 packet_t *(*get_packet) (incoming_packet_job_t *this);
53
54 /**
55 * @brief Destroys an incoming_packet_job_t object.
56 *
57 * @param this incoming_packet_job_t object to destroy
58 */
59 void (*destroy) (incoming_packet_job_t *this);
60 };
61
62 /**
63 * @brief Creates a job of type INCOMING_PACKET
64 *
65 * @param[in] packet packet to assign with this job
66 * @return created incoming_packet_job_t object
67 *
68 * @ingroup jobs
69 */
70 incoming_packet_job_t *incoming_packet_job_create(packet_t *packet);
71
72 #endif /*INCOMING_PACKET_JOB_H_*/