gnunetutil: add 2d and 3d allocation including tests
[oweals/gnunet.git] / src / include / gnunet_tun_lib.h
index 5c5627ee55b221194525329468c8961d6233dbcf..822a661cfb2fddde79fbcde3d3953954ef95fc4b 100644 (file)
 */
 
 /**
- * @file include/gnunet_tun_lib.h
- * @brief standard TCP/IP network structs and IP checksum calculations for TUN interaction
  * @author Philipp Toelke
  * @author Christian Grothoff
+ *
+ * @file
+ * Standard TCP/IP network structs and IP checksum calculations for TUN interaction
+ *
+ * @defgroup tun  TUN library
+ * Standard TCP/IP network structs and IP checksum calculations for TUN interaction
+ * @{
  */
 #ifndef GNUNET_TUN_LIB_H
 #define GNUNET_TUN_LIB_H
@@ -905,10 +910,27 @@ GNUNET_TUN_ipv4policy2regex (const char *policy);
  * the network.
  *
  * @param service_name a string
- * @param hc corresponding hash
+ * @param[out] hc corresponding hash
  */
 void
 GNUNET_TUN_service_name_to_hash (const char *service_name,
                                  struct GNUNET_HashCode *hc);
 
+
+/**
+ * Compute the CADET port given a service descriptor
+ * (returned from #GNUNET_TUN_service_name_to_hash) and
+ * a TCP/UDP port @a ip_port.
+ *
+ * @param desc service shared secret
+ * @param ip_port TCP/UDP port, use 0 for ICMP
+ * @param[out] cadet_port CADET port to use
+ */
+void
+GNUNET_TUN_compute_service_cadet_port (const struct GNUNET_HashCode *desc,
+                                       uint16_t ip_port,
+                                       struct GNUNET_HashCode *cadet_port);
+
 #endif
+
+/** @} */  /* end of group */