5.6.1. network_interface_slip — Serial Link Internet Protocol

Serial Line Internet Protocol (SLIP) is a link layer internet protocol used to transfer TCP/IP packets over a point-to-point serial line.

It is documented in RFC 1055.


Source code: src/inet/network_interface/slip.h

Example code: examples/inet/slip/main.c


Defines

NETWORK_INTERFACE_SLIP_FRAME_SIZE_MAX

Enums

enum network_interface_slip_state_t

Values:

NETWORK_INTERFACE_SLIP_STATE_NORMAL = 0
NETWORK_INTERFACE_SLIP_STATE_ESCAPE

Functions

int network_interface_slip_module_init(void)

Initialize the slip module.

Return
zero(0) or negative error code.

int network_interface_slip_init(struct network_interface_slip_t *self_p, struct inet_ip_addr_t *ipaddr_p, struct inet_ip_addr_t *netmask_p, struct inet_ip_addr_t *gateway_p, void *chout_p)

Initialize given slip network interface with given configuration and output channel.

Return
zero(0) or negative error code.
Parameters
  • self_p -

    Slip to initialize.

  • ipaddr_p -

    Network interface IP address.

  • netmask_p -

    Network interface netmask.

  • gateway_p -

    Network interface gateway.

  • chout_p -

    Output channel.

int network_interface_slip_input(struct network_interface_slip_t *self_p, uint8_t data)

Input a byte into the SLIP IP stack. Normally a user thread reads one byte at a time from the UART and calls this functions with the read byte as argument.

Return
Number of bytes written to the input frame or negative error code.
Parameters
  • self_p -

    Slip to initialize.

  • data -

    Byte to input into the stack.

struct network_interface_slip_t

Public Members

network_interface_slip_state_t state
struct pbuf *pbuf_p
uint8_t *buf_p
size_t size
struct network_interface_slip_t::@52 network_interface_slip_t::frame
void *chout_p
struct network_interface_t network_interface