diff --git a/include/proto/connection.h b/include/proto/connection.h index e8674462b..09467ba50 100644 --- a/include/proto/connection.h +++ b/include/proto/connection.h @@ -650,6 +650,13 @@ static inline struct xprt_ops *xprt_get(int id) return registered_xprt[id]; } +static inline int conn_get_alpn(const struct connection *conn, const char **str, int *len) +{ + if (!conn_xprt_ready(conn) || !conn->xprt->get_alpn) + return 0; + return conn->xprt->get_alpn(conn, str, len); +} + #endif /* _PROTO_CONNECTION_H */ /* diff --git a/include/types/connection.h b/include/types/connection.h index 60d977218..1e3fb7389 100644 --- a/include/types/connection.h +++ b/include/types/connection.h @@ -228,6 +228,7 @@ struct xprt_ops { void (*destroy_bind_conf)(struct bind_conf *conf); /* destroy a whole bind_conf */ int (*prepare_srv)(struct server *srv); /* prepare a server context */ void (*destroy_srv)(struct server *srv); /* destroy a server context */ + int (*get_alpn)(const struct connection *conn, const char **str, int *len); /* get application layer name */ char name[8]; /* transport layer name, zero-terminated */ };