Subversion Repositories Kolibri OS

Rev

Rev 2891 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2891 Rev 2914
Line 14... Line 14...
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
$Revision: 2891 $
19
$Revision: 2914 $
20
 
20
 
21
MAX_FRAGMENTS                   = 64
21
MAX_FRAGMENTS                   = 64
Line 576... Line 576...
576
        cmp     ecx, 65500              ; Max IPv4 packet size
576
        cmp     ecx, 65500              ; Max IPv4 packet size
577
        ja      .too_large
577
        ja      .too_large
Line 578... Line 578...
578
 
578
 
Line -... Line 579...
-
 
579
        push    ecx eax edx di
-
 
580
 
-
 
581
        cmp     eax, 1 shl 24 + 127
579
        push    ecx eax edx di
582
        je      .loopback
580
 
583
 
581
        call    IPv4_dest_to_dev        ; outputs device number in edi, dest ip in eax
584
        call    IPv4_dest_to_dev        ; outputs device number in edi, dest ip in eax
582
        call    ARP_IP_to_MAC
585
        call    ARP_IP_to_MAC
583
        test    eax, 0xffff0000         ; error bits
586
        test    eax, 0xffff0000         ; error bits
Line 595... Line 598...
595
        mov     di, ETHER_IPv4
598
        mov     di, ETHER_IPv4
596
        call    ETH_output
599
        call    ETH_output
597
        jz      .eth_error
600
        jz      .eth_error
598
        add     esp, 6                  ; pop the mac out of the stack
601
        add     esp, 6                  ; pop the mac out of the stack
Line -... Line 602...
-
 
602
 
599
 
603
  .continue:
600
        xchg    cl, ch                                  ; internet byte order
604
        xchg    cl, ch                                  ; internet byte order
601
        mov     [edi + IPv4_header.VersionAndIHL], 0x45 ; IPv4, normal length (no Optional header)
605
        mov     [edi + IPv4_header.VersionAndIHL], 0x45 ; IPv4, normal length (no Optional header)
602
        mov     [edi + IPv4_header.TypeOfService], 0    ; nothing special, just plain ip packet
606
        mov     [edi + IPv4_header.TypeOfService], 0    ; nothing special, just plain ip packet
603
        mov     [edi + IPv4_header.TotalLength], cx
607
        mov     [edi + IPv4_header.TotalLength], cx
Line 631... Line 635...
631
  .too_large:
635
  .too_large:
632
        DEBUGF  1,"IPv4_output: Packet too large!\n"
636
        DEBUGF  1,"IPv4_output: Packet too large!\n"
633
        xor     edi, edi
637
        xor     edi, edi
634
        ret
638
        ret
Line -... Line 639...
-
 
639
 
-
 
640
  .loopback:
-
 
641
        mov     dword [esp + 2], eax
-
 
642
        add     ecx, sizeof.IPv4_header
-
 
643
        mov     di, ETHER_IPv4
-
 
644
        call    LOOP_output
Line 635... Line 645...
635
 
645
        jmp     .continue