From 5e73068e09463ab420abcdba8cb10cf0b3d2b01c Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Wed, 18 Feb 2015 21:59:08 +0100 Subject: [PATCH] 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. --- src/include/netif/ppp/ppp_impl.h | 10 +++++++--- src/netif/ppp/ccp.c | 2 ++ src/netif/ppp/chap-new.c | 2 ++ src/netif/ppp/eap.c | 2 ++ src/netif/ppp/ecp.c | 2 ++ src/netif/ppp/ipcp.c | 2 ++ src/netif/ppp/ipv6cp.c | 2 ++ src/netif/ppp/lcp.c | 2 ++ src/netif/ppp/upap.c | 2 ++ 9 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/include/netif/ppp/ppp_impl.h b/src/include/netif/ppp/ppp_impl.h index c342778f..092e7141 100644 --- a/src/include/netif/ppp/ppp_impl.h +++ b/src/include/netif/ppp/ppp_impl.h @@ -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 */ diff --git a/src/netif/ppp/ccp.c b/src/netif/ppp/ccp.c index ff7e546c..9fdb7b70 100644 --- a/src/netif/ppp/ccp.c +++ b/src/netif/ppp/ccp.c @@ -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", diff --git a/src/netif/ppp/chap-new.c b/src/netif/ppp/chap-new.c index 4a4e910d..d72f717b 100644 --- a/src/netif/ppp/chap-new.c +++ b/src/netif/ppp/chap-new.c @@ -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 */ diff --git a/src/netif/ppp/eap.c b/src/netif/ppp/eap.c index a118c76e..2169be70 100644 --- a/src/netif/ppp/eap.c +++ b/src/netif/ppp/eap.c @@ -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 */ diff --git a/src/netif/ppp/ecp.c b/src/netif/ppp/ecp.c index fcc97e08..949e196a 100644 --- a/src/netif/ppp/ecp.c +++ b/src/netif/ppp/ecp.c @@ -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", diff --git a/src/netif/ppp/ipcp.c b/src/netif/ppp/ipcp.c index f22346cc..14f2a27a 100644 --- a/src/netif/ppp/ipcp.c +++ b/src/netif/ppp/ipcp.c @@ -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", diff --git a/src/netif/ppp/ipv6cp.c b/src/netif/ppp/ipv6cp.c index 72470670..cfa1336e 100644 --- a/src/netif/ppp/ipv6cp.c +++ b/src/netif/ppp/ipv6cp.c @@ -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", diff --git a/src/netif/ppp/lcp.c b/src/netif/ppp/lcp.c index 042729c9..e302e4d6 100644 --- a/src/netif/ppp/lcp.c +++ b/src/netif/ppp/lcp.c @@ -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, diff --git a/src/netif/ppp/upap.c b/src/netif/ppp/upap.c index efb6fc30..cdc9ce34 100644 --- a/src/netif/ppp/upap.c +++ b/src/netif/ppp/upap.c @@ -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,