9#ifndef PROTOCORE_NETWORK_NETWORK_H
10#define PROTOCORE_NETWORK_NETWORK_H
27 SSH_STREAM_ACCEPTED = 0,
110#if PROTOCORE_ENABLE_TCP_CLIENT
122 void (*
const claim)(
const uint8_t *work);
125 void (*
const owns)(
const uint8_t *work);
127 void (*
const emit)(
const uint8_t *work);
167static const SshNetworkNs SshNetwork __attribute__((unused)) = {
Root infrastructure: fixed widths, serializers, opcodes and sizes, for every layer above.
void protocore_ssh_network_owns(const uint8_t *work)
void protocore_ssh_network_chan_avail(uint8_t *work)
void protocore_ssh_network_chan_by_cid(uint8_t *work)
void protocore_ssh_network_chan_write(uint8_t *work)
void protocore_ssh_network_claim(const uint8_t *work)
SshNetworkVars SshNetworkV
The operands and the outcome.
uint8_t * protocore_ssh_network_span(void)
The PROTOCORE_SSH_NETWORK_BORROW bytes this module's state lives in.
void protocore_ssh_network_chan_drained(uint8_t *work)
void protocore_ssh_network_chan_close_all(uint8_t *work)
void protocore_ssh_network_chan_close(uint8_t *work)
void protocore_ssh_network_write_msg(const uint8_t *work)
void ssh_net_version_exchange_send(uint8_t i, uint8_t conn_slot)
Put the server identification string on the wire, raw, before any binary packet.
void protocore_ssh_network_chan_open(uint8_t *work)
void protocore_ssh_network_release(const uint8_t *work)
void protocore_ssh_network_chan_read(uint8_t *work)
void protocore_ssh_network_chan_adopt(uint8_t *work)
EMBED_ENUM_BYTE(SshStreamKind, SSH_STREAM_ACCEPTED=0, SSH_STREAM_DIALED)
Which transport a slot's byte stream belongs to.
void protocore_ssh_network_payload_region(const uint8_t *work)
void protocore_ssh_network_emit(const uint8_t *work)
void protocore_ssh_network_tx_drain(const uint8_t *work)
void protocore_ssh_network_slot_free(const uint8_t *work)
void protocore_ssh_network_write_msg_at(const uint8_t *work)
Per-protocol connection event/poll callbacks (the server's dispatch vtable).
RFC 4254 sec 7.2: where a bridged channel dials, and the client slot it takes.
uint32_t timeout_ms
what that open is given
const char * host
the destination a channel dials
int cid
the client slot a channel adopts, or the one a lookup names
Where a channel read writes.
size_t cap
how much room it has; a region lookup reports its own here
uint8_t * out
where a channel read writes
The message bytes an emit or a write carries.
const uint8_t * payload
the message bytes an emit or a write carries
size_t plen
the payload length already built in the region
void(*const chan_open)(uint8_t *work)
void(*const write_msg_at)(const uint8_t *work)
void(*const chan_close)(uint8_t *work)
void(*const chan_close_all)(uint8_t *work)
void(*const chan_read)(uint8_t *work)
void(*const slot_free)(const uint8_t *work)
void(*const chan_write)(uint8_t *work)
void(*const chan_by_cid)(uint8_t *work)
void(*const claim)(const uint8_t *work)
void(*const emit)(const uint8_t *work)
void(*const owns)(const uint8_t *work)
void(*const chan_drained)(uint8_t *work)
void(*const tx_drain)(const uint8_t *work)
void(*const write_msg)(const uint8_t *work)
void(*const chan_avail)(uint8_t *work)
void(*const release)(const uint8_t *work)
void(*const chan_adopt)(uint8_t *work)
void(*const payload_region)(const uint8_t *work)
SshChanDialArgs dial
where a bridged channel dials
SshStreamRef stream
which pool that handle indexes, and the channel it carries
uint8_t conn_slot
the stream slot it is bound to
int handle
the stream handle a claim binds
uint8_t ssh_slot
the SSH slot a call acts on
SshNetMsgArgs msg
the message bytes an emit or a write carries
SshChanReadArgs read_args
where a channel read writes
RFC 4254 sec 5: which pool a handle indexes, and the channel it carries.
SshStreamKind kind
which pool that handle indexes
uint32_t channel
the channel a bridge call names