error msg
[oweals/gnunet.git] / src / transport / plugin_transport_http_common.h
index 377eb9fb92e08a5af32009aee539fe001009eb9e..31676c2848e860c03c21338a6ccc81fdce361651 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "platform.h"
 #include "gnunet_common.h"
-
+#include "gnunet_transport_plugin.h"
 /**
  * Timeout values for testing
  */
 
 #endif
 
+#define HTTP_DEFAULT_PORT 80
+#define HTTPS_DEFAULT_PORT 443
+
+
+struct SplittedHTTPAddress;
+
+struct SplittedHTTPAddress *
+http_split_address (const char * addr);
+
 /**
  * Convert the transports address to a nice, human-readable
  * format.
@@ -121,6 +130,20 @@ http_common_address_from_socket (const char *protocol,
                                  const struct sockaddr *addr,
                                  socklen_t addrlen);
 
+/**
+ * Create a socketaddr from a HTTP address
+ *
+ * @param addr sockaddr * address
+ * @param addrlen length of the address
+ * @param res the result:
+ * GNUNET_SYSERR, invalid input,
+ * GNUNET_YES: could convert to ip,
+ * GNUNET_NO: valid input but could not convert to ip (hostname?)
+ * @return the string
+ */
+struct sockaddr *
+http_common_socket_from_address (const void *addr, size_t addrlen, int *res);
+
 /**
  * Get the length of an address
  *
@@ -128,7 +151,7 @@ http_common_address_from_socket (const char *protocol,
  * @return the size
  */
 size_t
-http_common_address_get_size (void *addr);
+http_common_address_get_size (const void *addr);
 
 
 /**