summaryrefslogtreecommitdiffstats
path: root/gatchat/ppp.h
diff options
context:
space:
mode:
authorPhilip Paeps <philip@paeps.cx>2014-06-19 12:07:05 +0200
committerDenis Kenzior <denkenz@gmail.com>2014-06-21 11:50:34 -0500
commita88662d23c45f49d9af5a508d4d0a778950b2420 (patch)
tree493246fd2c2789995a6530ca8f379e6a4ed402c8 /gatchat/ppp.h
parent1dd85809307b200bfe87e6a71c68fa244cb15bc6 (diff)
downloadofono-a88662d23c45f49d9af5a508d4d0a778950b2420.tar.bz2
gatchat: implement PAP authentication
Make the authentication method configurable, CHAP or PAP, defaulting to CHAP (i.e.: previous behaviour). Implementation details: o If PAP is configured, we NAK the CHAP authentication protocol option in LCP configuration requests and suggest PAP instead. This works around the amusing requirement of 3GPP TS 29.061 that modems must send a forced positive acknowledgement of the authentication method tried (i.e.: the modem will successfully accept any CHAP handshake, but if the network only supports PAP, the modem will hang up when it tries and fails to activate the PDP context) o The PAP Authenticate-Request is resent a hard-coded three times at ten-second intervals. This may be a bit too persistent. Chances are if it doesn't work the first time, it'll never work, but the RFC insists that we MUST retry.
Diffstat (limited to 'gatchat/ppp.h')
-rw-r--r--gatchat/ppp.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gatchat/ppp.h b/gatchat/ppp.h
index 718575b3..ac1a7ef2 100644
--- a/gatchat/ppp.h
+++ b/gatchat/ppp.h
@@ -22,6 +22,7 @@
#include "ppp_cp.h"
#define LCP_PROTOCOL 0xc021
+#define PAP_PROTOCOL 0xc023
#define CHAP_PROTOCOL 0xc223
#define IPCP_PROTO 0x8021
#define IPV6CP_PROTO 0x8057
@@ -38,6 +39,7 @@
struct ppp_chap;
struct ppp_net;
+struct ppp_pap;
struct ppp_header {
guint8 address;
@@ -109,6 +111,13 @@ void ppp_chap_free(struct ppp_chap *chap);
void ppp_chap_process_packet(struct ppp_chap *chap, const guint8 *new_packet,
gsize len);
+/* PAP related functions */
+struct ppp_pap *ppp_pap_new(GAtPPP *ppp);
+void ppp_pap_free(struct ppp_pap *pap);
+gboolean ppp_pap_start(struct ppp_pap *pap);
+void ppp_pap_process_packet(struct ppp_pap *pap, const guint8 *new_packet,
+ gsize len);
+
/* TUN / Network related functions */
struct ppp_net *ppp_net_new(GAtPPP *ppp, int fd);
const char *ppp_net_get_interface(struct ppp_net *net);