Subversion Repositories Kolibri OS

Rev

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

Rev 2869 Rev 2877
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: 2869 $
16
$Revision: 2877 $
Line 17... Line 17...
17
 
17
 
Line 27... Line 27...
27
        PID                     dd ? ; application process id
27
        PID                     dd ? ; application process id
28
        Domain                  dd ? ; INET/UNIX/..
28
        Domain                  dd ? ; INET/UNIX/..
29
        Type                    dd ? ; RAW/STREAM/DGRAP
29
        Type                    dd ? ; RAW/STREAM/DGRAP
30
        Protocol                dd ? ; ICMP/IPv4/ARP/TCP/UDP
30
        Protocol                dd ? ; ICMP/IPv4/ARP/TCP/UDP
31
        errorcode               dd ?
31
        errorcode               dd ?
-
 
32
        device                  dd ?
Line 32... Line 33...
32
 
33
 
33
        options                 dd ?
34
        options                 dd ?
34
        state                   dd ?
35
        state                   dd ?
Line 923... Line 924...
923
;
924
;
924
; SOCKET_set_options
925
; SOCKET_set_options
925
;
926
;
926
;  IN:  ecx = socket number
927
;  IN:  ecx = socket number
927
;       edx = pointer to the options:
928
;       edx = pointer to the options:
928
;               dd      level, optname, optval, optlen
929
;               dd      level, optname, optlen, optval
929
;  OUT: -1 on error
930
;  OUT: -1 on error
930
;
931
;
931
;-----------------------------------------------------------------
932
;-----------------------------------------------------------------
932
align 4
933
align 4
933
SOCKET_set_opt:
934
SOCKET_set_opt:
Line 935... Line 936...
935
        DEBUGF  1,"SOCKET_set_opt\n"
936
        DEBUGF  1,"SOCKET_set_opt\n"
Line 936... Line 937...
936
 
937
 
937
        call    SOCKET_num_to_ptr
938
        call    SOCKET_num_to_ptr
Line -... Line 939...
-
 
939
        jz      s_error
-
 
940
 
-
 
941
        cmp     dword [edx], SOL_SOCKET
-
 
942
        jne     s_error
-
 
943
 
-
 
944
        cmp     dword [edx+4], SO_BINDTODEVICE
-
 
945
        je      .bind
-
 
946
 
-
 
947
        jmp     s_error
-
 
948
 
-
 
949
  .bind:
-
 
950
        cmp     dword [edx+8], 0
-
 
951
        je      .unbind
-
 
952
 
-
 
953
        movzx   edx, byte [edx + 9]
-
 
954
        cmp     edx, MAX_NET_DEVICES
-
 
955
        ja      s_error
-
 
956
 
-
 
957
        mov     edx, [NET_DRV_LIST + 4*edx]
-
 
958
        test    edx, edx
-
 
959
        jz      s_error
-
 
960
        mov     [eax + SOCKET.device], edx
-
 
961
 
-
 
962
        DEBUGF  1,"Bound socket %x to device %x\n",eax, edx
-
 
963
 
Line -... Line 964...
-
 
964
        mov     dword [esp+32], 0       ; success!
-
 
965
        ret
Line -... Line 966...
-
 
966
 
938
        jz      s_error
967
  .unbind:
Line 939... Line 968...
939
 
968
        mov     [eax + SOCKET.device], 0