PPP, CCP, added receive and transmit chosen protocols in ccp_flags_set() (renamed ccp_set())

We need to know which methods were chosen when CCP is up, this used to be done
using ccp_test() which we are in the process of removing.

Using non-existing method 0 instead of -1 in CCP for unset method, allowing
type change from s16_t to u8_t for method.
This commit is contained in:
Sylvain Rochet
2015-04-19 13:51:35 +02:00
parent a5503df32b
commit ffb10e7aac
4 changed files with 14 additions and 12 deletions

View File

@@ -152,7 +152,7 @@ typedef struct ccp_options {
#if DEFLATE_SUPPORT
u_short deflate_size; /* lg(window size) for Deflate */
#endif /* DEFLATE_SUPPORT */
short method; /* code for chosen compression method */
u8_t method; /* code for chosen compression method */
} ccp_options;
extern const struct protent ccp_protent;

View File

@@ -475,7 +475,7 @@ int netif_get_mtu(ppp_pcb *pcb);
#if CCP_SUPPORT
int ccp_test(ppp_pcb *pcb, u_char *opt_ptr, int opt_len, int for_transmit);
void ccp_flags_set(ppp_pcb *pcb, int isopen, int isup);
void ccp_set(ppp_pcb *pcb, u8_t isopen, u8_t isup, u8_t receive_method, u8_t transmit_method);
int ccp_fatal_error(ppp_pcb *pcb);
#endif /* CCP_SUPPORT */