Subversion Repositories Kolibri OS

Rev

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

Rev 2364 Rev 2853
Line 1... Line 1...
1
;
1
;
2
; Netstat for KolibriOS v0.1  (still alpha version)
2
; Netstat for KolibriOS v0.2
-
 
3
;
-
 
4
; 0.1 - 22 sept 2009 - initial release
-
 
5
; 0.2 - 9 july 2012 - converted to new sysfunc numbers
3
;
6
;
4
; hidnplayr@gmail.com
7
; hidnplayr@gmail.com
5
;
8
;
Line -... Line 9...
-
 
9
 
-
 
10
format binary as ""
6
 
11
 
Line 7... Line 12...
7
use32
12
use32
Line 8... Line 13...
8
 
13
 
Line 19... Line 24...
19
__DEBUG__ equ 1
24
__DEBUG__ equ 1
20
__DEBUG_LEVEL__ equ 1
25
__DEBUG_LEVEL__ equ 1
Line 21... Line 26...
21
 
26
 
22
include '..\macros.inc'
27
include '..\macros.inc'
-
 
28
include '..\debug-fdo.inc'
Line 23... Line 29...
23
include '..\debug-fdo.inc'
29
include '..\network.inc'
24
 
30
 
Line 25... Line 31...
25
START:				       ; start of execution
31
START:                                 ; start of execution
Line 75... Line 81...
75
    mcall
81
    mcall
76
    add     ebx, 18
82
    add     ebx, 18
77
    mov     edx, str_queue_out
83
    mov     edx, str_queue_out
78
    mcall
84
    mcall
Line 79... Line 85...
79
 
85
 
80
    mov     ebx,1337 shl 16 + 4
86
    mov     ebx, API_ETH + 4
81
    mov     bh, [device]
87
    mov     bh, [device]
82
    mcall   76
88
    mcall   76
83
    push    eax
89
    push    eax
Line 108... Line 114...
108
    add     ebx, 18
114
    add     ebx, 18
109
    mov     edx, str_gateway
115
    mov     edx, str_gateway
110
    mcall
116
    mcall
Line 111... Line 117...
111
 
117
 
112
 
118
 
113
    mov     ebx, 0 shl 16 + 8
119
    mov     ebx, API_IPv4 + 8
114
    mov     bh, [device]
120
    mov     bh, [device]
Line 115... Line 121...
115
    mcall   76
121
    mcall   76
Line 193... Line 199...
193
  draw_stats:
199
  draw_stats:
Line 194... Line 200...
194
 
200
 
195
    cmp     [mode], 101
201
    cmp     [mode], 101
Line 196... Line 202...
196
    jne     not_101
202
    jne     not_101
197
 
203
 
198
    mov     ebx, 1337 shl 16 + 0
204
    mov     ebx, API_ETH
199
    mov     bh, [device]
205
    mov     bh, [device]
200
   @@:
206
   @@:
201
    push    ebx
207
    push    ebx
Line 247... Line 253...
247
 not_101:
253
 not_101:
Line 248... Line 254...
248
 
254
 
249
    cmp     [mode], 102
255
    cmp     [mode], 102
Line 250... Line 256...
250
    jne     not_102
256
    jne     not_102
251
 
257
 
252
    mov     ebx, 0 shl 16
258
    mov     ebx, API_IPv4
253
    mov     bh, [device]
259
    mov     bh, [device]
254
    push    ebx
260
    push    ebx
255
    mcall   76
261
    mcall   76
Line 279... Line 285...
279
 not_102:
285
 not_102:
Line 280... Line 286...
280
 
286
 
281
    cmp     [mode], 103
287
    cmp     [mode], 103
Line 282... Line 288...
282
    jne     not_103
288
    jne     not_103
283
 
289
 
284
    mov     ebx, 0x0608 shl 16 + 0
290
    mov     ebx, API_ARP
285
    mov     bh, [device]
291
    mov     bh, [device]
286
    push    ebx
292
    push    ebx
287
    mcall   76
293
    mcall   76
Line 318... Line 324...
318
not_103:
324
not_103:
Line 319... Line 325...
319
 
325
 
320
    cmp     [mode], 104
326
    cmp     [mode], 104
Line 321... Line 327...
321
    jne     not_104
327
    jne     not_104
322
 
328
 
323
    mov     ebx, 1 shl 16 + 0
329
    mov     ebx, API_ICMP
324
    mov     bh, [device]
330
    mov     bh, [device]
325
    push    ebx
331
    push    ebx
326
    mcall   76
332
    mcall   76
Line 349... Line 355...
349
not_104:
355
not_104:
Line 350... Line 356...
350
 
356
 
351
    cmp     [mode], 105
357
    cmp     [mode], 105
Line 352... Line 358...
352
    jne     not_105
358
    jne     not_105
353
 
359
 
354
    mov     ebx, 17 shl 16 + 0
360
    mov     ebx, API_UDP
355
    mov     bh, [device]
361
    mov     bh, [device]
356
    push    ebx
362
    push    ebx
357
    mcall   76
363
    mcall   76
Line 380... Line 386...
380
not_105:
386
not_105:
Line 381... Line 387...
381
 
387
 
382
    cmp     [mode], 106
388
    cmp     [mode], 106
Line 383... Line 389...
383
    jne     not_106
389
    jne     not_106
384
 
390
 
385
    mov     ebx, 6 shl 16 + 0
391
    mov     ebx, API_TCP
386
    mov     bh, [device]
392
    mov     bh, [device]
387
    push    ebx
393
    push    ebx
388
    mcall   76
394
    mcall   76
Line 418... Line 424...
418
 
424
 
419
 
425
 
420
  button:			  ; button
426
  button:                         ; button
421
    mcall   17			  ; get id
427
    mcall   17                    ; get id
422
    cmp     ah, 1
428
    cmp     ah, 1
423
    je	    close
429
    je      exit
Line 424... Line 430...
424
    mov     [mode], ah
430
    mov     [mode], ah
425
    jmp     redraw
431
    jmp     redraw
Line 426... Line 432...
426
 
432