diff options
author | Gabor X Toth <*@tg-x.net> | 2015-11-18 22:13:27 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2015-11-18 22:13:27 +0000 |
commit | ad0201797ed84806a0a42fe3435dd56bd2c69ae5 (patch) | |
tree | 83a04545e9d8dc1799892ca6c37b3af083b0e7bd /src/include/gnunet_social_service.h | |
parent | aba4cac0f08ecb17df34e375337090b00f457763 (diff) | |
download | gnunet-ad0201797ed84806a0a42fe3435dd56bd2c69ae5.tar.gz gnunet-ad0201797ed84806a0a42fe3435dd56bd2c69ae5.zip |
social: store/load entered places & notify clients about them
Diffstat (limited to 'src/include/gnunet_social_service.h')
-rw-r--r-- | src/include/gnunet_social_service.h | 73 |
1 files changed, 69 insertions, 4 deletions
diff --git a/src/include/gnunet_social_service.h b/src/include/gnunet_social_service.h index edb762a1e..21c073256 100644 --- a/src/include/gnunet_social_service.h +++ b/src/include/gnunet_social_service.h | |||
@@ -35,6 +35,7 @@ extern "C" | |||
35 | #endif | 35 | #endif |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | #include <stdint.h> | ||
38 | #include "gnunet_util_lib.h" | 39 | #include "gnunet_util_lib.h" |
39 | #include "gnunet_env_lib.h" | 40 | #include "gnunet_env_lib.h" |
40 | #include "gnunet_identity_service.h" | 41 | #include "gnunet_identity_service.h" |
@@ -73,7 +74,6 @@ struct GNUNET_SOCIAL_Guest; | |||
73 | */ | 74 | */ |
74 | struct GNUNET_SOCIAL_Slicer; | 75 | struct GNUNET_SOCIAL_Slicer; |
75 | 76 | ||
76 | |||
77 | /** | 77 | /** |
78 | * Function called upon receiving a message indicating a call to a @e method. | 78 | * Function called upon receiving a message indicating a call to a @e method. |
79 | * | 79 | * |
@@ -982,8 +982,8 @@ GNUNET_SOCIAL_place_look_cancel (struct GNUNET_SOCIAL_LookHandle *lh); | |||
982 | * Ego. | 982 | * Ego. |
983 | * @param name | 983 | * @param name |
984 | * The name for the PKEY record to put in the zone. | 984 | * The name for the PKEY record to put in the zone. |
985 | * @param pub_key | 985 | * @param nym_pub_key |
986 | * Public key to add. | 986 | * Public key of nym to add. |
987 | * @param expiration_time | 987 | * @param expiration_time |
988 | * Expiration time of the record, use 0 to remove the record. | 988 | * Expiration time of the record, use 0 to remove the record. |
989 | * @param result_cb | 989 | * @param result_cb |
@@ -995,12 +995,77 @@ void | |||
995 | GNUNET_SOCIAL_zone_add_pkey (const struct GNUNET_CONFIGURATION_Handle *cfg, | 995 | GNUNET_SOCIAL_zone_add_pkey (const struct GNUNET_CONFIGURATION_Handle *cfg, |
996 | const struct GNUNET_IDENTITY_Ego *ego, | 996 | const struct GNUNET_IDENTITY_Ego *ego, |
997 | const char *name, | 997 | const char *name, |
998 | const struct GNUNET_CRYPTO_EcdsaPublicKey *pub_key, | 998 | const struct GNUNET_CRYPTO_EcdsaPublicKey *nym_pub_key, |
999 | struct GNUNET_TIME_Absolute expiration_time, | 999 | struct GNUNET_TIME_Absolute expiration_time, |
1000 | GNUNET_NAMESTORE_ContinuationWithStatus result_cb, | 1000 | GNUNET_NAMESTORE_ContinuationWithStatus result_cb, |
1001 | void *result_cls); | 1001 | void *result_cls); |
1002 | 1002 | ||
1003 | 1003 | ||
1004 | /** | ||
1005 | * Handle for place notifications. | ||
1006 | */ | ||
1007 | struct GNUNET_SOCIAL_PlaceListenHandle; | ||
1008 | |||
1009 | |||
1010 | /** | ||
1011 | * Notification about a place entered as host. | ||
1012 | */ | ||
1013 | typedef void | ||
1014 | (*GNUNET_SOCIAL_PlaceNotifyHostCallback) (void *cls, | ||
1015 | const struct GNUNET_CRYPTO_EddsaPrivateKey *place_key, | ||
1016 | enum GNUNET_PSYC_Policy policy); | ||
1017 | |||
1018 | |||
1019 | /** | ||
1020 | * Notification about a place entered as guest. | ||
1021 | */ | ||
1022 | typedef void | ||
1023 | (*GNUNET_SOCIAL_PlaceNotifyGuestCallback) (void *cls, | ||
1024 | const struct GNUNET_CRYPTO_EddsaPublicKey *place_key, | ||
1025 | const struct GNUNET_PeerIdentity *origin, | ||
1026 | uint32_t relay_count, | ||
1027 | const struct GNUNET_PeerIdentity *relays, | ||
1028 | const struct GNUNET_PSYC_Message *entry_msg); | ||
1029 | |||
1030 | |||
1031 | /** | ||
1032 | * Start listening for entered places as host or guest. | ||
1033 | * | ||
1034 | * The @notify_host and @notify_guest functions are | ||
1035 | * initially called with the full list of entered places, | ||
1036 | * then later each time a new place is entered. | ||
1037 | * | ||
1038 | * @param cfg | ||
1039 | * Configuration. | ||
1040 | * @param ego | ||
1041 | * Listen for places of this ego. | ||
1042 | * @param notify_host | ||
1043 | * Function to notify about a place entered as host. | ||
1044 | * @param notify_guest | ||
1045 | * Function to notify about a place entered as guest.. | ||
1046 | * @param notify_cls | ||
1047 | * Closure for the callbacks. | ||
1048 | * | ||
1049 | * @return Handle that can be used to stop listening. | ||
1050 | */ | ||
1051 | struct GNUNET_SOCIAL_PlaceListenHandle * | ||
1052 | GNUNET_SOCIAL_place_listen_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
1053 | const struct GNUNET_IDENTITY_Ego *ego, | ||
1054 | GNUNET_SOCIAL_PlaceNotifyHostCallback notify_host, | ||
1055 | GNUNET_SOCIAL_PlaceNotifyGuestCallback notify_guest, | ||
1056 | void *notify_cls); | ||
1057 | |||
1058 | |||
1059 | /** | ||
1060 | * Stop listening for entered places. | ||
1061 | * | ||
1062 | * @param h | ||
1063 | * Listen handle. | ||
1064 | */ | ||
1065 | void | ||
1066 | GNUNET_SOCIAL_place_listen_stop (struct GNUNET_SOCIAL_PlaceListenHandle *h); | ||
1067 | |||
1068 | |||
1004 | #if 0 /* keep Emacsens' auto-indent happy */ | 1069 | #if 0 /* keep Emacsens' auto-indent happy */ |
1005 | { | 1070 | { |
1006 | #endif | 1071 | #endif |