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 2... Line 2...
2
; ARPmanager for KolibriOS
2
; ARPmanager for KolibriOS
3
;
3
;
4
; hidnplayr@gmail.com
4
; hidnplayr@gmail.com
5
;
5
;
Line -... Line 6...
-
 
6
 
-
 
7
format binary as ""
6
 
8
 
Line 7... Line 9...
7
use32
9
use32
Line 8... Line 10...
8
 
10
 
9
    org     0x0
11
    org     0x0
10
 
12
 
11
    db	   'MENUET01'	     ; 8 byte id
13
    db     'MENUET01'           ; 8 byte id
12
    dd	   0x01 	     ; header version
14
    dd     0x01                 ; header version
13
    dd	   START	     ; start of code
15
    dd     START                ; start of code
14
    dd	   IM_END	     ; size of image
16
    dd     IM_END               ; size of image
15
    dd	   (I_END+0x100)     ; memory for app
-
 
16
    dd	   (I_END+0x100)     ; esp
-
 
17
    dd	   I_PARAM , 0x0     ; I_Param , I_Icon
-
 
Line 18... Line 17...
18
 
17
    dd     (I_END+0x100)        ; memory for app
-
 
18
    dd     (I_END+0x100)        ; esp
-
 
19
    dd     0x0 , 0x0            ; I_Param , I_Icon
19
__DEBUG__ equ 1
20
 
Line 20... Line -...
20
__DEBUG_LEVEL__ equ 1
-
 
21
 
-
 
22
include '..\macros.inc'
21
include '../macros.inc'
23
include '..\debug-fdo.inc'
-
 
Line 24... Line 22...
24
 
22
purge   mov, add, sub
Line 25... Line 23...
25
START:				       ; start of execution
23
include '../struct.inc'
26
    ; TODO: check Parameters
-
 
27
 
24
include '../network.inc'
28
    DEBUGF 1, 'Hello!\n'
-
 
29
 
25
 
30
  redraw:
-
 
31
 
26
START:
Line 32... Line 27...
32
    mcall   12, 1
27
 
Line 33... Line 28...
33
 
28
redraw:
34
    mcall   0, 100 shl 16 + 520, 100 shl 16 + 240, 0x34bcbcbc, ,name
29
 
Line 35... Line 30...
35
 
30
        mcall   12, 1
36
    mcall   4, 25 shl 16 + 31, 0x80000000, title
31
        mcall   0, 100 shl 16 + 520, 100 shl 16 + 240, 0x34bcbcbc, , str_name
37
 
32
        mcall   4, 25 shl 16 + 31, 0x80000000, str_legend
38
    mcall   12, 2
33
        mcall   12, 2
Line 39... Line -...
39
 
-
 
40
  draw_stats:
34
 
41
 
35
draw_stats:
Line 42... Line 36...
42
	mov	edx, 50 shl 16 + 50
36
 
43
	mov	[last],0
37
        mov     edx, 50 shl 16 + 50
44
 
38
        mov     [last], 0
45
    .loop:
39
 
46
	mcall	76, 0x06080003, [last],,,ARP_ENTRY
40
  .loop:
Line 47... Line 41...
47
	cmp	eax, -1
41
        mcall   76, API_ARP + 3, [last],,, arp_buf
48
	je	mainloop
42
        cmp     eax, -1
Line 49... Line 43...
49
 
43
        je      mainloop
50
 
44
 
51
	mcall	4, edx, 0x80000000, str_entry
45
        mcall   4, edx, 0x80000000, str_entry
Line 52... Line 46...
52
	mov	edx, ebx
46
        mov     edx, ebx
53
 
47
 
54
	mov	eax, 47
48
        mov     eax, 47
Line 55... Line 49...
55
	mov	ebx, 0x00030000
49
        mov     ebx, 0x00030000
56
	mov	esi, 0x40000000
50
        mov     esi, 0x40000000
57
	mov	edi, 0x00bcbcbc
