Rev 1529 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1529 | Rev 1533 | ||
---|---|---|---|
Line 13... | Line 13... | ||
13 | ;; GNU GENERAL PUBLIC LICENSE ;; |
13 | ;; GNU GENERAL PUBLIC LICENSE ;; |
14 | ;; Version 2, June 1991 ;; |
14 | ;; Version 2, June 1991 ;; |
15 | ;; ;; |
15 | ;; ;; |
16 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
16 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 17... | Line 17... | ||
17 | 17 | ||
Line 18... | Line 18... | ||
18 | $Revision: 1529 $ |
18 | $Revision: 1533 $ |
Line 19... | Line 19... | ||
19 | 19 | ||
20 | virtual at 0 |
20 | virtual at 0 |
Line 167... | Line 167... | ||
167 | .start_ptr dd ? ; Pointer to start of buffer |
167 | .start_ptr dd ? ; Pointer to start of buffer |
168 | .end_ptr dd ? ; pointer to end of buffer |
168 | .end_ptr dd ? ; pointer to end of buffer |
169 | .read_ptr dd ? ; Read pointer |
169 | .read_ptr dd ? ; Read pointer |
170 | .write_ptr dd ? ; Write pointer |
170 | .write_ptr dd ? ; Write pointer |
171 | .size dd ? ; Number of bytes buffered |
171 | .size dd ? ; Number of bytes buffered |
- | 172 | .end: |
|
172 | } |
173 | } |
Line 173... | Line 174... | ||
173 | 174 | ||
Line 174... | Line 175... | ||
174 | virtual at 0 |
175 | virtual at 0 |
Line 175... | Line 176... | ||
175 | 176 | ||
Line 176... | Line 177... | ||
176 | RING_BUFFER RING_BUFFER |
177 | RING_BUFFER RING_BUFFER |
Line 177... | Line -... | ||
177 | - | ||
178 | end virtual |
- | |
179 | - | ||
180 | virtual at TCP_SOCKET.end |
178 | |
- | 179 | end virtual |
|
- | 180 | ||
181 | 181 | virtual at TCP_SOCKET.end |
|
Line 182... | Line 182... | ||
182 | rcv RING_BUFFER |
182 | |
Line 219... | Line 219... | ||
219 | xor eax, eax |
219 | xor eax, eax |
220 | mov edi, net_sockets |
220 | mov edi, net_sockets |
221 | mov ecx, 4 |
221 | mov ecx, 4 |
222 | rep stosd |
222 | rep stosd |
Line 223... | Line -... | ||
223 | - | ||
224 | ;--- for random port -- |
- | |
225 | - | ||
226 | mov al, 0x0 ; set up 1s timer |
- | |
227 | out 0x70, al |
- | |
228 | in al, 0x71 |
- | |
229 | - | ||
230 | ;---------------------- |
- | |
231 | 223 | ||
232 | @@: |
224 | @@: |
233 | pseudo_random eax |
225 | pseudo_random eax |
234 | cmp ax, MIN_EPHEMERAL_PORT |
226 | cmp ax, MIN_EPHEMERAL_PORT |
235 | jl @r |
227 | jl @r |
236 | cmp ax, MAX_EPHEMERAL_PORT |
228 | cmp ax, MAX_EPHEMERAL_PORT |
237 | jg @r |
- | |
238 | 229 | jg @r |
|
Line 239... | Line 230... | ||
239 | mov [last_UDP_port], ax |
230 | mov [last_UDP_port], ax |
240 | 231 | ||
241 | @@: |
232 | @@: |
242 | pseudo_random eax |
233 | pseudo_random eax |
243 | cmp ax, MIN_EPHEMERAL_PORT |
234 | cmp ax, MIN_EPHEMERAL_PORT |
244 | jl @r |
235 | jl @r |
245 | cmp ax, MAX_EPHEMERAL_PORT |
- | |
246 | jg @r |
236 | cmp ax, MAX_EPHEMERAL_PORT |
Line 247... | Line 237... | ||
247 | 237 | jg @r |
|
Line 316... | Line 306... | ||
316 | pop [eax + IP_SOCKET.LocalIP] ;;;; |
306 | pop [eax + IP_SOCKET.LocalIP] ;;;; |
Line 317... | Line 307... | ||
317 | 307 | ||
318 | cmp edx, IP_PROTO_TCP |
308 | cmp edx, IP_PROTO_TCP |
Line 319... | Line 309... | ||
319 | jnz .no_stream |
309 | jnz .no_stream |
320 | - | ||
321 | mov esi, eax |
- | |
322 | stdcall kernel_alloc, SOCKET_MAXDATA |
- | |
323 | mov [esi + rcv.start_ptr], eax |
- | |
324 | mov [esi + rcv.write_ptr], eax |
- | |
325 | mov [esi + rcv.read_ptr], eax |
- | |
326 | mov [esi + rcv.size], 0 |
- | |
Line 327... | Line 310... | ||
327 | add eax, SOCKET_MAXDATA |
310 | |
328 | mov [esi + rcv.end_ptr], eax |
- | |
329 | 311 | mov ebx, eax |
|
- | 312 | ||
330 | stdcall kernel_alloc, SOCKET_MAXDATA |
313 | lea eax, [ebx + STREAM_SOCKET.snd] |
331 | mov [esi + snd.start_ptr], eax |
- | |
332 | mov [esi + snd.write_ptr], eax |
314 | call SOCKET_ring_create |
333 | mov [esi + snd.read_ptr], eax |
- | |
Line 334... | Line 315... | ||
334 | mov [esi + snd.size], 0 |
315 | |
Line 335... | Line 316... | ||
335 | add eax, SOCKET_MAXDATA |
316 | lea eax, [ebx + STREAM_SOCKET.rcv] |
Line 495... | Line 476... | ||
495 | mov [eax + TCP_SOCKET.timer_persist], 0 |
476 | mov [eax + TCP_SOCKET.timer_persist], 0 |
496 | mov [eax + TCP_SOCKET.t_state], TCB_SYN_SENT |
477 | mov [eax + TCP_SOCKET.t_state], TCB_SYN_SENT |
497 | mov ebx, [TCP_sequence_num] |
478 | mov ebx, [TCP_sequence_num] |
498 | add [TCP_sequence_num], 6400 |
479 | add [TCP_sequence_num], 6400 |
499 | mov [eax + TCP_SOCKET.ISS], ebx |
480 | mov [eax + TCP_SOCKET.ISS], ebx |
500 | mov [eax + TCP_SOCKET.timer_keepalive], 120 ; 120*640ms => 75,6 seconds |
481 | mov [eax + TCP_SOCKET.timer_keepalive], TCP_time_keep_init |
- | 482 | ||
- | 483 | TCP_sendseqinit eax |
|
Line 501... | Line 484... | ||
501 | 484 | ||
Line 502... | Line 485... | ||
502 | ;;;; mov [ebx + TCP_SOCKET.timer_retransmission], |
485 | ;;;; mov [ebx + TCP_SOCKET.timer_retransmission], ;; todo: create macro to set retransmission timer |
503 | 486 | ||
504 | push eax |
487 | push eax |
Line 669... | Line 652... | ||
669 | DEBUGF 1,"socket_receive: socknum: %u bufaddr: %x, buflength: %u, flags: %x\n", ecx, edx, esi, edi |
652 | DEBUGF 1,"socket_receive: socknum: %u bufaddr: %x, buflength: %u, flags: %x\n", ecx, edx, esi, edi |
Line 670... | Line 653... | ||
670 | 653 | ||
671 | call SOCKET_num_to_ptr |
654 | call SOCKET_num_to_ptr |
Line -... | Line 655... | ||
- | 655 | jz s_error |
|
- | 656 | ||
- | 657 | cmp [eax + SOCKET.Type], IP_PROTO_TCP ;;;;;;;; |
|
672 | jz s_error |
658 | je .tcp |
673 | 659 | ||
674 | mov ebx, esi |
660 | mov ebx, esi |
675 | get_from_queue (eax + SOCKET_QUEUE_LOCATION),\ |
661 | get_from_queue (eax + SOCKET_QUEUE_LOCATION),\ |
676 | SOCKET_QUEUE_SIZE,\ |
662 | SOCKET_QUEUE_SIZE,\ |
Line 705... | Line 691... | ||
705 | jz .nd |
691 | jz .nd |
706 | rep movsd |
692 | rep movsd |
707 | .nd: |
693 | .nd: |
708 | ; remove the packet ;;; TODO: only if it is empty!! |
694 | ; remove the packet ;;; TODO: only if it is empty!! |
Line 709... | Line -... | ||
709 | - | ||
710 | ;;;; call TCP_output ; only if it is tcp |
- | |
711 | 695 | ||
- | 696 | call kernel_free |
|
- | 697 | ret |
|
- | 698 | ||
- | 699 | .tcp: |
|
- | 700 | ||
- | 701 | mov ecx, esi |
|
- | 702 | mov edi, edx |
|
- | 703 | add eax, STREAM_SOCKET.rcv |
|
- | 704 | call SOCKET_ring_read |
|
- | 705 | ||
Line 712... | Line 706... | ||
712 | call kernel_free |
706 | mov dword[esp+32], ecx ; return number of bytes copied in ebx |
Line 713... | Line 707... | ||
713 | 707 | ||
Line 785... | Line 779... | ||
785 | 779 | ||
786 | call SOCKET_find_port |
780 | call SOCKET_find_port |
Line 787... | Line 781... | ||
787 | jz s_error |
781 | jz s_error |
788 | - | ||
Line -... | Line 782... | ||
- | 782 | ||
- | 783 | @@: |
|
- | 784 | ||
- | 785 | push eax |
|
- | 786 | mov ecx, esi |
|
- | 787 | mov esi, edx |
|
789 | @@: |
788 | add eax, STREAM_SOCKET.snd |
Line 790... | Line 789... | ||
790 | ;;;; TODO: queue the data |
789 | call SOCKET_ring_write |
791 | 790 | pop eax |
|
Line 1026... | Line 1025... | ||
1026 | call kernel_free |
1025 | call kernel_free |
1027 | add esp, 8 |
1026 | add esp, 8 |
Line 1028... | Line 1027... | ||
1028 | 1027 | ||
Line -... | Line 1028... | ||
- | 1028 | ret |
|
- | 1029 | ||
- | 1030 | ||
- | 1031 | ;-------------------------- |
|
- | 1032 | ; |
|
- | 1033 | ; eax = ptr to ring struct (just a buffer of the right size) |
|
- | 1034 | ; |
|
- | 1035 | align 4 |
|
- | 1036 | SOCKET_ring_create: |
|
- | 1037 | ||
- | 1038 | mov esi, eax |
|
- | 1039 | stdcall create_ring_buffer, SOCKET_MAXDATA, PG_SW |
|
- | 1040 | ||
- | 1041 | DEBUGF 1,"SOCKET_ring_created: %x\n", eax |
|
- | 1042 | mov [esi + RING_BUFFER.start_ptr], eax |
|
- | 1043 | mov [esi + RING_BUFFER.write_ptr], eax |
|
- | 1044 | mov [esi + RING_BUFFER.read_ptr], eax |
|
- | 1045 | mov [esi + RING_BUFFER.size], 0 |
|
- | 1046 | add eax, SOCKET_MAXDATA |
|
- | 1047 | mov [esi + RING_BUFFER.end_ptr], eax |
|
- | 1048 | ||
1029 | ret |
1049 | ret |
1030 | 1050 | ||
1031 | ;----------------------------------------------------------------- |
1051 | ;----------------------------------------------------------------- |
1032 | ; |
1052 | ; |
1033 | ; SOCKET_ring_add |
1053 | ; SOCKET_ring_write |
1034 | ; |
1054 | ; |
1035 | ; Adds data to a stream socket |
1055 | ; Adds data to a stream socket, and updates write pointer and size |
1036 | ; |
1056 | ; |
1037 | ; IN: eax = ptr to ring struct |
1057 | ; IN: eax = ptr to ring struct |
1038 | ; ecx = data size |
1058 | ; ecx = data size |
1039 | ; esi = ptr to data |
1059 | ; esi = ptr to data |
1040 | ; |
1060 | ; |
1041 | ; OUT: eax = number of bytes stored |
1061 | ; OUT: ecx = number of bytes stored |
1042 | ; |
1062 | ; |
1043 | ;----------------------------------------------------------------- |
1063 | ;----------------------------------------------------------------- |
Line 1044... | Line 1064... | ||
1044 | align 4 |
1064 | align 4 |
Line 1045... | Line 1065... | ||
1045 | SOCKET_ring_add: |
1065 | SOCKET_ring_write: |
1046 | - | ||
1047 | DEBUGF 1,"SOCKET_ring_add: ringbuff=%x ptr=%x size=%u\n", eax, esi, ecx |
1066 | |
1048 | 1067 | DEBUGF 1,"SOCKET_ring_write: ringbuff=%x ptr=%x size=%u\n", eax, esi, ecx |
|
Line 1049... | Line -... | ||
1049 | mov edi, [eax + RING_BUFFER.size] |
- | |
1050 | add edi, ecx |
1068 | |
1051 | cmp edi, SOCKET_MAXDATA |
- | |
1052 | jg .too_large |
- | |
1053 | - | ||
1054 | mov [eax + RING_BUFFER.size], edi ; update size |
1069 | add [eax + RING_BUFFER.size], ecx |
1055 | .copy: |
1070 | cmp [eax + RING_BUFFER.size], SOCKET_MAXDATA |
1056 | push ecx ;<<<< 1 |
- | |
1057 | mov edi, [eax + RING_BUFFER.write_ptr] ; set write ptr in edi |
- | |
Line 1058... | Line -... | ||
1058 | add [eax + RING_BUFFER.write_ptr], ecx ; update write pointer |
- | |
1059 | mov edx, [eax + RING_BUFFER.end_ptr] |
1071 | jg .too_large |
1060 | cmp edx, [eax + RING_BUFFER.write_ptr] |
1072 | |
1061 | jg .copy_in_2 |
1073 | .copy: |
1062 | je .wrap_write_ptr |
1074 | mov edi, [eax + RING_BUFFER.write_ptr] |
- | 1075 | DEBUGF 2,"Copying %u bytes from %x to %x\n", ecx, esi, edi |
|
1063 | 1076 | ||
- | 1077 | push ecx |
|
- | 1078 | shr ecx, 1 |
|
- | 1079 | jnc .nb |
|
- | 1080 | movsb |
|
- | 1081 | .nb: |
|
1064 | .copy_more: |
1082 | shr ecx, 1 |
- | 1083 | jnc .nw |
|
1065 | push ecx |
1084 | movsw |
- | 1085 | .nw: |
|
- | 1086 | test ecx, ecx |
|
- | 1087 | jz .nd |
|
- | 1088 | rep movsd |
|
- | 1089 | .nd: |
|
- | 1090 | pop ecx |
|
- | 1091 | ||
- | 1092 | cmp edi, [eax + RING_BUFFER.end_ptr] |
|
- | 1093 | jge .wrap |
|
1066 | and ecx, 3 |
1094 | mov [eax + RING_BUFFER.write_ptr], edi |
Line 1067... | Line 1095... | ||
1067 | rep movsb |
1095 | |
Line 1068... | Line 1096... | ||
1068 | pop ecx |
1096 | ret |
1069 | shr ecx, 2 |
1097 | |
1070 | rep movsd |
1098 | .wrap: |
1071 | pop ecx ; >>>> 1/2 |
1099 | sub edi, SOCKET_MAXDATA |
Line 1072... | Line 1100... | ||
1072 | DEBUGF 2,"Copied %u bytes\n", ecx |
1100 | mov [eax + RING_BUFFER.write_ptr], edi |
1073 | - | ||
1074 | ret |
1101 | |
Line 1075... | Line 1102... | ||
1075 | 1102 | ret |
|
1076 | .too_large: |
1103 | |
1077 | mov ecx, SOCKET_MAXDATA ; calculate number of bytes available in buffer |
1104 | .too_large: |
1078 | sub ecx, [eax + RING_BUFFER.size] |
1105 | mov ecx, SOCKET_MAXDATA ; calculate number of bytes available in buffer |
Line 1079... | Line -... | ||
1079 | jz .full |
- | |
1080 | - | ||
1081 | mov [eax + RING_BUFFER.size], SOCKET_MAXDATA ; update size, we will fill buffer completely |
- | |
1082 | - | ||
1083 | jmp .copy |
- | |
1084 | - | ||
1085 | .full: |
- | |
1086 | DEBUGF 2,"Ring buffer is full!\n" |
- | |
1087 | xor ecx, ecx |
- | |
1088 | ret |
- | |
1089 | - | ||
1090 | .copy_in_2: |
- | |
1091 | DEBUGF 1,"Copying in 2 passes\n" |
- | |
1092 | - | ||
1093 | mov edx, ecx |
- | |
1094 | mov ecx, [eax + RING_BUFFER.end_ptr] ; find number of bytes till end of buffer |
- | |
1095 | sub ecx, edi |
- | |
1096 | sub edx, ecx |
- | |
Line 1097... | Line 1106... | ||
1097 | push edx ; <<<< 2 |
1106 | sub ecx, [eax + RING_BUFFER.size] |
1098 | 1107 | jge .full |
|
1099 | mov edi, [eax + RING_BUFFER.start_ptr] |
1108 | |
1100 | call .copy_more |
1109 | mov [eax + RING_BUFFER.size], SOCKET_MAXDATA ; update size, we will fill buffer completely |
1101 | 1110 | jmp .copy |
|
1102 | .wrap_write_ptr: |
1111 | |
1103 | sub [eax + RING_BUFFER.write_ptr], SOCKET_MAXDATA ; update write pointer |
1112 | .full: |
1104 | jmp .copy_more |
1113 | DEBUGF 2,"Ring buffer is full!\n" |
1105 | 1114 | xor ecx, ecx |
|
1106 | 1115 | ret |
|
1107 | 1116 | ||
1108 | 1117 | ||
1109 | ;----------------------------------------------------------------- |
1118 | ;----------------------------------------------------------------- |
1110 | ; |
1119 | ; |
1111 | ; SOCKET_ring_read |
1120 | ; SOCKET_ring_read |
Line 1112... | Line 1121... | ||
1112 | ; |
1121 | ; |
Line 1113... | Line 1122... | ||
1113 | ; reads the data, but let the data remain in the buffer |
1122 | ; reads the data, BUT DOES NOT CLEAR IT FROM MEMORY YET |
1114 | ; |
1123 | ; |
Line 1115... | Line -... | ||
1115 | ; IN: eax = ptr to ring struct |
- | |
1116 | ; ecx = buffer size |
1124 | ; IN: eax = ptr to ring struct |
1117 | ; edi = ptr to buffer |
- | |
1118 | ; |
1125 | ; ecx = buffer size |
1119 | ; OUT: eax = number of bytes read |
- | |
1120 | ; |
- | |
1121 | ;----------------------------------------------------------------- |
- | |
Line 1122... | Line 1126... | ||
1122 | align 4 |
1126 | ; edi = ptr to buffer |
1123 | SOCKET_ring_read: |
1127 | ; |
1124 | 1128 | ; OUT: ecx = number of bytes read |
|
1125 | DEBUGF 1,"SOCKET_ring_read: ringbuff=%x ptr=%x size=%u\n", eax, esi, ecx |
1129 | ; |
1126 | 1130 | ;----------------------------------------------------------------- |
|
- | 1131 | align 4 |
|
1127 | cmp [eax + RING_BUFFER.size], ecx ; update size |
1132 | SOCKET_ring_read: |
- | 1133 | ||
- | 1134 | DEBUGF 1,"SOCKET_ring_read: ringbuff=%x ptr=%x size=%u\n", eax, edi, ecx |
|
- | 1135 | ||
- | 1136 | cmp ecx, [eax + RING_BUFFER.size] |
|
- | 1137 | jg .less_data |
|
1128 | jl .too_large |
1138 | |
- | 1139 | .copy: |
|
1129 | 1140 | mov esi, [eax + RING_BUFFER.read_ptr] |
|
1130 | mov esi, [eax + RING_BUFFER.read_ptr] ; update read ptr |
- | |
Line -... | Line 1141... | ||
- | 1141 | ||
1131 | .copy: |
1142 | DEBUGF 2,"Copying %u bytes from %x to %x\n", ecx, esi, edi |
Line 1132... | Line 1143... | ||
1132 | push ecx ;<<<< 1 |
1143 | push ecx |
1133 | mov edx, [eax + RING_BUFFER.read_ptr] |
1144 | shr ecx, 1 |
- | 1145 | jnc .nb |
|
- | 1146 | movsb |
|
1134 | add edx, ecx |
1147 | .nb: |
Line 1135... | Line -... | ||
1135 | cmp edx, [eax + RING_BUFFER.end_ptr] |
- | |
1136 | jg .copy_in_2 |
- | |
1137 | - | ||
1138 | .copy_more: |
- | |
1139 | push ecx |
- | |
1140 | and ecx, 3 |
- | |
1141 | rep movsb |
- | |
1142 | pop ecx |
- | |
1143 | shr ecx, 2 |
- | |
1144 | rep movsd |
- | |
1145 | pop ecx ; >>>> 1/2 |
- | |
1146 | DEBUGF 2,"Copied %u bytes\n", ecx |
- | |
1147 | - | ||
1148 | ret |
- | |
1149 | - | ||
1150 | .too_large: |
- | |
1151 | mov ecx, [eax + RING_BUFFER.size] |
- | |
Line 1152... | Line 1148... | ||
1152 | jmp .copy |
1148 | shr ecx, 1 |
1153 | 1149 | jnc .nw |
|
1154 | .full: |
1150 | movsw |
1155 | DEBUGF 2,"Ring buffer is full!\n" |
1151 | .nw: |
Line 1184... | Line 1180... | ||
1184 | align 4 |
1180 | align 4 |
1185 | SOCKET_ring_free: |
1181 | SOCKET_ring_free: |
Line 1186... | Line 1182... | ||
1186 | 1182 | ||
Line 1187... | Line -... | ||
1187 | DEBUGF 1,"Trying to free %u bytes of data from ring %x\n", ecx, eax |
- | |
1188 | - | ||
1189 | cmp ecx, [eax + RING_BUFFER.size] |
- | |
1190 | jle .go_for_it |
- | |
1191 | - | ||
1192 | cmp ecx, SOCKET_MAXDATA ;;;; |
- | |
1193 | jg .moron_input |
- | |
1194 | - | ||
1195 | mov ecx, [eax + RING_BUFFER.size] |
- | |
1196 | 1183 | DEBUGF 1,"Trying to free %u bytes of data from ring %x\n", ecx, eax |
|
- | 1184 | ||
1197 | .go_for_it: |
1185 | sub [eax + RING_BUFFER.size], ecx |
Line 1198... | Line 1186... | ||
1198 | sub [eax + RING_BUFFER.size], ecx |
1186 | jl .sumthinwong |
1199 | add [eax + RING_BUFFER.read_ptr], ecx |
1187 | add [eax + RING_BUFFER.read_ptr], ecx |
1200 | 1188 | ||
1201 | mov edx, [eax + RING_BUFFER.end_ptr] |
1189 | mov edx, [eax + RING_BUFFER.end_ptr] |
1202 | cmp [eax + RING_BUFFER.read_ptr], edx |
1190 | cmp [eax + RING_BUFFER.read_ptr], edx |
1203 | jl @f |
1191 | jl @f |
Line -... | Line 1192... | ||
- | 1192 | sub [eax + RING_BUFFER.read_ptr], SOCKET_MAXDATA |
|
1204 | sub [eax + RING_BUFFER.read_ptr], SOCKET_MAXDATA ;;;;; |
1193 | @@: |
1205 | @@: |
1194 | ret |
1206 | ret |
1195 | |
Line 1207... | Line 1196... | ||
1207 | 1196 | .sumthinwong: ; we could free all available bytes, but that would be stupid, i guess.. |
|
Line 1369... | Line 1358... | ||
1369 | jnz .no_stream |
1358 | jnz .no_stream |
Line 1370... | Line 1359... | ||
1370 | 1359 | ||
1371 | cmp [eax + SOCKET.Type], IP_PROTO_TCP |
1360 | cmp [eax + SOCKET.Type], IP_PROTO_TCP |
Line 1372... | Line 1361... | ||
1372 | jnz .no_stream |
1361 | jnz .no_stream |
1373 | 1362 | ||
1374 | stdcall kernel_free, [eax + rcv.start_ptr] |
1363 | stdcall kernel_free, [eax + STREAM_SOCKET.rcv + RING_BUFFER.start_ptr] |
Line 1375... | Line 1364... | ||
1375 | stdcall kernel_free, [eax + snd.start_ptr] |
1364 | stdcall kernel_free, [eax + STREAM_SOCKET.snd + RING_BUFFER.start_ptr] |
1376 | .no_stream: |
1365 | .no_stream: |
1377 | 1366 | ||
Line 1398... | Line 1387... | ||
1398 | 1387 | ||
1399 | .error: |
1388 | .error: |
Line 1400... | Line 1389... | ||
1400 | ret |
1389 | ret |
1401 | 1390 | ||
1402 | 1391 | ||
Line 1403... | Line 1392... | ||
1403 | ; socket nr in ebx |
1392 | ; IN: socket nr in ebx |
1404 | ; new socket nr in eax |
1393 | ; OUT: socket nr in eax |
Line 1405... | Line 1394... | ||
1405 | ; preserver edx |
1394 | ; preserves edx |
Line 1438... | Line 1427... | ||
1438 | ; SOCKET_num_to_ptr |
1427 | ; SOCKET_num_to_ptr |
1439 | ; |
1428 | ; |
1440 | ; Get socket structure address by its number |
1429 | ; Get socket structure address by its number |
1441 | ; |
1430 | ; |
1442 | ; IN: ecx = socket number |
1431 | ; IN: ecx = socket number |
1443 | ; OUT: ecx = 0 on error, socket ptr otherwise |
1432 | ; OUT: eax = 0 on error, socket ptr otherwise |
1444 | ; ZF = set on error |
1433 | ; ZF = set on error |
1445 | ; |
1434 | ; |
1446 | ;--------------------------------------------------- |
1435 | ;--------------------------------------------------- |
1447 | align 4 |
1436 | align 4 |
1448 | SOCKET_num_to_ptr: |
1437 | SOCKET_num_to_ptr: |