Rev 1161 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1161 | Rev 1171 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;; STACK.INC ;; |
6 | ;; STACK.INC ;; |
7 | ;; ;; |
7 | ;; ;; |
8 | ;; TCP/IP stack for Menuet OS ;; |
8 | ;; BASIC TCP/IP stack for KolibriOS ;; |
9 | ;; ;; |
9 | ;; ;; |
10 | ;; Copyright 2002 Mike Hibbett, mikeh@oceanfree.net ;; |
10 | ;; Written by hidnplayr@kolibrios.org ;; |
11 | ;; ;; |
11 | ;; ;; |
- | 12 | ;; based on the work of Mike Hibbett, mikeh@oceanfree.net ;; |
|
12 | ;; See file COPYING for details ;; |
13 | ;; but also Paolo Franchetti ;; |
13 | ;; ;; |
14 | ;; ;; |
14 | ;; Version 0.7 ;; |
15 | ;; GNU GENERAL PUBLIC LICENSE ;; |
15 | ;; Added a timer per socket to allow delays when rx window ;; |
- | |
16 | ;; gets below 1KB ;; |
16 | ;; Version 2, June 1991 ;; |
17 | ;; ;; |
17 | ;; ;; |
18 | ;;10.01.2007 Bugfix for checksum function from Paolo Franchetti ;; |
- | |
19 | ;; ;; |
- | |
20 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
18 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 21... | Line 19... | ||
21 | 19 | ||
Line 22... | Line 20... | ||
22 | $Revision: 983 $ |
20 | $Revision: 983 $ |
Line 190... | Line 188... | ||
190 | 188 | ||
191 | 189 | ||
192 | - | ||
- | 190 | ||
193 | ;---------------------------------------------------------------- |
191 | ;---------------------------------------------------------------- |
194 | ; |
192 | ; |
Line 195... | Line 193... | ||
195 | ; |
193 | ; System function to work with network devices (73) |
196 | ; |
194 | ; |
Line 240... | Line 238... | ||
240 | 238 | ||
241 | 239 | ||
242 | - | ||
- | 240 | ||
243 | ;---------------------------------------------------------------- |
241 | ;---------------------------------------------------------------- |
244 | ; |
242 | ; |
Line 245... | Line 243... | ||
245 | ; |
243 | ; System Function To work with Protocols (75) |
246 | ; |
244 | ; |
247 | ;---------------------------------------------------------------- |
- | |
248 | 245 | ;---------------------------------------------------------------- |
|
249 | align 4 |
246 | |
Line 250... | Line 247... | ||
250 | sys_protocols: |
247 | align 4 |
251 | 248 | sys_protocols: |
|
252 | cmp bh, MAX_NET_DEVICES ; Check if device number exists |
249 | cmp bh, MAX_NET_DEVICES ; Check if device number exists |
253 | jge .doesnt_exist |
- | |
254 | 250 | jge .doesnt_exist |
|
255 | mov esi, ebx |
251 | |
Line 256... | Line 252... | ||
256 | and esi, 0x0000ff00 |
252 | mov esi, ebx |
Line 257... | Line 253... | ||
257 | shr esi, 6 |
253 | and esi, 0x0000ff00 |
Line 271... | Line 267... | ||
271 | je ICMP_API |
267 | je ICMP_API |
Line 272... | Line 268... | ||
272 | 268 | ||
273 | cmp ax , IP_PROTO_UDP |
269 | cmp ax , IP_PROTO_UDP |
Line 274... | Line 270... | ||
274 | je UDP_API |
270 | je UDP_API |
275 | 271 | ||
Line 276... | Line 272... | ||
276 | ; cmp ax , IP_PROTO_TCP |
272 | cmp ax , IP_PROTO_TCP |
277 | ; je TCP_API |
273 | ; je TCP_API |
Line 283... | Line 279... | ||
283 | je ETH_API |
279 | je ETH_API |
Line 284... | Line 280... | ||
284 | 280 | ||
Line 285... | Line 281... | ||
285 | add esp,4 ; if we reached here, no function was called, so we need to balance stack |
281 | add esp, 4 ; if we reached here, no function was called, so we need to balance stack |
286 | 282 | ||
287 | .doesnt_exist: |
283 | .doesnt_exist: |
Line 288... | Line 284... | ||
288 | DEBUGF 1,"sys_protocols: invalid device specified!\n" |
284 | DEBUGF 1,"sys_protocols: protocol %u doesnt exist on device %u!\n",ax, bh |
289 | mov eax, -1 |
285 | mov eax, -1 |
290 | 286 | ||
291 | .return: |
287 | .return: |