Subversion Repositories Kolibri OS

Rev

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

Rev 3556 Rev 3600
Line 17... Line 17...
17
$Revision: 2891 $
17
$Revision: 2891 $
Line 18... Line 18...
18
 
18
 
Line 19... Line 19...
19
iglobal
19
iglobal
-
 
20
 
20
 
21
LOOPBACK_DEVICE:
21
LOOPBACK_DEVICE:
22
 
22
        .type            dd NET_TYPE_LOOPBACK
23
        .device_type     dd NET_DEVICE_LOOPBACK
Line 23... Line 24...
23
        .mtu             dd 4096
24
        .mtu             dd 4096
24
        .name            dd .namestr
25
        .name            dd .namestr
Line 58... Line 59...
58
        push    ebx
59
        push    ebx
59
        push    ecx
60
        push    ecx
60
        push    eax
61
        push    eax
Line 61... Line 62...
61
 
62
 
62
        DEBUGF  DEBUG_NETWORK_VERBOSE, "LOOP_input: size=%u\n", ecx
63
        DEBUGF  DEBUG_NETWORK_VERBOSE, "LOOP_input: size=%u\n", ecx
63
        lea     edx, [eax + 2]
64
        lea     edx, [eax + 4]
64
        mov     ax, word[eax]
65
        mov     eax, dword[eax]
Line 65... Line 66...
65
        mov     ebx, LOOPBACK_DEVICE
66
        mov     ebx, LOOPBACK_DEVICE
66
 
67
 
Line 67... Line 68...
67
        cmp     ax, ETHER_IPv4
68
        cmp     eax, AF_INET4
Line 68... Line 69...
68
        je      IPv4_input
69
        je      IPv4_input
Line 94... Line 95...
94
LOOP_output:
95
LOOP_output:
Line 95... Line 96...
95
 
96
 
Line 96... Line 97...
96
        DEBUGF  DEBUG_NETWORK_VERBOSE, "LOOP_output\n"
97
        DEBUGF  DEBUG_NETWORK_VERBOSE, "LOOP_output\n"
97
 
98
 
Line 98... Line 99...
98
        push    ecx
99
        push    ecx
99
        push    di
100
        push    edi
100
 
101
 
101
        add     ecx, 2
102
        add     ecx, 4
102
        cmp     ecx, [LOOPBACK_DEVICE.mtu]
103
        cmp     ecx, [LOOPBACK_DEVICE.mtu]
103
        ja      .out_of_ram
104
        ja      .out_of_ram
104
        stdcall kernel_alloc, ecx
105
        stdcall kernel_alloc, ecx
105
        test    eax, eax
106
        test    eax, eax
106
        jz      .out_of_ram
107
        jz      .out_of_ram
Line 107... Line 108...
107
        mov     edi, eax
108
        mov     edi, eax
108
        pop     ax
109
        pop     eax
109
        stosw
110
        stosd
110
 
111
 
Line 111... Line 112...
111
        lea     eax, [edi - 2]  ; Set eax to buffer start
112
        lea     eax, [edi - 4]  ; Set eax to buffer start
112
        pop     ecx
113
        pop     ecx
113
        lea     edx, [ecx + 2]  ; Set edx to complete buffer size
114
        lea     edx, [ecx + 4]  ; Set edx to complete buffer size
Line 114... Line 115...
114
        mov     ebx, LOOPBACK_DEVICE
115
        mov     ebx, LOOPBACK_DEVICE
115
 
116
 
116
  .done:
117
  .done:
117
        DEBUGF  DEBUG_NETWORK_VERBOSE, "LOOP_output: ptr=%x size=%u\n", eax, edx
118
        DEBUGF  DEBUG_NETWORK_VERBOSE, "LOOP_output: ptr=%x size=%u\n", eax, edx
118
        ret
119
        ret