X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Finclude%2Fgnunet_nat_lib.h;h=93b441849b886abbcd513d2b305bbb86969795a7;hb=6973ade884b8e22e7fcaa51a90d00a8caa2d2fa4;hp=6c1db8043127ede1c34a01968d6c4dded277c4ef;hpb=cddbdf5b928c68ab71b40c950b9f01ea68a9fbdb;p=oweals%2Fgnunet.git diff --git a/src/include/gnunet_nat_lib.h b/src/include/gnunet_nat_lib.h index 6c1db8043..93b441849 100644 --- a/src/include/gnunet_nat_lib.h +++ b/src/include/gnunet_nat_lib.h @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - (C) 2007, 2008, 2009, 2010, 2011 Christian Grothoff (and other contributing authors) + (C) 2007, 2008, 2009, 2010, 2011, 2012 Christian Grothoff (and other contributing authors) GNUnet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -117,8 +117,11 @@ GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, const void *addr, * * @param h handle (used for configuration) * @param sa the address of the peer (IPv4-only) + * + * @return GNUNET_SYSERR on error, GNUNET_NO if nat client is disabled, + * GNUNET_OK otherwise */ -void +int GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, const struct sockaddr_in *sa); @@ -251,6 +254,46 @@ void GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini); +/** + * Handle to auto-configuration in progress. + */ +struct GNUNET_NAT_AutoHandle; + + +/** + * Function called with the result from the autoconfiguration. + * + * @param cls closure + * @param diff minimal suggested changes to the original configuration + * to make it work (as best as we can) + */ +typedef void (*GNUNET_NAT_AutoResultCallback)(void *cls, + const struct GNUNET_CONFIGURATION_Handle *diff); + + +/** + * Start auto-configuration routine. The resolver service should + * be available when this function is called. + * + * @param cfg initial configuration + * @param cb function to call with autoconfiguration result + * @param cb_cls closure for cb + * @return handle to cancel operation + */ +struct GNUNET_NAT_AutoHandle * +GNUNET_NAT_autoconfig_start (const struct GNUNET_CONFIGURATION_Handle *cfg, + GNUNET_NAT_AutoResultCallback cb, + void *cb_cls); + + +/** + * Abort autoconfiguration. + * + * @param ah handle for operation to abort + */ +void +GNUNET_NAT_autoconfig_cancel (struct GNUNET_NAT_AutoHandle *ah); + #endif /* end of gnunet_nat_lib.h */