Subversion Repositories Kolibri OS

Rev

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

Rev 2572 Rev 2573
Line 11... Line 11...
11
;;         GNU GENERAL PUBLIC LICENSE                              ;;
11
;;         GNU GENERAL PUBLIC LICENSE                              ;;
12
;;          Version 2, June 1991                                   ;;
12
;;          Version 2, June 1991                                   ;;
13
;;                                                                 ;;
13
;;                                                                 ;;
14
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
14
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 15... Line 15...
15
 
15
 
Line 16... Line 16...
16
$Revision: 2572 $
16
$Revision: 2573 $
Line 17... Line 17...
17
 
17
 
Line 797... Line 797...
797
align 4
797
align 4
798
SOCKET_send_udp:
798
SOCKET_send_udp:
Line 799... Line 799...
799
 
799
 
Line -... Line 800...
-
 
800
        DEBUGF  1,"SOCKET_send: UDP\n"
800
        DEBUGF  1,"SOCKET_send: UDP\n"
801
 
801
 
-
 
802
        call    UDP_output
802
        mov     [esp+32], ecx
-
 
803
        call    UDP_output
803
 
804
        cmp     eax, -1
Line 804... Line 805...
804
        mov     [esp+32], eax
805
        je      s_error
805
        ret
806
        ret
Line 811... Line 812...
811
        DEBUGF  1,"SOCKET_send: TCP\n"
812
        DEBUGF  1,"SOCKET_send: TCP\n"
Line 812... Line 813...
812
 
813
 
813
        push    eax
814
        push    eax
814
        add     eax, STREAM_SOCKET.snd
815
        add     eax, STREAM_SOCKET.snd
-
 
816
        call    SOCKET_ring_write
815
        call    SOCKET_ring_write
817
        mov     [esp+32], ecx
Line -... Line 818...
-
 
818
        pop     eax
816
        pop     eax
819
 
Line 817... Line 820...
817
 
820
        test    ecx, ecx
818
        call    TCP_output
821
        jz      s_error
Line 819... Line 822...
819
 
822
 
820
        mov     [esp+32], eax
823
        call    TCP_output
Line 821... Line 824...
821
        ret
824
        ret
Line -... Line 825...
-
 
825
 
822
 
826
 
823
 
-
 
824
align 4
827
align 4
-
 
828
SOCKET_send_ip:
825
SOCKET_send_ip:
829
 
Line -... Line 830...
-
 
830
        DEBUGF  1,"type: IP\n"
826
 
831
 
827
        DEBUGF  1,"type: IP\n"
832
        mov     [esp+32], ecx
Line 828... Line 833...
828
 
833
        call    IPv4_output_raw
Line -... Line 834...
-
 
834
        cmp     eax, -1
829
        call    IPv4_output_raw
835
        je      s_error
830
 
-
 
831
        mov     [esp+32], eax
836
        ret
-
 
837
 
832
        ret
838
 
Line 1134... Line 1140...
1134
SOCKET_ring_write:
1140
SOCKET_ring_write:
Line 1135... Line 1141...
1135
 
1141
 
Line 1136... Line 1142...
1136
        DEBUGF  1,"SOCKET_ring_write: ringbuff=%x ptr=%x size=%u\n", eax, esi, ecx
1142
        DEBUGF  1,"SOCKET_ring_write: ringbuff=%x ptr=%x size=%u\n", eax, esi, ecx
-
 
1143
 
1137
 
1144
        add     [eax + RING_BUFFER.size], ecx
1138
        add     [eax + RING_BUFFER.size], ecx
1145
        jc      .way_too_large
Line 1139... Line 1146...
1139
        cmp     [eax + RING_BUFFER.size], SOCKET_MAXDATA
1146
        cmp     [eax + RING_BUFFER.size], SOCKET_MAXDATA
1140
        ja      .too_large
1147
        ja      .too_large
Line 1172... Line 1179...
1172
 
1179
 
1173
  .too_large:                                                           ; update size, we will fill buffer completely
1180
  .too_large:                                                           ; update size, we will fill buffer completely
1174
        sub     [eax + RING_BUFFER.size], SOCKET_MAXDATA
1181
        sub     [eax + RING_BUFFER.size], SOCKET_MAXDATA
1175
        sub     ecx, [eax + RING_BUFFER.size]
1182
        sub     ecx, [eax + RING_BUFFER.size]
-
 
1183
        mov     [eax + RING_BUFFER.size], SOCKET_MAXDATA
Line 1176... Line -...
1176
        mov     [eax + RING_BUFFER.size], SOCKET_MAXDATA
-
 
1177
 
1184
        ja      .copy
1178
        test    ecx, ecx
-
 
1179
        jnz     .copy
1185
 
1180
 
1186
  .full:
1181
        DEBUGF  2,"SOCKET_ring_write: ring buffer is full!\n"
1187
        DEBUGF  2,"SOCKET_ring_write: ring buffer is full!\n"
Line -... Line 1188...
-
 
1188
        xor     ecx, ecx
-
 
1189
        ret
-
 
1190
 
-
 
1191
  .way_too_large:
-
 
1192
        sub     [eax + RING_BUFFER.size], ecx
-
 
1193
        mov     ecx, SOCKET_MAXDATA
-
 
1194
        sub     ecx, [eax + RING_BUFFER.size]
-
 
1195
        ja      .copy
Line 1182... Line 1196...
1182
        xor     ecx, ecx
1196
        jmp     .full
1183
        ret
1197
 
1184
 
1198
 
1185
 
1199