Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2853 → Rev 2852

/kernel/branches/net/applications/arpcfg/arpcfg.asm
4,8 → 4,6
; hidnplayr@gmail.com
;
 
format binary as ""
 
use32
 
org 0x0
16,20 → 14,27
dd IM_END ; size of image
dd (I_END+0x100) ; memory for app
dd (I_END+0x100) ; esp
dd 0x0 , 0x0 ; I_Param , I_Icon
dd I_PARAM , 0x0 ; I_Param , I_Icon
 
include '../macros.inc'
purge mov, add, sub
include '../struct.inc'
include '../network.inc'
__DEBUG__ equ 1
__DEBUG_LEVEL__ equ 1
 
START:
include '..\macros.inc'
include '..\debug-fdo.inc'
 
START: ; start of execution
; TODO: check Parameters
 
DEBUGF 1, 'Hello!\n'
 
redraw:
 
mcall 12, 1
mcall 0, 100 shl 16 + 520, 100 shl 16 + 240, 0x34bcbcbc, , str_name
mcall 4, 25 shl 16 + 31, 0x80000000, str_legend
 
mcall 0, 100 shl 16 + 520, 100 shl 16 + 240, 0x34bcbcbc, ,name
 
mcall 4, 25 shl 16 + 31, 0x80000000, title
 
mcall 12, 2
 
draw_stats:
38,10 → 43,11
mov [last], 0
 
.loop:
mcall 76, API_ARP + 3, [last],,, arp_buf
mcall 76, 0x06080003, [last],,,ARP_ENTRY
cmp eax, -1
je mainloop
 
 
mcall 4, edx, 0x80000000, str_entry
mov edx, ebx
 
51,53 → 57,53
mov edi, 0x00bcbcbc
xor ecx, ecx
 
mov cl, byte[arp_buf.IP+0]
mov cl, byte[ARP_ENTRY.IP+0]
mcall
 
mov cl, byte[arp_buf.IP+1]
mov cl, byte[ARP_ENTRY.IP+1]
add edx, 24 shl 16
mcall
 
mov cl, byte[arp_buf.IP+2]
mov cl, byte[ARP_ENTRY.IP+2]
add edx, 24 shl 16
mcall
 
mov cl, byte[arp_buf.IP+3]
mov cl, byte[ARP_ENTRY.IP+3]
add edx, 24 shl 16
mcall
 
 
mov ebx, 0x00020100
mov cl, byte[arp_buf.MAC+0]
mov cl, byte[ARP_ENTRY.MAC+0]
add edx, 36 shl 16
mcall
 
mov cl, byte[arp_buf.MAC+1]
mov cl, byte[ARP_ENTRY.MAC+1]
add edx, 18 shl 16
mcall
 
mov cl, byte[arp_buf.MAC+2]
mov cl, byte[ARP_ENTRY.MAC+2]
add edx, 18 shl 16
mcall
 
mov cl, byte[arp_buf.MAC+3]
mov cl, byte[ARP_ENTRY.MAC+3]
add edx, 18 shl 16
mcall
 
mov cl, byte[arp_buf.MAC+4]
mov cl, byte[ARP_ENTRY.MAC+4]
add edx, 18 shl 16
mcall
 
mov cl, byte[arp_buf.MAC+5]
mov cl, byte[ARP_ENTRY.MAC+5]
add edx, 18 shl 16
mcall
 
mov ebx, 0x00040000
mov cx, [arp_buf.status]
mov cx, [ARP_ENTRY.Status]
add edx, 30 shl 16
mcall
 
mov cx, [arp_buf.TTL]
mov cx, [ARP_ENTRY.TTL]
add edx, 60 shl 16
mcall
 
109,7 → 115,6
 
jmp .loop
 
 
mainloop:
 
mcall 23,50 ; wait for event with timeout (0,5 s)
132,10 → 137,10
button: ; button
mcall 17 ; get id
cmp ah, 1
je exit
je close
jmp redraw
 
exit:
close:
mcall -1
 
 
142,14 → 147,26
 
; DATA AREA
 
str_name db 'ARP manager', 0
str_legend db '# IP-address MAC-address Status TTL', 0
name db 'ARP manager',0
 
title db '# IP-address MAC-address Status TTL',0
str_entry db ' . . . - - - - - s', 0
 
last dd 0
 
 
ARP_ENTRY:
.IP dd 192 shl 0 + 168 shl 8 + 1 shl 16 + 1 shl 24
.MAC dp 0xdeadbeef1337
.Status dw 0x0300
.TTL dw 37
.size:
 
include_debug_strings ; ALWAYS present in data section
 
IM_END:
 
last dd ?
arp_buf ARP_entry
I_PARAM rb 1024
 
I_END: