diff options
Diffstat (limited to 'src/mesh/gnunet-service-mesh_local.c')
-rw-r--r-- | src/mesh/gnunet-service-mesh_local.c | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/src/mesh/gnunet-service-mesh_local.c b/src/mesh/gnunet-service-mesh_local.c index 989def211..764ebd68f 100644 --- a/src/mesh/gnunet-service-mesh_local.c +++ b/src/mesh/gnunet-service-mesh_local.c | |||
@@ -157,8 +157,8 @@ client_release_ports (void *cls, | |||
157 | * @param cls Closure (unused). | 157 | * @param cls Closure (unused). |
158 | * @param client Client handler. | 158 | * @param client Client handler. |
159 | */ | 159 | */ |
160 | void | 160 | static void |
161 | GMLH_client_connect (void *cls, struct GNUNET_SERVER_Client *client) | 161 | handle_client_connect (void *cls, struct GNUNET_SERVER_Client *client) |
162 | { | 162 | { |
163 | struct MeshClient *c; | 163 | struct MeshClient *c; |
164 | 164 | ||
@@ -180,8 +180,8 @@ GMLH_client_connect (void *cls, struct GNUNET_SERVER_Client *client) | |||
180 | * @param client identification of the client; NULL | 180 | * @param client identification of the client; NULL |
181 | * for the last call when the server is destroyed | 181 | * for the last call when the server is destroyed |
182 | */ | 182 | */ |
183 | void | 183 | static void |
184 | GMLH_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client) | 184 | handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client) |
185 | { | 185 | { |
186 | struct MeshClient *c; | 186 | struct MeshClient *c; |
187 | 187 | ||
@@ -240,9 +240,9 @@ GMLH_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client) | |||
240 | * @param client identification of the client | 240 | * @param client identification of the client |
241 | * @param message the actual message, which includes messages the client wants | 241 | * @param message the actual message, which includes messages the client wants |
242 | */ | 242 | */ |
243 | void | 243 | static void |
244 | GMLH_new_client (void *cls, struct GNUNET_SERVER_Client *client, | 244 | handle_new_client (void *cls, struct GNUNET_SERVER_Client *client, |
245 | const struct GNUNET_MessageHeader *message) | 245 | const struct GNUNET_MessageHeader *message) |
246 | { | 246 | { |
247 | struct GNUNET_MESH_ClientConnect *cc_msg; | 247 | struct GNUNET_MESH_ClientConnect *cc_msg; |
248 | struct MeshClient *c; | 248 | struct MeshClient *c; |
@@ -306,9 +306,9 @@ GMLH_new_client (void *cls, struct GNUNET_SERVER_Client *client, | |||
306 | * @param client Identification of the client. | 306 | * @param client Identification of the client. |
307 | * @param message The actual message. | 307 | * @param message The actual message. |
308 | */ | 308 | */ |
309 | void | 309 | static void |
310 | GMLH_channel_create (void *cls, struct GNUNET_SERVER_Client *client, | 310 | handle_channel_create (void *cls, struct GNUNET_SERVER_Client *client, |
311 | const struct GNUNET_MessageHeader *message) | 311 | const struct GNUNET_MessageHeader *message) |
312 | { | 312 | { |
313 | struct GNUNET_MESH_ChannelMessage *msg; | 313 | struct GNUNET_MESH_ChannelMessage *msg; |
314 | struct MeshPeer *peer; | 314 | struct MeshPeer *peer; |
@@ -409,9 +409,9 @@ GMLH_channel_create (void *cls, struct GNUNET_SERVER_Client *client, | |||
409 | * @param client identification of the client | 409 | * @param client identification of the client |
410 | * @param message the actual message | 410 | * @param message the actual message |
411 | */ | 411 | */ |
412 | void | 412 | static void |
413 | GMLH_channel_destroy (void *cls, struct GNUNET_SERVER_Client *client, | 413 | handle_channel_destroy (void *cls, struct GNUNET_SERVER_Client *client, |
414 | const struct GNUNET_MessageHeader *message) | 414 | const struct GNUNET_MessageHeader *message) |
415 | { | 415 | { |
416 | struct GNUNET_MESH_ChannelMessage *msg; | 416 | struct GNUNET_MESH_ChannelMessage *msg; |
417 | struct MeshClient *c; | 417 | struct MeshClient *c; |
@@ -486,9 +486,9 @@ GMLH_channel_destroy (void *cls, struct GNUNET_SERVER_Client *client, | |||
486 | * @param client identification of the client | 486 | * @param client identification of the client |
487 | * @param message the actual message | 487 | * @param message the actual message |
488 | */ | 488 | */ |
489 | void | 489 | static void |
490 | GMLH_data (void *cls, struct GNUNET_SERVER_Client *client, | 490 | handle_data (void *cls, struct GNUNET_SERVER_Client *client, |
491 | const struct GNUNET_MessageHeader *message) | 491 | const struct GNUNET_MessageHeader *message) |
492 | { | 492 | { |
493 | struct GNUNET_MESH_LocalData *msg; | 493 | struct GNUNET_MESH_LocalData *msg; |
494 | struct MeshClient *c; | 494 | struct MeshClient *c; |
@@ -584,9 +584,9 @@ GMLH_data (void *cls, struct GNUNET_SERVER_Client *client, | |||
584 | * @param client Identification of the client. | 584 | * @param client Identification of the client. |
585 | * @param message The actual message. | 585 | * @param message The actual message. |
586 | */ | 586 | */ |
587 | void | 587 | static void |
588 | GMLH_ack (void *cls, struct GNUNET_SERVER_Client *client, | 588 | handle_ack (void *cls, struct GNUNET_SERVER_Client *client, |
589 | const struct GNUNET_MessageHeader *message) | 589 | const struct GNUNET_MessageHeader *message) |
590 | { | 590 | { |
591 | struct GNUNET_MESH_LocalAck *msg; | 591 | struct GNUNET_MESH_LocalAck *msg; |
592 | struct MeshChannelReliability *rel; | 592 | struct MeshChannelReliability *rel; |
@@ -677,9 +677,9 @@ GMLH_ack (void *cls, struct GNUNET_SERVER_Client *client, | |||
677 | * @param client Identification of the client. | 677 | * @param client Identification of the client. |
678 | * @param message The actual message. | 678 | * @param message The actual message. |
679 | */ | 679 | */ |
680 | void | 680 | static void |
681 | GMLH_get_tunnels (void *cls, struct GNUNET_SERVER_Client *client, | 681 | handle_get_tunnels (void *cls, struct GNUNET_SERVER_Client *client, |
682 | const struct GNUNET_MessageHeader *message) | 682 | const struct GNUNET_MessageHeader *message) |
683 | { | 683 | { |
684 | struct MeshClient *c; | 684 | struct MeshClient *c; |
685 | 685 | ||
@@ -712,8 +712,8 @@ GMLH_get_tunnels (void *cls, struct GNUNET_SERVER_Client *client, | |||
712 | * @param message The actual message. | 712 | * @param message The actual message. |
713 | */ | 713 | */ |
714 | void | 714 | void |
715 | GMLH_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client, | 715 | handle_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client, |
716 | const struct GNUNET_MessageHeader *message) | 716 | const struct GNUNET_MessageHeader *message) |
717 | { | 717 | { |
718 | const struct GNUNET_MESH_LocalMonitor *msg; | 718 | const struct GNUNET_MESH_LocalMonitor *msg; |
719 | struct GNUNET_MESH_LocalMonitor *resp; | 719 | struct GNUNET_MESH_LocalMonitor *resp; |
@@ -768,17 +768,17 @@ GMLH_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client, | |||
768 | * Functions to handle messages from clients | 768 | * Functions to handle messages from clients |
769 | */ | 769 | */ |
770 | static struct GNUNET_SERVER_MessageHandler client_handlers[] = { | 770 | static struct GNUNET_SERVER_MessageHandler client_handlers[] = { |
771 | {&GMLH_new_client, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT, 0}, | 771 | {&handle_new_client, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT, 0}, |
772 | {&GMLH_channel_create, NULL, GNUNET_MESSAGE_TYPE_MESH_CHANNEL_CREATE, | 772 | {&handle_channel_create, NULL, GNUNET_MESSAGE_TYPE_MESH_CHANNEL_CREATE, |
773 | sizeof (struct GNUNET_MESH_ChannelMessage)}, | 773 | sizeof (struct GNUNET_MESH_ChannelMessage)}, |
774 | {&GMLH_channel_destroy, NULL, GNUNET_MESSAGE_TYPE_MESH_CHANNEL_DESTROY, | 774 | {&handle_channel_destroy, NULL, GNUNET_MESSAGE_TYPE_MESH_CHANNEL_DESTROY, |
775 | sizeof (struct GNUNET_MESH_ChannelMessage)}, | 775 | sizeof (struct GNUNET_MESH_ChannelMessage)}, |
776 | {&GMLH_data, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_DATA, 0}, | 776 | {&handle_data, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_DATA, 0}, |
777 | {&GMLH_ack, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_ACK, | 777 | {&handle_ack, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_ACK, |
778 | sizeof (struct GNUNET_MESH_LocalAck)}, | 778 | sizeof (struct GNUNET_MESH_LocalAck)}, |
779 | {&GMLH_get_tunnels, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_TUNNELS, | 779 | {&handle_get_tunnels, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_TUNNELS, |
780 | sizeof (struct GNUNET_MessageHeader)}, | 780 | sizeof (struct GNUNET_MessageHeader)}, |
781 | {&GMLH_show_tunnel, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_TUNNEL, | 781 | {&handle_show_tunnel, NULL, GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_TUNNEL, |
782 | sizeof (struct GNUNET_MESH_LocalMonitor)}, | 782 | sizeof (struct GNUNET_MESH_LocalMonitor)}, |
783 | {NULL, NULL, 0, 0} | 783 | {NULL, NULL, 0, 0} |
784 | }; | 784 | }; |
@@ -802,6 +802,7 @@ GML_init (struct GNUNET_SERVER_Handle *handle) | |||
802 | ports = GNUNET_CONTAINER_multihashmap32_create (32); | 802 | ports = GNUNET_CONTAINER_multihashmap32_create (32); |
803 | } | 803 | } |
804 | 804 | ||
805 | |||
805 | /** | 806 | /** |
806 | * Install server (service) handlers and start listening to clients. | 807 | * Install server (service) handlers and start listening to clients. |
807 | */ | 808 | */ |
@@ -809,8 +810,8 @@ void | |||
809 | GML_start (void) | 810 | GML_start (void) |
810 | { | 811 | { |
811 | GNUNET_SERVER_add_handlers (server_handle, client_handlers); | 812 | GNUNET_SERVER_add_handlers (server_handle, client_handlers); |
812 | GNUNET_SERVER_connect_notify (server_handle, &GMLH_client_connect, NULL); | 813 | GNUNET_SERVER_connect_notify (server_handle, &handle_client_connect, NULL); |
813 | GNUNET_SERVER_disconnect_notify (server_handle, &GMLH_client_disconnect, | 814 | GNUNET_SERVER_disconnect_notify (server_handle, &handle_client_disconnect, |
814 | NULL); | 815 | NULL); |
815 | nc = GNUNET_SERVER_notification_context_create (server_handle, 1); | 816 | nc = GNUNET_SERVER_notification_context_create (server_handle, 1); |
816 | 817 | ||