11cb0ef41Sopenharmony_ci/*
21cb0ef41Sopenharmony_ci * nghttp2 - HTTP/2 C Library
31cb0ef41Sopenharmony_ci *
41cb0ef41Sopenharmony_ci * Copyright (c) 2014 Tatsuhiro Tsujikawa
51cb0ef41Sopenharmony_ci *
61cb0ef41Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining
71cb0ef41Sopenharmony_ci * a copy of this software and associated documentation files (the
81cb0ef41Sopenharmony_ci * "Software"), to deal in the Software without restriction, including
91cb0ef41Sopenharmony_ci * without limitation the rights to use, copy, modify, merge, publish,
101cb0ef41Sopenharmony_ci * distribute, sublicense, and/or sell copies of the Software, and to
111cb0ef41Sopenharmony_ci * permit persons to whom the Software is furnished to do so, subject to
121cb0ef41Sopenharmony_ci * the following conditions:
131cb0ef41Sopenharmony_ci *
141cb0ef41Sopenharmony_ci * The above copyright notice and this permission notice shall be
151cb0ef41Sopenharmony_ci * included in all copies or substantial portions of the Software.
161cb0ef41Sopenharmony_ci *
171cb0ef41Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
181cb0ef41Sopenharmony_ci * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
191cb0ef41Sopenharmony_ci * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
201cb0ef41Sopenharmony_ci * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
211cb0ef41Sopenharmony_ci * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
221cb0ef41Sopenharmony_ci * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
231cb0ef41Sopenharmony_ci * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
241cb0ef41Sopenharmony_ci */
251cb0ef41Sopenharmony_ci#ifndef NGHTTP2_OPTION_H
261cb0ef41Sopenharmony_ci#define NGHTTP2_OPTION_H
271cb0ef41Sopenharmony_ci
281cb0ef41Sopenharmony_ci#ifdef HAVE_CONFIG_H
291cb0ef41Sopenharmony_ci#  include <config.h>
301cb0ef41Sopenharmony_ci#endif /* HAVE_CONFIG_H */
311cb0ef41Sopenharmony_ci
321cb0ef41Sopenharmony_ci#include <nghttp2/nghttp2.h>
331cb0ef41Sopenharmony_ci
341cb0ef41Sopenharmony_ci/**
351cb0ef41Sopenharmony_ci * Configuration options
361cb0ef41Sopenharmony_ci */
371cb0ef41Sopenharmony_citypedef enum {
381cb0ef41Sopenharmony_ci  /**
391cb0ef41Sopenharmony_ci   * This option prevents the library from sending WINDOW_UPDATE for a
401cb0ef41Sopenharmony_ci   * connection automatically.  If this option is set to nonzero, the
411cb0ef41Sopenharmony_ci   * library won't send WINDOW_UPDATE for DATA until application calls
421cb0ef41Sopenharmony_ci   * nghttp2_session_consume() to indicate the amount of consumed
431cb0ef41Sopenharmony_ci   * DATA.  By default, this option is set to zero.
441cb0ef41Sopenharmony_ci   */
451cb0ef41Sopenharmony_ci  NGHTTP2_OPT_NO_AUTO_WINDOW_UPDATE = 1,
461cb0ef41Sopenharmony_ci  /**
471cb0ef41Sopenharmony_ci   * This option sets the SETTINGS_MAX_CONCURRENT_STREAMS value of
481cb0ef41Sopenharmony_ci   * remote endpoint as if it is received in SETTINGS frame. Without
491cb0ef41Sopenharmony_ci   * specifying this option, before the local endpoint receives
501cb0ef41Sopenharmony_ci   * SETTINGS_MAX_CONCURRENT_STREAMS in SETTINGS frame from remote
511cb0ef41Sopenharmony_ci   * endpoint, SETTINGS_MAX_CONCURRENT_STREAMS is unlimited. This may
521cb0ef41Sopenharmony_ci   * cause problem if local endpoint submits lots of requests
531cb0ef41Sopenharmony_ci   * initially and sending them at once to the remote peer may lead to
541cb0ef41Sopenharmony_ci   * the rejection of some requests. Specifying this option to the
551cb0ef41Sopenharmony_ci   * sensible value, say 100, may avoid this kind of issue. This value
561cb0ef41Sopenharmony_ci   * will be overwritten if the local endpoint receives
571cb0ef41Sopenharmony_ci   * SETTINGS_MAX_CONCURRENT_STREAMS from the remote endpoint.
581cb0ef41Sopenharmony_ci   */
591cb0ef41Sopenharmony_ci  NGHTTP2_OPT_PEER_MAX_CONCURRENT_STREAMS = 1 << 1,
601cb0ef41Sopenharmony_ci  NGHTTP2_OPT_NO_RECV_CLIENT_MAGIC = 1 << 2,
611cb0ef41Sopenharmony_ci  NGHTTP2_OPT_NO_HTTP_MESSAGING = 1 << 3,
621cb0ef41Sopenharmony_ci  NGHTTP2_OPT_MAX_RESERVED_REMOTE_STREAMS = 1 << 4,
631cb0ef41Sopenharmony_ci  NGHTTP2_OPT_USER_RECV_EXT_TYPES = 1 << 5,
641cb0ef41Sopenharmony_ci  NGHTTP2_OPT_NO_AUTO_PING_ACK = 1 << 6,
651cb0ef41Sopenharmony_ci  NGHTTP2_OPT_BUILTIN_RECV_EXT_TYPES = 1 << 7,
661cb0ef41Sopenharmony_ci  NGHTTP2_OPT_MAX_SEND_HEADER_BLOCK_LENGTH = 1 << 8,
671cb0ef41Sopenharmony_ci  NGHTTP2_OPT_MAX_DEFLATE_DYNAMIC_TABLE_SIZE = 1 << 9,
681cb0ef41Sopenharmony_ci  NGHTTP2_OPT_NO_CLOSED_STREAMS = 1 << 10,
691cb0ef41Sopenharmony_ci  NGHTTP2_OPT_MAX_OUTBOUND_ACK = 1 << 11,
701cb0ef41Sopenharmony_ci  NGHTTP2_OPT_MAX_SETTINGS = 1 << 12,
711cb0ef41Sopenharmony_ci  NGHTTP2_OPT_SERVER_FALLBACK_RFC7540_PRIORITIES = 1 << 13,
721cb0ef41Sopenharmony_ci  NGHTTP2_OPT_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION = 1 << 14,
731cb0ef41Sopenharmony_ci  NGHTTP2_OPT_STREAM_RESET_RATE_LIMIT = 1 << 15,
741cb0ef41Sopenharmony_ci} nghttp2_option_flag;
751cb0ef41Sopenharmony_ci
761cb0ef41Sopenharmony_ci/**
771cb0ef41Sopenharmony_ci * Struct to store option values for nghttp2_session.
781cb0ef41Sopenharmony_ci */
791cb0ef41Sopenharmony_cistruct nghttp2_option {
801cb0ef41Sopenharmony_ci  /**
811cb0ef41Sopenharmony_ci   * NGHTTP2_OPT_STREAM_RESET_RATE_LIMIT
821cb0ef41Sopenharmony_ci   */
831cb0ef41Sopenharmony_ci  uint64_t stream_reset_burst;
841cb0ef41Sopenharmony_ci  uint64_t stream_reset_rate;
851cb0ef41Sopenharmony_ci  /**
861cb0ef41Sopenharmony_ci   * NGHTTP2_OPT_MAX_SEND_HEADER_BLOCK_LENGTH
871cb0ef41Sopenharmony_ci   */
881cb0ef41Sopenharmony_ci  size_t max_send_header_block_length;
891cb0ef41Sopenharmony_ci  /**
901cb0ef41Sopenharmony_ci   * NGHTTP2_OPT_MAX_DEFLATE_DYNAMIC_TABLE_SIZE
911cb0ef41Sopenharmony_ci   */
921cb0ef41Sopenharmony_ci  size_t max_deflate_dynamic_table_size;
931cb0ef41Sopenharmony_ci  /**
941cb0ef41Sopenharmony_ci   * NGHTTP2_OPT_MAX_OUTBOUND_ACK
951cb0ef41Sopenharmony_ci   */
961cb0ef41Sopenharmony_ci  size_t max_outbound_ack;
971cb0ef41Sopenharmony_ci  /**
981cb0ef41Sopenharmony_ci   * NGHTTP2_OPT_MAX_SETTINGS
991cb0ef41Sopenharmony_ci   */
1001cb0ef41Sopenharmony_ci  size_t max_settings;
1011cb0ef41Sopenharmony_ci  /**
1021cb0ef41Sopenharmony_ci   * Bitwise OR of nghttp2_option_flag to determine that which fields
1031cb0ef41Sopenharmony_ci   * are specified.
1041cb0ef41Sopenharmony_ci   */
1051cb0ef41Sopenharmony_ci  uint32_t opt_set_mask;
1061cb0ef41Sopenharmony_ci  /**
1071cb0ef41Sopenharmony_ci   * NGHTTP2_OPT_PEER_MAX_CONCURRENT_STREAMS
1081cb0ef41Sopenharmony_ci   */
1091cb0ef41Sopenharmony_ci  uint32_t peer_max_concurrent_streams;
1101cb0ef41Sopenharmony_ci  /**
1111cb0ef41Sopenharmony_ci   * NGHTTP2_OPT_MAX_RESERVED_REMOTE_STREAMS
1121cb0ef41Sopenharmony_ci   */
1131cb0ef41Sopenharmony_ci  uint32_t max_reserved_remote_streams;
1141cb0ef41Sopenharmony_ci  /**
1151cb0ef41Sopenharmony_ci   * NGHTTP2_OPT_BUILTIN_RECV_EXT_TYPES
1161cb0ef41Sopenharmony_ci   */
1171cb0ef41Sopenharmony_ci  uint32_t builtin_recv_ext_types;
1181cb0ef41Sopenharmony_ci  /**
1191cb0ef41Sopenharmony_ci   * NGHTTP2_OPT_NO_AUTO_WINDOW_UPDATE
1201cb0ef41Sopenharmony_ci   */
1211cb0ef41Sopenharmony_ci  int no_auto_window_update;
1221cb0ef41Sopenharmony_ci  /**
1231cb0ef41Sopenharmony_ci   * NGHTTP2_OPT_NO_RECV_CLIENT_MAGIC
1241cb0ef41Sopenharmony_ci   */
1251cb0ef41Sopenharmony_ci  int no_recv_client_magic;
1261cb0ef41Sopenharmony_ci  /**
1271cb0ef41Sopenharmony_ci   * NGHTTP2_OPT_NO_HTTP_MESSAGING
1281cb0ef41Sopenharmony_ci   */
1291cb0ef41Sopenharmony_ci  int no_http_messaging;
1301cb0ef41Sopenharmony_ci  /**
1311cb0ef41Sopenharmony_ci   * NGHTTP2_OPT_NO_AUTO_PING_ACK
1321cb0ef41Sopenharmony_ci   */
1331cb0ef41Sopenharmony_ci  int no_auto_ping_ack;
1341cb0ef41Sopenharmony_ci  /**
1351cb0ef41Sopenharmony_ci   * NGHTTP2_OPT_NO_CLOSED_STREAMS
1361cb0ef41Sopenharmony_ci   */
1371cb0ef41Sopenharmony_ci  int no_closed_streams;
1381cb0ef41Sopenharmony_ci  /**
1391cb0ef41Sopenharmony_ci   * NGHTTP2_OPT_SERVER_FALLBACK_RFC7540_PRIORITIES
1401cb0ef41Sopenharmony_ci   */
1411cb0ef41Sopenharmony_ci  int server_fallback_rfc7540_priorities;
1421cb0ef41Sopenharmony_ci  /**
1431cb0ef41Sopenharmony_ci   * NGHTTP2_OPT_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION
1441cb0ef41Sopenharmony_ci   */
1451cb0ef41Sopenharmony_ci  int no_rfc9113_leading_and_trailing_ws_validation;
1461cb0ef41Sopenharmony_ci  /**
1471cb0ef41Sopenharmony_ci   * NGHTTP2_OPT_USER_RECV_EXT_TYPES
1481cb0ef41Sopenharmony_ci   */
1491cb0ef41Sopenharmony_ci  uint8_t user_recv_ext_types[32];
1501cb0ef41Sopenharmony_ci};
1511cb0ef41Sopenharmony_ci
1521cb0ef41Sopenharmony_ci#endif /* NGHTTP2_OPTION_H */
153