PPP, CORE, Removed (*datainput) from struct protent if not used

Data input is only used by CCP and ECP, which are not supported at this time,
remove this entry from struct protent to save some flash.
This commit is contained in:
Sylvain Rochet 2015-02-18 21:59:08 +01:00
parent b71d9ce3f6
commit 5e73068e09
9 changed files with 23 additions and 3 deletions

View File

@ -254,6 +254,11 @@ extern int maxoctets_timeout; /* Timeout for check of octets limit */
#define PPP_OCTETS_DIRECTION_MAXSESSION 4
#endif
/* Data input is only used by CCP and ECP, which are not supported at this time,
* remove this entry from struct protent to save some flash
*/
#define PPP_DATAINPUT (CCP_SUPPORT || ECP_SUPPORT)
/*
* The following struct gives the addresses of procedures to call
* for a particular protocol.
@ -280,11 +285,10 @@ struct protent {
void (*printer) (void *, const 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 ?
*/
#if PPP_DATAINPUT
/* Process a received data packet */
void (*datainput) (ppp_pcb *pcb, u_char *pkt, int len);
#endif /* PPP_DATAINPUT */
#if PRINTPKT_SUPPORT
const char *name; /* Text name of protocol */
const char *data_name; /* Text name of corresponding data protocol */

View File

@ -192,7 +192,9 @@ const struct protent ccp_protent = {
#if PRINTPKT_SUPPORT
ccp_printpkt,
#endif /* PRINTPKT_SUPPORT */
#if PPP_DATAINPUT
ccp_datainput,
#endif /* PPP_DATAINPUT */
#if PRINTPKT_SUPPORT
"CCP",
"Compressed",

View File

@ -651,7 +651,9 @@ const struct protent chap_protent = {
#if PRINTPKT_SUPPORT
chap_print_pkt,
#endif /* PRINTPKT_SUPPORT */
#if PPP_DATAINPUT
NULL, /* datainput */
#endif /* PPP_DATAINPUT */
#if PRINTPKT_SUPPORT
"CHAP", /* name */
NULL, /* data_name */

View File

@ -123,7 +123,9 @@ const struct protent eap_protent = {
#if PRINTPKT_SUPPORT
eap_printpkt, /* print a packet in readable form */
#endif /* PRINTPKT_SUPPORT */
#if PPP_DATAINPUT
NULL, /* process a received data packet */
#endif /* PPP_DATAINPUT */
#if PRINTPKT_SUPPORT
"EAP", /* text name of protocol */
NULL, /* text name of corresponding data protocol */

View File

@ -111,7 +111,9 @@ const struct protent ecp_protent = {
#if PRINTPKT_SUPPORT
ecp_printpkt,
#endif /* PRINTPKT_SUPPORT */
#if PPP_DATAINPUT
NULL, /* ecp_datainput, */
#endif /* PPP_DATAINPUT */
#if PRINTPKT_SUPPORT
"ECP",
"Encrypted",

View File

@ -290,7 +290,9 @@ const struct protent ipcp_protent = {
#if PRINTPKT_SUPPORT
ipcp_printpkt,
#endif /* PRINTPKT_SUPPORT */
#if PPP_DATAINPUT
NULL,
#endif /* PPP_DATAINPUT */
#if PRINTPKT_SUPPORT
"IPCP",
"IP",

View File

@ -283,7 +283,9 @@ const struct protent ipv6cp_protent = {
#if PRINTPKT_SUPPORT
ipv6cp_printpkt,
#endif /* PRINTPKT_SUPPORT */
#if PPP_DATAINPUT
NULL,
#endif /* PPP_DATAINPUT */
#if PRINTPKT_SUPPORT
"IPV6CP",
"IPV6",

View File

@ -284,7 +284,9 @@ const struct protent lcp_protent = {
#if PRINTPKT_SUPPORT
lcp_printpkt,
#endif /* PRINTPKT_SUPPORT */
#if PPP_DATAINPUT
NULL,
#endif /* PPP_DATAINPUT */
#if PRINTPKT_SUPPORT
"LCP",
NULL,

View File

@ -101,7 +101,9 @@ const struct protent pap_protent = {
#if PRINTPKT_SUPPORT
upap_printpkt,
#endif /* PRINTPKT_SUPPORT */
#if PPP_DATAINPUT
NULL,
#endif /* PPP_DATAINPUT */
#if PRINTPKT_SUPPORT
"PAP",
NULL,