MINOR: connection: add a minimal transport layer registration system

There are still a lot of #ifdef USE_OPENSSL in the code (still 43
occurences) because we never know if we can directly access ssl_sock
or not. This patch attacks the problem differently by providing a
way for transport layers to register themselves and for users to
retrieve the pointer. Unregistered transport layers will point to NULL
so it will be easy to check if SSL is registered or not. The mechanism
is very inexpensive as it relies on a two-entries array of pointers,
so the performance will not be affected.
diff --git a/include/proto/connection.h b/include/proto/connection.h
index 6a24dec..2380bb8 100644
--- a/include/proto/connection.h
+++ b/include/proto/connection.h
@@ -30,6 +30,7 @@
 #include <proto/obj_type.h>
 
 extern struct pool_head *pool2_connection;
+extern struct xprt_ops *registered_xprt[XPRT_ENTRIES];
 
 /* perform minimal intializations, report 0 in case of error, 1 if OK. */
 int init_connection();
@@ -633,6 +634,21 @@
 	return conn->data->name;
 }
 
+/* registers pointer to transport layer <id> (XPRT_*) */
+static inline void xprt_register(int id, struct xprt_ops *xprt)
+{
+	if (id >= XPRT_ENTRIES)
+		return;
+	registered_xprt[id] = xprt;
+}
+
+/* returns pointer to transport layer <id> (XPRT_*) or NULL if not registered */
+static inline struct xprt_ops *xprt_get(int id)
+{
+	if (id >= XPRT_ENTRIES)
+		return NULL;
+	return registered_xprt[id];
+}
 
 #endif /* _PROTO_CONNECTION_H */