aboutsummaryrefslogtreecommitdiff
path: root/src/social/social_api.c
diff options
context:
space:
mode:
authorGabor X Toth <*@tg-x.net>2016-01-06 12:28:47 +0000
committerGabor X Toth <*@tg-x.net>2016-01-06 12:28:47 +0000
commit80d2de6cdc4d253c7fbc6a4bc067d856aab9cca9 (patch)
tree86e33af618c53b82afd0cb4855d7da595fcd5acd /src/social/social_api.c
parent7d1dfe26d99376a341bb150eb89ba717bb883077 (diff)
downloadgnunet-80d2de6cdc4d253c7fbc6a4bc067d856aab9cca9.tar.gz
gnunet-80d2de6cdc4d253c7fbc6a4bc067d856aab9cca9.zip
psyc/social: local join flag; social service: leave place, save _file
Diffstat (limited to 'src/social/social_api.c')
-rw-r--r--src/social/social_api.c55
1 files changed, 37 insertions, 18 deletions
diff --git a/src/social/social_api.c b/src/social/social_api.c
index 6c85ba294..3d5e9853f 100644
--- a/src/social/social_api.c
+++ b/src/social/social_api.c
@@ -1558,14 +1558,14 @@ app_recv_place (void *cls,
1558 struct GNUNET_SOCIAL_HostConnection *hconn = GNUNET_malloc (sizeof (*hconn)); 1558 struct GNUNET_SOCIAL_HostConnection *hconn = GNUNET_malloc (sizeof (*hconn));
1559 hconn->app = app; 1559 hconn->app = app;
1560 hconn->plc_msg = *pmsg; 1560 hconn->plc_msg = *pmsg;
1561 app->host_cb (app->cb_cls, hconn, ego, &pmsg->place_pub_key); 1561 app->host_cb (app->cb_cls, hconn, ego, &pmsg->place_pub_key, pmsg->place_state);
1562 } 1562 }
1563 else 1563 else
1564 { 1564 {
1565 struct GNUNET_SOCIAL_GuestConnection *gconn = GNUNET_malloc (sizeof (*gconn)); 1565 struct GNUNET_SOCIAL_GuestConnection *gconn = GNUNET_malloc (sizeof (*gconn));
1566 gconn->app = app; 1566 gconn->app = app;
1567 gconn->plc_msg = *pmsg; 1567 gconn->plc_msg = *pmsg;
1568 app->guest_cb (app->cb_cls, gconn, ego, &pmsg->place_pub_key); 1568 app->guest_cb (app->cb_cls, gconn, ego, &pmsg->place_pub_key, pmsg->place_state);
1569 } 1569 }
1570} 1570}
1571 1571
@@ -1717,8 +1717,8 @@ guest_cleanup (void *cls)
1717 * A place is created upon first entering, and it is active until permanently 1717 * A place is created upon first entering, and it is active until permanently
1718 * left using GNUNET_SOCIAL_host_leave(). 1718 * left using GNUNET_SOCIAL_host_leave().
1719 * 1719 *
1720 * @param cfg 1720 * @param app
1721 * Configuration to contact the social service. 1721 * Application handle.
1722 * @param ego 1722 * @param ego
1723 * Identity of the host. 1723 * Identity of the host.
1724 * @param place_key 1724 * @param place_key
@@ -1808,7 +1808,7 @@ GNUNET_SOCIAL_host_enter (const struct GNUNET_SOCIAL_App *app,
1808 * 1808 *
1809 * @return Handle for the host. 1809 * @return Handle for the host.
1810 */ 1810 */
1811struct GNUNET_SOCIAL_Host * 1811 struct GNUNET_SOCIAL_Host *
1812GNUNET_SOCIAL_host_enter_reconnect (struct GNUNET_SOCIAL_HostConnection *hconn, 1812GNUNET_SOCIAL_host_enter_reconnect (struct GNUNET_SOCIAL_HostConnection *hconn,
1813 struct GNUNET_SOCIAL_Slicer *slicer, 1813 struct GNUNET_SOCIAL_Slicer *slicer,
1814 GNUNET_SOCIAL_HostEnterCallback enter_cb, 1814 GNUNET_SOCIAL_HostEnterCallback enter_cb,
@@ -2202,20 +2202,34 @@ guest_enter_request_create (const char *app_id,
2202 return greq; 2202 return greq;
2203} 2203}
2204 2204
2205
2205/** 2206/**
2206 * Request entry to a place as a guest. 2207 * Request entry to a place as a guest.
2207 * 2208 *
2208 * @param cfg Configuration to contact the social service. 2209 * @param app
2209 * @param ego Identity of the guest. 2210 * Application handle.
2210 * @param crypto_address Public key of the place to enter. 2211 * @param ego
2211 * @param origin Peer identity of the origin of the underlying multicast group. 2212 * Identity of the guest.
2212 * @param relay_count Number of elements in the @a relays array. 2213 * @param place_pub_key
2213 * @param relays Relays for the underlying multicast group. 2214 * Public key of the place to enter.
2214 * @param method_name Method name for the message. 2215 * @param flags
2215 * @param env Environment containing variables for the message, or NULL. 2216 * Flags for the entry.
2216 * @param data Payload for the message to give to the enter callback. 2217 * @param origin
2217 * @param data_size Number of bytes in @a data. 2218 * Peer identity of the origin of the underlying multicast group.
2218 * @param slicer Slicer to use for processing incoming requests from guests. 2219 * @param relay_count
2220 * Number of elements in the @a relays array.
2221 * @param relays
2222 * Relays for the underlying multicast group.
2223 * @param method_name
2224 * Method name for the message.
2225 * @param env
2226 * Environment containing variables for the message, or NULL.
2227 * @param data
2228 * Payload for the message to give to the enter callback.
2229 * @param data_size
2230 * Number of bytes in @a data.
2231 * @param slicer
2232 * Slicer to use for processing incoming requests from guests.
2219 * 2233 *
2220 * @return NULL on errors, otherwise handle for the guest. 2234 * @return NULL on errors, otherwise handle for the guest.
2221 */ 2235 */
@@ -2223,6 +2237,7 @@ struct GNUNET_SOCIAL_Guest *
2223GNUNET_SOCIAL_guest_enter (const struct GNUNET_SOCIAL_App *app, 2237GNUNET_SOCIAL_guest_enter (const struct GNUNET_SOCIAL_App *app,
2224 const struct GNUNET_SOCIAL_Ego *ego, 2238 const struct GNUNET_SOCIAL_Ego *ego,
2225 const struct GNUNET_CRYPTO_EddsaPublicKey *place_pub_key, 2239 const struct GNUNET_CRYPTO_EddsaPublicKey *place_pub_key,
2240 enum GNUNET_PSYC_SlaveJoinFlags flags,
2226 const struct GNUNET_PeerIdentity *origin, 2241 const struct GNUNET_PeerIdentity *origin,
2227 uint32_t relay_count, 2242 uint32_t relay_count,
2228 const struct GNUNET_PeerIdentity *relays, 2243 const struct GNUNET_PeerIdentity *relays,
@@ -2263,8 +2278,8 @@ GNUNET_SOCIAL_guest_enter (const struct GNUNET_SOCIAL_App *app,
2263/** 2278/**
2264 * Request entry to a place by name as a guest. 2279 * Request entry to a place by name as a guest.
2265 * 2280 *
2266 * @param cfg 2281 * @param app
2267 * Configuration to contact the social service. 2282 * Application handle.
2268 * @param ego 2283 * @param ego
2269 * Identity of the guest. 2284 * Identity of the guest.
2270 * @param gns_name 2285 * @param gns_name
@@ -2356,6 +2371,8 @@ GNUNET_SOCIAL_guest_enter_by_name (const struct GNUNET_SOCIAL_App *app,
2356 * @param gconn 2371 * @param gconn
2357 * Guest connection handle. 2372 * Guest connection handle.
2358 * @see GNUNET_SOCIAL_app_connect() & GNUNET_SOCIAL_AppGuestPlaceCallback() 2373 * @see GNUNET_SOCIAL_app_connect() & GNUNET_SOCIAL_AppGuestPlaceCallback()
2374 * @param flags
2375 * Flags for the entry.
2359 * @param slicer 2376 * @param slicer
2360 * Slicer to use for processing incoming requests from guests. 2377 * Slicer to use for processing incoming requests from guests.
2361 * @param local_enter_cb 2378 * @param local_enter_cb
@@ -2367,6 +2384,7 @@ GNUNET_SOCIAL_guest_enter_by_name (const struct GNUNET_SOCIAL_App *app,
2367 */ 2384 */
2368struct GNUNET_SOCIAL_Guest * 2385struct GNUNET_SOCIAL_Guest *
2369GNUNET_SOCIAL_guest_enter_reconnect (struct GNUNET_SOCIAL_GuestConnection *gconn, 2386GNUNET_SOCIAL_guest_enter_reconnect (struct GNUNET_SOCIAL_GuestConnection *gconn,
2387 enum GNUNET_PSYC_SlaveJoinFlags flags,
2370 struct GNUNET_SOCIAL_Slicer *slicer, 2388 struct GNUNET_SOCIAL_Slicer *slicer,
2371 GNUNET_SOCIAL_GuestEnterCallback local_enter_cb, 2389 GNUNET_SOCIAL_GuestEnterCallback local_enter_cb,
2372 void *cls) 2390 void *cls)
@@ -2381,6 +2399,7 @@ GNUNET_SOCIAL_guest_enter_reconnect (struct GNUNET_SOCIAL_GuestConnection *gconn
2381 greq->header.size = htons (greq_size); 2399 greq->header.size = htons (greq_size);
2382 greq->ego_pub_key = gconn->plc_msg.ego_pub_key; 2400 greq->ego_pub_key = gconn->plc_msg.ego_pub_key;
2383 greq->place_pub_key = gconn->plc_msg.place_pub_key; 2401 greq->place_pub_key = gconn->plc_msg.place_pub_key;
2402 greq->flags = htonl (flags);
2384 2403
2385 memcpy (&greq[1], gconn->app->id, app_id_size); 2404 memcpy (&greq[1], gconn->app->id, app_id_size);
2386 2405