34 |
#ifndef PPP_H |
#ifndef PPP_H |
35 |
#define PPP_H |
#define PPP_H |
36 |
|
|
37 |
#include "target.h" |
#include "lwip/opt.h" |
38 |
|
|
39 |
#if PPP_SUPPORT > 0 |
#if PPP_SUPPORT > 0 |
40 |
|
#include "lwip/sio.h" |
41 |
|
#include "lwip/api.h" |
42 |
|
#include "lwip/sockets.h" |
43 |
|
#include "lwip/stats.h" |
44 |
|
#include "lwip/mem.h" |
45 |
|
#include "lwip/tcpip.h" |
46 |
|
#include "lwip/netif.h" |
47 |
|
|
48 |
/* |
/* |
49 |
* pppd.h - PPP daemon global declarations. |
* pppd.h - PPP daemon global declarations. |
50 |
* |
* |
91 |
* OR MODIFICATIONS. |
* OR MODIFICATIONS. |
92 |
*/ |
*/ |
93 |
|
|
94 |
|
#define TIMEOUT(f, a, t) sys_untimeout((f), (a)), sys_timeout((t)*1000, (f), (a)) |
95 |
|
#define UNTIMEOUT(f, a) sys_untimeout((f), (a)) |
96 |
|
|
97 |
|
|
98 |
|
# ifndef __u_char_defined |
99 |
|
|
100 |
|
/* Type definitions for BSD code. */ |
101 |
|
typedef unsigned long u_long; |
102 |
|
typedef unsigned int u_int; |
103 |
|
typedef unsigned short u_short; |
104 |
|
typedef unsigned char u_char; |
105 |
|
|
106 |
|
#endif |
107 |
|
|
108 |
/* |
/* |
109 |
* Constants and structures defined by the internet system, |
* Constants and structures defined by the internet system, |
110 |
* Per RFC 790, September 1981, and numerous additions. |
* Per RFC 790, September 1981, and numerous additions. |
219 |
PUTCHAR(PPP_UI, p); \ |
PUTCHAR(PPP_UI, p); \ |
220 |
PUTSHORT(t, p); } |
PUTSHORT(t, p); } |
221 |
|
|
|
/* |
|
|
* Definitions of bits in internet address integers. |
|
|
* On subnets, the decomposition of addresses to host and net parts |
|
|
* is done according to subnet mask, not the masks here. |
|
|
*/ |
|
|
#define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0) |
|
|
#define IN_CLASSA_NET 0xff000000 |
|
|
#define IN_CLASSA_NSHIFT 24 |
|
|
#define IN_CLASSA_HOST 0x00ffffff |
|
|
#define IN_CLASSA_MAX 128 |
|
|
|
|
|
#define IN_CLASSB(i) (((long)(i) & 0xc0000000) == 0x80000000) |
|
|
#define IN_CLASSB_NET 0xffff0000 |
|
|
#define IN_CLASSB_NSHIFT 16 |
|
|
#define IN_CLASSB_HOST 0x0000ffff |
|
|
#define IN_CLASSB_MAX 65536 |
|
|
|
|
|
#define IN_CLASSC(i) (((long)(i) & 0xe0000000) == 0xc0000000) |
|
|
#define IN_CLASSC_NET 0xffffff00 |
|
|
#define IN_CLASSC_NSHIFT 8 |
|
|
#define IN_CLASSC_HOST 0x000000ff |
|
|
|
|
|
#define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000) |
|
|
#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ |
|
|
#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ |
|
|
#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ |
|
|
#define IN_MULTICAST(i) IN_CLASSD(i) |
|
|
|
|
|
#define IN_EXPERIMENTAL(i) (((long)(i) & 0xf0000000) == 0xf0000000) |
|
|
#define IN_BADCLASS(i) (((long)(i) & 0xf0000000) == 0xf0000000) |
|
|
|
|
|
#define IN_LOOPBACKNET 127 /* official! */ |
|
|
|
|
|
|
|
222 |
/************************* |
/************************* |
223 |
*** PUBLIC DEFINITIONS *** |
*** PUBLIC DEFINITIONS *** |
224 |
*************************/ |
*************************/ |
346 |
* Return a new PPP connection descriptor on success or |
* Return a new PPP connection descriptor on success or |
347 |
* an error code (negative) on failure. |
* an error code (negative) on failure. |
348 |
*/ |
*/ |
349 |
int pppOpen(ppp_sio_fd_t fd, void (*linkStatusCB)(void *arg, int errCode), void *linkStatusArg); |
int pppOpen(sio_fd_t fd, void (*linkStatusCB)(void *arg, int errCode), void *linkStatusArg); |
350 |
|
|
351 |
/* |
/* |
352 |
* Close a PPP connection and release the descriptor. |
* Close a PPP connection and release the descriptor. |
398 |
/* Configure i/f down (for IP) */ |
/* Configure i/f down (for IP) */ |
399 |
int sifdown (int); |
int sifdown (int); |
400 |
/* Configure IP addresses for i/f */ |
/* Configure IP addresses for i/f */ |
401 |
int sifaddr (int, u32_t, u32_t, u32_t); |
int sifaddr (int, u32_t, u32_t, u32_t, u32_t, u32_t); |
402 |
/* Reset i/f IP addresses */ |
/* Reset i/f IP addresses */ |
403 |
int cifaddr (int, u32_t, u32_t); |
int cifaddr (int, u32_t, u32_t); |
404 |
/* Create default route through i/f */ |
/* Create default route through i/f */ |