Rev 3636 | Rev 3704 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3636 | Rev 3682 | ||
---|---|---|---|
Line 22... | Line 22... | ||
22 | 22 | ||
23 | TIMEOUT = 3 ; in seconds |
23 | TIMEOUT = 3 ; in seconds |
24 | BUFFER = 1024 ; in bytes |
24 | BUFFER = 1024 ; in bytes |
25 | DHCP_TRIES = 3 ; number of times to try contacting DHCP server |
25 | DHCP_TRIES = 3 ; number of times to try contacting DHCP server |
26 | __DEBUG__ = 1 ; enable/disable |
26 | __DEBUG__ = 1 ; enable/disable |
Line 27... | Line 27... | ||
27 | __DEBUG_LEVEL__ = 1 ; 1 = all, 2 = errors |
27 | __DEBUG_LEVEL__ = 2 ; 1 = all, 2 = errors |
Line 28... | Line 28... | ||
28 | 28 | ||
29 | ; CONFIGURATION FOR LINK-LOCAL |
29 | ; CONFIGURATION FOR LINK-LOCAL |
Line 344... | Line 344... | ||
344 | call parse_response |
344 | call parse_response |
Line 345... | Line 345... | ||
345 | 345 | ||
346 | cmp [dhcpMsgType], 0x05 ; Was the response an ACK? It should be |
346 | cmp [dhcpMsgType], 0x05 ; Was the response an ACK? It should be |
Line 347... | Line 347... | ||
347 | jne read_data ; NO - read next packets |
347 | jne read_data ; NO - read next packets |
Line 348... | Line 348... | ||
348 | 348 | ||
Line 349... | Line 349... | ||
349 | DEBUGF 1, "Got ACK, applying settings\n" |
349 | DEBUGF 2, "Setting IP using DHCP\n" |
350 | 350 | ||
Line 493... | Line 493... | ||
493 | shl ecx, 16 |
493 | shl ecx, 16 |
494 | mov cx, 0xfea9 ; IP 169.254.0.0 link local net, see RFC3927 |
494 | mov cx, 0xfea9 ; IP 169.254.0.0 link local net, see RFC3927 |
495 | mov ebx, API_IPv4 + 3 |
495 | mov ebx, API_IPv4 + 3 |
496 | mov bh, [device] |
496 | mov bh, [device] |
497 | mcall 76, , ecx ; mask is 255.255.0.0 |
497 | mcall 76, , ecx ; mask is 255.255.0.0 |
498 | DEBUGF 1,"Link Local IP assinged: 169.254.%u.%u\n", [generator+0]:1, [generator+1]:1 |
498 | DEBUGF 2,"Link Local IP assigned: 169.254.%u.%u\n", [generator+0]:1, [generator+1]:1 |
499 | mov bl, 7 |
499 | mov bl, 7 |
500 | mcall 76, , 0xffff |
500 | mcall 76, , 0xffff |
501 | mov bl, 9 |
501 | mov bl, 9 |
502 | mcall 76, , 0x0 |
502 | mcall 76, , 0x0 |
503 | mov bl, 5 |
503 | mov bl, 5 |
Line 554... | Line 554... | ||
554 | jmp announce_loop |
554 | jmp announce_loop |
555 | @@: |
555 | @@: |
Line 556... | Line 556... | ||
556 | 556 | ||
557 | 557 | ||
558 | error: |
558 | error: |
559 | DEBUGF 1,"Socket error\n" |
559 | DEBUGF 2,"Socket error\n" |
Line 560... | Line 560... | ||
560 | exit: ; we should, instead of closing, detect ARP conflicts and detect if cable keeps connected ;) |
560 | exit: ; we should, instead of closing, detect ARP conflicts and detect if cable keeps connected ;) |