Subversion Repositories Kolibri OS

Rev

Rev 1206 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1206 Rev 1528
1
;
1
;
2
; Netstat for KolibriOS v0.1  (still alpha version)
2
; Netstat for KolibriOS v0.1  (still alpha version)
3
;
3
;
4
; hidnplayr@gmail.com
4
; hidnplayr@gmail.com
5
;
5
;
6
 
6
 
7
use32
7
use32
8
 
8
 
9
    org     0x0
9
    org     0x0
10
 
10
 
11
    db	   'MENUET01'	     ; 8 byte id
11
    db	   'MENUET01'	     ; 8 byte id
12
    dd	   0x01 	     ; header version
12
    dd	   0x01 	     ; header version
13
    dd	   START	     ; start of code
13
    dd	   START	     ; start of code
14
    dd	   IM_END	     ; size of image
14
    dd	   I_END	     ; size of image
15
    dd	   (I_END+0x100)     ; memory for app
15
    dd	   (I_END+0x100)     ; memory for app
16
    dd	   (I_END+0x100)     ; esp
16
    dd	   (I_END+0x100)     ; esp
17
    dd	   I_PARAM , 0x0     ; I_Param , I_Icon
17
    dd	   I_PARAM , 0x0     ; I_Param , I_Icon
18
 
18
 
19
__DEBUG__ equ 1
19
__DEBUG__ equ 1
20
__DEBUG_LEVEL__ equ 1
20
__DEBUG_LEVEL__ equ 1
21
 
21
 
22
include '..\macros.inc'
22
include '..\macros.inc'
23
include '..\debug-fdo.inc'
23
include '..\debug-fdo.inc'
24
 
24
 
25
START:				       ; start of execution
25
START:				       ; start of execution
26
    ; TODO: check Parameters
26
    ; TODO: check Parameters
27
 
27
 
28
    DEBUGF 1, 'Hello!\n'
-
 
29
 
28
    DEBUGF  1, 'Netstat application loaded!\n'
30
 
-
 
31
  redraw:
29
 
32
 
30
  redraw:
33
    mcall   12, 1
31
    mcall   12, 1
34
 
32
 
35
    mcall   0, 100 shl 16 + 520, 100 shl 16 + 240, 0x34bcbcbc, ,name
33
    mcall   0, 100 shl 16 + 520, 100 shl 16 + 240, 0x34bcbcbc , , name
36
 
34
 
37
    mov     edx, 101
35
    mov     edx, 101
38
    mov     esi, 0x00aaaaff
36
    mov     esi, 0x00aaaaff
39
    mov     edi, 0x00aaffff
37
    mov     edi, 0x00aaffff
40
 
38
 
41
    cmp     dl, [mode]
39
    cmp     dl, [mode]
42
    cmove   esi, edi
40
    cmove   esi, edi
43
    mcall   8, 25 shl 16 + 65, 25 shl 16 + 20
41
    mcall   8, 25 shl 16 + 65, 25 shl 16 + 20
44
 
42
 
45
   @@:
43
  .morebuttons:
46
    inc     edx
44
    inc     edx
47
    add     ebx, 75 shl 16
45
    add     ebx, 75 shl 16
48
    mov     esi, 0x00aaaaff
46
    mov     esi, 0x00aaaaff
49
 
47
 
50
    cmp     dl, [mode]
48
    cmp     dl, [mode]
51
    cmove   esi, edi
49
    cmove   esi, edi
52
    mcall
50
    mcall
53
 
51
 
54
    cmp     edx, 105
52
    cmp     edx, 105
55
    jle     @r
53
    jle     .morebuttons
56
 
54
 
57
    mcall   4, 28 shl 16 + 31, 0x80000000, modes
55
    mcall   4, 28 shl 16 + 31, 0x80000000, modes
58
 
56
 
59
    cmp     [mode], 101
57
    cmp     [mode], 101
60
    jne     @f
58
    jne     .no_eth
61
 
59
 
62
    mcall   4, 20 shl 16 + 75, 0x80000000, str_packets_tx
60
    mcall   4, 20 shl 16 + 75, 0x80000000, str_packets_tx
63
    add     ebx, 18
61
    add     ebx, 18
64
    mov     edx, str_packets_rx
62
    mov     edx, str_packets_rx
65
    mcall
63
    mcall
66
    add     ebx, 18
64
    add     ebx, 18
67
    mov     edx, str_bytes_tx
65
    mov     edx, str_bytes_tx
68
    mcall
66
    mcall
69
    add     ebx, 18
67
    add     ebx, 18
70
    mov     edx, str_bytes_rx
68
    mov     edx, str_bytes_rx
71
    mcall
69
    mcall
72
    add     ebx, 18
70
    add     ebx, 18
73
    mov     edx, str_MAC
71
    mov     edx, str_MAC
74
    mcall
72
    mcall
75
    add     ebx, 18
73
    add     ebx, 18
76
    mov     edx, str_queue_in
74
    mov     edx, str_queue_in
77
    mcall
75
    mcall
78
    add     ebx, 18
76
    add     ebx, 18
79
    mov     edx, str_queue_out
77
    mov     edx, str_queue_out
80
    mcall
78
    mcall
81
 
79
 
82
    mov     ebx,1337 shl 16 + 4
80
    mov     ebx,1337 shl 16 + 4
83
    mov     bh, [device]
81
    mov     bh, [device]
84
    mcall   75
82
    mcall   75
85
    push    eax
83
    push    eax
86
    push    bx
84
    push    bx
87
 
85
 
88
    mov     edx, 135 shl 16 + 75 + 4*18
86
    mov     edx, 135 shl 16 + 75 + 4*18
89
    call    draw_mac
87
    call    draw_mac
90
    jmp     end_of_draw
88
    jmp     end_of_draw
91
 
89
 
92
 @@:
90
 .no_eth:
93
 
91
 
94
    cmp     [mode], 102
92
    cmp     [mode], 102
95
    jne     @f
93
    jne     .no_ip
96
 
94
 
97
    mcall   4, 20 shl 16 + 75, 0x80000000, str_packets_tx
95
    mcall   4, 20 shl 16 + 75, 0x80000000, str_packets_tx
98
    add     ebx, 18
96
    add     ebx, 18
99
    mov     edx, str_packets_rx
97
    mov     edx, str_packets_rx
100
    mcall
98
    mcall
101
    add     ebx, 18
99
    add     ebx, 18
102
    mov     edx, str_ip
100
    mov     edx, str_ip
103
    mcall
101
    mcall
104
    add     ebx, 18
102
    add     ebx, 18
105
    mov     edx, str_dns
103
    mov     edx, str_dns
106
    mcall
104
    mcall
107
    add     ebx, 18
105
    add     ebx, 18
108
    mov     edx, str_subnet
106
    mov     edx, str_subnet
109
    mcall
107
    mcall
110
    add     ebx, 18
108
    add     ebx, 18
111
    mov     edx, str_gateway
109
    mov     edx, str_gateway
112
    mcall
110
    mcall
113
 
111
 
114
 
112
 
115
    mov     ebx, 0 shl 16 + 8
113
    mov     ebx, 0 shl 16 + 8
116
    mov     bh, [device]
114
    mov     bh, [device]
117
    mcall   75
115
    mcall   75
118
    push    eax
116
    push    eax
119
 
117
 
120
    dec     bl
118
    dec     bl
121
    dec     bl
119
    dec     bl
122
    mcall   75
120
    mcall   75
123
    push    eax
121
    push    eax
124
 
122
 
125
    dec     bl
123
    dec     bl
126
    dec     bl
124
    dec     bl
127
    mcall   75
125
    mcall   75
128
    push    eax
126
    push    eax
129
 
127
 
130
    dec     bl
128
    dec     bl
131
    dec     bl
129
    dec     bl
132
    mcall   75
130
    mcall   75
133
    push    eax
131
    push    eax
134
 
132
 
135
    mov     edx, 135 shl 16 + 75 + 2*18
133
    mov     edx, 135 shl 16 + 75 + 2*18
136
    call    draw_ip
134
    call    draw_ip
137
 
135
 
138
    add     edx, 18
136
    add     edx, 18
139
    call    draw_ip
137
    call    draw_ip
140
 
138
 
141
    add     edx, 18
139
    add     edx, 18
142
    call    draw_ip
140
    call    draw_ip
143
 
141
 
144
    add     edx, 18
142
    add     edx, 18
145
    call    draw_ip
143
    call    draw_ip
146
 
144
 
147
    jmp     end_of_draw
145
    jmp     end_of_draw
148
 
146
 
149
 @@:
147
 .no_ip:
150
 
148
 
151
    cmp     [mode], 103
149
    cmp     [mode], 103
152
    jne     @f
150
    jne     .no_arp
153
 
151
 
154
    mcall   4, 20 shl 16 + 75, 0x80000000, str_packets_tx
152
    mcall   4, 20 shl 16 + 75, 0x80000000, str_packets_tx
155
    add     ebx, 18
153
    add     ebx, 18
156
    mov     edx, str_packets_rx
154
    mov     edx, str_packets_rx
157
    mcall
155
    mcall
158
    add     ebx, 18
156
    add     ebx, 18
159
    mov     edx, str_arp
157
    mov     edx, str_arp
160
    mcall
158
    mcall
161
 
159
 
162
    jmp     end_of_draw
160
    jmp     end_of_draw
163
 
161
 
164
 @@:
162
 .no_arp:
165
 
163
 
166
    mcall   4, 20 shl 16 + 75, 0x80000000, str_packets_tx
164
    mcall   4, 20 shl 16 + 75, 0x80000000, str_packets_tx
167
    add     ebx, 18
165
    add     ebx, 18
168
    mov     edx, str_packets_rx
166
    mov     edx, str_packets_rx
169
    mcall
167
    mcall
170
 
168
 
171
 end_of_draw:
169
 end_of_draw:
172
 
170
 
173
    mcall   12, 2
171
    mcall   12, 2
174
 
172
 
175
    jmp     draw_stats
173
    jmp     draw_stats
176
 
174
 
177
  mainloop:
175
  mainloop:
178
 
176
 
179
    mcall   23,50		   ; wait for event with timeout    (0,5 s)
177
    mcall   23,500		    ; wait for event with timeout    (0,5 s)
180
 
178
 
181
    cmp     eax, 1
179
    cmp     eax, 1
182
    je	    redraw
180
    je	    redraw
183
    cmp     eax, 2
181
    cmp     eax, 2
184
    je	    key
182
    je	    key
185
    cmp     eax, 3
183
    cmp     eax, 3
186
    je	    button
184
    je	    button
187
 
185
 
188
 
186
 
189
 
187
 
190
 
188
 
191
;-------------------------------
189
;-------------------------------
192
;
190
;
193
;------------------------------
191
;------------------------------
194
 
192
 
195
  draw_stats:
193
  draw_stats:
196
 
194
 
197
    cmp     [mode], 101
195
    cmp     [mode], 101
198
    jne     not_101
196
    jne     not_101
199
 
197
 
200
    mov     ebx, 1337 shl 16 + 0
198
    mov     ebx, 1337 shl 16 + 0
201
    mov     bh, [device]
199
    mov     bh, [device]
202
   @@:
200
   @@:
203
    push    ebx
201
    push    ebx
204
    mcall   75
202
    mcall   75
205
    pop     ebx
203
    pop     ebx
206
    push    eax
204
    push    eax
207
    inc     bl
205
    inc     bl
208
    cmp     bl, 3
206
    cmp     bl, 3
209
    jle     @r
207
    jle     @r
210
 
208
 
211
    inc     bl	 ;5
209
    inc     bl	 ;5
212
    inc     bl	 ;6
210
    inc     bl	 ;6
213
 
211
 
214
   @@:
212
   @@:
215
    push    ebx
213
    push    ebx
216
    mcall   75
214
    mcall   75
217
    pop     ebx
215
    pop     ebx
218
    push    eax
216
    push    eax
219
    inc     bl
217
    inc     bl
220
    cmp     bl, 7
218
    cmp     bl, 7
221
    jle     @r
219
    jle     @r
222
 
220
 
223
    mov     eax, 47
221
    mov     eax, 47
224
    mov     ebx, 0x000a0000
222
    mov     ebx, 0x000a0000
225
    mov     esi, 0x40000000
223
    mov     esi, 0x40000000
226
    mov     edi, 0x00bcbcbc
224
    mov     edi, 0x00bcbcbc
227
    mov     edx, 135 shl 16 + 75 + 6*18
225
    mov     edx, 135 shl 16 + 75 + 6*18
228
    pop     ecx
226
    pop     ecx
229
    mcall
227
    mcall
230
    sub     edx, 18
228
    sub     edx, 18
231
    pop     ecx
229
    pop     ecx
232
    mcall
230
    mcall
233
    sub     edx, 2*18
231
    sub     edx, 2*18
234
    pop     ecx
232
    pop     ecx
235
    mcall
233
    mcall
236
    sub     edx, 18
234
    sub     edx, 18
237
    pop     ecx
235
    pop     ecx
238
    mcall
236
    mcall
239
    sub     edx, 18
237
    sub     edx, 18
240
    pop     ecx
238
    pop     ecx
241
    mcall
239
    mcall
242
    sub     edx, 18
240
    sub     edx, 18
243
    pop     ecx
241
    pop     ecx
244
    mcall
242
    mcall
245
 
243
 
246
    jmp     mainloop
244
    jmp     mainloop
247
 
245
 
248
 
246
 
249
 not_101:
247
 not_101:
250
 
248
 
251
    cmp     [mode], 102
249
    cmp     [mode], 102
252
    jne     not_102
250
    jne     not_102
253
 
251
 
254
    mov     ebx, 0 shl 16
252
    mov     ebx, 0 shl 16
255
    mov     bh, [device]
253
    mov     bh, [device]
256
    push    ebx
254
    push    ebx
257
    mcall   75
255
    mcall   75
258
    pop     ebx
256
    pop     ebx
259
    push    eax
257
    push    eax
260
    inc     bl
258
    inc     bl
261
    push    ebx
259
    push    ebx
262
    mcall   75
260
    mcall   75
263
    pop     ebx
261
    pop     ebx
264
    push    eax
262
    push    eax
265
    inc     bl
263
    inc     bl
266
 
264
 
267
    mov     eax, 47
265
    mov     eax, 47
268
    mov     ebx, 0x000a0000
266
    mov     ebx, 0x000a0000
269
    mov     esi, 0x40000000
267
    mov     esi, 0x40000000
270
    mov     edi, 0x00bcbcbc
268
    mov     edi, 0x00bcbcbc
271
    mov     edx, 135 shl 16 + 75 + 18
269
    mov     edx, 135 shl 16 + 75 + 18
272
    pop     ecx
270
    pop     ecx
273
    mcall
271
    mcall
274
    sub     edx, 18
272
    sub     edx, 18
275
    pop     ecx
273
    pop     ecx
276
    mcall
274
    mcall
277
 
275
 
278
    jmp     mainloop
276
    jmp     mainloop
279
 
277
 
280
 
278
 
281
 not_102:
279
 not_102:
282
 
280
 
283
    cmp     [mode], 103
281
    cmp     [mode], 103
284
    jne     not_103
282
    jne     not_103
285
 
283
 
286
    mov     ebx, 0x0608 shl 16 + 0
284
    mov     ebx, 0x0608 shl 16 + 0
287
    mov     bh, [device]
285
    mov     bh, [device]
288
    push    ebx
286
    push    ebx
289
    mcall   75
287
    mcall   75
290
    pop     ebx
288
    pop     ebx
291
    push    eax
289
    push    eax
292
    inc     bl
290
    inc     bl
293
    push    ebx
291
    push    ebx
294
    mcall   75
292
    mcall   75
295
    pop     ebx
293
    pop     ebx
296
    push    eax
294
    push    eax
297
    inc     bl
295
    inc     bl
298
    push    ebx
296
    push    ebx
299
    mcall   75
297
    mcall   75
300
    pop     ebx
298
    pop     ebx
301
    push    eax
299
    push    eax
302
    inc     bl
