#include <api_frame_helper_noise.h>
|
| APIError | state_action_ () |
| | To be called from read/write methods.
|
| |
| APIError | state_action_client_hello_ () |
| |
| APIError | state_action_server_hello_ () |
| |
| APIError | state_action_handshake_ () |
| |
| APIError | state_action_handshake_read_ () |
| |
| APIError | state_action_handshake_write_ () |
| |
| APIError | try_read_frame_ () |
| | Read a packet into the rx_buf_.
|
| |
| APIError | write_frame_ (const uint8_t *data, uint16_t len) |
| |
| APIError | encrypt_noise_message_ (uint8_t *buf_start, uint16_t payload_size, uint8_t message_type, uint16_t &encrypted_len_out) |
| |
| APIError | init_handshake_ () |
| | Initiate the data structures for the handshake.
|
| |
| APIError | check_handshake_finished_ () |
| |
| void | send_explicit_handshake_reject_ (const LogString *reason) |
| |
| APIError | handle_handshake_frame_error_ (APIError aerr) |
| |
| APIError | handle_noise_error_ (int err, const LogString *func_name, APIError api_err) |
| |
| APIError | drain_overflow_and_handle_errors_ () |
| |
| ssize_t ESPHOME_ALWAYS_INLINE | write_iov_to_socket_ (const struct iovec *iov, int iovcnt) |
| |
| APIError ESPHOME_ALWAYS_INLINE | write_raw_fast_buf_ (const void *data, uint16_t len) |
| |
| APIError | write_raw_buf_ (const void *data, uint16_t len, ssize_t sent=WRITE_NOT_ATTEMPTED) |
| |
| APIError | write_raw_iov_ (const struct iovec *iov, int iovcnt, uint16_t total_write_len, ssize_t sent=WRITE_NOT_ATTEMPTED) |
| |
| void | log_packet_sending_ (const void *data, uint16_t len) |
| |
| APIError ESPHOME_ALWAYS_INLINE | check_data_state_ () const |
| |
| void | set_nodelay_raw_ (bool enable) |
| |
| APIError | init_common_ () |
| |
| APIError | handle_socket_read_result_ (ssize_t received) |
| |
Definition at line 10 of file api_frame_helper_noise.h.
◆ APINoiseFrameHelper()
◆ ~APINoiseFrameHelper()
| esphome::api::APINoiseFrameHelper::~APINoiseFrameHelper |
( |
| ) |
|
|
override |
◆ check_handshake_finished_()
| APIError esphome::api::APINoiseFrameHelper::check_handshake_finished_ |
( |
| ) |
|
|
protected |
◆ encrypt_noise_message_()
| APIError esphome::api::APINoiseFrameHelper::encrypt_noise_message_ |
( |
uint8_t * | buf_start, |
|
|
uint16_t | payload_size, |
|
|
uint8_t | message_type, |
|
|
uint16_t & | encrypted_len_out ) |
|
protected |
◆ handle_handshake_frame_error_()
| APIError esphome::api::APINoiseFrameHelper::handle_handshake_frame_error_ |
( |
APIError | aerr | ) |
|
|
protected |
◆ handle_noise_error_()
| APIError esphome::api::APINoiseFrameHelper::handle_noise_error_ |
( |
int | err, |
|
|
const LogString * | func_name, |
|
|
APIError | api_err ) |
|
protected |
◆ init()
| APIError esphome::api::APINoiseFrameHelper::init |
( |
| ) |
|
|
overridevirtual |
◆ init_handshake_()
| APIError esphome::api::APINoiseFrameHelper::init_handshake_ |
( |
| ) |
|
|
protected |
Initiate the data structures for the handshake.
- Returns
- 0 on success, -1 on error (check errno)
Definition at line 561 of file api_frame_helper_noise.cpp.
◆ loop()
| APIError esphome::api::APINoiseFrameHelper::loop |
( |
| ) |
|
|
overridevirtual |
◆ read_packet()
◆ send_explicit_handshake_reject_()
| void esphome::api::APINoiseFrameHelper::send_explicit_handshake_reject_ |
( |
const LogString * | reason | ) |
|
|
protected |
◆ state_action_()
| APIError esphome::api::APINoiseFrameHelper::state_action_ |
( |
| ) |
|
|
protected |
To be called from read/write methods.
This method runs through the internal handshake methods, if in that state.
If the handshake is still active when this method returns and a read/write can't take place at the moment, returns WOULD_BLOCK. If an error occurred, returns that error. Only returns OK if the transport is ready for data traffic.
Definition at line 244 of file api_frame_helper_noise.cpp.
◆ state_action_client_hello_()
| APIError esphome::api::APINoiseFrameHelper::state_action_client_hello_ |
( |
| ) |
|
|
protected |
◆ state_action_handshake_()
| APIError esphome::api::APINoiseFrameHelper::state_action_handshake_ |
( |
| ) |
|
|
protected |
◆ state_action_handshake_read_()
| APIError esphome::api::APINoiseFrameHelper::state_action_handshake_read_ |
( |
| ) |
|
|
protected |
◆ state_action_handshake_write_()
| APIError esphome::api::APINoiseFrameHelper::state_action_handshake_write_ |
( |
| ) |
|
|
protected |
◆ state_action_server_hello_()
| APIError esphome::api::APINoiseFrameHelper::state_action_server_hello_ |
( |
| ) |
|
|
protected |
◆ try_read_frame_()
| APIError esphome::api::APINoiseFrameHelper::try_read_frame_ |
( |
| ) |
|
|
protected |
Read a packet into the rx_buf_.
- Returns
- APIError::OK if a full packet is in rx_buf_
errno EWOULDBLOCK: Packet could not be read without blocking. Try again later. errno ENOMEM: Not enough memory for reading packet. errno API_ERROR_BAD_INDICATOR: Bad indicator byte at start of frame. errno API_ERROR_HANDSHAKE_PACKET_LEN: Packet too big for this phase.
Definition at line 164 of file api_frame_helper_noise.cpp.
◆ write_frame_()
| APIError esphome::api::APINoiseFrameHelper::write_frame_ |
( |
const uint8_t * | data, |
|
|
uint16_t | len ) |
|
protected |
◆ write_protobuf_messages()
◆ write_protobuf_packet()
◆ ctx_
◆ handshake_
| NoiseHandshakeState* esphome::api::APINoiseFrameHelper::handshake_ {nullptr} |
|
protected |
◆ HEADER_PADDING
| uint8_t esphome::api::APINoiseFrameHelper::HEADER_PADDING = 1 + 2 + 2 + 2 |
|
staticconstexpr |
◆ nid_
| NoiseProtocolId esphome::api::APINoiseFrameHelper::nid_ |
|
protected |
◆ prologue_
| APIBuffer esphome::api::APINoiseFrameHelper::prologue_ |
|
protected |
◆ recv_cipher_
| NoiseCipherState* esphome::api::APINoiseFrameHelper::recv_cipher_ {nullptr} |
|
protected |
◆ rx_header_buf_
| uint8_t esphome::api::APINoiseFrameHelper::rx_header_buf_[3] |
|
protected |
◆ rx_header_buf_len_
| uint8_t esphome::api::APINoiseFrameHelper::rx_header_buf_len_ = 0 |
|
protected |
◆ send_cipher_
| NoiseCipherState* esphome::api::APINoiseFrameHelper::send_cipher_ {nullptr} |
|
protected |
The documentation for this class was generated from the following files: