Subversion Repositories Kolibri OS

Rev

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

Rev 5363 Rev 5522
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: 5363 $
17
$Revision: 5522 $
Line 18... Line 18...
18
 
18
 
Line 152... Line 152...
152
        mov     eax, net_sockets
152
        mov     eax, net_sockets
Line 153... Line 153...
153
 
153
 
154
  .next_socket:
154
  .next_socket:
155
        mov     eax, [eax + SOCKET.NextPtr]
155
        mov     eax, [eax + SOCKET.NextPtr]
156
        or      eax, eax
156
        or      eax, eax
Line 157... Line 157...
157
        jz      .dump_
157
        jz      .unlock_dump
158
 
158
 
Line 159... Line 159...
159
        cmp     [eax + SOCKET.Domain], AF_INET4
159
        cmp     [eax + SOCKET.Domain], AF_INET4
Line 211... Line 211...
211
 
211
 
212
        DEBUGF  DEBUG_NETWORK_VERBOSE, "UDP_input: new remote port=%x\n", cx ; FIXME: find a way to print big endian values with debugf
212
        DEBUGF  DEBUG_NETWORK_VERBOSE, "UDP_input: new remote port=%x\n", cx ; FIXME: find a way to print big endian values with debugf
213
        mov     [eax + UDP_SOCKET.RemotePort], cx
213
        mov     [eax + UDP_SOCKET.RemotePort], cx
Line 214... Line 214...
214
        jmp     .updatesock
214
        jmp     .updatesock
215
 
-
 
216
  .dump_:
215
 
217
 
216
  .unlock_dump:
218
        pusha
217
        pusha
219
        mov     ecx, socket_mutex
218
        mov     ecx, socket_mutex
Line 220... Line 219...
220
        call    mutex_unlock
219
        call    mutex_unlock
221
        popa
-
 
222
 
220
        popa
Line 223... Line 221...
223
        DEBUGF  DEBUG_NETWORK_VERBOSE, "UDP_input: no socket found\n"
221
 
224
 
222
        DEBUGF  DEBUG_NETWORK_VERBOSE, "UDP_input: no socket found\n"
Line 225... Line 223...
225
        jmp     .dump
223
        jmp     .dump
226
 
-
 
227
  .checksum_mismatch:
-
 
228
        DEBUGF  DEBUG_NETWORK_VERBOSE, "UDP_input: checksum mismatch\n"
224
 
229
 
-
 
-
 
225
  .checksum_mismatch:
230
  .dump:
226
        DEBUGF  DEBUG_NETWORK_VERBOSE, "UDP_input: checksum mismatch\n"
Line 231... Line -...
231
        call    NET_packet_free
-
 
232
        add     esp, 4 ; pop (balance stack)
227
 
233
        DEBUGF  DEBUG_NETWORK_VERBOSE,"UDP_input: dumping\n"
228
  .dump:
234
 
229
        DEBUGF  DEBUG_NETWORK_VERBOSE, "UDP_input: dumping\n"
235
        ret
230
        call    NET_BUFF_free
236
 
231
        ret
Line 258... Line 253...
258
        DEBUGF  DEBUG_NETWORK_VERBOSE, "UDP_output: remote port=%x, ", dx    ; FIXME: find a way to print big endian values with debugf
253
        DEBUGF  DEBUG_NETWORK_VERBOSE, "UDP_output: remote port=%x, ", dx    ; FIXME: find a way to print big endian values with debugf
259
        rol     edx, 16
254
        rol     edx, 16
260
        mov     dx, [eax + UDP_SOCKET.LocalPort]
255
        mov     dx, [eax + UDP_SOCKET.LocalPort]
261
        DEBUGF  DEBUG_NETWORK_VERBOSE, "local port=%x\n", dx
256
        DEBUGF  DEBUG_NETWORK_VERBOSE, "local port=%x\n", dx
Line 262... Line 257...
262
 
257
 
263
        sub     esp, 8                                          ; Data ptr and data size will be placed here
258
        sub     esp, 4                                          ; Data ptr will be placed here
264
        push    edx esi
259
        push    edx esi
265
        mov     edx, [eax + IP_SOCKET.LocalIP]
260
        mov     edx, [eax + IP_SOCKET.LocalIP]
266
        mov     eax, [eax + IP_SOCKET.RemoteIP]
261
        mov     eax, [eax + IP_SOCKET.RemoteIP]
267
        mov     di, IP_PROTO_UDP shl 8 + 128
262
        mov     di, IP_PROTO_UDP shl 8 + 128
268
        add     ecx, sizeof.UDP_header
263
        add     ecx, sizeof.UDP_header
269
        call    IPv4_output
264
        call    IPv4_output
270
        jz      .fail
265
        jz      .fail
271
        mov     [esp + 8], eax                                  ; pointer to buffer start
-
 
Line 272... Line 266...
272
        mov     [esp + 8 + 4], edx                              ; buffer size
266
        mov     [esp + 8], eax                                  ; pointer to buffer start
273
 
267
 
Line 274... Line 268...
274
        mov     [edi + UDP_header.Length], cx
268
        mov     [edi + UDP_header.Length], cx