ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
network.h File Reference

Decoupled stream I/O: ring buffer in, framed bytes out, one SSH slot per socket. More...

Go to the source code of this file.

Classes

struct  SshStreamRef
 RFC 4254 sec 5: which pool a handle indexes, and the channel it carries. More...
struct  SshNetMsgArgs
 The message bytes an emit or a write carries. More...
struct  SshChanDialArgs
 RFC 4254 sec 7.2: where a bridged channel dials, and the client slot it takes. More...
struct  SshChanReadArgs
 Where a channel read writes. More...
struct  SshNetworkVars
struct  SshNetworkNs
 The entries. More...

Functions

 EMBED_ENUM_BYTE (SshStreamKind, SSH_STREAM_ACCEPTED=0, SSH_STREAM_DIALED)
 Which transport a slot's byte stream belongs to.
void protocore_ssh_network_claim (const uint8_t *work)
void protocore_ssh_network_release (const uint8_t *work)
void protocore_ssh_network_slot_free (const uint8_t *work)
void protocore_ssh_network_owns (const uint8_t *work)
void protocore_ssh_network_tx_drain (const uint8_t *work)
void protocore_ssh_network_emit (const uint8_t *work)
void protocore_ssh_network_write_msg (const uint8_t *work)
void protocore_ssh_network_payload_region (const uint8_t *work)
void protocore_ssh_network_write_msg_at (const uint8_t *work)
void protocore_ssh_network_chan_open (uint8_t *work)
void protocore_ssh_network_chan_adopt (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_chan_read (uint8_t *work)
void protocore_ssh_network_chan_avail (uint8_t *work)
void protocore_ssh_network_chan_drained (uint8_t *work)
void protocore_ssh_network_chan_close (uint8_t *work)
void protocore_ssh_network_chan_close_all (uint8_t *work)
uint8_t * protocore_ssh_network_span (void)
 The PROTOCORE_SSH_NETWORK_BORROW bytes this module's state lives in.
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.

Variables

SshNetworkVars SshNetworkV
 The operands and the outcome.

Detailed Description

Decoupled stream I/O: ring buffer in, framed bytes out, one SSH slot per socket.

Definition in file network.h.

Function Documentation

◆ EMBED_ENUM_BYTE()

EMBED_ENUM_BYTE ( SshStreamKind ,
SSH_STREAM_ACCEPTED = 0,
SSH_STREAM_DIALED  )

Which transport a slot's byte stream belongs to.

RFC 4253 sec 4: "SSH works over any 8-bit clean, binary-transparent transport", and sec 4 gives the two ends different ones - the listening role's stream is a socket this end accepted, the initiating role's is one it dialled. They are separate pools with separate handle spaces, so the handle alone does not say which array it indexes.

◆ protocore_ssh_network_claim()

void protocore_ssh_network_claim ( const uint8_t * work)

◆ protocore_ssh_network_release()

void protocore_ssh_network_release ( const uint8_t * work)

◆ protocore_ssh_network_slot_free()

void protocore_ssh_network_slot_free ( const uint8_t * work)

◆ protocore_ssh_network_owns()

void protocore_ssh_network_owns ( const uint8_t * work)

◆ protocore_ssh_network_tx_drain()

void protocore_ssh_network_tx_drain ( const uint8_t * work)

◆ protocore_ssh_network_emit()

void protocore_ssh_network_emit ( const uint8_t * work)

◆ protocore_ssh_network_write_msg()

void protocore_ssh_network_write_msg ( const uint8_t * work)

◆ protocore_ssh_network_payload_region()

void protocore_ssh_network_payload_region ( const uint8_t * work)

◆ protocore_ssh_network_write_msg_at()

void protocore_ssh_network_write_msg_at ( const uint8_t * work)

◆ protocore_ssh_network_chan_open()

void protocore_ssh_network_chan_open ( uint8_t * work)

◆ protocore_ssh_network_chan_adopt()

void protocore_ssh_network_chan_adopt ( uint8_t * work)

◆ protocore_ssh_network_chan_by_cid()

void protocore_ssh_network_chan_by_cid ( uint8_t * work)

◆ protocore_ssh_network_chan_write()

void protocore_ssh_network_chan_write ( uint8_t * work)

◆ protocore_ssh_network_chan_read()

void protocore_ssh_network_chan_read ( uint8_t * work)

◆ protocore_ssh_network_chan_avail()

void protocore_ssh_network_chan_avail ( uint8_t * work)

◆ protocore_ssh_network_chan_drained()

void protocore_ssh_network_chan_drained ( uint8_t * work)

◆ protocore_ssh_network_chan_close()

void protocore_ssh_network_chan_close ( uint8_t * work)

◆ protocore_ssh_network_chan_close_all()

◆ protocore_ssh_network_span()

uint8_t * protocore_ssh_network_span ( void )

The PROTOCORE_SSH_NETWORK_BORROW bytes this module's state lives in.

Stated beside the namespace rather than on it: an entry takes a borrow, and this is where that borrow comes from. Taken once from the end of the pool, which no mark and no release walks, so the state lasts the life of the program.

Returns
the span.

◆ ssh_net_version_exchange_send()

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.

Variable Documentation

◆ SshNetworkV

SshNetworkVars SshNetworkV
extern

The operands and the outcome.