Rev 3632 | Rev 3682 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3632 | Rev 3636 | ||
---|---|---|---|
Line 193... | Line 193... | ||
193 | mcall -1 |
193 | mcall -1 |
Line 194... | Line 194... | ||
194 | 194 | ||
Line 195... | Line -... | ||
195 | - | ||
196 | try_dhcp: |
- | |
197 | 195 | ||
Line 198... | Line 196... | ||
198 | mov [tries], DHCP_TRIES |
196 | try_dhcp: |
199 | 197 | ||
200 | DEBUGF 1,"->Trying DHCP\n" |
198 | DEBUGF 1,"->Trying DHCP\n" |
Line 225... | Line 223... | ||
225 | imul eax, 100 |
223 | imul eax, 100 |
226 | mov [currTime], eax |
224 | mov [currTime], eax |
Line 227... | Line 225... | ||
227 | 225 | ||
Line -... | Line 226... | ||
- | 226 | build_request: ; Creates a DHCP request packet. |
|
- | 227 | ||
228 | build_request: ; Creates a DHCP request packet. |
228 | mov [tries], DHCP_TRIES |
Line 229... | Line 229... | ||
229 | 229 | ||
230 | DEBUGF 1,"->Building request\n" |
230 | DEBUGF 1,"->Building request\n" |
231 | 231 | ||
Line 273... | Line 273... | ||
273 | mov [edx+240+17], dword 0x0f060301 |
273 | mov [edx+240+17], dword 0x0f060301 |
Line 274... | Line 274... | ||
274 | 274 | ||
275 | cmp [dhcpMsgType], byte 0x01 ; Check which msg we are sending |
275 | cmp [dhcpMsgType], byte 0x01 ; Check which msg we are sending |
Line 276... | Line 276... | ||
276 | jne request_options |
276 | jne request_options |
Line 277... | Line 277... | ||
277 | 277 | ||
278 | mov [edx+240+21], byte 0xff ; "Discover" options |
278 | mov [edx+240+21], byte 0xff ; end of options marker |
Line 279... | Line 279... | ||
279 | 279 | ||
280 | mov [dhcpMsgLen], dword 262 ; end of options marker |
280 | mov [dhcpMsgLen], 262 ; length |
281 | jmp send_dhcpmsg |
281 | jmp send_dhcpmsg |
282 | 282 | ||
Line 283... | Line 283... | ||
283 | request_options: |
283 | request_options: |
Line 284... | Line 284... | ||
284 | mov [edx+240+21], word 0x0436 ; server IP |
284 | mov [edx+240+21], word 0x0436 ; server IP |
Line 285... | Line 285... | ||
285 | mov eax, [dhcpServerIP] |
285 | mov eax, [dhcpServerIP] |
286 | mov [edx+240+23], eax |
286 | mov [edx+240+23], eax |
287 | 287 | ||
288 | mov [edx+240+27], byte 0xff ; end of options marker |
288 | mov [edx+240+27], byte 0xff ; end of options marker |
Line 289... | Line 289... | ||
289 | 289 | ||
290 | mov [dhcpMsgLen], dword 268 |
290 | mov [dhcpMsgLen], 268 ; length |
Line 334... | Line 334... | ||
334 | 334 | ||
335 | call dhcp_end |
335 | call dhcp_end |
Line 336... | Line 336... | ||
336 | jmp link_local |
336 | jmp link_local |
- | 337 | ||
337 | 338 | send_request: |
|
338 | send_request: |
339 | DEBUGF 1, "Got offer, making request\n" |
Line 339... | Line 340... | ||
339 | mov [dhcpMsgType], 0x03 ; make it a request |
340 | mov [dhcpMsgType], 0x03 ; make it a request |
340 | jmp build_request |
341 | jmp build_request |
Line 341... | Line 342... | ||
341 | 342 | ||
342 | request: |
343 | request: |
Line -... | Line 344... | ||
- | 344 | call parse_response |
|
- | 345 | ||
343 | call parse_response |
346 | cmp [dhcpMsgType], 0x05 ; Was the response an ACK? It should be |
Line 344... | Line 347... | ||
344 | 347 | jne read_data ; NO - read next packets |
|
345 | cmp [dhcpMsgType], 0x05 ; Was the response an ACK? It should be |
348 | |
346 | jne read_data ; NO - read next packets |
349 | DEBUGF 1, "Got ACK, applying settings\n" |