external/ppp
リビジョン | 2e50db22360222a36f5a32eeabdf0daec39c61a9 (tree) |
---|---|
日時 | 2013-12-18 04:02:02 |
作者 | Elliott Hughes <enh@goog...> |
コミッター | Christopher Ferris |
Fix pppd to build with both old and uapi headers.
Bug: 11559337
(cherry picked from commit 5e0738a2d8667ec1ea629649edc4fc5ae453f4a1)
Change-Id: I7a25195e22b3b244e75c9f615c1233e34d92dc4d
@@ -38,6 +38,10 @@ | ||
38 | 38 | #ifndef _PPP_DEFS_H_ |
39 | 39 | #define _PPP_DEFS_H_ |
40 | 40 | |
41 | +#if defined(PPP_ADDRESS) | |
42 | +#define USING_UAPI | |
43 | +#endif | |
44 | + | |
41 | 45 | /* |
42 | 46 | * The basic PPP frame. |
43 | 47 | */ |
@@ -59,9 +63,11 @@ | ||
59 | 63 | #define PPP_MAXMRU 65000 /* Largest MRU we allow */ |
60 | 64 | #define PPP_MINMRU 128 |
61 | 65 | |
66 | +#if !defined(USING_UAPI) | |
62 | 67 | #define PPP_ADDRESS(p) (((u_char *)(p))[0]) |
63 | 68 | #define PPP_CONTROL(p) (((u_char *)(p))[1]) |
64 | 69 | #define PPP_PROTOCOL(p) ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3]) |
70 | +#endif | |
65 | 71 | |
66 | 72 | /* |
67 | 73 | * Significant octet values. |
@@ -124,6 +130,15 @@ typedef u_int32_t ext_accm[8]; | ||
124 | 130 | /* |
125 | 131 | * What to do with network protocol (NP) packets. |
126 | 132 | */ |
133 | +#if defined(USING_UAPI) | |
134 | +/* This stuff isn't in uapi. TODO: is there a newer pppd that doesn't use this? */ | |
135 | +#define ifr__name b.ifr_ifrn.ifrn_name | |
136 | +#define stats_ptr b.ifr_ifru.ifru_data | |
137 | +struct ifpppstatsreq { | |
138 | + struct ifreq b; | |
139 | + struct ppp_stats stats; | |
140 | +}; | |
141 | +#else | |
127 | 142 | enum NPmode { |
128 | 143 | NPMODE_PASS, /* pass the packet through */ |
129 | 144 | NPMODE_DROP, /* silently drop the packet */ |
@@ -183,6 +198,8 @@ struct ppp_idle { | ||
183 | 198 | time_t recv_idle; /* time since last NP packet received */ |
184 | 199 | }; |
185 | 200 | |
201 | +#endif | |
202 | + | |
186 | 203 | #ifndef __P |
187 | 204 | #ifdef __STDC__ |
188 | 205 | #define __P(x) x |
@@ -111,6 +111,7 @@ | ||
111 | 111 | #include <netinet/if_ether.h> |
112 | 112 | #else |
113 | 113 | #include <linux/types.h> |
114 | +#include <linux/tty.h> | |
114 | 115 | #include <linux/if.h> |
115 | 116 | #include <linux/if_arp.h> |
116 | 117 | #include <linux/route.h> |