summaryrefslogtreecommitdiffstats
path: root/gatchat/ppp.h
diff options
context:
space:
mode:
authorKristen Carlson Accardi <kristen@linux.intel.com>2010-04-13 08:17:17 -0700
committerDenis Kenzior <denkenz@gmail.com>2010-04-14 17:16:03 -0500
commit60643ee287fcfd1077bfcf917f4419687142998a (patch)
tree70c9b3a73b3483ecff47f56ed436b988e61f0346 /gatchat/ppp.h
parent962d2fff509e251ae715875e89e5a080a37ab588 (diff)
downloadofono-60643ee287fcfd1077bfcf917f4419687142998a.tar.bz2
ppp: nak unknown auth protocol
If we are sent a Config-Request for an auth proto other than CHAP with MD5, send a NAK.
Diffstat (limited to 'gatchat/ppp.h')
-rw-r--r--gatchat/ppp.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/gatchat/ppp.h b/gatchat/ppp.h
index 70451620..a8a04867 100644
--- a/gatchat/ppp.h
+++ b/gatchat/ppp.h
@@ -25,6 +25,7 @@
#define CHAP_PROTOCOL 0xc223
#define IPCP_PROTO 0x8021
#define PPP_IP_PROTO 0x0021
+#define MD5 5
enum ppp_phase {
PPP_PHASE_DEAD = 0, /* Link dead */
@@ -62,12 +63,21 @@ static inline guint16 __get_unaligned_short(const void *p)
return ptr->s;
}
+static inline void __put_unaligned_short(void *p, guint16 val)
+{
+ struct packed_short *ptr = p;
+ ptr->s = val;
+}
+
#define get_host_long(p) \
(ntohl(__get_unaligned_long(p)))
#define get_host_short(p) \
(ntohs(__get_unaligned_short(p)))
+#define put_network_short(p, val) \
+ (__put_unaligned_short(p, htons(val)))
+
#define ppp_info(packet) \
(packet + 4)