#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();
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 */
CO_SFL_STREAMER = 0x0002, /* Producer is continuously streaming data */
};
+/* known transport layers (for ease of lookup) */
+enum {
+ XPRT_RAW = 0,
+ XPRT_SSL = 1,
+ XPRT_ENTRIES /* must be last one */
+};
+
/* xprt_ops describes transport-layer operations for a connection. They
* generally run over a socket-based control layer, but not always. Some
* of them are used for data transfer with the upper layer (rcv_*, snd_*)
#endif
struct pool_head *pool2_connection;
+struct xprt_ops *registered_xprt[XPRT_ENTRIES] = { NULL, };
/* perform minimal intializations, report 0 in case of error, 1 if OK. */
int init_connection()
.name = "RAW",
};
+
+__attribute__((constructor))
+static void __ssl_sock_deinit(void)
+{
+ xprt_register(XPRT_RAW, &raw_sock);
+}
+
/*
* Local variables:
* c-indent-level: 8
global.listen_default_ssloptions = BC_SSL_O_NONE;
global.connect_default_ssloptions = SRV_SSL_O_NONE;
+ xprt_register(XPRT_SSL, &ssl_sock);
SSL_library_init();
cm = SSL_COMP_get_compression_methods();
sk_SSL_COMP_zero(cm);