Macros ====== Library version macros ---------------------- .. macro:: DWNX_VERSION Version number of the dwnx library release. .. macro:: DWNX_VERSION_NUM Numerical representation of the version number of the dwnx library release. This is a 24 bit number with 8 bits for major number, 8 bits for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. QUIC specific macros -------------------- .. macro:: DWNX_MAX_VARINT :macro:`DWNX_MAX_VARINT` is the maximum value which can be encoded in variable-length integer encoding. .. macro:: DWNX_DEFAULT_MAX_RECORD_SIZE :macro:`DWNX_DEFAULT_MAX_RECORD_SIZE` is the default maximum QMux record size. dwnx library error codes ------------------------ .. macro:: DWNX_ERR_INVALID_ARGUMENT :macro:`DWNX_ERR_INVALID_ARGUMENT` indicates that a passed argument is invalid. .. macro:: DWNX_ERR_NOBUF :macro:`DWNX_ERR_NOBUF` indicates that a provided buffer does not have enough space to store data. .. macro:: DWNX_ERR_PROTO :macro:`DWNX_ERR_PROTO` indicates a general protocol error. .. macro:: DWNX_ERR_INVALID_STATE :macro:`DWNX_ERR_INVALID_STATE` indicates that a requested operation is not allowed at the current connection state. .. macro:: DWNX_ERR_STREAM_ID_BLOCKED :macro:`DWNX_ERR_STREAM_ID_BLOCKED` indicates that there is no spare stream ID available. .. macro:: DWNX_ERR_STREAM_IN_USE :macro:`DWNX_ERR_STREAM_IN_USE` indicates that a stream ID is already in use. .. macro:: DWNX_ERR_STREAM_DATA_BLOCKED :macro:`DWNX_ERR_STREAM_DATA_BLOCKED` indicates that stream data cannot be sent because of flow control. .. macro:: DWNX_ERR_FLOW_CONTROL :macro:`DWNX_ERR_FLOW_CONTROL` indicates flow control error. .. macro:: DWNX_ERR_STREAM_LIMIT :macro:`DWNX_ERR_STREAM_LIMIT` indicates that a remote endpoint opens more streams that is permitted. .. macro:: DWNX_ERR_FINAL_SIZE :macro:`DWNX_ERR_FINAL_SIZE` indicates that inconsistent final size of a stream. .. macro:: DWNX_ERR_REQUIRED_TRANSPORT_PARAM :macro:`DWNX_ERR_REQUIRED_TRANSPORT_PARAM` indicates that a required transport parameter is missing. .. macro:: DWNX_ERR_MALFORMED_TRANSPORT_PARAM :macro:`DWNX_ERR_MALFORMED_TRANSPORT_PARAM` indicates that a transport parameter is malformed. .. macro:: DWNX_ERR_FRAME_ENCODING :macro:`DWNX_ERR_FRAME_ENCODING` indicates there is an error in frame encoding. .. macro:: DWNX_ERR_STREAM_SHUT_WR :macro:`DWNX_ERR_STREAM_SHUT_WR` indicates no more data can be sent to a stream. .. macro:: DWNX_ERR_STREAM_NOT_FOUND :macro:`DWNX_ERR_STREAM_NOT_FOUND` indicates that a stream was not found. .. macro:: DWNX_ERR_STREAM_STATE :macro:`DWNX_ERR_STREAM_STATE` indicates that a requested operation is not allowed at the current stream state. .. macro:: DWNX_ERR_CLOSING :macro:`DWNX_ERR_CLOSING` indicates that connection is in closing state. .. macro:: DWNX_ERR_DRAINING :macro:`DWNX_ERR_DRAINING` indicates that connection is in draining state. .. macro:: DWNX_ERR_TRANSPORT_PARAM :macro:`DWNX_ERR_TRANSPORT_PARAM` indicates a general transport parameter error. .. macro:: DWNX_ERR_INTERNAL :macro:`DWNX_ERR_INTERNAL` indicates an internal error. .. macro:: DWNX_ERR_WRITE_MORE :macro:`DWNX_ERR_WRITE_MORE` indicates :macro:`DWNX_WRITE_STREAM_FLAG_MORE` is used and a function call succeeded. .. macro:: DWNX_ERR_IDLE_CLOSE :macro:`DWNX_ERR_IDLE_CLOSE` indicates the connection should be closed silently because of idle timeout. .. macro:: DWNX_ERR_FATAL :macro:`DWNX_ERR_FATAL` indicates that error codes less than this value is fatal error. When this error is returned, an endpoint should close connection immediately. .. macro:: DWNX_ERR_NOMEM :macro:`DWNX_ERR_NOMEM` indicates out of memory. .. macro:: DWNX_ERR_CALLBACK_FAILURE :macro:`DWNX_ERR_CALLBACK_FAILURE` indicates that user defined callback function failed. QUIC transport error code ------------------------- .. macro:: DWNX_NO_ERROR :macro:`DWNX_NO_ERROR` is QUIC transport error code ``NO_ERROR``. .. macro:: DWNX_INTERNAL_ERROR :macro:`DWNX_INTERNAL_ERROR` is QUIC transport error code ``INTERNAL_ERROR``. .. macro:: DWNX_CONNECTION_REFUSED :macro:`DWNX_CONNECTION_REFUSED` is QUIC transport error code ``CONNECTION_REFUSED``. .. macro:: DWNX_FLOW_CONTROL_ERROR :macro:`DWNX_FLOW_CONTROL_ERROR` is QUIC transport error code ``FLOW_CONTROL_ERROR``. .. macro:: DWNX_STREAM_LIMIT_ERROR :macro:`DWNX_STREAM_LIMIT_ERROR` is QUIC transport error code ``STREAM_LIMIT_ERROR``. .. macro:: DWNX_STREAM_STATE_ERROR :macro:`DWNX_STREAM_STATE_ERROR` is QUIC transport error code ``STREAM_STATE_ERROR``. .. macro:: DWNX_FINAL_SIZE_ERROR :macro:`DWNX_FINAL_SIZE_ERROR` is QUIC transport error code ``FINAL_SIZE_ERROR``. .. macro:: DWNX_FRAME_ENCODING_ERROR :macro:`DWNX_FRAME_ENCODING_ERROR` is QUIC transport error code ``FRAME_ENCODING_ERROR``. .. macro:: DWNX_TRANSPORT_PARAMETER_ERROR :macro:`DWNX_TRANSPORT_PARAMETER_ERROR` is QUIC transport error code ``TRANSPORT_PARAMETER_ERROR``. .. macro:: DWNX_PROTOCOL_VIOLATION :macro:`DWNX_PROTOCOL_VIOLATION` is QUIC transport error code ``PROTOCOL_VIOLATION``. .. macro:: DWNX_APPLICATION_ERROR :macro:`DWNX_APPLICATION_ERROR` is QUIC transport error code ``APPLICATION_ERROR``. Time related macros ------------------- .. macro:: DWNX_NANOSECONDS :macro:`DWNX_NANOSECONDS` is a count of tick which corresponds to 1 nanosecond. .. macro:: DWNX_MICROSECONDS :macro:`DWNX_MICROSECONDS` is a count of tick which corresponds to 1 microsecond. .. macro:: DWNX_MILLISECONDS :macro:`DWNX_MILLISECONDS` is a count of tick which corresponds to 1 millisecond. .. macro:: DWNX_SECONDS :macro:`DWNX_SECONDS` is a count of tick which corresponds to 1 second. .. macro:: DWNX_MINUTES :macro:`DWNX_MINUTES` is a count of tick which corresponds to 1 minute. STREAM frame data flags ----------------------- .. macro:: DWNX_STREAM_DATA_FLAG_NONE :macro:`DWNX_STREAM_DATA_FLAG_NONE` indicates no flag set. .. macro:: DWNX_STREAM_DATA_FLAG_FIN :macro:`DWNX_STREAM_DATA_FLAG_FIN` indicates that this chunk of data is final piece of an incoming stream. Stream close flags for :type:`dwnx_stream_close` callback. ---------------------------------------------------------- .. macro:: DWNX_STREAM_CLOSE_FLAG_NONE :macro:`DWNX_STREAM_CLOSE_FLAG_NONE` indicates no flag set. .. macro:: DWNX_STREAM_CLOSE_FLAG_RX_APP_ERROR_CODE_SET :macro:`DWNX_STREAM_CLOSE_FLAG_RX_APP_ERROR_CODE_SET` indicates that rx_app_error_code parameter is set. .. macro:: DWNX_STREAM_CLOSE_FLAG_TX_APP_ERROR_CODE_SET :macro:`DWNX_STREAM_CLOSE_FLAG_TX_APP_ERROR_CODE_SET` indicates that tx_app_error_code parameter is set. Write stream data flags ----------------------- .. macro:: DWNX_WRITE_STREAM_FLAG_NONE :macro:`DWNX_WRITE_STREAM_FLAG_NONE` indicates no flag set. .. macro:: DWNX_WRITE_STREAM_FLAG_FIN :macro:`DWNX_WRITE_STREAM_FLAG_FIN` indicates that a passed data is the final part of a stream.