mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-04-09 21:44:21 +00:00
protent table moved to our PPP impl
This commit is contained in:
parent
7f9fea18ae
commit
4dd297cef2
@ -266,6 +266,7 @@ extern char *getlogin __P((void));
|
|||||||
#define setlogmask(x)
|
#define setlogmask(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
/*
|
/*
|
||||||
* PPP Data Link Layer "protocol" table.
|
* PPP Data Link Layer "protocol" table.
|
||||||
* One entry per supported protocol.
|
* One entry per supported protocol.
|
||||||
@ -300,7 +301,7 @@ struct protent *protocols[] = {
|
|||||||
#endif /* EAP_SUPPORT */
|
#endif /* EAP_SUPPORT */
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/*
|
/*
|
||||||
|
@ -412,6 +412,7 @@ extern int option_priority; /* priority of current options */
|
|||||||
#define PHASE_HOLDOFF 11
|
#define PHASE_HOLDOFF 11
|
||||||
#define PHASE_MASTER 12
|
#define PHASE_MASTER 12
|
||||||
|
|
||||||
|
#if 0
|
||||||
/*
|
/*
|
||||||
* The following struct gives the addresses of procedures to call
|
* The following struct gives the addresses of procedures to call
|
||||||
* for a particular protocol.
|
* for a particular protocol.
|
||||||
@ -463,6 +464,7 @@ struct protent {
|
|||||||
|
|
||||||
/* Table of pointers to supported protocols */
|
/* Table of pointers to supported protocols */
|
||||||
extern struct protent *protocols[];
|
extern struct protent *protocols[];
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This struct contains pointers to a set of procedures for
|
* This struct contains pointers to a set of procedures for
|
||||||
|
@ -11,17 +11,33 @@
|
|||||||
#include "lwip/stats.h"
|
#include "lwip/stats.h"
|
||||||
#include "lwip/sys.h"
|
#include "lwip/sys.h"
|
||||||
|
|
||||||
|
#if PPPOE_SUPPORT
|
||||||
|
#include "netif/ppp_oe.h"
|
||||||
|
#endif /* PPPOE_SUPPORT */
|
||||||
|
|
||||||
#include "pppd.h"
|
#include "pppd.h"
|
||||||
|
#include "pppdebug.h"
|
||||||
|
#include "pppmy.h"
|
||||||
|
|
||||||
#include "fsm.h"
|
#include "fsm.h"
|
||||||
#include "lcp.h"
|
#include "lcp.h"
|
||||||
#include "ipcp.h"
|
#include "ipcp.h"
|
||||||
|
|
||||||
#include "pppdebug.h"
|
#if PAP_SUPPORT
|
||||||
#include "pppmy.h"
|
#include "upap.h"
|
||||||
|
#endif /* PAP_SUPPORT */
|
||||||
#if PPPOE_SUPPORT
|
#if CHAP_SUPPORT
|
||||||
#include "netif/ppp_oe.h"
|
#include "chap-new.h"
|
||||||
#endif /* PPPOE_SUPPORT */
|
#endif /* CHAP_SUPPORT */
|
||||||
|
#if EAP_SUPPORT
|
||||||
|
#include "eap.h"
|
||||||
|
#endif /* EAP_SUPPORT */
|
||||||
|
#if CCP_SUPPORT
|
||||||
|
#include "ccp.h"
|
||||||
|
#endif /* EAP_SUPPORT */
|
||||||
|
#if ECP_SUPPORT
|
||||||
|
#include "ecp.h"
|
||||||
|
#endif /* EAP_SUPPORT */
|
||||||
|
|
||||||
/* FIXME: add a phase per PPP session */
|
/* FIXME: add a phase per PPP session */
|
||||||
int phase; /* where the link is at */
|
int phase; /* where the link is at */
|
||||||
@ -35,6 +51,41 @@ unsigned link_connect_time;
|
|||||||
int link_stats_valid;
|
int link_stats_valid;
|
||||||
#endif /* PPP_STATS_SUPPORT */
|
#endif /* PPP_STATS_SUPPORT */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PPP Data Link Layer "protocol" table.
|
||||||
|
* One entry per supported protocol.
|
||||||
|
* The last entry must be NULL.
|
||||||
|
*/
|
||||||
|
struct protent *protocols[] = {
|
||||||
|
&lcp_protent,
|
||||||
|
#if PAP_SUPPORT
|
||||||
|
&pap_protent,
|
||||||
|
#endif /* PAP_SUPPORT */
|
||||||
|
#if CHAP_SUPPORT
|
||||||
|
&chap_protent,
|
||||||
|
#endif /* CHAP_SUPPORT */
|
||||||
|
#if CBCP_SUPPORT
|
||||||
|
&cbcp_protent,
|
||||||
|
#endif
|
||||||
|
&ipcp_protent,
|
||||||
|
#ifdef INET6
|
||||||
|
&ipv6cp_protent,
|
||||||
|
#endif
|
||||||
|
#if CCP_SUPPORT
|
||||||
|
&ccp_protent,
|
||||||
|
#endif /* CCP_SUPPORT */
|
||||||
|
#if ECP_SUPPORT
|
||||||
|
&ecp_protent,
|
||||||
|
#endif /* ECP_SUPPORT */
|
||||||
|
#ifdef AT_CHANGE
|
||||||
|
&atcp_protent,
|
||||||
|
#endif
|
||||||
|
#if EAP_SUPPORT
|
||||||
|
&eap_protent,
|
||||||
|
#endif /* EAP_SUPPORT */
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
/* PPP packet parser states. Current state indicates operation yet to be
|
/* PPP packet parser states. Current state indicates operation yet to be
|
||||||
* completed. */
|
* completed. */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -21,6 +21,57 @@
|
|||||||
typedef unsigned char bool;
|
typedef unsigned char bool;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following struct gives the addresses of procedures to call
|
||||||
|
* for a particular protocol.
|
||||||
|
*/
|
||||||
|
struct protent {
|
||||||
|
u_short protocol; /* PPP protocol number */
|
||||||
|
/* Initialization procedure */
|
||||||
|
void (*init) __P((int unit));
|
||||||
|
/* Process a received packet */
|
||||||
|
void (*input) __P((int unit, u_char *pkt, int len));
|
||||||
|
/* Process a received protocol-reject */
|
||||||
|
void (*protrej) __P((int unit));
|
||||||
|
/* Lower layer has come up */
|
||||||
|
void (*lowerup) __P((int unit));
|
||||||
|
/* Lower layer has gone down */
|
||||||
|
void (*lowerdown) __P((int unit));
|
||||||
|
/* Open the protocol */
|
||||||
|
void (*open) __P((int unit));
|
||||||
|
/* Close the protocol */
|
||||||
|
void (*close) __P((int unit, char *reason));
|
||||||
|
#if PRINTPKT_SUPPORT
|
||||||
|
/* Print a packet in readable form */
|
||||||
|
int (*printpkt) __P((u_char *pkt, int len,
|
||||||
|
void (*printer) __P((void *, char *, ...)),
|
||||||
|
void *arg));
|
||||||
|
#endif /* PRINTPKT_SUPPORT */
|
||||||
|
/* FIXME: data input is only used by CCP, which is not supported at this time,
|
||||||
|
* should we remove this entry and save some flash ?
|
||||||
|
*/
|
||||||
|
/* Process a received data packet */
|
||||||
|
void (*datainput) __P((int unit, u_char *pkt, int len));
|
||||||
|
bool enabled_flag; /* 0 iff protocol is disabled */
|
||||||
|
#if PRINTPKT_SUPPORT
|
||||||
|
char *name; /* Text name of protocol */
|
||||||
|
char *data_name; /* Text name of corresponding data protocol */
|
||||||
|
#endif /* PRINTPKT_SUPPORT */
|
||||||
|
#if PPP_OPTIONS
|
||||||
|
option_t *options; /* List of command-line options */
|
||||||
|
/* Check requested options, assign defaults */
|
||||||
|
void (*check_options) __P((void));
|
||||||
|
#endif /* PPP_OPTIONS */
|
||||||
|
#if DEMAND_SUPPORT
|
||||||
|
/* Configure interface for demand-dial */
|
||||||
|
int (*demand_conf) __P((int unit));
|
||||||
|
/* Say whether to bring up link for this pkt */
|
||||||
|
int (*active_pkt) __P((u_char *pkt, int len));
|
||||||
|
#endif /* DEMAND_SUPPORT */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Table of pointers to supported protocols */
|
||||||
|
extern struct protent *protocols[];
|
||||||
|
|
||||||
|
|
||||||
/*************************
|
/*************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user