| | | |
Offset 1, 46 lines modified | Offset 1, 26 lines modified |
1 | .class·public·Lcom/android/networkstack/tethering/PrivateAddressCoordinator; | 1 | .class·public·Lcom/android/networkstack/tethering/PrivateAddressCoordinator; |
2 | .super·Ljava/lang/Object; | 2 | .super·Ljava/lang/Object; |
3 | .source·"PrivateAddressCoordinator.java" | 3 | .source·"PrivateAddressCoordinator.java" |
| |
| |
4 | #·instance·fields | 4 | #·instance·fields |
5 | .field·private·final·mCachedAddresses:Landroid/util/SparseArray; | |
6 | ····.annotation·system·Ldalvik/annotation/Signature; | |
7 | ········value·=·{ | |
8 | ············"Landroid/util/SparseArray<", | |
9 | ············"Landroid/net/LinkAddress;", | |
10 | ············">;" | |
11 | ········} | |
12 | ····.end·annotation | |
13 | .end·field | |
| |
14 | .field·private·final·mConfig:Lcom/android/networkstack/tethering/TetheringConfiguration; | |
| |
15 | .field·private·final·mConnectivityMgr:Landroid/net/ConnectivityManager; | 5 | .field·private·final·mConnectivityMgr:Landroid/net/ConnectivityManager; |
| |
16 | .field·private·final·mDownstreams:Landroid/util/ArraySet; | 6 | .field·private·final·mDownstreams:Landroid/util/ArraySet; |
17 | ····.annotation·system·Ldalvik/annotation/Signature; | 7 | ····.annotation·system·Ldalvik/annotation/Signature; |
18 | ········value·=·{ | 8 | ········value·=·{ |
19 | ············"Landroid/util/ArraySet<", | 9 | ············"Landroid/util/ArraySet<", |
20 | ············"Landroid/net/ip/IpServer;", | 10 | ············"Landroid/net/ip/IpServer;", |
21 | ············">;" | 11 | ············">;" |
22 | ········} | 12 | ········} |
23 | ····.end·annotation | 13 | ····.end·annotation |
24 | .end·field | 14 | .end·field |
| |
25 | .field·private·final·mTetheringPrefixes:Ljava/util/List; | 15 | .field·private·final·mTetheringPrefix:Landroid/net/IpPrefix; |
26 | ····.annotation·system·Ldalvik/annotation/Signature; | |
27 | ········value·=·{ | |
28 | ············"Ljava/util/List<", | |
29 | ············"Landroid/net/IpPrefix;", | |
30 | ············">;" | |
31 | ········} | |
32 | ····.end·annotation | |
33 | .end·field | |
| |
34 | .field·private·final·mUpstreamPrefixMap:Landroid/util/ArrayMap; | 16 | .field·private·final·mUpstreamPrefixMap:Landroid/util/ArrayMap; |
35 | ····.annotation·system·Ldalvik/annotation/Signature; | 17 | ····.annotation·system·Ldalvik/annotation/Signature; |
36 | ········value·=·{ | 18 | ········value·=·{ |
37 | ············"Landroid/util/ArrayMap<", | 19 | ············"Landroid/util/ArrayMap<", |
38 | ············"Landroid/net/Network;", | 20 | ············"Landroid/net/Network;", |
39 | ············"Ljava/util/List<", | 21 | ············"Ljava/util/List<", |
Offset 48, 432 lines modified | Offset 28, 76 lines modified |
48 | ············">;>;" | 28 | ············">;>;" |
49 | ········} | 29 | ········} |
50 | ····.end·annotation | 30 | ····.end·annotation |
51 | .end·field | 31 | .end·field |
| |
| |
52 | #·direct·methods | 32 | #·direct·methods |
53 | .method·public·constructor·<init>(Landroid/content/Context;Lcom/android/networkstack/tethering/TetheringConfiguration;)V | 33 | .method·public·constructor·<init>(Landroid/content/Context;)V |
54 | ····.locals·3 | 34 | ····.locals·2 |
| |
55 | ····.line·82 | 35 | ····.line·74 |
56 | ····invoke-direct·{p0},·Ljava/lang/Object;-><init>()V | 36 | ····invoke-direct·{p0},·Ljava/lang/Object;-><init>()V |
| |
57 | ····.line·83 | 37 | ····.line·75 |
58 | ····new-instance·v0,·Landroid/util/ArraySet; | 38 | ····new-instance·v0,·Landroid/util/ArraySet; |
| |
59 | ····invoke-direct·{v0},·Landroid/util/ArraySet;-><init>()V | 39 | ····invoke-direct·{v0},·Landroid/util/ArraySet;-><init>()V |
| |
60 | ····iput-object·v0,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mDownstreams:Landroid/util/ArraySet; | 40 | ····iput-object·v0,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mDownstreams:Landroid/util/ArraySet; |
| |
61 | ····.line·84 | 41 | ····.line·76 |
62 | ····new-instance·v0,·Landroid/util/ArrayMap; | 42 | ····new-instance·v0,·Landroid/util/ArrayMap; |
| |
63 | ····invoke-direct·{v0},·Landroid/util/ArrayMap;-><init>()V | 43 | ····invoke-direct·{v0},·Landroid/util/ArrayMap;-><init>()V |
| |
64 | ····iput-object·v0,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mUpstreamPrefixMap:Landroid/util/ArrayMap; | 44 | ····iput-object·v0,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mUpstreamPrefixMap:Landroid/util/ArrayMap; |
| |
| 45 | ····.line·77 |
| 46 | ····new-instance·v0,·Landroid/net/IpPrefix; |
| |
| 47 | ····const-string·v1,·"192.168.0.0/16" |
| |
| 48 | ····invoke-direct·{v0,·v1},·Landroid/net/IpPrefix;-><init>(Ljava/lang/String;)V |
| |
| 49 | ····iput-object·v0,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mTetheringPrefix:Landroid/net/IpPrefix; |
| |
65 | ····const-string·v0,·"connectivity" | 50 | ····const-string·v0,·"connectivity" |
| |
66 | ····.line·85 | 51 | ····.line·78 |
67 | ····invoke-virtual·{p1,·v0},·Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; | 52 | ····invoke-virtual·{p1,·v0},·Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; |
| |
68 | ····move-result-object·p1 | 53 | ····move-result-object·p1 |
| |
69 | ····check-cast·p1,·Landroid/net/ConnectivityManager; | 54 | ····check-cast·p1,·Landroid/net/ConnectivityManager; |
| |
70 | ····iput-object·p1,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mConnectivityMgr:Landroid/net/ConnectivityManager; | 55 | ····iput-object·p1,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mConnectivityMgr:Landroid/net/ConnectivityManager; |
| |
71 | ····.line·87 | |
72 | ····iput-object·p2,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mConfig:Lcom/android/networkstack/tethering/TetheringConfiguration; | |
| |
73 | ····.line·88 | |
74 | ····new-instance·p1,·Landroid/util/SparseArray; | |
| |
75 | ····invoke-direct·{p1},·Landroid/util/SparseArray;-><init>()V | |
| |
76 | ····iput-object·p1,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mCachedAddresses:Landroid/util/SparseArray; | |
| |
77 | ····.line·90 | |
78 | ····new-instance·v0,·Landroid/net/LinkAddress; | |
| |
79 | ····const-string·v1,·"192.168.44.1/24" | |
| |
80 | ····invoke-direct·{v0,·v1},·Landroid/net/LinkAddress;-><init>(Ljava/lang/String;)V | |
| |
81 | ····const/4·v1,·0x2 | |
| |
82 | ····invoke-virtual·{p1,·v1,·v0},·Landroid/util/SparseArray;->put(ILjava/lang/Object;)V | |
| |
83 | ····.line·91 | |
84 | ····iget-object·p1,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mCachedAddresses:Landroid/util/SparseArray; | |
| |
85 | ····new-instance·v0,·Landroid/net/LinkAddress; | |
| |
86 | ····const-string·v1,·"192.168.49.1/24" | |
| |
87 | ····invoke-direct·{v0,·v1},·Landroid/net/LinkAddress;-><init>(Ljava/lang/String;)V | |
| |
88 | ····const/4·v1,·0x3 | |
| |
89 | ····invoke-virtual·{p1,·v1,·v0},·Landroid/util/SparseArray;->put(ILjava/lang/Object;)V | |
| |
90 | ····.line·93 | |
91 | ····new-instance·p1,·Ljava/util/ArrayList; | |
| |
92 | ····const/4·v0,·0x1 | |
| |
93 | ····new-array·v0,·v0,·[Landroid/net/IpPrefix; | |
| |
94 | ····new-instance·v1,·Landroid/net/IpPrefix; | |
| |
95 | ····const-string·v2,·"192.168.0.0/16" | |
| |
96 | ····invoke-direct·{v1,·v2},·Landroid/net/IpPrefix;-><init>(Ljava/lang/String;)V | |
| |
97 | ····const/4·v2,·0x0 | |
| |
98 | ····aput-object·v1,·v0,·v2 | |
| |
99 | ····invoke-static·{v0},·Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List; | |
| |
100 | ····move-result-object·v0 | |
| |
101 | ····invoke-direct·{p1,·v0},·Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V | |
| |
102 | ····iput-object·p1,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mTetheringPrefixes:Ljava/util/List; | |
| |
103 | ····.line·94 | |
104 | ····invoke-virtual·{p2},·Lcom/android/networkstack/tethering/TetheringConfiguration;->isSelectAllPrefixRangeEnabled()Z | |
| |
105 | ····move-result·p1 | |
| |
106 | ····if-eqz·p1,·:cond_0 | |
| |
107 | ····.line·95 | |
108 | ····iget-object·p1,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mTetheringPrefixes:Ljava/util/List; | |
| |
109 | ····new-instance·p2,·Landroid/net/IpPrefix; | |
| |
110 | ····const-string·v0,·"172.16.0.0/12" | |
| |
111 | ····invoke-direct·{p2,·v0},·Landroid/net/IpPrefix;-><init>(Ljava/lang/String;)V | |
| |
112 | ····invoke-interface·{p1,·p2},·Ljava/util/List;->add(Ljava/lang/Object;)Z | |
| |
113 | ····.line·96 | |
114 | ····iget-object·p0,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mTetheringPrefixes:Ljava/util/List; | |
| |
115 | ····new-instance·p1,·Landroid/net/IpPrefix; | |
| |
116 | ····const-string·p2,·"10.0.0.0/8" | |
| |
117 | ····invoke-direct·{p1,·p2},·Landroid/net/IpPrefix;-><init>(Ljava/lang/String;)V | |
| |
118 | ····invoke-interface·{p0,·p1},·Ljava/util/List;->add(Ljava/lang/Object;)Z | |
| |
119 | ····:cond_0 | |
120 | ····return-void | 56 | ····return-void |
121 | .end·method | 57 | .end·method |
| |
122 | .method·private·chooseDownstreamAddress(Landroid/net/IpPrefix;)Landroid/net/LinkAddress; | |
123 | ····.locals·4 | |
| |
124 | ····.line·236 | |
125 | ····invoke-virtual·{p1},·Landroid/net/IpPrefix;->getPrefixLength()I | |
| |
126 | ····move-result·v0 | |
| |
127 | ····invoke-static·{v0},·Lcom/android/networkstack/tethering/util/Inet4AddressUtils;->prefixLengthToV4NetmaskIntHTH(I)I | |
| |
128 | ····move-result·v0 | |
| |
129 | ····.line·239 | |
130 | ····invoke-direct·{p0,·p1},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->getPrefixBaseAddress(Landroid/net/IpPrefix;)I | |
| |
131 | ····move-result·p1 | |
| |
132 | ····const/16·v1,·0x18 | |
| |
133 | ····.line·242 | |
134 | ····invoke-static·{v1},·Lcom/android/networkstack/tethering/util/Inet4AddressUtils;->prefixLengthToV4NetmaskIntHTH(I)I | |
| |
135 | ····move-result·v1 | |
| |
136 | ····.line·261 | |
137 | ····invoke-virtual·{p0},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->getRandomInt()I | |
| |
138 | ····move-result·v2 | |
| |
139 | ····not-int·v3,·v0 | |
| |
140 | ····and-int/2addr·v2,·v3 | |
| |
141 | ····and-int/2addr·v2,·v1 | |
| |
142 | ····not-int·v1,·v1 | |
| |
143 | ····.line·266 | |
144 | ····invoke-direct·{p0,·v1},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->getSanitizedSubAddr(I)I | |
| |
145 | ····move-result·v1 | |
| |
146 | ····add-int/lit8·v3,·v3,·0x1 | |
| |
147 | ····.line·270 | |
148 | ····invoke-direct·{p0,·v2,·v3,·p1,·v0},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->findAvailablePrefixFromRange(IIII)Landroid/net/IpPrefix; | |
| |
149 | ····move-result-object·v3 | |
| |
150 | ····if-eqz·v3,·:cond_0 | |
| |
151 | ····.line·272 | |
152 | ····invoke-direct·{p0,·v3,·v1},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->getLinkAddress(Landroid/net/IpPrefix;I)Landroid/net/LinkAddress; | |
| |
153 | ····move-result-object·p0 | |
| |
154 | ····return-object·p0 | |
| |
155 | ····:cond_0 | |
156 | ····const/4·v3,·0x0 | |
| |
157 | ····.line·275 | |
158 | ····invoke-direct·{p0,·v3,·v2,·p1,·v0},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->findAvailablePrefixFromRange(IIII)Landroid/net/IpPrefix; | |
| |
159 | ····move-result-object·p1 | |
| |
160 | ····.line·278 | |
161 | ····invoke-direct·{p0,·p1,·v1},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->getLinkAddress(Landroid/net/IpPrefix;I)Landroid/net/LinkAddress; | |
| |
162 | ····move-result-object·p0 | |
| |
163 | ····return-object·p0 | |
164 | .end·method | |
| |
165 | .method·private·findAvailablePrefixFromRange(IIII)Landroid/net/IpPrefix; | |
166 | ····.locals·2 | |
| |
167 | ····:goto_0 | |
168 | ····if-ge·p1,·p2,·:cond_1 | |
| |
169 | ····or-int/2addr·p1,·p3 | |
| |
170 | ····.line·292 | |
171 | ····invoke-static·{p1},·Lcom/android/networkstack/tethering/util/Inet4AddressUtils;->intToInet4AddressHTH(I)Ljava/net/Inet4Address; | |
| |
172 | ····move-result-object·p1 | |
| |
173 | ····.line·293 | |
174 | ····new-instance·v0,·Landroid/net/IpPrefix; | |
| |
175 | ····const/16·v1,·0x18 | |
| |
176 | ····invoke-direct·{v0,·p1,·v1},·Landroid/net/IpPrefix;-><init>(Ljava/net/InetAddress;I)V | |
| |
177 | ····.line·295 | |
178 | ····invoke-direct·{p0,·v0},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->getConflictPrefix(Landroid/net/IpPrefix;)Landroid/net/IpPrefix; | |
| |
179 | ····move-result-object·p1 | |
| |
180 | ····if-nez·p1,·:cond_0 | |
| |
181 | ····return-object·v0 | |
| |
182 | ····.line·299 | |
183 | ····:cond_0 | |
184 | ····invoke-direct·{p0,·p1,·p4},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->getNextSubPrefix(Landroid/net/IpPrefix;I)I | |
| |
185 | ····move-result·p1 | |
| |
186 | ····goto·:goto_0 | |
| |
187 | ····:cond_1 | |
188 | ····const/4·p0,·0x0 | |
| |
189 | ····return-object·p0 | |
190 | .end·method | |
| |
191 | .method·private·getConflictPrefix(Landroid/net/IpPrefix;)Landroid/net/IpPrefix; | |
192 | ····.locals·1 | |
| |
193 | ····.line·207 | |
194 | ····invoke-direct·{p0,·p1},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->getConflictWithUpstream(Landroid/net/IpPrefix;)Landroid/net/IpPrefix; | |
| |
195 | ····move-result-object·v0 | |
| |
196 | ····if-eqz·v0,·:cond_0 | |
| |
197 | ····return-object·v0 | |
| |
198 | ····.line·210 | |
199 | ····:cond_0 | |
200 | ····invoke-direct·{p0,·p1},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->getInUseDownstreamPrefix(Landroid/net/IpPrefix;)Landroid/net/IpPrefix; | |
| |
201 | ····move-result-object·p0 | |
| |
202 | ····return-object·p0 | |
203 | .end·method | |
| |
204 | .method·private·getConflictWithUpstream(Landroid/net/IpPrefix;)Landroid/net/IpPrefix; | |
205 | ····.locals·4 | |
| |
206 | ····const/4·v0,·0x0 | |
| |
207 | ····.line·340 | |
208 | ····:goto_0 | |
209 | ····iget-object·v1,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mUpstreamPrefixMap:Landroid/util/ArrayMap; | |
| |
210 | ····invoke-virtual·{v1},·Landroid/util/ArrayMap;->size()I | |
| |
211 | ····move-result·v1 | |
| |
212 | ····if-ge·v0,·v1,·:cond_2 | |
| |
213 | ····.line·341 | |
214 | ····iget-object·v1,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mUpstreamPrefixMap:Landroid/util/ArrayMap; | |
| |
215 | ····invoke-virtual·{v1,·v0},·Landroid/util/ArrayMap;->valueAt(I)Ljava/lang/Object; | |
| |
216 | ····move-result-object·v1 | |
| |
217 | ····check-cast·v1,·Ljava/util/List; | |
| |
218 | ····.line·342 | |
219 | ····invoke-interface·{v1},·Ljava/util/List;->iterator()Ljava/util/Iterator; | |
| |
220 | ····move-result-object·v1 | |
| |
221 | ····:cond_0 | |
222 | ····invoke-interface·{v1},·Ljava/util/Iterator;->hasNext()Z | |
| |
223 | ····move-result·v2 | |
| |
224 | ····if-eqz·v2,·:cond_1 | |
| |
225 | ····invoke-interface·{v1},·Ljava/util/Iterator;->next()Ljava/lang/Object; | |
| |
226 | ····move-result-object·v2 | |
| |
227 | ····check-cast·v2,·Landroid/net/IpPrefix; | |
| |
228 | ····.line·343 | |
229 | ····invoke-direct·{p0,·p1,·v2},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->isConflictPrefix(Landroid/net/IpPrefix;Landroid/net/IpPrefix;)Z | |
| |
230 | ····move-result·v3 | |
| |
231 | ····if-eqz·v3,·:cond_0 | |
| |
232 | ····return-object·v2 | |
| |
233 | ····:cond_1 | |
234 | ····add-int/lit8·v0,·v0,·0x1 | |
| |
235 | ····goto·:goto_0 | |
| |
236 | ····:cond_2 | |
237 | ····const/4·p0,·0x0 | |
| |
238 | ····return-object·p0 | |
239 | .end·method | |
| |
240 | .method·private·getDownstreamPrefix(Landroid/net/ip/IpServer;)Landroid/net/IpPrefix; | 58 | .method·private·getDownstreamPrefix(Landroid/net/ip/IpServer;)Landroid/net/IpPrefix; |
241 | ····.locals·0 | 59 | ····.locals·0 |
| |
242 | ····.line·382 | 60 | ····.line·233 |
243 | ····invoke-virtual·{p1},·Landroid/net/ip/IpServer;->getAddress()Landroid/net/LinkAddress; | 61 | ····invoke-virtual·{p1},·Landroid/net/ip/IpServer;->getAddress()Landroid/net/LinkAddress; |
| |
244 | ····move-result-object·p0 | 62 | ····move-result-object·p0 |
| |
| 63 | ····if-nez·p0,·:cond_0 |
245 | ····.line·384 | |
246 | ····invoke-static·{p0},·Landroid/net/util/PrefixUtils;->asIpPrefix(Landroid/net/LinkAddress;)Landroid/net/IpPrefix; | |
| |
247 | ····move-result-object·p0 | 64 | ····const/4·p0,·0x0 |
| |
248 | ····return-object·p0 | 65 | ····return-object·p0 |
249 | .end·method | |
| |
250 | .method·private·getInUseDownstreamPrefix(Landroid/net/IpPrefix;)Landroid/net/IpPrefix; | |
251 | ····.locals·3 | |
| |
252 | ····const/4·v0,·0x0 | |
| |
253 | ····.line·364 | |
254 | ····:goto_0 | |
255 | ····iget-object·v1,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mCachedAddresses:Landroid/util/SparseArray; | |
| |
256 | ····invoke-virtual·{v1},·Landroid/util/SparseArray;->size()I | |
| |
257 | ····move-result·v1 | |
| |
258 | ····if-ge·v0,·v1,·:cond_1 | |
| |
259 | ····.line·365 | |
260 | ····iget-object·v1,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mCachedAddresses:Landroid/util/SparseArray; | |
| |
261 | ····invoke-virtual·{v1,·v0},·Landroid/util/SparseArray;->valueAt(I)Ljava/lang/Object; | |
| |
262 | ····move-result-object·v1 | |
| |
263 | ····check-cast·v1,·Landroid/net/LinkAddress; | |
| |
264 | ····invoke-static·{v1},·Landroid/net/util/PrefixUtils;->asIpPrefix(Landroid/net/LinkAddress;)Landroid/net/IpPrefix; | |
| |
265 | ····move-result-object·v1 | |
| |
266 | ····.line·366 | |
267 | ····invoke-direct·{p0,·p1,·v1},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->isConflictPrefix(Landroid/net/IpPrefix;Landroid/net/IpPrefix;)Z | |
| |
268 | ····move-result·v2 | |
| |
269 | ····if-eqz·v2,·:cond_0 | |
| |
270 | ····return-object·v1 | |
| |
| 66 | ····.line·236 |
271 | ····:cond_0 | 67 | ····:cond_0 |
| 68 | ····invoke-static·{p0},·Landroid/net/util/PrefixUtils;->asIpPrefix(Landroid/net/LinkAddress;)Landroid/net/IpPrefix; |
272 | ····add-int/lit8·v0,·v0,·0x1 | |
| |
273 | ····goto·:goto_0 | |
| |
274 | ····.line·371 | |
275 | ····:cond_1 | |
276 | ····iget-object·v0,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mDownstreams:Landroid/util/ArraySet; | |
| |
277 | ····invoke-virtual·{v0},·Landroid/util/ArraySet;->iterator()Ljava/util/Iterator; | |
| |
278 | ····move-result-object·v0 | |
| |
279 | ····:cond_2 | |
280 | ····invoke-interface·{v0},·Ljava/util/Iterator;->hasNext()Z | |
| |
281 | ····move-result·v1 | |
| |
282 | ····if-eqz·v1,·:cond_3 | |
| |
283 | ····invoke-interface·{v0},·Ljava/util/Iterator;->next()Ljava/lang/Object; | |
| |
284 | ····move-result-object·v1 | |
| |
285 | ····check-cast·v1,·Landroid/net/ip/IpServer; | |
| |
286 | ····.line·372 | |
287 | ····invoke-direct·{p0,·v1},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->getDownstreamPrefix(Landroid/net/ip/IpServer;)Landroid/net/IpPrefix; | |
| |
288 | ····move-result-object·v1 | |
| |
289 | ····.line·374 | |
290 | ····invoke-direct·{p0,·p1,·v1},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->isConflictPrefix(Landroid/net/IpPrefix;Landroid/net/IpPrefix;)Z | |
| |
291 | ····move-result·v2 | |
| |
292 | ····if-eqz·v2,·:cond_2 | |
| |
293 | ····return-object·v1 | |
| |
| 69 | ····move-result-object·p0 |
294 | ····:cond_3 | |
295 | ····const/4·p0,·0x0 | |
| |
296 | ····return-object·p0 | 70 | ····return-object·p0 |
297 | .end·method | 71 | .end·method |
| |
298 | .method·private·getIpv4Prefixes(Ljava/util/List;)Ljava/util/ArrayList; | 72 | .method·private·getIpv4Prefixes(Ljava/util/List;)Ljava/util/ArrayList; |
299 | ····.locals·2 | 73 | ····.locals·2 |
300 | ····.annotation·system·Ldalvik/annotation/Signature; | 74 | ····.annotation·system·Ldalvik/annotation/Signature; |
Offset 484, 20 lines modified | Offset 108, 20 lines modified |
484 | ············">;)", | 108 | ············">;)", |
485 | ············"Ljava/util/ArrayList<", | 109 | ············"Ljava/util/ArrayList<", |
486 | ············"Landroid/net/IpPrefix;", | 110 | ············"Landroid/net/IpPrefix;", |
487 | ············">;" | 111 | ············">;" |
488 | ········} | 112 | ········} |
489 | ····.end·annotation | 113 | ····.end·annotation |
| |
490 | ····.line·125 | 114 | ····.line·98 |
491 | ····new-instance·p0,·Ljava/util/ArrayList; | 115 | ····new-instance·p0,·Ljava/util/ArrayList; |
| |
492 | ····invoke-direct·{p0},·Ljava/util/ArrayList;-><init>()V | 116 | ····invoke-direct·{p0},·Ljava/util/ArrayList;-><init>()V |
| |
493 | ····.line·126 | 117 | ····.line·99 |
494 | ····invoke-interface·{p1},·Ljava/util/List;->iterator()Ljava/util/Iterator; | 118 | ····invoke-interface·{p1},·Ljava/util/List;->iterator()Ljava/util/Iterator; |
| |
495 | ····move-result-object·p1 | 119 | ····move-result-object·p1 |
| |
496 | ····:goto_0 | 120 | ····:goto_0 |
497 | ····invoke-interface·{p1},·Ljava/util/Iterator;->hasNext()Z | 121 | ····invoke-interface·{p1},·Ljava/util/Iterator;->hasNext()Z |
| |
Offset 507, 765 lines modified | Offset 131, 712 lines modified |
| |
507 | ····invoke-interface·{p1},·Ljava/util/Iterator;->next()Ljava/lang/Object; | 131 | ····invoke-interface·{p1},·Ljava/util/Iterator;->next()Ljava/lang/Object; |
| |
508 | ····move-result-object·v0 | 132 | ····move-result-object·v0 |
| |
509 | ····check-cast·v0,·Landroid/net/LinkAddress; | 133 | ····check-cast·v0,·Landroid/net/LinkAddress; |
| |
510 | ····.line·127 | 134 | ····.line·100 |
511 | ····invoke-virtual·{v0},·Landroid/net/LinkAddress;->isIpv4()Z | 135 | ····invoke-virtual·{v0},·Landroid/net/LinkAddress;->isIpv4()Z |
| |
512 | ····move-result·v1 | 136 | ····move-result·v1 |
| |
513 | ····if-nez·v1,·:cond_0 | 137 | ····if-nez·v1,·:cond_0 |
| |
514 | ····goto·:goto_0 | 138 | ····goto·:goto_0 |
| |
515 | ····.line·129 | 139 | ····.line·102 |
516 | ····:cond_0 | 140 | ····:cond_0 |
517 | ····invoke-static·{v0},·Landroid/net/util/PrefixUtils;->asIpPrefix(Landroid/net/LinkAddress;)Landroid/net/IpPrefix; | 141 | ····invoke-static·{v0},·Landroid/net/util/PrefixUtils;->asIpPrefix(Landroid/net/LinkAddress;)Landroid/net/IpPrefix; |
| |
518 | ····move-result-object·v0 | 142 | ····move-result-object·v0 |
| |
519 | ····invoke-virtual·{p0,·v0},·Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z | 143 | ····invoke-virtual·{p0,·v0},·Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z |
| |
520 | ····goto·:goto_0 | 144 | ····goto·:goto_0 |
| |
521 | ····:cond_1 | 145 | ····:cond_1 |
522 | ····return-object·p0 | 146 | ····return-object·p0 |
523 | .end·method | 147 | .end·method |
| |
524 | .method·private·getLinkAddress(Landroid/net/IpPrefix;I)Landroid/net/LinkAddress; | 148 | .method·private·varargs·getSanitizedAddressSuffix(I[B)B |
525 | ····.locals·0 | 149 | ····.locals·2 |
| |
526 | ····if-nez·p1,·:cond_0 | |
| |
527 | ····const/4·p0,·0x0 | |
| |
528 | ····return-object·p0 | |
| |
529 | ····.line·284 | |
530 | ····:cond_0 | |
531 | ····invoke-direct·{p0,·p1},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->getPrefixBaseAddress(Landroid/net/IpPrefix;)I | |
| |
532 | ····move-result·p0 | |
| |
533 | ····or-int/2addr·p0,·p2 | |
| |
534 | ····invoke-static·{p0},·Lcom/android/networkstack/tethering/util/Inet4AddressUtils;->intToInet4AddressHTH(I)Ljava/net/Inet4Address; | |
| |
535 | ····move-result-object·p0 | |
| |
536 | ····.line·285 | |
537 | ····new-instance·p1,·Landroid/net/LinkAddress; | |
| |
538 | ····const/16·p2,·0x18 | |
| |
539 | ····invoke-direct·{p1,·p0,·p2},·Landroid/net/LinkAddress;-><init>(Ljava/net/InetAddress;I)V | |
| |
540 | ····return-object·p1 | |
541 | .end·method | |
| |
542 | .method·private·getNextSubPrefix(Landroid/net/IpPrefix;I)I | |
543 | ····.locals·1 | |
| |
544 | ····.line·220 | |
545 | ····invoke-virtual·{p1},·Landroid/net/IpPrefix;->getPrefixLength()I | |
| |
546 | ····move-result·v0 | |
| |
547 | ····invoke-static·{v0},·Lcom/android/networkstack/tethering/util/Inet4AddressUtils;->prefixLengthToV4NetmaskIntHTH(I)I | |
| |
548 | ····move-result·v0 | |
| |
549 | ····not-int·v0,·v0 | |
| |
550 | ····.line·224 | |
551 | ····invoke-direct·{p0,·p1},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->getPrefixBaseAddress(Landroid/net/IpPrefix;)I | |
| |
552 | ····move-result·p0 | |
| |
553 | ····or-int/2addr·p0,·v0 | |
| |
554 | ····not-int·p1,·p2 | |
| |
555 | ····and-int/2addr·p0,·p1 | |
| |
556 | ····const/16·p1,·0x18 | |
| |
557 | ····.line·226 | |
558 | ····invoke-static·{p1},·Lcom/android/networkstack/tethering/util/Inet4AddressUtils;->prefixLengthToV4NetmaskIntHTH(I)I | |
| |
559 | ····add-int/lit16·p0,·p0,·0x100 | 150 | ····and-int/lit16·p0,·p1,·0xff |
| |
| 151 | ····int-to-byte·p0,·p0 |
560 | ····return·p0 | |
561 | .end·method | |
| |
562 | .method·private·getPrefixBaseAddress(Landroid/net/IpPrefix;)I | |
563 | ····.locals·0 | 152 | ····.line·187 |
| 153 | ····array-length·p1,·p2 |
| |
| 154 | ····const/4·v0,·0x0 |
564 | ····.line·199 | |
565 | ····invoke-virtual·{p1},·Landroid/net/IpPrefix;->getAddress()Ljava/net/InetAddress; | |
| |
566 | ····move-result-object·p0 | 155 | ····:goto_0 |
| 156 | ····if-ge·v0,·p1,·:cond_1 |
| |
567 | ····check-cast·p0,·Ljava/net/Inet4Address; | 157 | ····aget-byte·v1,·p2,·v0 |
| |
568 | ····invoke-static·{p0},·Lcom/android/networkstack/tethering/util/Inet4AddressUtils;->inet4AddressToIntHTH(Ljava/net/Inet4Address;)I | 158 | ····if-ne·p0,·v1,·:cond_0 |
| |
569 | ····move-result·p0 | 159 | ····const/16·p0,·0x2a |
| |
570 | ····return·p0 | 160 | ····return·p0 |
571 | .end·method | |
| |
| 161 | ····:cond_0 |
572 | .method·private·getSanitizedSubAddr(I)I | |
573 | ····.locals·1 | |
| |
574 | ····.line·313 | |
575 | ····invoke-virtual·{p0},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->getRandomInt()I | |
| |
576 | ····move-result·p0 | |
| |
577 | ····and-int/2addr·p0,·p1 | |
| |
578 | ····and-int/lit16·p1,·p0,·0xff | 162 | ····add-int/lit8·v0,·v0,·0x1 |
| |
579 | ····if-eqz·p1,·:cond_1 | |
| |
580 | ····const/4·v0,·0x1 | |
| |
581 | ····if-eq·p1,·v0,·:cond_1 | |
| |
582 | ····const/16·v0,·0xff | |
| |
583 | ····if-ne·p1,·v0,·:cond_0 | |
| |
584 | ····goto·:goto_0 | 163 | ····goto·:goto_0 |
| |
585 | ····:cond_0 | |
586 | ····return·p0 | |
| |
587 | ····:cond_1 | 164 | ····:cond_1 |
588 | ····:goto_0 | |
589 | ····and-int/lit8·p0,·p0,·-0x4 | |
| |
590 | ····add-int/lit8·p0,·p0,·0x2 | |
| |
591 | ····return·p0 | 165 | ····return·p0 |
592 | .end·method | 166 | .end·method |
| |
593 | .method·private·handleMaybePrefixConflict(Ljava/util/List;)V | 167 | .method·private·handleMaybePrefixConflict(Ljava/util/List;)V |
594 | ····.locals·5 | 168 | ····.locals·5 |
595 | ····.annotation·system·Ldalvik/annotation/Signature; | 169 | ····.annotation·system·Ldalvik/annotation/Signature; |
596 | ········value·=·{ | 170 | ········value·=·{ |
597 | ············"(", | 171 | ············"(", |
598 | ············"Ljava/util/List<", | 172 | ············"Ljava/util/List<", |
599 | ············"Landroid/net/IpPrefix;", | 173 | ············"Landroid/net/IpPrefix;", |
600 | ············">;)V" | 174 | ············">;)V" |
601 | ········} | 175 | ········} |
602 | ····.end·annotation | 176 | ····.end·annotation |
| |
603 | ····.line·136 | 177 | ····.line·109 |
604 | ····iget-object·v0,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mDownstreams:Landroid/util/ArraySet; | 178 | ····iget-object·v0,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mDownstreams:Landroid/util/ArraySet; |
| |
605 | ····invoke-virtual·{v0},·Landroid/util/ArraySet;->iterator()Ljava/util/Iterator; | 179 | ····invoke-virtual·{v0},·Landroid/util/ArraySet;->iterator()Ljava/util/Iterator; |
| |
606 | ····move-result-object·v0 | 180 | ····move-result-object·v0 |
| |
607 | ····:cond_0 | 181 | ····:cond_0 |
608 | ····:goto_0 | 182 | ····:goto_0 |
609 | ····invoke-interface·{v0},·Ljava/util/Iterator;->hasNext()Z | 183 | ····invoke-interface·{v0},·Ljava/util/Iterator;->hasNext()Z |
| |
610 | ····move-result·v1 | 184 | ····move-result·v1 |
| |
611 | ····if-eqz·v1,·:cond_2 | 185 | ····if-eqz·v1,·:cond_3 |
| |
612 | ····invoke-interface·{v0},·Ljava/util/Iterator;->next()Ljava/lang/Object; | 186 | ····invoke-interface·{v0},·Ljava/util/Iterator;->next()Ljava/lang/Object; |
| |
613 | ····move-result-object·v1 | 187 | ····move-result-object·v1 |
| |
614 | ····check-cast·v1,·Landroid/net/ip/IpServer; | 188 | ····check-cast·v1,·Landroid/net/ip/IpServer; |
| |
615 | ····.line·137 | 189 | ····.line·110 |
616 | ····invoke-direct·{p0,·v1},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->getDownstreamPrefix(Landroid/net/ip/IpServer;)Landroid/net/IpPrefix; | 190 | ····invoke-direct·{p0,·v1},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->getDownstreamPrefix(Landroid/net/ip/IpServer;)Landroid/net/IpPrefix; |
| |
617 | ····move-result-object·v2 | 191 | ····move-result-object·v2 |
| |
| 192 | ····if-nez·v2,·:cond_1 |
| |
| 193 | ····goto·:goto_0 |
| |
618 | ····.line·139 | 194 | ····.line·113 |
| 195 | ····:cond_1 |
619 | ····invoke-interface·{p1},·Ljava/util/List;->iterator()Ljava/util/Iterator; | 196 | ····invoke-interface·{p1},·Ljava/util/List;->iterator()Ljava/util/Iterator; |
| |
620 | ····move-result-object·v3 | 197 | ····move-result-object·v3 |
| |
621 | ····:cond_1 | 198 | ····:cond_2 |
622 | ····invoke-interface·{v3},·Ljava/util/Iterator;->hasNext()Z | 199 | ····invoke-interface·{v3},·Ljava/util/Iterator;->hasNext()Z |
| |
623 | ····move-result·v4 | 200 | ····move-result·v4 |
| |
624 | ····if-eqz·v4,·:cond_0 | 201 | ····if-eqz·v4,·:cond_0 |
| |
625 | ····invoke-interface·{v3},·Ljava/util/Iterator;->next()Ljava/lang/Object; | 202 | ····invoke-interface·{v3},·Ljava/util/Iterator;->next()Ljava/lang/Object; |
| |
626 | ····move-result-object·v4 | 203 | ····move-result-object·v4 |
| |
627 | ····check-cast·v4,·Landroid/net/IpPrefix; | 204 | ····check-cast·v4,·Landroid/net/IpPrefix; |
| |
628 | ····.line·140 | 205 | ····.line·114 |
629 | ····invoke-direct·{p0,·v4,·v2},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->isConflictPrefix(Landroid/net/IpPrefix;Landroid/net/IpPrefix;)Z | 206 | ····invoke-direct·{p0,·v4,·v2},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->isConflictPrefix(Landroid/net/IpPrefix;Landroid/net/IpPrefix;)Z |
| |
630 | ····move-result·v4 | 207 | ····move-result·v4 |
| |
631 | ····if-eqz·v4,·:cond_1 | 208 | ····if-eqz·v4,·:cond_2 |
| |
632 | ····const/16·v2,·0x71 | 209 | ····const/16·v2,·0x71 |
| |
633 | ····.line·141 | 210 | ····.line·115 |
634 | ····invoke-virtual·{v1,·v2},·Lcom/android/networkstack/tethering/util/StateMachine;->sendMessage(I)V | 211 | ····invoke-virtual·{v1,·v2},·Lcom/android/networkstack/tethering/util/StateMachine;->sendMessage(I)V |
| |
635 | ····goto·:goto_0 | 212 | ····goto·:goto_0 |
| |
636 | ····:cond_2 | 213 | ····:cond_3 |
637 | ····return-void | 214 | ····return-void |
638 | .end·method | 215 | .end·method |
| |
639 | .method·private·isConflictPrefix(Landroid/net/IpPrefix;Landroid/net/IpPrefix;)Z | 216 | .method·private·isConflictPrefix(Landroid/net/IpPrefix;Landroid/net/IpPrefix;)Z |
640 | ····.locals·1 | 217 | ····.locals·1 |
| |
641 | ····.line·354 | 218 | ····.line·215 |
642 | ····invoke-virtual·{p2},·Landroid/net/IpPrefix;->getPrefixLength()I | 219 | ····invoke-virtual·{p2},·Landroid/net/IpPrefix;->getPrefixLength()I |
| |
643 | ····move-result·p0 | 220 | ····move-result·p0 |
| |
644 | ····invoke-virtual·{p1},·Landroid/net/IpPrefix;->getPrefixLength()I | 221 | ····invoke-virtual·{p1},·Landroid/net/IpPrefix;->getPrefixLength()I |
| |
645 | ····move-result·v0 | 222 | ····move-result·v0 |
| |
646 | ····if-ge·p0,·v0,·:cond_0 | 223 | ····if-ge·p0,·v0,·:cond_0 |
| |
647 | ····.line·355 | 224 | ····.line·216 |
648 | ····invoke-virtual·{p1},·Landroid/net/IpPrefix;->getAddress()Ljava/net/InetAddress; | 225 | ····invoke-virtual·{p1},·Landroid/net/IpPrefix;->getAddress()Ljava/net/InetAddress; |
| |
649 | ····move-result-object·p0 | 226 | ····move-result-object·p0 |
| |
650 | ····invoke-virtual·{p2,·p0},·Landroid/net/IpPrefix;->contains(Ljava/net/InetAddress;)Z | 227 | ····invoke-virtual·{p2,·p0},·Landroid/net/IpPrefix;->contains(Ljava/net/InetAddress;)Z |
| |
651 | ····move-result·p0 | 228 | ····move-result·p0 |
| |
652 | ····return·p0 | 229 | ····return·p0 |
| |
653 | ····.line·358 | 230 | ····.line·219 |
654 | ····:cond_0 | 231 | ····:cond_0 |
655 | ····invoke-virtual·{p2},·Landroid/net/IpPrefix;->getAddress()Ljava/net/InetAddress; | 232 | ····invoke-virtual·{p2},·Landroid/net/IpPrefix;->getAddress()Ljava/net/InetAddress; |
| |
656 | ····move-result-object·p0 | 233 | ····move-result-object·p0 |
| |
657 | ····invoke-virtual·{p1,·p0},·Landroid/net/IpPrefix;->contains(Ljava/net/InetAddress;)Z | 234 | ····invoke-virtual·{p1,·p0},·Landroid/net/IpPrefix;->contains(Ljava/net/InetAddress;)Z |
| |
658 | ····move-result·p0 | 235 | ····move-result·p0 |
| |
659 | ····return·p0 | 236 | ····return·p0 |
660 | .end·method | 237 | .end·method |
| |
661 | .method·private·isConflictWithUpstream(Landroid/net/IpPrefix;)Z | 238 | .method·private·isConflictWithUpstream(Landroid/net/IpPrefix;)Z |
662 | ····.locals·0 | 239 | ····.locals·4 |
| |
| 240 | ····const/4·v0,·0x0 |
663 | ····.line·350 | |
664 | ····invoke-direct·{p0,·p1},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->getConflictWithUpstream(Landroid/net/IpPrefix;)Landroid/net/IpPrefix; | |
| |
665 | ····move-result-object·p0 | 241 | ····move·v1,·v0 |
| |
| 242 | ····.line·205 |
| 243 | ····:goto_0 |
| 244 | ····iget-object·v2,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mUpstreamPrefixMap:Landroid/util/ArrayMap; |
| |
666 | ····if-eqz·p0,·:cond_0 | 245 | ····invoke-virtual·{v2},·Landroid/util/ArrayMap;->size()I |
| |
667 | ····const/4·p0,·0x1 | 246 | ····move-result·v2 |
| |
668 | ····goto·:goto_0 | 247 | ····if-ge·v1,·v2,·:cond_2 |
| |
669 | ····:cond_0 | |
670 | ····const/4·p0,·0x0 | 248 | ····.line·206 |
| 249 | ····iget-object·v2,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mUpstreamPrefixMap:Landroid/util/ArrayMap; |
| |
| 250 | ····invoke-virtual·{v2,·v1},·Landroid/util/ArrayMap;->valueAt(I)Ljava/lang/Object; |
671 | ····:goto_0 | |
672 | ····return·p0 | |
673 | .end·method | |
| |
| 251 | ····move-result-object·v2 |
| |
674 | #·virtual·methods | |
675 | .method·dump(Lcom/android/networkstack/tethering/util/IndentingPrintWriter;)V | |
676 | ····.locals·6 | 252 | ····check-cast·v2,·Ljava/util/List; |
| |
| 253 | ····.line·207 |
| 254 | ····invoke-interface·{v2},·Ljava/util/List;->iterator()Ljava/util/Iterator; |
| |
677 | ····const-string·v0,·"mTetheringPrefixes:" | 255 | ····move-result-object·v2 |
| |
678 | ····.line·388 | |
679 | ····invoke-virtual·{p1,·v0},·Ljava/io/PrintWriter;->println(Ljava/lang/String;)V | 256 | ····:cond_0 |
| 257 | ····invoke-interface·{v2},·Ljava/util/Iterator;->hasNext()Z |
| |
| 258 | ····move-result·v3 |
680 | ····.line·389 | |
681 | ····invoke-virtual·{p1},·Lcom/android/networkstack/tethering/util/IndentingPrintWriter;->increaseIndent()Lcom/android/networkstack/tethering/util/IndentingPrintWriter; | |
| |
| 259 | ····if-eqz·v3,·:cond_1 |
682 | ····.line·390 | |
683 | ····iget-object·v0,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mTetheringPrefixes:Ljava/util/List; | |
| |
684 | ····invoke-interface·{v0},·Ljava/util/List;->iterator()Ljava/util/Iterator; | 260 | ····invoke-interface·{v2},·Ljava/util/Iterator;->next()Ljava/lang/Object; |
| |
685 | ····move-result-object·v0 | 261 | ····move-result-object·v3 |
| |
| 262 | ····check-cast·v3,·Landroid/net/IpPrefix; |
686 | ····:goto_0 | |
687 | ····invoke-interface·{v0},·Ljava/util/Iterator;->hasNext()Z | |
| |
688 | ····move-result·v1 | 263 | ····.line·208 |
| 264 | ····invoke-direct·{p0,·p1,·v3},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->isConflictPrefix(Landroid/net/IpPrefix;Landroid/net/IpPrefix;)Z |
| |
689 | ····if-eqz·v1,·:cond_0 | 265 | ····move-result·v3 |
| |
690 | ····invoke-interface·{v0},·Ljava/util/Iterator;->next()Ljava/lang/Object; | 266 | ····if-eqz·v3,·:cond_0 |
| |
691 | ····move-result-object·v1 | 267 | ····const/4·p0,·0x1 |
| |
692 | ····check-cast·v1,·Landroid/net/IpPrefix; | 268 | ····return·p0 |
| |
693 | ····.line·391 | |
694 | ····invoke-virtual·{p1,·v1},·Ljava/io/PrintWriter;->println(Ljava/lang/Object;)V | 269 | ····:cond_1 |
| 270 | ····add-int/lit8·v1,·v1,·0x1 |
| |
695 | ····goto·:goto_0 | 271 | ····goto·:goto_0 |
| |
696 | ····.line·393 | |
697 | ····:cond_0 | 272 | ····:cond_2 |
698 | ····invoke-virtual·{p1},·Lcom/android/networkstack/tethering/util/IndentingPrintWriter;->decreaseIndent()Lcom/android/networkstack/tethering/util/IndentingPrintWriter; | 273 | ····return·v0 |
| 274 | .end·method |
| |
699 | ····const-string·v0,·"mUpstreamPrefixMap:" | 275 | .method·private·isDownstreamPrefixInUse(Landroid/net/IpPrefix;)Z |
| 276 | ····.locals·2 |
| |
700 | ····.line·395 | 277 | ····.line·225 |
701 | ····invoke-virtual·{p1,·v0},·Ljava/io/PrintWriter;->println(Ljava/lang/String;)V | 278 | ····iget-object·v0,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mDownstreams:Landroid/util/ArraySet; |
| |
| 279 | ····invoke-virtual·{v0},·Landroid/util/ArraySet;->iterator()Ljava/util/Iterator; |
702 | ····.line·396 | |
703 | ····invoke-virtual·{p1},·Lcom/android/networkstack/tethering/util/IndentingPrintWriter;->increaseIndent()Lcom/android/networkstack/tethering/util/IndentingPrintWriter; | |
| |
704 | ····const/4·v0,·0x0 | 280 | ····move-result-object·v0 |
| |
705 | ····move·v1,·v0 | 281 | ····:cond_0 |
| 282 | ····invoke-interface·{v0},·Ljava/util/Iterator;->hasNext()Z |
| |
| 283 | ····move-result·v1 |
706 | ····.line·397 | |
707 | ····:goto_1 | |
708 | ····iget-object·v2,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mUpstreamPrefixMap:Landroid/util/ArrayMap; | |
| |
709 | ····invoke-virtual·{v2},·Landroid/util/ArrayMap;->size()I | 284 | ····if-eqz·v1,·:cond_1 |
| |
710 | ····move-result·v2 | 285 | ····invoke-interface·{v0},·Ljava/util/Iterator;->next()Ljava/lang/Object; |
| |
711 | ····const-string·v3,·"·-·" | 286 | ····move-result-object·v1 |
| |
712 | ····if-ge·v1,·v2,·:cond_1 | 287 | ····check-cast·v1,·Landroid/net/ip/IpServer; |
| |
713 | ····.line·398 | 288 | ····.line·226 |
714 | ····new-instance·v2,·Ljava/lang/StringBuilder; | 289 | ····invoke-direct·{p0,·v1},·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->getDownstreamPrefix(Landroid/net/ip/IpServer;)Landroid/net/IpPrefix; |
| |
715 | ····invoke-direct·{v2},·Ljava/lang/StringBuilder;-><init>()V | 290 | ····move-result-object·v1 |
| |
716 | ····iget-object·v4,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mUpstreamPrefixMap:Landroid/util/ArrayMap; | 291 | ····.line·227 |
| 292 | ····invoke-virtual·{p1,·v1},·Landroid/net/IpPrefix;->equals(Ljava/lang/Object;)Z |
| |
717 | ····invoke-virtual·{v4,·v1},·Landroid/util/ArrayMap;->keyAt(I)Ljava/lang/Object; | 293 | ····move-result·v1 |
| |
718 | ····move-result-object·v4 | 294 | ····if-eqz·v1,·:cond_0 |
| |
719 | ····invoke-virtual·{v2,·v4},·Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; | 295 | ····const/4·p0,·0x1 |
| |
720 | ····invoke-virtual·{v2,·v3},·Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; | 296 | ····return·p0 |
| |
721 | ····iget-object·v3,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mUpstreamPrefixMap:Landroid/util/ArrayMap; | 297 | ····:cond_1 |
| 298 | ····const/4·p0,·0x0 |
| |
722 | ····invoke-virtual·{v3,·v1},·Landroid/util/ArrayMap;->valueAt(I)Ljava/lang/Object; | 299 | ····return·p0 |
| 300 | .end·method |
| |
723 | ····move-result-object·v3 | 301 | .method·private·maybeRemoveDeprectedUpstreams()V |
| 302 | ····.locals·5 |
| |
724 | ····invoke-virtual·{v2,·v3},·Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; | 303 | ····.line·128 |
| 304 | ····iget-object·v0,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mDownstreams:Landroid/util/ArraySet; |
| |
725 | ····invoke-virtual·{v2},·Ljava/lang/StringBuilder;->toString()Ljava/lang/String; | 305 | ····invoke-virtual·{v0},·Landroid/util/ArraySet;->isEmpty()Z |
| |
726 | ····move-result-object·v2 | 306 | ····move-result·v0 |
| |
727 | ····invoke-virtual·{p1,·v2},·Ljava/io/PrintWriter;->println(Ljava/lang/String;)V | 307 | ····if-eqz·v0,·:cond_3 |
| |
728 | ····add-int/lit8·v1,·v1,·0x1 | 308 | ····iget-object·v0,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mUpstreamPrefixMap:Landroid/util/ArrayMap; |
| |
| 309 | ····invoke-virtual·{v0},·Landroid/util/ArrayMap;->isEmpty()Z |
| |
| 310 | ····move-result·v0 |
| |
| 311 | ····if-eqz·v0,·:cond_0 |
| |
729 | ····goto·:goto_1 | 312 | ····goto·:goto_1 |
| |
730 | ····.line·400 | 313 | ····.line·130 |
731 | ····:cond_1 | 314 | ····:cond_0 |
732 | ····invoke-virtual·{p1},·Lcom/android/networkstack/tethering/util/IndentingPrintWriter;->decreaseIndent()Lcom/android/networkstack/tethering/util/IndentingPrintWriter; | 315 | ····new-instance·v0,·Ljava/util/ArrayList; |
| |
733 | ····const-string·v1,·"mDownstreams:" | 316 | ····invoke-direct·{v0},·Ljava/util/ArrayList;-><init>()V |
| |
734 | ····.line·402 | 317 | ····.line·131 |
735 | ····invoke-virtual·{p1,·v1},·Ljava/io/PrintWriter;->println(Ljava/lang/String;)V | 318 | ····iget-object·v1,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mConnectivityMgr:Landroid/net/ConnectivityManager; |
| |
| 319 | ····invoke-virtual·{v1},·Landroid/net/ConnectivityManager;->getAllNetworks()[Landroid/net/Network; |
736 | ····.line·403 | |
737 | ····invoke-virtual·{p1},·Lcom/android/networkstack/tethering/util/IndentingPrintWriter;->increaseIndent()Lcom/android/networkstack/tethering/util/IndentingPrintWriter; | |
| |
| 320 | ····move-result-object·v1 |
738 | ····.line·404 | |
739 | ····iget-object·v1,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mDownstreams:Landroid/util/ArraySet; | |
| |
740 | ····invoke-virtual·{v1},·Landroid/util/ArraySet;->iterator()Ljava/util/Iterator; | 321 | ····invoke-static·{v1},·Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List; |
| |
741 | ····move-result-object·v1 | 322 | ····move-result-object·v1 |
| |
| 323 | ····const/4·v2,·0x0 |
742 | ····:goto_2 | |
743 | ····invoke-interface·{v1},·Ljava/util/Iterator;->hasNext()Z | |
| |
744 | ····move-result·v2 | 324 | ····.line·132 |
| 325 | ····:goto_0 |
| 326 | ····iget-object·v3,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mUpstreamPrefixMap:Landroid/util/ArrayMap; |
| |
745 | ····if-eqz·v2,·:cond_2 | 327 | ····invoke-virtual·{v3},·Landroid/util/ArrayMap;->size()I |
| |
746 | ····invoke-interface·{v1},·Ljava/util/Iterator;->next()Ljava/lang/Object; | 328 | ····move-result·v3 |
| |
747 | ····move-result-object·v2 | 329 | ····if-ge·v2,·v3,·:cond_2 |
| |
748 | ····check-cast·v2,·Landroid/net/ip/IpServer; | 330 | ····.line·133 |
| 331 | ····iget-object·v3,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mUpstreamPrefixMap:Landroid/util/ArrayMap; |
| |
| 332 | ····invoke-virtual·{v3,·v2},·Landroid/util/ArrayMap;->keyAt(I)Ljava/lang/Object; |
749 | ····.line·405 | |
750 | ····new-instance·v4,·Ljava/lang/StringBuilder; | |
| |
751 | ····invoke-direct·{v4},·Ljava/lang/StringBuilder;-><init>()V | 333 | ····move-result-object·v3 |
| |
752 | ····invoke-virtual·{v2},·Landroid/net/ip/IpServer;->interfaceType()I | 334 | ····check-cast·v3,·Landroid/net/Network; |
| |
753 | ····move-result·v5 | 335 | ····.line·134 |
| 336 | ····invoke-interface·{v1,·v3},·Ljava/util/List;->contains(Ljava/lang/Object;)Z |
| |
754 | ····invoke-virtual·{v4,·v5},·Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; | 337 | ····move-result·v4 |
| |
755 | ····invoke-virtual·{v4,·v3},·Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; | 338 | ····if-nez·v4,·:cond_1 |
| |
756 | ····invoke-virtual·{v2},·Landroid/net/ip/IpServer;->getAddress()Landroid/net/LinkAddress; | 339 | ····invoke-virtual·{v0,·v3},·Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z |
| |
757 | ····move-result-object·v2 | 340 | ····:cond_1 |
| 341 | ····add-int/lit8·v2,·v2,·0x1 |
| |
758 | ····invoke-virtual·{v4,·v2},·Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; | 342 | ····goto·:goto_0 |
| |
759 | ····invoke-virtual·{v4},·Ljava/lang/StringBuilder;->toString()Ljava/lang/String; | 343 | ····.line·137 |
| 344 | ····:cond_2 |
| 345 | ····iget-object·p0,·p0,·Lcom/android/networkstack/tethering/PrivateAddressCoordinator;->mUpstreamPrefixMap:Landroid/util/ArrayMap; |
| |
760 | ····move-result-object·v2 | 346 | ····invoke-virtual·{p0,·v0},·Landroid/util/ArrayMap;->removeAll(Ljava/util/Collection;)Z |
| |
761 | ····invoke-virtual·{p1,·v2},·Ljava/io/PrintWriter;->println(Ljava/lang/String;)V | 347 | ····:cond_3 |
| 348 | ····:goto_1 |
| 349 | ····return-void |
| 350 | .end·method |
| |
762 | ····goto·:goto_2 | |
| |
| 351 | #·virtual·methods |
| 352 | .method·dump(Lcom/android/networkstack/tethering/util/IndentingPrintWriter;)V |
| 353 | ····.locals·4 |
| |
763 | ····.line·407 | 354 | ····.line·240 |
764 | ····:cond_2 | |
765 | ····invoke-virtual·{p1},·Lcom/android/networkstack/tethering/util/IndentingPrintWriter;->decreaseIndent()Lcom/android/networkstack/tethering/util/IndentingPrintWriter; | 355 | ····invoke-virtual·{p1},·Lcom/android/networkstack/tethering/util/IndentingPrintWriter;->decreaseIndent()Lcom/android/networkstack/tethering/util/IndentingPrintWriter; |
| |
766 | ····const-string·v1,·"mCachedAddresses:" | 356 | ····const-string·v0,·"mUpstreamPrefixMap:" |
| |
767 | ····.line·409 | 357 | ····.line·241 |
768 | ····invoke-virtual·{p1,·v1},·Ljava/io/PrintWriter;->println(Ljava/lang/String;)V | 358 | ····invoke-virtual·{p1,·v0},·Ljava/io/PrintWriter;->println(Ljava/lang/String;)V |
| |
Max diff block lines reached; 16940/49468 bytes (34.24%) of diff not shown.
|