Subversion Repositories Kolibri OS

Rev

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

Rev 2402 Rev 2614
Line 19... Line 19...
19
;;          GNU GENERAL PUBLIC LICENSE                             ;;
19
;;          GNU GENERAL PUBLIC LICENSE                             ;;
20
;;             Version 2, June 1991                                ;;
20
;;             Version 2, June 1991                                ;;
21
;;                                                                 ;;
21
;;                                                                 ;;
22
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 23... Line 23...
23
 
23
 
Line 24... Line 24...
24
$Revision: 2402 $
24
$Revision: 2614 $
25
 
25
 
Line 26... Line 26...
26
__DEBUG_LEVEL_OLD__     equ __DEBUG_LEVEL__     ; use seperate debug level for network part of kernel
26
__DEBUG_LEVEL_OLD__     equ __DEBUG_LEVEL__     ; use seperate debug level for network part of kernel
27
__DEBUG_LEVEL__         equ 1
27
__DEBUG_LEVEL__         equ 1
28
 
28
 
29
uglobal
29
uglobal
Line 30... Line 30...
30
        net_10ms        dd ?
30
        net_10ms        dd ?
Line 31... Line 31...
31
        net_tmr_count   dw ?
31
        net_tmr_count   dw ?
32
endg
32
endg
Line 33... Line 33...
33
 
33
 
34
MAX_NET_DEVICES         equ 16
34
MAX_NET_DEVICES        = 16
35
 
35
 
36
MIN_EPHEMERAL_PORT      equ 49152
36
MIN_EPHEMERAL_PORT     = 49152
37
MAX_EPHEMERAL_PORT      equ 61000
37
MAX_EPHEMERAL_PORT     = 61000
Line 38... Line 38...
38
 
38
 
39
; Ethernet protocol numbers
39
; Ethernet protocol numbers
40
ETHER_ARP               equ 0x0608
40
ETHER_ARP              = 0x0608
41
ETHER_IPv4              equ 0x0008
41
ETHER_IPv4             = 0x0008
42
ETHER_PPP_DISCOVERY     equ 0x6388
42
ETHER_PPP_DISCOVERY    = 0x6388
Line 43... Line 43...
43
ETHER_PPP_SESSION       equ 0x6488
43
ETHER_PPP_SESSION      = 0x6488
44
 
44
 
45
;Protocol family
45
;Protocol family
46
AF_UNSPEC               equ 0
46
AF_UNSPEC              = 0
47
AF_UNIX                 equ 1
47
AF_UNIX                = 1
Line 48... Line 48...
48
AF_INET4                equ 2
48
AF_INET4               = 2
49
AF_INET6                equ 10
49
AF_INET6               = 10
50
 
50
 
51
; Internet protocol numbers
51
; Internet protocol numbers
Line 52... Line 52...
52
IP_PROTO_IP             equ 0
52
IP_PROTO_IP            = 0
53
IP_PROTO_ICMP           equ 1
53
IP_PROTO_ICMP          = 1
54
IP_PROTO_TCP            equ 6
54
IP_PROTO_TCP           = 6
55
IP_PROTO_UDP            equ 17
55
IP_PROTO_UDP           = 17
56
 
56
 
57
; Socket types
57
; Socket types
58
SOCK_STREAM             equ 1
58
SOCK_STREAM            = 1
59
SOCK_DGRAM              equ 2
59
SOCK_DGRAM             = 2
60
SOCK_RAW                equ 3
60
SOCK_RAW               = 3
61
 
61
 
Line 62... Line 62...
62
; Socket options
62
; Socket options
63
SO_ACCEPTCON            equ 1 shl 0
63
SO_ACCEPTCON           = 1 shl 0
64
SO_BROADCAST            equ 1 shl 1
64
SO_BROADCAST           = 1 shl 1
65
SO_DEBUG                equ 1 shl 2
65
SO_DEBUG               = 1 shl 2
66
SO_DONTROUTE            equ 1 shl 3
66
SO_DONTROUTE           = 1 shl 3
67
SO_KEEPALIVE            equ 1 shl 4
67
SO_KEEPALIVE           = 1 shl 4
68
SO_OOBINLINE            equ 1 shl 5
68
SO_OOBINLINE           = 1 shl 5
69
SO_REUSEADDR            equ 1 shl 6
69
SO_REUSEADDR           = 1 shl 6
70
SO_REUSEPORT            equ 1 shl 7
70
SO_REUSEPORT           = 1 shl 7
71
SO_USELOOPBACK          equ 1 shl 8
71
SO_USELOOPBACK         = 1 shl 8
72
 
