summaryrefslogtreecommitdiff
path: root/src/auction/gnunet-service-auction.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/auction/gnunet-service-auction.c')
-rw-r--r--src/auction/gnunet-service-auction.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/src/auction/gnunet-service-auction.c b/src/auction/gnunet-service-auction.c
index a5518b0f3..ed1be20d8 100644
--- a/src/auction/gnunet-service-auction.c
+++ b/src/auction/gnunet-service-auction.c
@@ -11,12 +11,12 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
18 SPDX-License-Identifier: AGPL3.0-or-later 18 SPDX-License-Identifier: AGPL3.0-or-later
19 */ 19 */
20 20
21/** 21/**
22 * @file auction/gnunet-service-auction.c 22 * @file auction/gnunet-service-auction.c
@@ -36,10 +36,10 @@
36 * @return #GNUNET_OK (always) 36 * @return #GNUNET_OK (always)
37 */ 37 */
38static int 38static int
39check_create (void *cls, const struct GNUNET_AUCTION_ClientCreateMessage *msg) 39check_create(void *cls, const struct GNUNET_AUCTION_ClientCreateMessage *msg)
40{ 40{
41 /* always well-formed due to arbitrary length description */ 41 /* always well-formed due to arbitrary length description */
42 return GNUNET_OK; 42 return GNUNET_OK;
43} 43}
44 44
45 45
@@ -50,26 +50,26 @@ check_create (void *cls, const struct GNUNET_AUCTION_ClientCreateMessage *msg)
50 * @param msg the actual message received 50 * @param msg the actual message received
51 */ 51 */
52static void 52static void
53handle_create (void *cls, const struct GNUNET_AUCTION_ClientCreateMessage *msg) 53handle_create(void *cls, const struct GNUNET_AUCTION_ClientCreateMessage *msg)
54{ 54{
55 struct GNUNET_SERVICE_Client *client = cls; 55 struct GNUNET_SERVICE_Client *client = cls;
56// struct GNUNET_MQ_Handle *mq; 56// struct GNUNET_MQ_Handle *mq;
57// struct GNUNET_MQ_Envelope *env; 57// struct GNUNET_MQ_Envelope *env;
58// struct GNUNET_AUCTION_blabla em; 58// struct GNUNET_AUCTION_blabla em;
59 uint16_t size; 59 uint16_t size;
60 60
61 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 61 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
62 "Received CREATE message from client\n"); 62 "Received CREATE message from client\n");
63 63
64 size = ntohs (msg->header.size); 64 size = ntohs(msg->header.size);
65 65
66 /**TODO: create auction and return auction object */ 66 /**TODO: create auction and return auction object */
67// mq = GNUNET_SERVICE_client_get_mq (client); 67// mq = GNUNET_SERVICE_client_get_mq (client);
68// setup_info_message (&em); 68// setup_info_message (&em);
69// env = GNUNET_MQ_msg_copy (&em.header); 69// env = GNUNET_MQ_msg_copy (&em.header);
70// GNUNET_MQ_send (mq, env); 70// GNUNET_MQ_send (mq, env);
71 71
72 GNUNET_SERVICE_client_continue (client); 72 GNUNET_SERVICE_client_continue(client);
73} 73}
74 74
75 75
@@ -79,9 +79,9 @@ handle_create (void *cls, const struct GNUNET_AUCTION_ClientCreateMessage *msg)
79 * @param cls unused 79 * @param cls unused
80 */ 80 */
81static void 81static void
82cleanup_task (void *cls) 82cleanup_task(void *cls)
83{ 83{
84 /* FIXME: do clean up here */ 84 /* FIXME: do clean up here */
85} 85}
86 86
87 87
@@ -94,11 +94,11 @@ cleanup_task (void *cls)
94 * @return @a c 94 * @return @a c
95 */ 95 */
96static void * 96static void *
97client_connect_cb (void *cls, 97client_connect_cb(void *cls,
98 struct GNUNET_SERVICE_Client *c, 98 struct GNUNET_SERVICE_Client *c,
99 struct GNUNET_MQ_Handle *mq) 99 struct GNUNET_MQ_Handle *mq)
100{ 100{
101 return c; 101 return c;
102} 102}
103 103
104 104
@@ -110,11 +110,11 @@ client_connect_cb (void *cls,
110 * @param internal_cls should be equal to @a c 110 * @param internal_cls should be equal to @a c
111 */ 111 */
112static void 112static void
113client_disconnect_cb (void *cls, 113client_disconnect_cb(void *cls,
114 struct GNUNET_SERVICE_Client *c, 114 struct GNUNET_SERVICE_Client *c,
115 void *internal_cls) 115 void *internal_cls)
116{ 116{
117 GNUNET_assert (c == internal_cls); 117 GNUNET_assert(c == internal_cls);
118} 118}
119 119
120 120
@@ -126,12 +126,12 @@ client_disconnect_cb (void *cls,
126 * @param service the initialized service 126 * @param service the initialized service
127 */ 127 */
128static void 128static void
129run (void *cls, 129run(void *cls,
130 const struct GNUNET_CONFIGURATION_Handle *cfg, 130 const struct GNUNET_CONFIGURATION_Handle *cfg,
131 struct GNUNET_SERVICE_Handle *service) 131 struct GNUNET_SERVICE_Handle *service)
132{ 132{
133 /* FIXME: do setup here */ 133 /* FIXME: do setup here */
134 GNUNET_SCHEDULER_add_shutdown (&cleanup_task, NULL); 134 GNUNET_SCHEDULER_add_shutdown(&cleanup_task, NULL);
135} 135}
136 136
137 137
@@ -139,17 +139,17 @@ run (void *cls,
139 * Define "main" method using service macro. 139 * Define "main" method using service macro.
140 */ 140 */
141GNUNET_SERVICE_MAIN 141GNUNET_SERVICE_MAIN
142("auction", 142 ("auction",
143 GNUNET_SERVICE_OPTION_NONE, 143 GNUNET_SERVICE_OPTION_NONE,
144 &run, 144 &run,
145 &client_connect_cb, 145 &client_connect_cb,
146 &client_disconnect_cb, 146 &client_disconnect_cb,
147 NULL, 147 NULL,
148 GNUNET_MQ_hd_var_size (create, 148 GNUNET_MQ_hd_var_size(create,
149 GNUNET_MESSAGE_TYPE_AUCTION_CLIENT_CREATE, 149 GNUNET_MESSAGE_TYPE_AUCTION_CLIENT_CREATE,
150 struct GNUNET_AUCTION_ClientCreateMessage, 150 struct GNUNET_AUCTION_ClientCreateMessage,
151 NULL), 151 NULL),
152 GNUNET_MQ_handler_end ()) 152 GNUNET_MQ_handler_end())
153 153
154 154
155/* end of gnunet-service-auction.c */ 155/* end of gnunet-service-auction.c */