The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
alpn_id.h
Go to the documentation of this file.
1#pragma once
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16 */
17#ifdef WITH_TLS
18/**
19 * $Id: fd5f130ff503b96c031163274b2a07f4c3e532aa $
20 *
21 * @file lib/tls/alpn_id.h
22 * @brief Structure for ALPN IDs
23 *
24 * This file is needed so that the files in src/protocols can define protocol-specific ALPN IDs, without
25 * getting confused with the rest of the TLS and request data structures.
26 *
27 * @copyright 2026 Network RADIUS SAS (legal@networkradius.com)
28 */
29RCSIDH(alpn_id_h, "$Id: fd5f130ff503b96c031163274b2a07f4c3e532aa $")
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/** Value of `alpn_id` when no ALPN name was negotiated, and no entry has #FR_TLS_ALPN_DEFAULT set.
36 */
37#define FR_TLS_ALPN_ID_NONE (0)
38
39/** Flags for #fr_tls_alpn_t
40 *
41 * @{
42 */
43#define FR_TLS_ALPN_DEFAULT (1 << 0) //!< The protocol which both ends use when no ALPN is used.
44#define FR_TLS_ALPN_STICKY (1 << 1) //!< A session which negotiated ALPN can only be resumed with
45 ///< the same ALPN string.
46/** @} */
47
48/** One protocol that an application can negotiate
49 *
50 * A table is an array of entries. The table ends with #FR_TLS_ALPN_TABLE_TERMINATOR
51 *
52 * The `id` of each entry is its position in the table plus one, so the entry with a given `id` is
53 * `table[id - 1]`. fr_tls_alpn_set() fails when a table does not follow that rule.
54 */
55typedef struct fr_tls_alpn_s {
56 int id; //!< The application's value for this protocol. 1 for the first entry,
57 ///< 2 for the second entry, etc.
58 char const *name; //!< ALPN string, without the length octet.
59 char const *conf_name; //!< Name of the item in the `alpn` section.
60 unsigned int flags; //!< #FR_TLS_ALPN_DEFAULT and #FR_TLS_ALPN_STICKY.
61} fr_tls_alpn_t;
62
63#define FR_TLS_ALPN_TABLE_TERMINATOR { .id = FR_TLS_ALPN_ID_NONE }
64
65#ifdef __cplusplus
66}
67#endif
68#endif /* WITH_TLS */
#define RCSIDH(h, id)
Definition build.h:610
static char const * name