51
        mov     edi, 0x00bcbcbc
Line 58... Line 52...
58
	xor	ecx, ecx
52
        xor     ecx, ecx
59
 
53
 
60
	mov	cl, byte[ARP_ENTRY.IP+0]
54
        mov     cl, byte[arp_buf.IP+0]
61
	mcall
55
        mcall
Line 62... Line 56...
62
 
56
 
63
	mov	cl, byte[ARP_ENTRY.IP+1]
57
        mov     cl, byte[arp_buf.IP+1]
64
	add	edx, 24 shl 16
58
        add     edx, 24 shl 16
Line 65... Line 59...
65
	mcall
59
        mcall
66
 
60
 
67
	mov	cl, byte[ARP_ENTRY.IP+2]
61
        mov     cl, byte[arp_buf.IP+2]
Line 68... Line 62...
68
	add	edx, 24 shl 16
62
        add     edx, 24 shl 16
69
	mcall
63
        mcall
70
 
64
 
Line 71... Line 65...
71
	mov	cl, byte[ARP_ENTRY.IP+3]
65
        mov     cl, byte[arp_buf.IP+3]
72
	add	edx, 24 shl 16
66
        add     edx, 24 shl 16
73
	mcall
67
        mcall
Line 74... Line 68...
74
 
68
 
75
 
69
 
76
	mov	ebx, 0x00020100
70
        mov     ebx, 0x00020100
Line 77... Line 71...
77
	mov	cl, byte[ARP_ENTRY.MAC+0]
71
        mov     cl, byte[arp_buf.MAC+0]
78
	add	edx, 36 shl 16
72
        add     edx, 36 shl 16
79
	mcall
73
        mcall
80
 
74
 
Line 81... Line 75...
81
	mov	cl, byte[ARP_ENTRY.MAC+1]
75
        mov     cl, byte[arp_buf.MAC+1]
82
	add	edx, 18 shl 16
76
        add     edx, 18 shl 16
83
	mcall
77
        mcall
Line 84... Line 78...
84
 
78
 
85
	mov	cl, byte[ARP_ENTRY.MAC+2]
79
        mov     cl, byte[arp_buf.MAC+2]
Line 113... Line 107...
113
	rol	edx, 16
107
        rol     edx, 16
114
	inc	[last]
108
        inc     [last]
Line 115... Line 109...
115
 
109
 
Line -... Line 110...
-
 
110
        jmp     .loop
116
	jmp	.loop
111
 
Line 117... Line 112...
117
 
112
 
Line 118... Line 113...
118
  mainloop:
113
mainloop:
Line 135... Line 130...
135
 
130
 
136
 
131
 
137
  button:			  ; button
132
button:                                 ; button
138
    mcall   17			  ; get id
133
        mcall   17                      ; get id
139
    cmp     ah, 1
134
        cmp     ah, 1
Line 140... Line 135...
140
    je	    close
135
        je      exit
141
    jmp     redraw
136
        jmp     redraw
Line 142... Line 137...
142
 
137
 
Line 143... Line 138...
143
  close:
138
exit:
144
    mcall   -1
-
 
145
 
139
        mcall   -1
146
 
140
 
Line 147... Line -...
147
 
-
 
148
; DATA AREA
-
 
149
 
-
 
150
name	db 'ARP manager',0
-
 
151
 
-
 
152
title	db '#   IP-address        MAC-address         Status    TTL',0
-
 
153
str_entry   db '   .   .   .        -  -  -  -  -                     s',0
-
 
154
 
-
 
155
last	dd 0
-
 
156
 
-
 
157
 
-
 
158
ARP_ENTRY:
-
 
159
       .IP		dd  192 shl 0 + 168 shl 8 + 1 shl 16 + 1 shl 24
141
 
Line 160... Line 142...
160
       .MAC		dp  0xdeadbeef1337
142
 
-
 
143
; DATA AREA
Line 161... Line 144...
161
       .Status		dw  0x0300
144