Rev 3545 | Rev 3600 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3545 | Rev 3556 | ||
---|---|---|---|
Line 114... | Line 114... | ||
114 | ; |
114 | ; |
115 | ;----------------------------------------------------------------- |
115 | ;----------------------------------------------------------------- |
116 | align 4 |
116 | align 4 |
117 | UDP_input: |
117 | UDP_input: |
Line 118... | Line 118... | ||
118 | 118 | ||
Line 119... | Line 119... | ||
119 | DEBUGF 1,"UDP_input: size=%u\n", ecx |
119 | DEBUGF DEBUG_NETWORK_VERBOSE, "UDP_input: size=%u\n", ecx |
Line 120... | Line 120... | ||
120 | 120 | ||
121 | ; First validate, checksum |
121 | ; First validate, checksum |
Line 127... | Line 127... | ||
127 | 127 | ||
128 | UDP_checksum (edi), (edi+4) |
128 | UDP_checksum (edi), (edi+4) |
Line 129... | Line 129... | ||
129 | jnz .checksum_mismatch |
129 | jnz .checksum_mismatch |
130 | 130 | ||
Line 131... | Line 131... | ||
131 | .no_checksum: |
131 | .no_checksum: |
Line 132... | Line 132... | ||
132 | DEBUGF 1,"UDP_input: checksum ok\n" |
132 | DEBUGF DEBUG_NETWORK_VERBOSE, "UDP_input: checksum ok\n" |
Line 156... | Line 156... | ||
156 | jne .next_socket |
156 | jne .next_socket |
Line 157... | Line 157... | ||
157 | 157 | ||
158 | cmp [eax + UDP_SOCKET.LocalPort], dx |
158 | cmp [eax + UDP_SOCKET.LocalPort], dx |
Line 159... | Line 159... | ||
159 | jne .next_socket |
159 | jne .next_socket |
Line 160... | Line 160... | ||
160 | 160 | ||
Line 161... | Line 161... | ||
161 | DEBUGF 1,"UDP_input: socket=%x\n", eax |
161 | DEBUGF DEBUG_NETWORK_VERBOSE, "UDP_input: socket=%x\n", eax |
162 | 162 | ||
Line 194... | Line 194... | ||
194 | pusha |
194 | pusha |
195 | lea ecx, [eax + SOCKET.mutex] |
195 | lea ecx, [eax + SOCKET.mutex] |
196 | call mutex_lock |
196 | call mutex_lock |
197 | popa |
197 | popa |
Line 198... | Line 198... | ||
198 | 198 | ||
199 | DEBUGF 1,"UDP_input: new remote port=%x\n", cx ; FIXME: find a way to print big endian values with debugf |
199 | DEBUGF DEBUG_NETWORK_VERBOSE, "UDP_input: new remote port=%x\n", cx ; FIXME: find a way to print big endian values with debugf |
200 | mov [eax + UDP_SOCKET.RemotePort], cx |
200 | mov [eax + UDP_SOCKET.RemotePort], cx |
Line 201... | Line 201... | ||
201 | inc [eax + UDP_SOCKET.firstpacket] |
201 | inc [eax + UDP_SOCKET.firstpacket] |
Line 202... | Line 202... | ||
202 | 202 | ||
203 | jmp .updatesock |
203 | jmp .updatesock |
Line 204... | Line 204... | ||
204 | 204 | ||
205 | 205 | ||
206 | .checksum_mismatch: |
206 | .checksum_mismatch: |
207 | DEBUGF 2,"UDP_input: checksum mismatch\n" |
207 | DEBUGF DEBUG_NETWORK_VERBOSE, "UDP_input: checksum mismatch\n" |
Line 208... | Line 208... | ||
208 | 208 | ||
Line 227... | Line 227... | ||
227 | ;----------------------------------------------------------------- |
227 | ;----------------------------------------------------------------- |
Line 228... | Line 228... | ||
228 | 228 | ||
229 | align 4 |
229 | align 4 |
Line 230... | Line 230... | ||
230 | UDP_output: |
230 | UDP_output: |
Line 231... | Line 231... | ||
231 | 231 | ||
232 | DEBUGF 1,"UDP_output: socket=%x bytes=%u data_ptr=%x\n", eax, ecx, esi |
232 | DEBUGF DEBUG_NETWORK_VERBOSE, "UDP_output: socket=%x bytes=%u data_ptr=%x\n", eax, ecx, esi |
233 | 233 | ||
234 | mov dx, [eax + UDP_SOCKET.RemotePort] |
234 | mov dx, [eax + UDP_SOCKET.RemotePort] |
235 | DEBUGF 1,"UDP_output: remote port=%x, ", dx ; FIXME: find a way to print big endian values with debugf |
235 | DEBUGF DEBUG_NETWORK_VERBOSE, "UDP_output: remote port=%x, ", dx ; FIXME: find a way to print big endian values with debugf |
Line 236... | Line 236... | ||
236 | rol edx, 16 |
236 | rol edx, 16 |
237 | mov dx, [eax + UDP_SOCKET.LocalPort] |
237 | mov dx, [eax + UDP_SOCKET.LocalPort] |
238 | DEBUGF 1,"local port=%x\n", dx |
238 | DEBUGF DEBUG_NETWORK_VERBOSE, "local port=%x\n", dx |
239 | 239 | ||
Line 268... | Line 268... | ||
268 | ; Checksum |
268 | ; Checksum |
269 | mov esi, edi |
269 | mov esi, edi |
270 | mov [edi + UDP_header.Checksum], 0 |
270 | mov [edi + UDP_header.Checksum], 0 |
271 | UDP_checksum (edi-4), (edi-8) ; FIXME: IPv4 packet could have options.. |
271 | UDP_checksum (edi-4), (edi-8) ; FIXME: IPv4 packet could have options.. |
Line 272... | Line 272... | ||
272 | 272 | ||
273 | DEBUGF 1,"UDP_output: sending with device %x\n", ebx |
273 | DEBUGF DEBUG_NETWORK_VERBOSE, "UDP_output: sending with device %x\n", ebx |
274 | call [ebx + NET_DEVICE.transmit] |
274 | call [ebx + NET_DEVICE.transmit] |
275 | test eax, eax |
275 | test eax, eax |
276 | jnz @f |
276 | jnz @f |
277 | inc [UDP_PACKETS_TX] ; FIXME: correct device? |
277 | inc [UDP_PACKETS_TX] ; FIXME: correct device? |
Line 278... | Line 278... | ||
278 | @@: |
278 | @@: |
Line 279... | Line 279... | ||
279 | 279 | ||
280 | ret |
280 | ret |
281 | 281 | ||
282 | .fail: |
282 | .fail: |
283 | DEBUGF 1,"UDP_output: failed\n" |
283 | DEBUGF DEBUG_NETWORK_ERROR, "UDP_output: failed\n" |