KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
ppp.h File Reference

PPP interface for network communications. More...

#include <sys/cdefs.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/queue.h>

Go to the source code of this file.

Data Structures

struct  ppp_device_t
 PPP device structure. More...
 
struct  ppp_protocol_t
 PPP Protocol structure. More...
 

Macros

#define PPP_TX_END_OF_PKT   0x00000001
 End of packet flag.
 
#define PPP_PROTO_ENTRY_INIT   { NULL, NULL }
 Static initializer for protocol list entry.
 
#define PPP_PHASE_DEAD   0x01
 Pre-connection.
 
#define PPP_PHASE_ESTABLISH   0x02
 Establishing connection.
 
#define PPP_PHASE_AUTHENTICATE   0x03
 Authentication to peer.
 
#define PPP_PHASE_NETWORK   0x04
 Established and working.
 
#define PPP_PHASE_TERMINATE   0x05
 Tearing down the link.
 
#define PPP_FLAG_AUTH_PAP   0x00000001
 PAP authentication.
 
#define PPP_FLAG_AUTH_CHAP   0x00000002
 CHAP authentication.
 
#define PPP_FLAG_PCOMP   0x00000004
 Protocol compression.
 
#define PPP_FLAG_ACCOMP   0x00000008
 Addr/ctrl compression.
 
#define PPP_FLAG_MAGIC_NUMBER   0x00000010
 Use magic numbers.
 
#define PPP_FLAG_WANT_MRU   0x00000020
 Specify MRU.
 
#define PPP_FLAG_NO_ACCM   0x00000040
 No ctl character map.
 

Functions

int ppp_set_device (ppp_device_t *dev)
 Set the device used to do PPP communications.
 
int ppp_set_login (const char *username, const char *password)
 Set the login credentials used to authenticate to the peer.
 
int ppp_send (const uint8_t *data, size_t len, uint16_t proto)
 Send a packet on the PPP link.
 
int ppp_add_protocol (ppp_protocol_t *hnd)
 Register a protocol with the PPP stack.
 
int ppp_del_protocol (ppp_protocol_t *hnd)
 Unregister a protocol from the PPP stack.
 
int ppp_lcp_send_proto_reject (uint16_t proto, const uint8_t *pkt, size_t len)
 Send a Protocol Reject packet on the link.
 
uint32_t ppp_get_flags (void)
 Get the flags set for our side of the link.
 
uint32_t ppp_get_peer_flags (void)
 Get the flags set for the peer's side of the link.
 
void ppp_set_flags (uint32_t flags)
 Set the flags set for our side of the link.
 
int ppp_connect (void)
 Establish a point-to-point link across a previously set-up device.
 
int ppp_scif_init (int bps)
 Initialize the Dreamcast serial port for a PPP link.
 
int ppp_modem_init (const char *number, int blind, int *conn_rate)
 Initialize the Dreamcast modem for a PPP link.
 
int ppp_init (void)
 Initialize the PPP library.
 
int ppp_shutdown (void)
 Shut down the PPP library.
 

Detailed Description

PPP interface for network communications.

This file defines the API provided by libppp to interact with the PPP stack. PPP is a network communication protocol used to establish a direct link between two peers. It is most commonly used as the data link layer protocol for dialup internet access, but can also be potentially used on broadband connections (PPP over Ethernet or PPPoE) or on a direct serial line to a computer.

The API presented by this library is designed to be extensible to whatever devices you might want to use it with, and was designed to integrate fairly simply into the rest of KOS' network stack.

Author
Lawrence Sebald