2 * @file incoming_packet_job.h
4 * @brief Interface of incoming_packet_job_t.
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
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>.
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
23 #ifndef INCOMING_PACKET_JOB_H_
24 #define INCOMING_PACKET_JOB_H_
27 #include <network/packet.h>
28 #include <queues/jobs/job.h>
31 typedef struct incoming_packet_job_t incoming_packet_job_t
;
34 * @brief Class representing an INCOMING_PACKET Job.
36 * An incoming pack job is created from the receiver, which has
37 * read a packet to process from the socket.
40 * - incoming_packet_job_create()
44 struct incoming_packet_job_t
{
46 * implements job_t interface
51 * @brief Returns the assigned packet_t object
53 * @warning Returned packet is not cloned and has to get destroyed by the caller.
55 * @param this calling incoming_packet_job_t object
56 * @return assigned packet
58 packet_t
*(*get_packet
) (incoming_packet_job_t
*this);
61 * @brief Destroys an incoming_packet_job_t object.
63 * @param this incoming_packet_job_t object to destroy
65 void (*destroy
) (incoming_packet_job_t
*this);
69 * @brief Creates a job of type INCOMING_PACKET
71 * @param[in] packet packet to assign with this job
72 * @return created incoming_packet_job_t object
76 incoming_packet_job_t
*incoming_packet_job_create(packet_t
*packet
);
78 #endif /*INCOMING_PACKET_JOB_H_*/