diff options
Diffstat (limited to 'gatchat/ppp.h')
-rw-r--r-- | gatchat/ppp.h | 10 |
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) |