300
    inc     bl
303
 
301
 
304
    mov     eax, 47
302
    mov     eax, 47
305
    mov     ebx, 0x000a0000
303
    mov     ebx, 0x000a0000
306
    mov     esi, 0x40000000
304
    mov     esi, 0x40000000
307
    mov     edi, 0x00bcbcbc
305
    mov     edi, 0x00bcbcbc
308
    mov     edx, 135 shl 16 + 75 + 2*18
306
    mov     edx, 135 shl 16 + 75 + 2*18
309
    pop     ecx
307
    pop     ecx
310
    mcall
308
    mcall
311
    sub     edx, 18
309
    sub     edx, 18
312
    pop     ecx
310
    pop     ecx
313
    mcall
311
    mcall
314
    sub     edx, 18
312
    sub     edx, 18
315
    pop     ecx
313
    pop     ecx
316
    mcall
314
    mcall
317
 
315
 
318
    jmp     mainloop
316
    jmp     mainloop
319
 
317
 
320
not_103:
318
not_103:
321
 
319
 
322
    cmp     [mode], 104
320
    cmp     [mode], 104
323
    jne     not_104
321
    jne     not_104
324
 
322
 
325
    mov     ebx, 1 shl 16 + 0
323
    mov     ebx, 1 shl 16 + 0
326
    mov     bh, [device]
324
    mov     bh, [device]
327
    push    ebx
325
    push    ebx
328
    mcall   75
326
    mcall   75
329
    pop     ebx
327
    pop     ebx
330
    push    eax
328
    push    eax
331
    inc     bl
329
    inc     bl
332
    push    ebx
330
    push    ebx
333
    mcall   75
331
    mcall   75
334
    pop     ebx
332
    pop     ebx
335
    push    eax
333
    push    eax
336
    inc     bl
334
    inc     bl
337
 
335
 
338
    mov     eax, 47
336
    mov     eax, 47
339
    mov     ebx, 0x000a0000
337
    mov     ebx, 0x000a0000
340
    mov     esi, 0x40000000
338
    mov     esi, 0x40000000
341
    mov     edi, 0x00bcbcbc
339
    mov     edi, 0x00bcbcbc
342
    mov     edx, 135 shl 16 + 75 + 18
340
    mov     edx, 135 shl 16 + 75 + 18
343
    pop     ecx
341
    pop     ecx
344
    mcall
342
    mcall
345
    sub     edx, 18
343
    sub     edx, 18
346
    pop     ecx
344
    pop     ecx
347
    mcall
345
    mcall
348
 
346
 
349
    jmp     mainloop
347
    jmp     mainloop
350
 
348
 
351
not_104:
349
not_104:
352
 
350
 
353
    cmp     [mode], 105
351
    cmp     [mode], 105
354
    jne     not_105
352
    jne     not_105
355
 
353
 
356
    mov     ebx, 17 shl 16 + 0
354
    mov     ebx, 17 shl 16 + 0
357
    mov     bh, [device]
355
    mov     bh, [device]
358
    push    ebx
356
    push    ebx
359
    mcall   75
357
    mcall   75
360
    pop     ebx
358
    pop     ebx
361
    push    eax
359
    push    eax
362
    inc     bl
360
    inc     bl
363
    push    ebx
361
    push    ebx
364
    mcall   75
362
    mcall   75
365
    pop     ebx
363
    pop     ebx
366
    push    eax
364
    push    eax
367
    inc     bl
365
    inc     bl
368
 
366
 
369
    mov     eax, 47
367
    mov     eax, 47
370
    mov     ebx, 0x000a0000
368
    mov     ebx, 0x000a0000
371
    mov     esi, 0x40000000
369
    mov     esi, 0x40000000
372
    mov     edi, 0x00bcbcbc
370
    mov     edi, 0x00bcbcbc
373
    mov     edx, 135 shl 16 + 75 + 18
371
    mov     edx, 135 shl 16 + 75 + 18
374
    pop     ecx
372
    pop     ecx
375
    mcall
373
    mcall
376
    sub     edx, 18
374
    sub     edx, 18
377
    pop     ecx
