- docs updated
[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 Class representing an INCOMING_PACKET Job.
35 *
36 * An incoming pack job is created from the receiver, which has
37 * read a packet to process from the socket.
38 *
39 * @b Constructors:
40 * - incoming_packet_job_create()
41 *
42 * @ingroup jobs
43 */
44 struct incoming_packet_job_t {
45 /**
46 * implements job_t interface
47 */
48 job_t job_interface;
49
50 /**
51 * @brief Returns the assigned packet_t object
52 *
53 * @warning Returned packet is not cloned and has to get destroyed by the caller.
54 *
55 * @param this calling incoming_packet_job_t object
56 * @return assigned packet
57 */
58 packet_t *(*get_packet) (incoming_packet_job_t *this);
59
60 /**
61 * @brief Destroys an incoming_packet_job_t object.
62 *
63 * @param this incoming_packet_job_t object to destroy
64 */
65 void (*destroy) (incoming_packet_job_t *this);
66 };
67
68 /**
69 * @brief Creates a job of type INCOMING_PACKET
70 *
71 * @param[in] packet packet to assign with this job
72 * @return created incoming_packet_job_t object
73 *
74 * @ingroup jobs
75 */
76 incoming_packet_job_t *incoming_packet_job_create(packet_t *packet);
77
78 #endif /*INCOMING_PACKET_JOB_H_*/