Rev 1485 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1485 | Rev 1514 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;; ARP.INC ;; |
6 | ;; ARP.INC ;; |
7 | ;; ;; |
7 | ;; ;; |
8 | ;; Part of the tcp/ip network stack for KolibriOS ;; |
8 | ;; Part of the tcp/ip network stack for KolibriOS ;; |
Line 10... | Line 10... | ||
10 | ;; Based on the work of [Johnny_B] and [smb] ;; |
10 | ;; Based on the work of [Johnny_B] and [smb] ;; |
11 | ;; ;; |
11 | ;; ;; |
12 | ;; Written by hidnplayr@kolibrios.org ;; |
12 | ;; Written by hidnplayr@kolibrios.org ;; |
13 | ;; ;; |
13 | ;; ;; |
14 | ;; GNU GENERAL PUBLIC LICENSE ;; |
14 | ;; GNU GENERAL PUBLIC LICENSE ;; |
15 | ;; Version 2, June 1991 ;; |
15 | ;; Version 2, June- 1991 ;; |
16 | ;; ;; |
16 | ;; ;; |
17 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
17 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 18... | Line 18... | ||
18 | 18 | ||
Line 19... | Line 19... | ||
19 | 19 | ||
20 | $Revision: 1485 $ |
20 | $Revision: 1514 $ |
21 | 21 | ||
Line 240... | Line 240... | ||
240 | 240 | ||
241 | push eax ; DestIP |
241 | push eax ; DestIP |
242 | mov eax, [IP_LIST+4*edi] ; senderIP |
242 | mov eax, [IP_LIST+4*edi] ; senderIP |
Line 243... | Line 243... | ||
243 | push eax |
243 | push eax |
244 | 244 | ||
245 | mov edi, [ETH_DRV_LIST + 4*edi] |
245 | mov edi, [NET_DRV_LIST + 4*edi] |
246 | lea eax, [edi + ETH_DEVICE.mac] |
246 | lea eax, [edi + ETH_DEVICE.mac] |
247 | mov ebx, ETH_BROADCAST |
247 | mov ebx, ETH_BROADCAST |
248 | mov ecx, 60 ; minimum packet size |
248 | mov ecx, 60 ; minimum packet size |
249 | mov edx, edi ;;; |
249 | mov edx, edi ;;; |
250 | mov di , ETHER_ARP |
- | |
251 | call ETH_create_packet |
250 | mov di , ETHER_ARP |
Line 252... | Line 251... | ||
252 | cmp edi, -1 |
251 | call ETH_create_packet |
Line 253... | Line 252... | ||
253 | je .exit |
252 | jz .exit |
254 | 253 | ||
Line 273... | Line 272... | ||
273 | stosd ; |
272 | stosd ; |
Line 274... | Line 273... | ||
274 | 273 | ||
Line 275... | Line 274... | ||
275 | DEBUGF 1,"ARP Packet for device %x created successfully\n", ebx |
274 | DEBUGF 1,"ARP Packet for device %x created successfully\n", ebx |
276 | 275 | ||
Line 277... | Line 276... | ||
277 | push edx ecx |
276 | push edx ecx |
278 | jmp ETH_sender |
277 | jmp NET_send |
279 | 278 | ||
280 | .exit: |
279 | .exit: |
Line 521... | Line 520... | ||
521 | 520 | ||
522 | .maybe_request: |
521 | .maybe_request: |
523 | cmp word [edx + ARP_Packet.Opcode], ARP_REQ_OPCODE ; Is this a request packet? |
522 | cmp word [edx + ARP_Packet.Opcode], ARP_REQ_OPCODE ; Is this a request packet? |
Line 524... | Line 523... | ||
524 | jne .exit |
523 | jne .exit |
525 | 524 | ||
526 | call ETH_struc2dev |
525 | call NET_ptr_to_num |
527 | DEBUGF 1,"ARP Request packet through device: %u\n", edi |
526 | DEBUGF 1,"ARP Request packet through device: %u\n", edi |
528 | inc [ARP_PACKETS_RX+4*edi] |
527 | inc [ARP_PACKETS_RX+4*edi] |
Line 547... | Line 546... | ||
547 | movsd ; Move Sender Mac to Dest MAC |
546 | movsd ; Move Sender Mac to Dest MAC |
548 | movsw ; |
547 | movsw ; |
549 | movsd ; Move sender IP to Dest IP |
548 | movsd ; Move sender IP to Dest IP |
Line 550... | Line 549... | ||
550 | 549 | ||
551 | pop esi |
550 | pop esi |
552 | mov esi, [ETH_DRV_LIST + 4*esi] |
551 | mov esi, [NET_DRV_LIST + 4*esi] |
553 | lea esi, [esi + ETH_DEVICE.mac] |
552 | lea esi, [esi + ETH_DEVICE.mac] |
554 | lea edi, [edx + ARP_Packet.SenderMAC] |
553 | lea edi, [edx + ARP_Packet.SenderMAC] |
555 | movsd ; Copy MAC address from in MAC_LIST |
554 | movsd ; Copy MAC address from in MAC_LIST |
556 | movsw ; |
555 | movsw ; |
Line 571... | Line 570... | ||
571 | ; mov ax , ETHER_ARP |
570 | ; mov ax , ETHER_ARP |
572 | ; stosw |
571 | ; stosw |
Line 573... | Line 572... | ||
573 | 572 | ||
Line 574... | Line 573... | ||
574 | DEBUGF 1,"ARP_Handler - Sending reply \n" |
573 | DEBUGF 1,"ARP_Handler - Sending reply \n" |
Line 575... | Line 574... | ||
575 | 574 | ||
576 | jmp ETH_sender ; And send it! |
575 | jmp NET_send ; And send it! |
577 | 576 |