From 2e069429c20ab661cfb7f1d4958909da8bae1107 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Tue, 3 Jul 2012 22:03:51 +0200 Subject: [PATCH] removed bool type, replaced by u8_t --- src/netif/ppp/eap.h | 2 +- src/netif/ppp/ipcp.c | 4 ++-- src/netif/ppp/ppp.c | 2 +- src/netif/ppp/ppp.h | 14 -------------- src/netif/ppp/ppp_impl.h | 27 +++++++-------------------- 5 files changed, 11 insertions(+), 38 deletions(-) diff --git a/src/netif/ppp/eap.h b/src/netif/ppp/eap.h index 5ee6daf4..a40a9d39 100644 --- a/src/netif/ppp/eap.h +++ b/src/netif/ppp/eap.h @@ -140,7 +140,7 @@ typedef struct eap_state { int es_savedtime; /* Saved timeout */ int es_rechallenge; /* EAP rechallenge interval */ int es_lwrechallenge; /* SRP lightweight rechallenge inter */ - bool es_usepseudo; /* Use SRP Pseudonym if offered one */ + u8_t es_usepseudo; /* Use SRP Pseudonym if offered one */ int es_usedpseudo; /* Set if we already sent PN */ int es_challen; /* Length of challenge string */ u_char es_challenge[EAP_MAX_CHALLENGE_LENGTH]; diff --git a/src/netif/ppp/ipcp.c b/src/netif/ppp/ipcp.c index 9445c63e..fd411f6d 100644 --- a/src/netif/ppp/ipcp.c +++ b/src/netif/ppp/ipcp.c @@ -306,7 +306,7 @@ struct protent ipcp_protent = { #endif /* DEMAND_SUPPORT */ }; -static void ipcp_clear_addrs(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t hisaddr, bool replacedefaultroute); +static void ipcp_clear_addrs(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t hisaddr, u8_t replacedefaultroute); /* * Lengths of configuration options. @@ -2014,7 +2014,7 @@ static void ipcp_down(fsm *f) { * ipcp_clear_addrs() - clear the interface addresses, routes, * proxy arp entries, etc. */ -static void ipcp_clear_addrs(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t hisaddr, bool replacedefaultroute) { +static void ipcp_clear_addrs(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t hisaddr, u8_t replacedefaultroute) { if (pcb->proxy_arp_set) { cifproxyarp(pcb, hisaddr); diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index feaa965f..3f4612ef 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -2032,7 +2032,7 @@ int netif_get_mtu(ppp_pcb *pcb) { * and then changes the temporary addresses to the addresses for the real * ppp connection when it has come up. */ -int sifdefaultroute(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t gateway, bool replace) { +int sifdefaultroute(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t gateway, u8_t replace) { LWIP_UNUSED_ARG(ouraddr); LWIP_UNUSED_ARG(gateway); diff --git a/src/netif/ppp/ppp.h b/src/netif/ppp/ppp.h index 68d69812..cc8ad0ff 100644 --- a/src/netif/ppp/ppp.h +++ b/src/netif/ppp/ppp.h @@ -79,20 +79,6 @@ #endif /* PPPOS_SUPPORT */ -#ifndef __u_char_defined - -/* Type definitions for BSD code. */ -typedef unsigned long u_long; -typedef unsigned int u_int; -typedef unsigned short u_short; -typedef unsigned char u_char; - -#endif - -#ifndef bool -typedef unsigned char bool; -#endif - /************************* *** PUBLIC DEFINITIONS *** *************************/ diff --git a/src/netif/ppp/ppp_impl.h b/src/netif/ppp/ppp_impl.h index 8ced5819..b19b88a7 100644 --- a/src/netif/ppp/ppp_impl.h +++ b/src/netif/ppp/ppp_impl.h @@ -134,19 +134,6 @@ u16_t ppp_get_fcs(u8_t byte); #define PPP_FCS(fcs, c) (((fcs) >> 8) ^ ppp_get_fcs(((fcs) ^ (c)) & 0xff)) #endif -/* - * A 32-bit unsigned integral type. - */ - -#if !defined(__BIT_TYPES_DEFINED__) && !defined(_BITYPES) \ - && !defined(__FreeBSD__) && (NS_TARGET < 40) -#ifdef UINT32_T -typedef UINT32_T u_int32_t; -#else -typedef unsigned int u_int32_t; -typedef unsigned short u_int16_t; -#endif -#endif /* * What to do with network protocol (NP) packets. @@ -238,11 +225,11 @@ struct ppp_idle { * Global variables. */ #ifdef HAVE_MULTILINK -extern bool multilink; /* enable multilink operation */ -extern bool doing_multilink; -extern bool multilink_master; -extern bool bundle_eof; -extern bool bundle_terminating; +extern u8_t multilink; /* enable multilink operation */ +extern u8_t doing_multilink; +extern u8_t multilink_master; +extern u8_t bundle_eof; +extern u8_t bundle_terminating; #endif #ifdef MAXOCTETS @@ -292,7 +279,7 @@ struct protent { */ /* Process a received data packet */ void (*datainput) (ppp_pcb *pcb, u_char *pkt, int len); - bool enabled_flag; /* 0 if protocol is disabled */ + u8_t enabled_flag; /* 0 if protocol is disabled */ #if PRINTPKT_SUPPORT char *name; /* Text name of protocol */ char *data_name; /* Text name of corresponding data protocol */ @@ -429,7 +416,7 @@ int sifnpmode(ppp_pcb *pcb, int proto, enum NPmode mode); void netif_set_mtu(ppp_pcb *pcb, int mtu); int netif_get_mtu(ppp_pcb *pcb); -int sifdefaultroute(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t gateway, bool replace); +int sifdefaultroute(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t gateway, u8_t replace); int cifdefaultroute(ppp_pcb *pcb, u_int32_t ouraddr, u_int32_t gateway); int sifproxyarp(ppp_pcb *pcb, u_int32_t his_adr);