diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-03-16 16:27:38 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-03-16 16:27:38 +0100 |
commit | b92543a726e5f0df8c29788badae049923f3b35a (patch) | |
tree | bd7ee5d653054174441e01f2ae1ab0d178cdf247 /src/social/gnunet-social.c | |
parent | e724ea478e4efe6e2531f81908ce0f9334357d81 (diff) | |
download | gnunet-b92543a726e5f0df8c29788badae049923f3b35a.tar.gz gnunet-b92543a726e5f0df8c29788badae049923f3b35a.zip |
porting social
Diffstat (limited to 'src/social/gnunet-social.c')
-rw-r--r-- | src/social/gnunet-social.c | 267 |
1 files changed, 156 insertions, 111 deletions
diff --git a/src/social/gnunet-social.c b/src/social/gnunet-social.c index b864b828e..71392d8e9 100644 --- a/src/social/gnunet-social.c +++ b/src/social/gnunet-social.c | |||
@@ -1199,7 +1199,7 @@ int | |||
1199 | main (int argc, char *const *argv) | 1199 | main (int argc, char *const *argv) |
1200 | { | 1200 | { |
1201 | int res; | 1201 | int res; |
1202 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 1202 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
1203 | /* | 1203 | /* |
1204 | * gnunet program options in addition to the ones below: | 1204 | * gnunet program options in addition to the ones below: |
1205 | * | 1205 | * |
@@ -1212,120 +1212,165 @@ main (int argc, char *const *argv) | |||
1212 | 1212 | ||
1213 | /* operations */ | 1213 | /* operations */ |
1214 | 1214 | ||
1215 | { 'A', "host-assign", NULL, | 1215 | GNUNET_GETOPT_OPTION_SET_ONE ('A', |
1216 | gettext_noop ("assign --name in state to --data"), | 1216 | "host-assign", |
1217 | GNUNET_NO, &GNUNET_GETOPT_set_one, &op_host_assign }, | 1217 | gettext_noop ("assign --name in state to --data"), |
1218 | 1218 | &op_host_assign), | |
1219 | { 'B', "guest-leave", NULL, | 1219 | |
1220 | gettext_noop ("say good-bye and leave somebody else's place"), | 1220 | GNUNET_GETOPT_OPTION_SET_ONE ('B', |
1221 | GNUNET_NO, &GNUNET_GETOPT_set_one, &op_guest_leave }, | 1221 | "guest-leave", |
1222 | 1222 | gettext_noop ("say good-bye and leave somebody else's place"), | |
1223 | { 'C', "host-enter", NULL, | 1223 | &op_guest_leave), |
1224 | gettext_noop ("create a place"), | 1224 | |
1225 | GNUNET_NO, &GNUNET_GETOPT_set_one, &op_host_enter }, | 1225 | GNUNET_GETOPT_OPTION_SET_ONE ('C', |
1226 | 1226 | "host-enter", | |
1227 | { 'D', "host-leave", NULL, | 1227 | gettext_noop ("create a place"), |
1228 | gettext_noop ("destroy a place we were hosting"), | 1228 | &op_host_enter), |
1229 | GNUNET_NO, &GNUNET_GETOPT_set_one, &op_host_leave }, | 1229 | |
1230 | 1230 | GNUNET_GETOPT_OPTION_SET_ONE ('C', | |
1231 | { 'E', "guest-enter", NULL, | 1231 | "host-enter", |
1232 | gettext_noop ("enter somebody else's place"), | 1232 | gettext_noop ("create a place"), |
1233 | GNUNET_NO, &GNUNET_GETOPT_set_one, &op_guest_enter }, | 1233 | &op_host_enter), |
1234 | 1234 | ||
1235 | { 'F', "look-for", NULL, | 1235 | GNUNET_GETOPT_OPTION_SET_ONE ('D', |
1236 | gettext_noop ("find state matching name prefix"), | 1236 | "host-leave", |
1237 | GNUNET_NO, &GNUNET_GETOPT_set_one, &op_look_for }, | 1237 | gettext_noop ("destroy a place we were hosting"), |
1238 | 1238 | &op_host_leave), | |
1239 | { 'H', "replay-latest", NULL, | 1239 | |
1240 | gettext_noop ("replay history of messages up to the given --limit"), | 1240 | GNUNET_GETOPT_OPTION_SET_ONE ('E', |
1241 | GNUNET_NO, &GNUNET_GETOPT_set_one, &op_replay_latest }, | 1241 | "guest-enter", |
1242 | 1242 | gettext_noop ("enter somebody else's place"), | |
1243 | { 'N', "host-reconnect", NULL, | 1243 | &op_guest_enter), |
1244 | gettext_noop ("reconnect to a previously created place"), | 1244 | |
1245 | GNUNET_NO, &GNUNET_GETOPT_set_one, &op_host_reconnect }, | 1245 | |
1246 | 1246 | GNUNET_GETOPT_OPTION_SET_ONE ('F', | |
1247 | { 'P', "host-announce", NULL, | 1247 | "look-for", |
1248 | gettext_noop ("publish something to a place we are hosting"), | 1248 | gettext_noop ("find state matching name prefix"), |
1249 | GNUNET_NO, &GNUNET_GETOPT_set_one, &op_host_announce }, | 1249 | &op_look_for), |
1250 | 1250 | ||
1251 | { 'R', "guest-reconnect", NULL, | 1251 | GNUNET_GETOPT_OPTION_SET_ONE ('H', |
1252 | gettext_noop ("reconnect to a previously entered place"), | 1252 | "replay-latest", |
1253 | GNUNET_NO, &GNUNET_GETOPT_set_one, &op_guest_reconnect }, | 1253 | gettext_noop ("replay history of messages up to the given --limit"), |
1254 | 1254 | &op_replay_latest), | |
1255 | { 'S', "look-at", NULL, | 1255 | |
1256 | gettext_noop ("search for state matching exact name"), | 1256 | GNUNET_GETOPT_OPTION_SET_ONE ('N', |
1257 | GNUNET_NO, &GNUNET_GETOPT_set_one, &op_look_at }, | 1257 | "host-reconnect", |
1258 | 1258 | gettext_noop ("reconnect to a previously created place"), | |
1259 | { 'T', "guest-talk", NULL, | 1259 | &op_host_reconnect), |
1260 | gettext_noop ("submit something to somebody's place"), | 1260 | |
1261 | GNUNET_NO, &GNUNET_GETOPT_set_one, &op_guest_talk }, | 1261 | GNUNET_GETOPT_OPTION_SET_ONE ('P', |
1262 | 1262 | "host-announce", | |
1263 | { 'U', "status", NULL, | 1263 | gettext_noop ("publish something to a place we are hosting"), |
1264 | gettext_noop ("list of egos and subscribed places"), | 1264 | &op_host_announce), |
1265 | GNUNET_NO, &GNUNET_GETOPT_set_one, &op_status }, | 1265 | |
1266 | 1266 | GNUNET_GETOPT_OPTION_SET_ONE ('R', | |
1267 | { 'X', "replay", NULL, | 1267 | "guest-reconnect", |
1268 | gettext_noop ("extract and replay history between message IDs --start and --until"), | 1268 | gettext_noop ("reconnect to a previously entered place"), |
1269 | GNUNET_NO, &GNUNET_GETOPT_set_one, &op_replay }, | 1269 | &op_guest_reconnect), |
1270 | |||
1271 | GNUNET_GETOPT_OPTION_SET_ONE ('S', | ||
1272 | "look-at", | ||
1273 | gettext_noop ("search for state matching exact name"), | ||
1274 | &op_look_at), | ||
1275 | |||
1276 | GNUNET_GETOPT_OPTION_SET_ONE ('T', | ||
1277 | "guest-talk", | ||
1278 | gettext_noop ("submit something to somebody's place"), | ||
1279 | &op_guest_talk), | ||
1280 | |||
1281 | GNUNET_GETOPT_OPTION_SET_ONE ('U', | ||
1282 | "status", | ||
1283 | gettext_noop ("list of egos and subscribed places"), | ||
1284 | &op_status), | ||
1285 | |||
1286 | GNUNET_GETOPT_OPTION_SET_ONE ('X', | ||
1287 | "replay", | ||
1288 | gettext_noop ("extract and replay history between message IDs --start and --until"), | ||
1289 | &op_replay), | ||
1270 | 1290 | ||
1271 | 1291 | ||
1272 | /* options */ | 1292 | /* options */ |
1273 | 1293 | ||
1274 | { 'a', "app", "APPLICATION_ID", | 1294 | GNUNET_GETOPT_OPTION_STRING ('a', |
1275 | gettext_noop ("application ID to use when connecting"), | 1295 | "app", |
1276 | GNUNET_YES, &GNUNET_GETOPT_set_string, &opt_app }, | 1296 | "APPLICATION_ID", |
1277 | 1297 | gettext_noop ("application ID to use when connecting"), | |
1278 | { 'd', "data", "DATA", | 1298 | &opt_app), |
1279 | gettext_noop ("message body or state value"), | 1299 | |
1280 | GNUNET_YES, &GNUNET_GETOPT_set_string, &opt_data }, | 1300 | GNUNET_GETOPT_OPTION_STRING ('d', |
1281 | 1301 | "data", | |
1282 | { 'e', "ego", "NAME|PUBKEY", | 1302 | "DATA", |
1283 | gettext_noop ("name or public key of ego"), | 1303 | gettext_noop ("message body or state value"), |
1284 | GNUNET_YES, &GNUNET_GETOPT_set_string, &opt_ego }, | 1304 | &opt_data), |
1285 | 1305 | ||
1286 | { 'f', "follow", NULL, | 1306 | GNUNET_GETOPT_OPTION_STRING ('e', |
1287 | gettext_noop ("wait for incoming messages"), | 1307 | "ego", |
1288 | GNUNET_NO, &GNUNET_GETOPT_set_one, &opt_follow }, | 1308 | "NAME|PUBKEY", |
1289 | 1309 | gettext_noop ("name or public key of ego"), | |
1290 | { 'g', "gns", "GNS_NAME", | 1310 | &opt_ego), |
1291 | gettext_noop ("GNS name"), | 1311 | |
1292 | GNUNET_YES, &GNUNET_GETOPT_set_string, &opt_gns }, | 1312 | GNUNET_GETOPT_OPTION_SET_ONE ('f', |
1293 | 1313 | "follow", | |
1294 | { 'i', "peer", "PEER_ID", | 1314 | gettext_noop ("wait for incoming messages"), |
1295 | gettext_noop ("peer ID for --guest-enter"), | 1315 | &opt_follow), |
1296 | GNUNET_YES, &GNUNET_GETOPT_set_string, &opt_peer }, | 1316 | |
1297 | 1317 | GNUNET_GETOPT_OPTION_STRING ('g', | |
1298 | { 'k', "name", "VAR_NAME", | 1318 | "gns", |
1299 | gettext_noop ("name (key) to query from state"), | 1319 | "GNS_NAME", |
1300 | GNUNET_YES, &GNUNET_GETOPT_set_string, &opt_name }, | 1320 | gettext_noop ("GNS name"), |
1301 | 1321 | &opt_gns), | |
1302 | { 'm', "method", "METHOD_NAME", | 1322 | |
1303 | gettext_noop ("method name"), | 1323 | GNUNET_GETOPT_OPTION_STRING ('i', |
1304 | GNUNET_YES, &GNUNET_GETOPT_set_string, &opt_method }, | 1324 | "peer", |
1305 | 1325 | "PEER_ID", | |
1306 | { 'n', "limit", NULL, | 1326 | gettext_noop ("peer ID for --guest-enter"), |
1307 | gettext_noop ("number of messages to replay from history"), | 1327 | &opt_peer), |
1308 | GNUNET_YES, &GNUNET_GETOPT_set_ulong, &opt_limit }, | 1328 | |
1309 | 1329 | GNUNET_GETOPT_OPTION_STRING ('k', | |
1310 | { 'p', "place", "PUBKEY", | 1330 | "name", |
1311 | gettext_noop ("key address of place"), | 1331 | "VAR_NAME", |
1312 | GNUNET_YES, &GNUNET_GETOPT_set_string, &opt_place }, | 1332 | gettext_noop ("name (key) to query from state"), |
1313 | 1333 | &opt_name), | |
1314 | { 's', "start", NULL, | 1334 | |
1315 | gettext_noop ("start message ID for history replay"), | 1335 | GNUNET_GETOPT_OPTION_STRING ('m', |
1316 | GNUNET_YES, &GNUNET_GETOPT_set_ulong, &opt_start }, | 1336 | "method", |
1317 | 1337 | "METHOD_NAME", | |
1318 | { 'w', "welcome", NULL, | 1338 | gettext_noop ("method name"), |
1319 | gettext_noop ("respond to entry requests by admitting all guests"), | 1339 | &opt_method), |
1320 | GNUNET_NO, &GNUNET_GETOPT_set_one, &opt_welcome }, | 1340 | |
1321 | 1341 | GNUNET_GETOPT_OPTION_SET_ULONG ('n', | |
1322 | { 'u', "until", NULL, | 1342 | "limit", |
1323 | gettext_noop ("end message ID for history replay"), | 1343 | NULL, |
1324 | GNUNET_YES, &GNUNET_GETOPT_set_ulong, &opt_until }, | 1344 | gettext_noop ("number of messages to replay from history"), |
1325 | 1345 | &opt_limit), | |
1326 | { 'y', "deny", NULL, | 1346 | |
1327 | gettext_noop ("respond to entry requests by refusing all guests"), | 1347 | GNUNET_GETOPT_OPTION_STRING ('p', |
1328 | GNUNET_NO, &GNUNET_GETOPT_set_one, &opt_deny }, | 1348 | "place", |
1349 | "PUBKEY", | ||
1350 | gettext_noop ("key address of place"), | ||
1351 | &opt_place), | ||
1352 | |||
1353 | GNUNET_GETOPT_OPTION_SET_ULONG ('s', | ||
1354 | "start", | ||
1355 | NULL, | ||
1356 | gettext_noop ("start message ID for history replay"), | ||
1357 | &opt_start), | ||
1358 | |||
1359 | GNUNET_GETOPT_OPTION_SET_ONE ('w', | ||
1360 | "welcome", | ||
1361 | gettext_noop ("respond to entry requests by admitting all guests"), | ||
1362 | &opt_welcome), | ||
1363 | |||
1364 | GNUNET_GETOPT_OPTION_SET_ULONG ('u', | ||
1365 | "until", | ||
1366 | NULL, | ||
1367 | gettext_noop ("end message ID for history replay"), | ||
1368 | &opt_until), | ||
1369 | |||
1370 | GNUNET_GETOPT_OPTION_SET_ONE ('y', | ||
1371 | "deny", | ||
1372 | gettext_noop ("respond to entry requests by refusing all guests"), | ||
1373 | &opt_deny), | ||
1329 | 1374 | ||
1330 | GNUNET_GETOPT_OPTION_END | 1375 | GNUNET_GETOPT_OPTION_END |
1331 | }; | 1376 | }; |