375
    pop     ecx
378
    mcall
376
    mcall
379
 
377
 
380
    jmp     mainloop
378
    jmp     mainloop
381
 
379
 
382
not_105:
380
not_105:
383
 
381
 
384
    cmp     [mode], 106
382
    cmp     [mode], 106
385
    jne     not_106
383
    jne     not_106
386
 
384
 
387
    mov     ebx, 6 shl 16 + 0
385
    mov     ebx, 6 shl 16 + 0
388
    mov     bh, [device]
386
    mov     bh, [device]
389
    push    ebx
387
    push    ebx
390
    mcall   75
388
    mcall   75
391
    pop     ebx
389
    pop     ebx
392
    push    eax
390
    push    eax
393
    inc     bl
391
    inc     bl
394
    push    ebx
392
    push    ebx
395
    mcall   75
393
    mcall   75
396
    pop     ebx
394
    pop     ebx
397
    push    eax
395
    push    eax
398
    inc     bl
396
    inc     bl
399
 
397
 
400
    mov     eax, 47
398
    mov     eax, 47
401
    mov     ebx, 0x000a0000
399
    mov     ebx, 0x000a0000
402
    mov     esi, 0x40000000
400
    mov     esi, 0x40000000
403
    mov     edi, 0x00bcbcbc
401
    mov     edi, 0x00bcbcbc
404
    mov     edx, 135 shl 16 + 75 + 18
402
    mov     edx, 135 shl 16 + 75 + 18
405
    pop     ecx
403
    pop     ecx
406
    mcall
404
    mcall
407
    sub     edx, 18
405
    sub     edx, 18
408
    pop     ecx
406
    pop     ecx
409
    mcall
407
    mcall
410
 
408
 
411
    jmp     mainloop
409
    jmp     mainloop
412
 
410
 
413
not_106:
411
not_106:
414
 
412
 
415
    jmp     mainloop
413
    jmp     mainloop
416
 
414
 
417
  key:
415
  key:
418
    mcall   2
416
    mcall   2
419
    jmp     mainloop
417
    jmp     mainloop
420
 
418
 
421
 
419
 
422
  button:			  ; button
420
  button:			  ; button
423
    mcall   17			  ; get id
421
    mcall   17			  ; get id
424
    cmp     ah, 1
422
    cmp     ah, 1
425
    je	    close
423
    je	    close
426
    mov     [mode], ah
424
    mov     [mode], ah
427
    jmp     redraw
425
    jmp     redraw
428
 
426
 
429
  close:
427
  close:
430
    mcall   -1
428
    mcall   -1
431
 
429
 
432
 
430
 
433
 
431
 
434
draw_mac:
432
draw_mac:
435
 
433
 
436
	mov	eax, 47
434
	mov	eax, 47
437
	mov	ebx, 0x00020100
435
	mov	ebx, 0x00020100
438
	mov	esi, 0x40000000
436
	mov	esi, 0x40000000
439
	mov	edi, 0x00bcbcbc
437
	mov	edi, 0x00bcbcbc
440
 
438
 
441
	mov	cl, [esp+4]
439
	mov	cl, [esp+4]
442
	mcall
440
	mcall
443
 
441
 
444
	mov	cl, [esp+4+1]
442
	mov	cl, [esp+4+1]
445
	add	edx, 15 shl 16
443
	add	edx, 15 shl 16
446
	mcall
444
	mcall
447
 
445
 
448
	mov	cl, [esp+4+2]
446
	mov	cl, [esp+4+2]
449
	add	edx, 15 shl 16
447
	add	edx, 15 shl 16
450
	mcall
448
	mcall
451
 
449
 
452
	mov	cl, [esp+4+3]
450
	mov	cl, [esp+4+3]
453
	add	edx, 15 shl 16
451
	add	edx, 15 shl 16
454
	mcall
452
	mcall
455
 
453
 
456
	mov	cl, [esp+4+4]
454
	mov	cl, [esp+4+4]
457
	add	edx, 15 shl 16
455
	add	edx, 15 shl 16
458
	mcall
456
	mcall
459
 
457
 
460
	mov	cl, [esp+4+5]
458
	mov	cl, [esp+4+5]
461
	add	edx, 15 shl 16
459
	add	edx, 15 shl 16
462
	mcall
460
	mcall
463
 
-
 
464
	mov	eax, [esp]
-
 
465
	add	esp, 6+4
461
 
466
	sub	edx, 5*15 shl 16
462
	sub	edx, 5*15 shl 16
467
 
463
 
468
	jmp	eax
464
	ret	6
469
 
465
 
470
 
466
 
471
draw_ip:
467
draw_ip:
472
 
468
 
473
	mov	eax, 47
469
	mov	eax, 47
474
	mov	ebx, 0x00030000
470
	mov	ebx, 0x00030000
475
	mov	esi, 0x40000000
471
	mov	esi, 0x40000000
476
	mov	edi, 0x00bcbcbc
472
	mov	edi, 0x00bcbcbc
477
 
473
 
478
	xor	ecx, ecx
474
	xor	ecx, ecx
479
 
475
 
480
	mov	cl, [esp+4]
476
	mov	cl, [esp+4]
481
	mcall
477
	mcall
482
 
478
 
483
	mov	cl, [esp+4+1]
479
	mov	cl, [esp+4+1]
484
	add	edx, 30 shl 16
480
	add	edx, 30 shl 16
485
	mcall
481
	mcall
486
 
482
 
487
	mov	cl, [esp+4+2]
483
	mov	cl, [esp+4+2]
488
	add	edx, 30 shl 16
484
	add	edx, 30 shl 16
489
	mcall
485
	mcall
490
 
486
 
491
	mov	cl, [esp+4+3]
487
	mov	cl, [esp+4+3]
492
	add	edx, 30 shl 16
488
	add	edx, 30 shl 16
493
	mcall
489
	mcall
494
 
490
 
495
	sub	edx, 3*30 shl 16
491
	sub	edx, 3*30 shl 16
496
	mov	eax, [esp]
-
 
497
	add	esp, 8
-
 
498
	jmp	eax
492
	ret	4
499
 
493
 
500
 
494
 
501
; DATA AREA
495
; DATA AREA
502
 
-
 
503
IM_END:
-
 
504
 
496
 
505
name	db 'Netstat',0
497
name	db 'Netstat',0
506
mode	db 101
498
mode	db 101
507
device	db 0
499
device	db 0
508
modes	db 'Ethernet        IPv4        ARP         ICMP         UDP         TCP',0
500
modes	db 'Ethernet        IPv4        ARP         ICMP         UDP         TCP',0
509
 
501
 
510
str_packets_tx db 'Packets sent:',0
502
str_packets_tx db 'Packets sent:',0
511
str_packets_rx db 'Packets received:',0
503
str_packets_rx db 'Packets received:',0
512
str_bytes_tx   db 'Bytes sent:',0
504
str_bytes_tx   db 'Bytes sent:',0
513
str_bytes_rx   db 'Bytes received:',0
505
str_bytes_rx   db 'Bytes received:',0
514
str_MAC        db 'MAC address:',0
506
str_MAC        db 'MAC address:',0
515
str_queue_in   db 'IN-queue size:',0
507
str_queue_in   db 'IN-queue size:',0
516
str_queue_out  db 'OUT-queue size:',0
508
str_queue_out  db 'OUT-queue size:',0
517
str_ip	       db 'IP address:',0
509
str_ip	       db 'IP address:',0
518
str_dns        db 'DNS address:',0
510
str_dns        db 'DNS address:',0
519
str_subnet     db 'Subnet mask:',0
511
str_subnet     db 'Subnet mask:',0
520
str_gateway    db 'Standard gateway:',0
512
str_gateway    db 'Standard gateway:',0
521
str_arp        db 'ARP entrys:',0
513
str_arp        db 'ARP entrys:',0
522
 
514
 
523
include_debug_strings	 ; ALWAYS present in data section
515
include_debug_strings	 ; ALWAYS present in data section
524
 
516
 
525
I_PARAM rb 1024
517
I_PARAM rb 1024
526
 
518
 
527
I_END:
519
I_END: