The Pedigree Project 0.1
Classes | Macros | Enumerations | Functions
slipif.c File Reference
#include "netif/slipif.h"
#include "lwip/opt.h"
#include "lwip/def.h"
#include "lwip/pbuf.h"
#include "lwip/stats.h"
#include "lwip/snmp.h"
#include "lwip/sys.h"
#include "lwip/sio.h"
+ Include dependency graph for slipif.c:

Go to the source code of this file.

Classes

struct  slipif_priv
 

Macros

#define SLIP_END   0xC0 /* 0300: start and end of every packet */
 
#define SLIP_ESC   0xDB /* 0333: escape start (one byte escaped data follows) */
 
#define SLIP_ESC_END   0xDC /* 0334: following escape: original byte is 0xC0 (END) */
 
#define SLIP_ESC_ESC   0xDD /* 0335: following escape: original byte is 0xDB (ESC) */
 
#define SLIP_MAX_SIZE   1500
 
#define SLIP_SIO_SPEED(sio_fd)   0
 

Enumerations

enum  slipif_recv_state { SLIP_RECV_NORMAL , SLIP_RECV_ESCAPE }
 

Functions

err_t slipif_init (struct netif *netif)
 
void slipif_poll (struct netif *netif)
 

Detailed Description

SLIP Interface

Definition in file slipif.c.

Macro Definition Documentation

◆ SLIP_END

#define SLIP_END   0xC0 /* 0300: start and end of every packet */

Definition at line 91 of file slipif.c.

◆ SLIP_ESC

#define SLIP_ESC   0xDB /* 0333: escape start (one byte escaped data follows) */

Definition at line 92 of file slipif.c.

◆ SLIP_ESC_END

#define SLIP_ESC_END   0xDC /* 0334: following escape: original byte is 0xC0 (END) */

Definition at line 93 of file slipif.c.

◆ SLIP_ESC_ESC

#define SLIP_ESC_ESC   0xDD /* 0335: following escape: original byte is 0xDB (ESC) */

Definition at line 94 of file slipif.c.

◆ SLIP_MAX_SIZE

#define SLIP_MAX_SIZE   1500

Maximum packet size that is received by this netif

Definition at line 98 of file slipif.c.

◆ SLIP_SIO_SPEED

#define SLIP_SIO_SPEED (   sio_fd)    0

Define this to the interface speed for SNMP (sio_fd is the sio_fd_t returned by sio_open). The default value of zero means 'unknown'.

Definition at line 106 of file slipif.c.

Enumeration Type Documentation

◆ slipif_recv_state

enum slipif_recv_state

Definition at line 109 of file slipif.c.

Function Documentation

◆ slipif_init()

err_t slipif_init ( struct netif *  netif)

SLIP netif initialization

Call the arch specific sio_open and remember the opened device in the state field of the netif.

Parameters
netifthe lwip network interface structure for this slipif
Returns
ERR_OK if serial line could be opened, ERR_MEM if no memory could be allocated, ERR_IF is serial line couldn't be opened
Note
netif->num must contain the number of the serial port to open (0 by default). If netif->state is != NULL, it is interpreted as an u8_t pointer pointing to the serial port number instead of netif->num.

Definition at line 380 of file slipif.c.

References ERR_IF, ERR_MEM, ERR_OK, LWIP_DEBUGF, mem_free(), mem_malloc(), netif::mtu, netif::name, netif::num, SLIP_DEBUG, SLIP_MAX_SIZE, SLIP_SIO_SPEED, SLIPIF_THREAD_NAME, SLIPIF_THREAD_PRIO, SLIPIF_THREAD_STACKSIZE, netif::state, and sys_thread_new().

◆ slipif_poll()

void slipif_poll ( struct netif *  netif)

Polls the serial device and feeds the IP layer with incoming packets.

Parameters
netifThe lwip network interface structure for this slipif

Definition at line 446 of file slipif.c.

References netif::state.