9#ifndef PROTOCORE_NETWORK_NETWORK_H
10#define PROTOCORE_NETWORK_NETWORK_H
111#if PROTOCORE_ENABLE_TCP_CLIENT
123 void (*
const claim)(uint8_t *work);
124 void (*
const release)(uint8_t *work);
125 void (*
const slot_free)(uint8_t *work);
126 void (*
const owns)(uint8_t *work);
127 void (*
const tx_drain)(uint8_t *work);
128 void (*
const emit)(uint8_t *work);
129 void (*
const write_msg)(uint8_t *work);
130 void (*
const payload_region)(uint8_t *work);
131 void (*
const write_msg_at)(uint8_t *work);
132 void (*
const chan_open)(uint8_t *work);
133 void (*
const chan_adopt)(uint8_t *work);
134 void (*
const chan_by_cid)(uint8_t *work);
135 void (*
const chan_write)(uint8_t *work);
136 void (*
const chan_read)(uint8_t *work);
137 void (*
const chan_avail)(uint8_t *work);
138 void (*
const chan_drained)(uint8_t *work);
139 void (*
const chan_close)(uint8_t *work);
140 void (*
const chan_close_all)(uint8_t *work);
168static const SshNetworkNs SshNetwork __attribute__((unused)) = {
PROTO_ENUM_PACKED
Application protocol spoken on a listener port or connection slot.
Root infrastructure: fixed widths, serializers, opcodes and sizes, for every layer above.
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)
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_claim(uint8_t *work)
void protocore_ssh_network_chan_close_all(uint8_t *work)
void protocore_ssh_network_tx_drain(uint8_t *work)
void protocore_ssh_network_chan_close(uint8_t *work)
void protocore_ssh_network_write_msg_at(uint8_t *work)
void protocore_ssh_network_release(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_chan_read(uint8_t *work)
void protocore_ssh_network_chan_adopt(uint8_t *work)
void protocore_ssh_network_slot_free(uint8_t *work)
void protocore_ssh_network_emit(uint8_t *work)
void protocore_ssh_network_write_msg(uint8_t *work)
@ SSH_STREAM_DIALED
outbound: the handle indexes the client transport's own pool
@ SSH_STREAM_ACCEPTED
inbound: the handle indexes conn_pool[]
enum PROTO_ENUM_PACKED SshStreamKind
Which transport a slot's byte stream belongs to.
void protocore_ssh_network_payload_region(uint8_t *work)
void protocore_ssh_network_owns(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 claim)(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
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS