Rev 6911 | Rev 7679 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6911 | Rev 7678 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2017. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2019. 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 | ;; UDP.INC ;; |
6 | ;; UDP.INC ;; |
7 | ;; ;; |
7 | ;; ;; |
8 | ;; Part of the tcp/ip network stack for KolibriOS ;; |
8 | ;; Part of the tcp/ip network stack for KolibriOS ;; |
Line 12... | Line 12... | ||
12 | ;; GNU GENERAL PUBLIC LICENSE ;; |
12 | ;; GNU GENERAL PUBLIC LICENSE ;; |
13 | ;; Version 2, June 1991 ;; |
13 | ;; Version 2, June 1991 ;; |
14 | ;; ;; |
14 | ;; ;; |
15 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
15 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 16... | Line 16... | ||
16 | 16 | ||
Line 17... | Line 17... | ||
17 | $Revision: 6911 $ |
17 | $Revision: 7678 $ |
Line 18... | Line 18... | ||
18 | 18 | ||
Line 28... | Line 28... | ||
28 | 28 | ||
29 | 29 | ||
Line 30... | Line 30... | ||
30 | uglobal |
30 | uglobal |
31 | align 4 |
31 | align 4 |
Line 32... | Line 32... | ||
32 | 32 | ||
Line 33... | Line 33... | ||
33 | UDP_PACKETS_TX rd NET_DEVICES_MAX |
33 | UDP_packets_tx rd NET_DEVICES_MAX |
Line 42... | Line 42... | ||
42 | ; ; |
42 | ; ; |
43 | ;-----------------------------------------------------------------; |
43 | ;-----------------------------------------------------------------; |
44 | macro udp_init { |
44 | macro udp_init { |
Line 45... | Line 45... | ||
45 | 45 | ||
46 | xor eax, eax |
46 | xor eax, eax |
47 | mov edi, UDP_PACKETS_TX |
47 | mov edi, UDP_packets_tx |
48 | mov ecx, 2*NET_DEVICES_MAX |
48 | mov ecx, 2*NET_DEVICES_MAX |
49 | rep stosd |
49 | rep stosd |
Line 186... | Line 186... | ||
186 | lea ecx, [eax + SOCKET.mutex] |
186 | lea ecx, [eax + SOCKET.mutex] |
187 | call mutex_lock |
187 | call mutex_lock |
188 | popa |
188 | popa |
Line 189... | Line 189... | ||
189 | 189 | ||
190 | .updatesock: |
190 | .updatesock: |
Line 191... | Line 191... | ||
191 | inc [UDP_PACKETS_RX + edi] |
191 | inc [UDP_packets_rx + edi] |
192 | 192 | ||
193 | movzx ecx, [esi + UDP_header.Length] |
193 | movzx ecx, [esi + UDP_header.Length] |
Line 284... | Line 284... | ||
284 | DEBUGF DEBUG_NETWORK_VERBOSE, "UDP_output: sending with device %x\n", ebx |
284 | DEBUGF DEBUG_NETWORK_VERBOSE, "UDP_output: sending with device %x\n", ebx |
285 | call [ebx + NET_DEVICE.transmit] |
285 | call [ebx + NET_DEVICE.transmit] |
286 | test eax, eax |
286 | test eax, eax |
287 | jnz @f |
287 | jnz @f |
288 | call net_ptr_to_num4 |
288 | call net_ptr_to_num4 |
289 | inc [UDP_PACKETS_TX + edi] |
289 | inc [UDP_packets_tx + edi] |
290 | @@: |
290 | @@: |
Line 291... | Line 291... | ||
291 | 291 | ||
Line 292... | Line 292... | ||
292 | ret |
292 | ret |
Line 339... | Line 339... | ||
339 | mov eax, [eax + UDP_SOCKET.RemoteIP] |
339 | mov eax, [eax + UDP_SOCKET.RemoteIP] |
340 | call ipv4_route |
340 | call ipv4_route |
341 | test eax, eax |
341 | test eax, eax |
342 | jz .enoroute |
342 | jz .enoroute |
343 | pop eax |
343 | pop eax |
344 | mov ebx, [NET_DRV_LIST + edi] |
344 | mov ebx, [net_drv_list + edi] |
345 | mov [eax + UDP_SOCKET.device], ebx |
345 | mov [eax + UDP_SOCKET.device], ebx |
346 | mov [eax + UDP_SOCKET.LocalIP], edx |
346 | mov [eax + UDP_SOCKET.LocalIP], edx |
347 | popa |
347 | popa |
Line 348... | Line 348... | ||
348 | 348 | ||
Line 418... | Line 418... | ||
418 | .error: |
418 | .error: |
419 | mov eax, -1 |
419 | mov eax, -1 |
420 | ret |
420 | ret |
Line 421... | Line 421... | ||
421 | 421 | ||
422 | .packets_tx: |
422 | .packets_tx: |
423 | mov eax, [UDP_PACKETS_TX + eax] |
423 | mov eax, [UDP_packets_tx + eax] |
Line 424... | Line 424... | ||
424 | ret |
424 | ret |
425 | 425 | ||
426 | .packets_rx: |
426 | .packets_rx: |