aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_social_service.h
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/include/gnunet_social_service.h
parent7d1dfe26d99376a341bb150eb89ba717bb883077 (diff)
downloadgnunet-80d2de6cdc4d253c7fbc6a4bc067d856aab9cca9.tar.gz
gnunet-80d2de6cdc4d253c7fbc6a4bc067d856aab9cca9.zip
psyc/social: local join flag; social service: leave place, save _file
Diffstat (limited to 'src/include/gnunet_social_service.h')
-rw-r--r--src/include/gnunet_social_service.h138
1 files changed, 120 insertions, 18 deletions
diff --git a/src/include/gnunet_social_service.h b/src/include/gnunet_social_service.h
index 47062fdaf..bde3dbceb 100644
--- a/src/include/gnunet_social_service.h
+++ b/src/include/gnunet_social_service.h
@@ -119,22 +119,66 @@ typedef void
119 119
120 120
121/** 121/**
122 * Notification about a place entered. 122 * Entry status of a place.
123 */
124enum GNUNET_SOCIAL_PlaceState
125{
126 /**
127 * Place was once entered but left since.
128 */
129 GNUNET_SOCIAL_PLACE_STATE_ARCHIVED = 0,
130 /**
131 * Place is entered but not subscribed.
132 */
133 GNUNET_SOCIAL_PLACE_STATE_ENTERED = 1,
134 /**
135 * Place is entered and subscribed.
136 */
137 GNUNET_SOCIAL_PLACE_STATE_SUBSCRIBED = 2,
138};
139
140
141/**
142 * Notification about a home.
143 *
144 * @param cls
145 * Closure.
146 * @param hconn
147 * Host connection, to be used with GNUNET_SOCIAL_host_enter_reconnect()
148 * @param ego
149 * Ego used to enter the place.
150 * @param place_pub_key
151 * Public key of the place.
152 * @param place_state
153 * @see enum GNUNET_SOCIAL_PlaceState
123 */ 154 */
124typedef void 155typedef void
125(*GNUNET_SOCIAL_AppHostPlaceCallback) (void *cls, 156(*GNUNET_SOCIAL_AppHostPlaceCallback) (void *cls,
126 struct GNUNET_SOCIAL_HostConnection *hconn, 157 struct GNUNET_SOCIAL_HostConnection *hconn,
127 struct GNUNET_SOCIAL_Ego *ego, 158 struct GNUNET_SOCIAL_Ego *ego,
128 const struct GNUNET_CRYPTO_EddsaPublicKey *place_pub_key); 159 const struct GNUNET_CRYPTO_EddsaPublicKey *place_pub_key,
160 enum GNUNET_SOCIAL_PlaceState place_state);
129 161
130/** 162/**
131h * Notification about a place entered. 163 * Notification about a place.
164 *
165 * @param cls
166 * Closure.
167 * @param gconn
168 * Guest connection, to be used with GNUNET_SOCIAL_guest_enter_reconnect()
169 * @param ego
170 * Ego used to enter the place.
171 * @param place_pub_key
172 * Public key of the place.
173 * @param place_state
174 * @see enum GNUNET_SOCIAL_PlaceState
132 */ 175 */
133typedef void 176typedef void
134(*GNUNET_SOCIAL_AppGuestPlaceCallback) (void *cls, 177(*GNUNET_SOCIAL_AppGuestPlaceCallback) (void *cls,
135 struct GNUNET_SOCIAL_GuestConnection *gconn, 178 struct GNUNET_SOCIAL_GuestConnection *gconn,
136 struct GNUNET_SOCIAL_Ego *ego, 179 struct GNUNET_SOCIAL_Ego *ego,
137 const struct GNUNET_CRYPTO_EddsaPublicKey *place_pub_key); 180 const struct GNUNET_CRYPTO_EddsaPublicKey *place_pub_key,
181 enum GNUNET_SOCIAL_PlaceState place_state);
138 182
139 183
140/** 184/**
@@ -719,6 +763,47 @@ GNUNET_SOCIAL_host_announce_cancel (struct GNUNET_SOCIAL_Announcement *a);
719 763
720 764
721/** 765/**
766 * Allow relaying messages from guests matching a given @a method_prefix.
767 *
768 * @param host
769 * The host.
770 * @param method_prefix
771 * Method prefix to allow.
772 */
773void
774GNUNET_SOCIAL_host_relay_allow_method (struct GNUNET_SOCIAL_Host *host,
775 const char *method_prefix);
776
777
778/**
779 * Allow relaying changes to objects of the place.
780 *
781 * Only applies to messages with an allowed method name.
782 * @see GNUNET_SCOIAL_host_relay_allow_method()
783 *
784 * @param host
785 * The host.
786 * @param object_prefix
787 * Object prefix to allow modifying.
788 */
789void
790GNUNET_SOCIAL_host_relay_allow_method (struct GNUNET_SOCIAL_Host *host,
791 const char *object_prefix);
792
793
794/**
795 * Stop relaying messages from guests.
796 *
797 * Remove all allowed relay rules.
798 *
799 *
800 *
801 */
802void
803GNUNET_SOCIAL_host_relay_stop (struct GNUNET_SOCIAL_Host *host);
804
805
806/**
722 * Obtain handle for a hosted place. 807 * Obtain handle for a hosted place.
723 * 808 *
724 * The returned handle can be used to access the place API. 809 * The returned handle can be used to access the place API.
@@ -824,17 +909,30 @@ typedef void
824/** 909/**
825 * Request entry to a place as a guest. 910 * Request entry to a place as a guest.
826 * 911 *
827 * @param cfg Configuration to contact the social service. 912 * @param app
828 * @param ego Identity of the guest. 913 * Application handle.
829 * @param crypto_address Public key of the place to enter. 914 * @param ego
830 * @param origin Peer identity of the origin of the underlying multicast group. 915 * Identity of the guest.
831 * @param relay_count Number of elements in the @a relays array. 916 * @param place_pub_key
832 * @param relays Relays for the underlying multicast group. 917 * Public key of the place to enter.
833 * @param method_name Method name for the message. 918 * @param flags
834 * @param env Environment containing variables for the message, or NULL. 919 * Flags for the entry.
835 * @param data Payload for the message to give to the enter callback. 920 * @param origin
836 * @param data_size Number of bytes in @a data. 921 * Peer identity of the origin of the underlying multicast group.
837 * @param slicer Slicer to use for processing incoming requests from guests. 922 * @param relay_count
923 * Number of elements in the @a relays array.
924 * @param relays
925 * Relays for the underlying multicast group.
926 * @param method_name
927 * Method name for the message.
928 * @param env
929 * Environment containing variables for the message, or NULL.
930 * @param data
931 * Payload for the message to give to the enter callback.
932 * @param data_size
933 * Number of bytes in @a data.
934 * @param slicer
935 * Slicer to use for processing incoming requests from guests.
838 * 936 *
839 * @return NULL on errors, otherwise handle for the guest. 937 * @return NULL on errors, otherwise handle for the guest.
840 */ 938 */
@@ -842,21 +940,22 @@ struct GNUNET_SOCIAL_Guest *
842GNUNET_SOCIAL_guest_enter (const struct GNUNET_SOCIAL_App *app, 940GNUNET_SOCIAL_guest_enter (const struct GNUNET_SOCIAL_App *app,
843 const struct GNUNET_SOCIAL_Ego *ego, 941 const struct GNUNET_SOCIAL_Ego *ego,
844 const struct GNUNET_CRYPTO_EddsaPublicKey *place_pub_key, 942 const struct GNUNET_CRYPTO_EddsaPublicKey *place_pub_key,
943 enum GNUNET_PSYC_SlaveJoinFlags flags,
845 const struct GNUNET_PeerIdentity *origin, 944 const struct GNUNET_PeerIdentity *origin,
846 uint32_t relay_count, 945 uint32_t relay_count,
847 const struct GNUNET_PeerIdentity *relays, 946 const struct GNUNET_PeerIdentity *relays,
848 const struct GNUNET_PSYC_Message *entry_msg, 947 const struct GNUNET_PSYC_Message *entry_msg,
849 struct GNUNET_SOCIAL_Slicer *slicer, 948 struct GNUNET_SOCIAL_Slicer *slicer,
850 GNUNET_SOCIAL_GuestEnterCallback local_enter_cb, 949 GNUNET_SOCIAL_GuestEnterCallback local_enter_cb,
851 GNUNET_SOCIAL_EntryDecisionCallback entry_decision_cb, 950 GNUNET_SOCIAL_EntryDecisionCallback entry_dcsn_cb,
852 void *cls); 951 void *cls);
853 952
854 953
855/** 954/**
856 * Request entry to a place by name as a guest. 955 * Request entry to a place by name as a guest.
857 * 956 *
858 * @param cfg 957 * @param app
859 * Configuration to contact the social service. 958 * Application handle.
860 * @param ego 959 * @param ego
861 * Identity of the guest. 960 * Identity of the guest.
862 * @param gns_name 961 * @param gns_name
@@ -896,6 +995,8 @@ GNUNET_SOCIAL_guest_enter_by_name (const struct GNUNET_SOCIAL_App *app,
896 * @param gconn 995 * @param gconn
897 * Guest connection handle. 996 * Guest connection handle.
898 * @see GNUNET_SOCIAL_app_connect() & GNUNET_SOCIAL_AppGuestPlaceCallback() 997 * @see GNUNET_SOCIAL_app_connect() & GNUNET_SOCIAL_AppGuestPlaceCallback()
998 * @param flags
999 * Flags for the entry.
899 * @param slicer 1000 * @param slicer
900 * Slicer to use for processing incoming requests from guests. 1001 * Slicer to use for processing incoming requests from guests.
901 * @param local_enter_cb 1002 * @param local_enter_cb
@@ -907,6 +1008,7 @@ GNUNET_SOCIAL_guest_enter_by_name (const struct GNUNET_SOCIAL_App *app,
907 */ 1008 */
908struct GNUNET_SOCIAL_Guest * 1009struct GNUNET_SOCIAL_Guest *
909GNUNET_SOCIAL_guest_enter_reconnect (struct GNUNET_SOCIAL_GuestConnection *gconn, 1010GNUNET_SOCIAL_guest_enter_reconnect (struct GNUNET_SOCIAL_GuestConnection *gconn,
1011 enum GNUNET_PSYC_SlaveJoinFlags flags,
910 struct GNUNET_SOCIAL_Slicer *slicer, 1012 struct GNUNET_SOCIAL_Slicer *slicer,
911 GNUNET_SOCIAL_GuestEnterCallback local_enter_cb, 1013 GNUNET_SOCIAL_GuestEnterCallback local_enter_cb,
912 void *cls); 1014 void *cls);