mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-08 08:33:39 +08:00
PPP: introduce ppp_set_mppe
Helper function to setup MPPE (Microsoft Point to Point Encryption) for a PPP link. Allows enabling/disabled MPPE itself, enabling/disabling stateless support, and whether we are willing to negotiate 40-bit and/or 128-bit encryptions.
This commit is contained in:
@@ -234,6 +234,21 @@ void ppp_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *pas
|
||||
#endif /* PPP_AUTH_SUPPORT */
|
||||
}
|
||||
|
||||
#if MPPE_SUPPORT
|
||||
/* Set MPPE configuration */
|
||||
void ppp_set_mppe(ppp_pcb *pcb, u8_t flags) {
|
||||
if (flags == PPP_MPPE_DISABLE) {
|
||||
pcb->settings.require_mppe = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
pcb->settings.require_mppe = 1;
|
||||
pcb->settings.refuse_mppe_stateful = !(flags & PPP_MPPE_ALLOW_STATEFUL);
|
||||
pcb->settings.refuse_mppe_40 = !!(flags & PPP_MPPE_REFUSE_40);
|
||||
pcb->settings.refuse_mppe_128 = !!(flags & PPP_MPPE_REFUSE_128);
|
||||
}
|
||||
#endif /* MPPE_SUPPORT */
|
||||
|
||||
#if PPP_NOTIFY_PHASE
|
||||
void ppp_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_phase_cb) {
|
||||
pcb->notify_phase_cb = notify_phase_cb;
|
||||
@@ -658,10 +673,6 @@ ppp_pcb *ppp_new(struct netif *pppif, const struct link_callbacks *callbacks, vo
|
||||
#endif /* PPP_SERVER */
|
||||
#endif /* EAP_SUPPORT */
|
||||
|
||||
#if MPPE_SUPPORT
|
||||
pcb->settings.refuse_mppe_stateful = 1;
|
||||
#endif /* MPPE_SUPPORT */
|
||||
|
||||
pcb->settings.lcp_loopbackfail = LCP_DEFLOOPBACKFAIL;
|
||||
pcb->settings.lcp_echo_interval = LCP_ECHOINTERVAL;
|
||||
pcb->settings.lcp_echo_fails = LCP_MAXECHOFAILS;
|
||||
|
||||
Reference in New Issue
Block a user