Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1171 → Rev 1170

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