]>
Commit | Line | Data |
---|---|---|
d5cc1758 TB |
1 | /* |
2 | * Copyright (C) 2007 Tobias Brunner | |
19ef2aec TB |
3 | * |
4 | * Copyright (C) secunet Security Networks AG | |
d5cc1758 TB |
5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | |
7 | * under the terms of the GNU General Public License as published by the | |
8 | * Free Software Foundation; either version 2 of the License, or (at your | |
9 | * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, but | |
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | * for more details. | |
552cc11b MW |
15 | */ |
16 | ||
17 | /** | |
18 | * @defgroup mediation_job mediation_job | |
222a64d8 | 19 | * @{ @ingroup cjobs |
d5cc1758 TB |
20 | */ |
21 | ||
22 | #ifndef MEDIATION_JOB_H_ | |
23 | #define MEDIATION_JOB_H_ | |
24 | ||
25 | typedef struct mediation_job_t mediation_job_t; | |
26 | ||
27 | #include <library.h> | |
28 | #include <processing/jobs/job.h> | |
29 | #include <utils/identification.h> | |
12642a68 | 30 | #include <collections/linked_list.h> |
d5cc1758 TB |
31 | |
32 | /** | |
552cc11b | 33 | * Class representing a MEDIATION Job. |
7daf5226 | 34 | * |
d5cc1758 | 35 | * This job handles the mediation on the mediation server. |
d5cc1758 TB |
36 | */ |
37 | struct mediation_job_t { | |
38 | /** | |
39 | * implements job_t interface | |
40 | */ | |
41 | job_t job_interface; | |
42 | }; | |
43 | ||
44 | /** | |
552cc11b | 45 | * Creates a job of type MEDIATION. |
7daf5226 | 46 | * |
d5cc1758 | 47 | * Parameters get cloned. |
7daf5226 | 48 | * |
d5cc1758 TB |
49 | * @param peer_id ID of the requested peer |
50 | * @param requester ID of the requesting peer | |
dc04b7c7 TB |
51 | * @param connect_id content of ME_CONNECTID (could be NULL) |
52 | * @param connect_key content of ME_CONNECTKEY | |
d5cc1758 TB |
53 | * @param endpoints list of submitted endpoints |
54 | * @param response TRUE if this is a response | |
55 | * @return job object | |
d5cc1758 TB |
56 | */ |
57 | mediation_job_t *mediation_job_create(identification_t *peer_id, | |
dc04b7c7 | 58 | identification_t *requester, chunk_t connect_id, chunk_t connect_key, |
d5cc1758 TB |
59 | linked_list_t *endpoints, bool response); |
60 | ||
61 | ||
62 | /** | |
552cc11b | 63 | * Creates a special job of type MEDIATION that is used to send a callback |
d5cc1758 | 64 | * notification to a peer. |
7daf5226 | 65 | * |
d5cc1758 | 66 | * Parameters get cloned. |
7daf5226 | 67 | * |
d5cc1758 TB |
68 | * @param requester ID of the waiting peer |
69 | * @param peer_id ID of the requested peer | |
70 | * @return job object | |
d5cc1758 TB |
71 | */ |
72 | mediation_job_t *mediation_callback_job_create(identification_t *requester, | |
73 | identification_t *peer_id); | |
74 | ||
1490ff4d | 75 | #endif /** MEDIATION_JOB_H_ @}*/ |