Rev 8867 | Rev 9692 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8867 | Rev 9049 | ||
---|---|---|---|
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: 8867 $ |
18 | $Revision: 9049 $ |
Line 19... | Line 19... | ||
19 | 19 | ||
20 | struct SOCKET |
20 | struct SOCKET |
Line 330... | Line 330... | ||
330 | 330 | ||
331 | .no_inet4: |
331 | .no_inet4: |
332 | cmp ecx, AF_PPP |
332 | cmp ecx, AF_PPP |
Line 333... | Line 333... | ||
333 | jne .no_ppp |
333 | jne .no_ppp |
334 | 334 | ||
Line 335... | Line 335... | ||
335 | cmp esi, PPP_PROTO_ETHERNET |
335 | ; cmp esi, PPP_PROTO_ETHERNET |
336 | je .pppoe |
336 | ; je .pppoe |
337 | 337 | ||
338 | .no_ppp: |
338 | .no_ppp: |
Line 402... | Line 402... | ||
402 | mov [eax + SOCKET.snd_proc], socket_send_icmp |
402 | mov [eax + SOCKET.snd_proc], socket_send_icmp |
403 | mov [eax + SOCKET.rcv_proc], socket_receive_dgram |
403 | mov [eax + SOCKET.rcv_proc], socket_receive_dgram |
404 | mov [eax + SOCKET.connect_proc], ipv4_connect |
404 | mov [eax + SOCKET.connect_proc], ipv4_connect |
405 | ret |
405 | ret |
Line 406... | Line 406... | ||
406 | 406 | ||
407 | align 4 |
407 | ;align 4 |
408 | .pppoe: |
408 | ; .pppoe: |
409 | push eax |
409 | ; push eax |
410 | init_queue (eax + SOCKET_QUEUE_LOCATION) ; Set up data receiving queue |
410 | ; init_queue (eax + SOCKET_QUEUE_LOCATION) ; Set up data receiving queue |
411 | pop eax |
411 | ; pop eax |
412 | 412 | ; |
|
413 | mov [eax + SOCKET.snd_proc], socket_send_pppoe |
413 | ; mov [eax + SOCKET.snd_proc], socket_send_pppoe |
414 | mov [eax + SOCKET.rcv_proc], socket_receive_dgram |
414 | ; mov [eax + SOCKET.rcv_proc], socket_receive_dgram |
Line 415... | Line 415... | ||
415 | ret |
415 | ; ret |
416 | 416 | ||
417 | 417 | ||
Line 772... | Line 772... | ||
772 | ; ; |
772 | ; ; |
773 | ; socket_receive: Receive some data from the remote end. ; |
773 | ; socket_receive: Receive some data from the remote end. ; |
774 | ; ; |
774 | ; ; |
775 | ; IN: ecx = socket number ; |
775 | ; IN: ecx = socket number ; |
776 | ; edx = addr to application buffer ; |
776 | ; edx = addr to application buffer ; |
777 | ; edx = length of application buffer ; |
777 | ; esi = length of application buffer ; |
778 | ; edi = flags ; |
778 | ; edi = flags ; |
779 | ; ; |
779 | ; ; |
780 | ; OUT: eax = number of bytes copied ; |
780 | ; OUT: eax = number of bytes copied ; |
781 | ; eax = -1 on error ; |
781 | ; eax = -1 on error ; |
782 | ; eax = 0 when socket has been closed by the remote end ; |
782 | ; eax = 0 when socket has been closed by the remote end ; |
Line 790... | Line 790... | ||
790 | 790 | ||
791 | call socket_num_to_ptr |
791 | call socket_num_to_ptr |
792 | test eax, eax |
792 | test eax, eax |
Line -... | Line 793... | ||
- | 793 | jz .invalid |
|
- | 794 | ||
- | 795 | stdcall is_region_userspace, edx, esi |
|
793 | jz .invalid |
796 | jnz .invalid |
794 | 797 | ||
795 | .loop: |
798 | .loop: |
796 | push edi |
799 | push edi |
Line 996... | Line 999... | ||
996 | 999 | ||
997 | call socket_num_to_ptr |
1000 | call socket_num_to_ptr |
998 | test eax, eax |
1001 | test eax, eax |
Line -... | Line 1002... | ||
- | 1002 | jz .invalid |
|
- | 1003 | ||
- | 1004 | stdcall is_region_userspace, edx, esi |
|
999 | jz .invalid |
1005 | jnz .invalid |
1000 | 1006 | ||
Line 1001... | Line 1007... | ||
1001 | mov ecx, esi |
1007 | mov ecx, esi |
Line 1078... | Line 1084... | ||
1078 | mov dword[esp+32], eax |
1084 | mov dword[esp+32], eax |
1079 | mov dword[esp+20], ebx |
1085 | mov dword[esp+20], ebx |
1080 | ret |
1086 | ret |
Line 1081... | Line 1087... | ||
1081 | 1087 | ||
1082 | 1088 | ||
1083 | align 4 |
1089 | ;align 4 |
1084 | socket_send_pppoe: |
1090 | ;socket_send_pppoe: |
1085 | 1091 | ; |
|
1086 | DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_send: PPPoE\n" |
1092 | ; DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_send: PPPoE\n" |
1087 | 1093 | ; |
|
1088 | mov [esp+32], ecx |
1094 | ; mov [esp+32], ecx |
1089 | mov ebx, [eax + SOCKET.device] |
1095 | ; mov ebx, [eax + SOCKET.device] |
1090 | 1096 | ; |
|
1091 | call pppoe_discovery_output ; FIXME: errorcodes |
1097 | ; call pppoe_discovery_output ; FIXME: errorcodes |
1092 | cmp eax, -1 |
1098 | ; cmp eax, -1 |
1093 | je .error |
1099 | ; je .error |
1094 | ret |
1100 | ; ret |
1095 | 1101 | ; |
|
1096 | .error: |
1102 | ; .error: |
1097 | mov dword[esp+32], -1 |
1103 | ; mov dword[esp+32], -1 |
Line 1098... | Line 1104... | ||
1098 | mov dword[esp+20], EMSGSIZE |
1104 | ; mov dword[esp+20], EMSGSIZE |
1099 | ret |
1105 | ; ret |
Line 1381... | Line 1387... | ||
1381 | 1387 | ||
1382 | call socket_num_to_ptr |
1388 | call socket_num_to_ptr |
1383 | test eax, eax |
1389 | test eax, eax |
Line -... | Line 1390... | ||
- | 1390 | jz .invalid |
|
- | 1391 | ||
- | 1392 | stdcall is_region_userspace, edi, SOCKET_STRUCT_SIZE |
|
1384 | jz .invalid |
1393 | jnz .invalid |
1385 | 1394 | ||
1386 | mov esi, eax |
1395 | mov esi, eax |
Line 1387... | Line 1396... | ||
1387 | mov ecx, SOCKET_STRUCT_SIZE/4 |
1396 | mov ecx, SOCKET_STRUCT_SIZE/4 |