Nexus HTTP/3
A QUIC and HTTP/3 library
Classes | Typedefs | Enumerations | Functions
nexus::quic Namespace Reference

Generic QUIC library. More...

Classes

class  client
 a generic QUIC client that owns a UDP socket and uses it to service client connections More...
 
class  connection
 a generic QUIC connection that can initiate outgoing streams and accept incoming streams More...
 
class  connection_id
 an opaque connection id string More...
 
class  server
 a generic QUIC server capable of managing one or more UDP sockets via class acceptor More...
 
class  acceptor
 a generic QUIC acceptor that owns a UDP socket and uses it to accept and service incoming connections More...
 
struct  bad_setting
 exception thrown by client/server constructors on unchecked settings More...
 
struct  settings
 quic transport settings used to initialize a client or server More...
 
class  stream
 a generic bidirectional QUIC stream that meets the type requirements of asio's AsyncRead/WriteStream and SyncRead/WriteStream More...
 

Typedefs

using stream_id = uint64_t
 stream identifier that is unique to a connection
 

Enumerations

enum class  connection_error {
  aborted = 1 ,
  handshake_failed ,
  timed_out ,
  reset ,
  going_away ,
  peer_going_away
}
 quic connection errors More...
 
enum class  stream_error {
  eof = 1 ,
  busy ,
  aborted ,
  reset
}
 quic stream errors More...
 
enum class  transport_error {
  no_error = 0x0 ,
  internal_error = 0x1 ,
  connection_refused = 0x2 ,
  flow_control_error = 0x3 ,
  stream_limit_error = 0x4 ,
  stream_state_error = 0x5 ,
  final_size_error = 0x6 ,
  frame_encoding_error = 0x7 ,
  transport_parameter_error = 0x8 ,
  connection_id_limit_error = 0x9 ,
  protocol_violation = 0xa ,
  invalid_token = 0xb ,
  application_error = 0xc ,
  crypto_buffer_exceeded = 0xd ,
  key_update_error = 0xe ,
  aead_limit_reached = 0xf ,
  no_viable_path = 0x10
}
 quic transport error codes sent in CONNECTION_CLOSE frames
 
enum class  tls_alert : uint8_t {
  close_notify = 0 ,
  unexpected_message = 10 ,
  bad_record_mac = 20 ,
  record_overflow = 22 ,
  handshake_failure = 40 ,
  bad_certificate = 42 ,
  unsupported_certificate = 43 ,
  certificate_revoked = 44 ,
  certificate_expired = 45 ,
  certificate_unknown = 46 ,
  illegal_parameter = 47 ,
  unknown_ca = 48 ,
  access_denied = 49 ,
  decode_error = 50 ,
  decrypt_error = 51 ,
  protocol_version = 70 ,
  insufficient_security = 71 ,
  internal_error = 80 ,
  inappropriate_fallback = 86 ,
  user_canceled = 90 ,
  missing_extension = 109 ,
  unsupported_extension = 110 ,
  unrecognized_name = 112 ,
  bad_certificate_status_response = 113 ,
  unknown_psk_identity = 115 ,
  certificate_required = 116 ,
  no_application_protocol = 120
}
 tls alerts
 

Functions

const error_category & connection_category ()
 connection error category
 
error_code make_error_code (connection_error e)
 
error_condition make_error_condition (connection_error e)
 
const error_category & stream_category ()
 stream error category
 
error_code make_error_code (stream_error e)
 
error_condition make_error_condition (stream_error e)
 
const error_category & transport_category ()
 transport error category
 
error_code make_error_code (transport_error e)
 
error_condition make_error_condition (transport_error e)
 
const error_category & tls_category ()
 tls error category
 
error_code make_error_code (tls_alert e)
 
error_condition make_error_condition (tls_alert e)
 
const error_category & application_category ()
 application-level error category
 
settings default_client_settings ()
 return default client settings
 
settings default_server_settings ()
 return default server settings
 
bool check_client_settings (const settings &s, std::string *message)
 check the validity of the client settings
 
bool check_server_settings (const settings &s, std::string *message)
 check the validity of the server settings
 
void prepare_socket (udp::socket &sock, bool is_server, error_code &ec)
 
bool client_initiated (stream_id id)
 return true if the stream id was initiated by the client
 
bool server_initiated (stream_id id)
 return true if the stream id was initiated by the server
 

Detailed Description

Generic QUIC library.

Enumeration Type Documentation

◆ connection_error

quic connection errors

Enumerator
aborted 

this end of the connection was closed

handshake_failed 

the connection's tls handshake failed

timed_out 

the connection or handshake timed out

reset 

connection reset by peer

going_away 

sent GOAWAY to peer

peer_going_away 

peer sent GOAWAY

◆ stream_error

quic stream errors

Enumerator
eof 

no more bytes can be read because the peer closed the stream for writing

busy 

stream cannot process more than one read or more than one write at a time

aborted 

this end of the stream was closed

reset 

stream reset by peer