72
 
73
 
73
 
74
; Socket States
74
; Socket States
75
SS_NOFDREF              equ 0x001       ; no file table ref any more
75
SS_NOFDREF             = 0x001       ; no file table ref any more
76
SS_ISCONNECTED          equ 0x002       ; socket connected to a peer
76
SS_ISCONNECTED         = 0x002       ; socket connected to a peer
Line 77... Line 77...
77
SS_ISCONNECTING         equ 0x004       ; in process of connecting to peer
77
SS_ISCONNECTING        = 0x004       ; in process of connecting to peer
Line 78... Line 78...
78
SS_ISDISCONNECTING      equ 0x008       ; in process of disconnecting
78
SS_ISDISCONNECTING     = 0x008       ; in process of disconnecting
79
SS_CANTSENDMORE         equ 0x010       ; can't send more data to peer
79
SS_CANTSENDMORE        = 0x010       ; can't send more data to peer
80
SS_CANTRCVMORE          equ 0x020       ; can't receive more data from peer
80
SS_CANTRCVMORE         = 0x020       ; can't receive more data from peer
Line 81... Line 81...
81
SS_RCVATMARK            equ 0x040       ; at mark on input
81
SS_RCVATMARK           = 0x040       ; at mark on input
Line 82... Line 82...
82
SS_ISABORTING           equ 0x080       ; aborting fd references - close()
82
SS_ISABORTING          = 0x080       ; aborting fd references - close()
83
SS_RESTARTSYS           equ 0x100       ; restart blocked system calls
83
SS_RESTARTSYS          = 0x100       ; restart blocked system calls
84
SS_ISDISCONNECTED       equ 0x800       ; socket disconnected from peer
84
SS_ISDISCONNECTED      = 0x800       ; socket disconnected from peer
85
 
85
 
86
SS_ASYNC                equ 0x100       ; async i/o notify
86
SS_ASYNC               = 0x100       ; async i/o notify
87
SS_ISCONFIRMING         equ 0x200       ; deciding to accept connection req
87
SS_ISCONFIRMING        = 0x200       ; deciding to accept connection req
Line 88... Line 88...
88
SS_MORETOCOME           equ 0x400
88
SS_MORETOCOME          = 0x400
Line 153... Line 153...
153
 
153
 
Line 154... Line 154...
154
include "queue.inc"
154
include "queue.inc"
Line 155... Line -...
155
 
-
 
156
include "ethernet.inc"
155
 
Line 157... Line 156...
157
 
156
include "ethernet.inc"
158
;include "slip.inc"
157
 
Line 159... Line 158...
159
;include "pppoe.inc"
158
;include "PPPoE.inc"
Line 689... Line 688...
689
 
688
 
690
        mov     eax, ebx                        ; set ax to protocol number
689
        mov     eax, ebx                        ; set ax to protocol number
Line 691... Line 690...
691
        shr     eax, 16                         ;
690
        shr     eax, 16                         ;
692
 
691
 
Line 693... Line 692...
693
        cmp     ax , IP_PROTO_IP
692
        cmp     ax, IP_PROTO_IP
694
        je      IPv4_API
693
        je      IPv4_api
Line 695... Line 694...
695
 
694
 
696
        cmp     ax , IP_PROTO_ICMP
695
        cmp     ax, IP_PROTO_ICMP
Line 697... Line 696...
697
        je      ICMP_API
696
        je      ICMP_api
698
 
697
 
Line 699... Line 698...
699
        cmp     ax , IP_PROTO_UDP
698
        cmp     ax, IP_PROTO_UDP
700
        je      UDP_API
699
        je      UDP_api
Line 701... Line 700...
701
 
700
 
702
        cmp     ax , IP_PROTO_TCP
701
        cmp     ax, IP_PROTO_TCP
-
 
702
        je      TCP_api
-
 
703
 
-
 
704
        cmp     ax, ETHER_ARP
Line 703... Line 705...
703
        je      TCP_API
705
        je      ARP_api
Line 704... Line 706...
704
 
706
 
705
        cmp     ax , ETHER_ARP
707
        cmp     ax, 1337  ;;;;;
706
        je      ARP_API
708
        je      ETH_api
Line 707... Line 709...
707
 
709
 
708
        cmp     ax , 1337  ;;;;;
710
;        cmp     ax, API_PPPoE
709
        je      ETH_API
711
;        je      PPPoE_api
Line 710... Line 712...
710
 
712
 
711
        add     esp, 4                           ; if we reached here, no function was called, so we need to balance stack
713
        add     esp, 4                           ; if we reached here, no function was called, so we need to balance stack