1,23 → 1,21 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; |
;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;; STACK.INC ;; |
;; ;; |
;; TCP/IP stack for Menuet OS ;; |
;; BASIC TCP/IP stack for KolibriOS ;; |
;; ;; |
;; Copyright 2002 Mike Hibbett, mikeh@oceanfree.net ;; |
;; Written by hidnplayr@kolibrios.org ;; |
;; ;; |
;; See file COPYING for details ;; |
;; based on the work of Mike Hibbett, mikeh@oceanfree.net ;; |
;; but also Paolo Franchetti ;; |
;; ;; |
;; Version 0.7 ;; |
;; Added a timer per socket to allow delays when rx window ;; |
;; gets below 1KB ;; |
;; GNU GENERAL PUBLIC LICENSE ;; |
;; Version 2, June 1991 ;; |
;; ;; |
;;10.01.2007 Bugfix for checksum function from Paolo Franchetti ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
$Revision: 983 $ |
|
192,8 → 190,8 |
|
;---------------------------------------------------------------- |
; |
; System function to work with network devices (73) |
; |
; |
;---------------------------------------------------------------- |
|
align 4 |
242,13 → 240,12 |
|
;---------------------------------------------------------------- |
; |
; System Function To work with Protocols (75) |
; |
; |
;---------------------------------------------------------------- |
|
align 4 |
sys_protocols: |
|
cmp bh, MAX_NET_DEVICES ; Check if device number exists |
jge .doesnt_exist |
|
255,8 → 252,7 |
mov esi, ebx |
and esi, 0x0000ff00 |
shr esi, 6 |
|
cmp dword [esi + ETH_DRV_LIST], 0 ; check if driver is running TODO: check otehr lists too |
cmp dword [esi + ETH_DRV_LIST], 0 ; check if driver is running TODO: check other lists too |
je .doesnt_exist |
|
push .return ; return address (we will be using jumps instead of calls) |
273,7 → 269,7 |
cmp ax , IP_PROTO_UDP |
je UDP_API |
|
; cmp ax , IP_PROTO_TCP |
cmp ax , IP_PROTO_TCP |
; je TCP_API |
|
cmp ax, ETHER_ARP |
285,9 → 281,9 |
add esp,4 ; if we reached here, no function was called, so we need to balance stack |
|
.doesnt_exist: |
DEBUGF 1,"sys_protocols: invalid device specified!\n" |
DEBUGF 1,"sys_protocols: protocol %u doesnt exist on device %u!\n",ax, bh |
mov eax, -1 |
|
.return: |
mov [esp+32], eax |
mov [esp+28+4], eax |
ret |