Subversion Repositories Kolibri OS

Rev

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

Rev 5589 Rev 5610
Line 8... Line 8...
8
;;          GNU GENERAL PUBLIC LICENSE                             ;;
8
;;          GNU GENERAL PUBLIC LICENSE                             ;;
9
;;             Version 2, June 1991                                ;;
9
;;             Version 2, June 1991                                ;;
10
;;                                                                 ;;
10
;;                                                                 ;;
11
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
11
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 12... Line -...
12
 
-
 
13
enum_callback:
-
 
14
 
12
 
Line 15... Line 13...
15
ipcfg:
13
ipcfg:
Line 16... Line 14...
16
 
14
 
Line 26... Line 24...
26
; If settings not found, use default settings from 'ip?' section
24
; If settings not found, use default settings from 'ip?' section
27
        mov     dword[str_ini_int], 'ip?'
25
        mov     dword[str_ini_int], 'ip?'
28
  @@:
26
  @@:
Line 29... Line 27...
29
 
27
 
30
; Read ip/subnet/gateway type
28
; Read ip/subnet/gateway type
31
        mov     [option_ip], op_ip_static
29
        mov     [option_ip], op_ip_disabled
32
        invoke  ini.get_str, net_ini, str_ini_int, str_ini_ip_type, ini_buf, 16, sz_0
30
        invoke  ini.get_str, net_ini, str_ini_int, str_ini_ip_type, ini_buf, 16, sz_0
33
;        test    eax, eax
31
        test    eax, eax
34
;        jz      .disabled
32
        jnz     .ip_type_loaded
35
        mov     eax, dword[ini_buf]
33
        mov     eax, dword[ini_buf]
36
        or      eax, 0x20202020
34
        or      eax, 0x20202020
37
        cmp     eax, 'stat'
35
        cmp     eax, 'auto'
-
 
36
        jne     @f
-
 
37
;        cmp     byte[ini_buf+4], 0
38
        je      @f
38
;        jne     @f
-
 
39
        mov     [option_ip], op_ip_auto
39
        mov     [option_ip], op_ip_auto
40
        jmp     .ip_type_loaded
-
 
41
  @@:
-
 
42
        cmp     eax, 'dhcp'
-
 
43
        jne     @f
-
 
44
;        cmp     byte[ini_buf+4], 0
-
 
45
;        jne     @f
-
 
46
        mov     [option_ip], op_ip_auto
-
 
47
        jmp     .ip_type_loaded
-
 
48
  @@:
-
 
49
        cmp     eax, 'stat'
-
 
50
        jne     @f
-
 
51
;        mov     eax, dword[ini_buf+3]
-
 
52
;        or      eax, 0x202020
-
 
53
;        cmp     eax, 'tic'
-
 
54
;        jne     @f
-
 
55
        mov     [option_ip], op_ip_static
-
 
56
;        jmp     .ip_type_loaded
-
 
57
  @@:
Line 40... Line 58...
40
  @@:
58
  .ip_type_loaded:
41
 
59
 
42
; Read DNS type
60
; Read DNS type
-
 
61
        mov     [option_dns], op_dns_auto
-
 
62
        invoke  ini.get_str, net_ini, str_ini_int, str_ini_dns_type, ini_buf, 16, sz_0
43
        mov     [option_dns], op_dns_static
63
        test    eax, eax
44
        invoke  ini.get_str, net_ini, str_ini_int, str_ini_dns_type, ini_buf, 16, sz_0
64
        jnz     @f
45
        mov     eax, dword[ini_buf]
65
        mov     eax, dword[ini_buf]
46
        or      eax, 0x20202020
66
        or      eax, 0x20202020
-
 
67
        cmp     eax, 'stat'
-
 
68
        jne     @f
-
 
69
;        mov     eax, dword[ini_buf+3]
-
 
70
;        or      eax, 0x202020
47
        cmp     eax, 'stat'
71
;        cmp     eax, 'tic'
48
        je      @f
72
;        jne     @f
Line 49... Line 73...
49
        mov     [option_dns], op_dns_auto
73
        mov     [option_dns], op_dns_static
50
  @@:
74
  @@:
51
 
75
 
Line 80... Line 104...
80
        mov     edi, str_title
104
        mov     edi, str_title
81
        mcall   0, 50 shl 16 + 200, 30 shl 16 + 200
105
        mcall   0, 50 shl 16 + 200, 30 shl 16 + 200
Line 82... Line 106...
82
 
106
 
83
        mov     ecx, 0x80000000
107
        mov     ecx, 0x80000000
84
        or      ecx, [sc.work_text]
108
        or      ecx, [sc.work_text]
85
;        mov     ebx, 47 shl 16 + 10
109
;        mov     ebx, 47 shl 16 + 25
86
;        mov     edx, str_mode
110
;        mov     edx, str_mode
87
;        mcall
111
;        mcall
88
        mov     ebx, 59 shl 16 + 35
112
        mov     ebx, 59 shl 16 + 50
89
        mov     edx, sz_ip
113
        mov     edx, sz_ip
90
        mcall   4
114
        mcall   4
91
        mov     ebx, 5 shl 16 + 55
115
        mov     ebx, 5 shl 16 + 70
92
        mov     edx, sz_subnet
116
        mov     edx, sz_subnet
93
        mcall
117
        mcall
94
        mov     ebx, 29 shl 16 + 75
118
        mov     ebx, 29 shl 16 + 90
95
        mov     edx, sz_gateway
119
        mov     edx, sz_gateway
96
        mcall
120
        mcall
97
;        mov     ebx, 47 shl 16 + 80
121
;        mov     ebx, 47 shl 16 + 95
98
;        mov     edx, str_mode
122
;        mov     edx, str_mode
99
;        mcall
123
;        mcall
100
        mov     ebx, 53 shl 16 + 120
124
        mov     ebx, 53 shl 16 + 135
101
        mov     edx, sz_dns
125
        mov     edx, sz_dns
Line 102... Line 126...
102
        mcall
126
        mcall
103
 
127
 
Line 107... Line 131...
107
        invoke  edit_box_draw, edit_dns
131
        invoke  edit_box_draw, edit_dns
Line 108... Line 132...
108
 
132
 
109
        invoke  option_box_draw, Option_boxs1
133
        invoke  option_box_draw, Option_boxs1
Line 110... Line 134...
110
        invoke  option_box_draw, Option_boxs2
134
        invoke  option_box_draw, Option_boxs2
Line 111... Line 135...
111
 
135
 
112
        mcall   8, 80 shl 16 + 100, 150 shl 16 + 16, 2, [sc.work_button]
136
        mcall   8, 80 shl 16 + 100, 155 shl 16 + 16, 2, [sc.work_button]
113
 
137
 
114
        mov     ecx, 0x80000000
138
        mov     ecx, 0x80000000
115
        or      ecx, [sc.work_button_text]
139
        or      ecx, [sc.work_button_text]
Line 116... Line 140...
116
        mov     ebx, 112 shl 16 + 155
140
        mov     ebx, 112 shl 16 + 160
Line 213... Line 237...
213
; Settings look valid, save them to the ini file
237
; Settings look valid, save them to the ini file
214
; Re-create 'ip..' string, we dont want to save to 'ip?' section.
238
; Re-create 'ip..' string, we dont want to save to 'ip?' section.
215
        call    create_str_ini_int
239
        call    create_str_ini_int
Line 216... Line 240...
216
 
240
 
217
        cmp     [option_ip], op_ip_auto
241
        cmp     [option_ip], op_ip_auto
218
        jne     .ip_static
242
        jne     @f
219
        invoke  ini.set_str, net_ini, str_ini_int, str_ini_ip_type, sz_dhcp, 4
243
        invoke  ini.set_str, net_ini, str_ini_int, str_ini_ip_type, sz_auto, 4
220
        jmp     @f
-
 
221
  .ip_static:
-
 
222
        invoke  ini.set_str, net_ini, str_ini_int, str_ini_ip_type, sz_static2, 6
244
        jmp     .ip_type_ok
-
 
245
  @@:
-
 
246
        cmp     [option_ip], op_ip_static
-
 
247
        jne     @f
-
 
248
        invoke  ini.set_str, net_ini, str_ini_int, str_ini_ip_type, sz_static, 6
-
 
249
        jmp     .ip_type_ok
-
 
250
  @@:
-
 
251
;        cmp     [option_ip], op_ip_disabled
-
 
252
;        jne     @f
-
 
253
        invoke  ini.set_str, net_ini, str_ini_int, str_ini_ip_type, sz_disabled, 8
-
 
254
;  @@:
Line 223... Line 255...
223
  @@:
255
  .ip_type_ok:
224
 
256
 
225
        cmp     [option_dns], op_dns_auto
257
        cmp     [option_dns], op_dns_auto
226
        invoke  ini.set_str, net_ini, str_ini_int, str_ini_dns_type, sz_dhcp, 4
258
        invoke  ini.set_str, net_ini, str_ini_int, str_ini_dns_type, sz_auto, 4
227
        jmp     @f
259
        jmp     @f
228
  .dns_static:
260
  .dns_static:
Line 229... Line 261...
229
        invoke  ini.set_str, net_ini, str_ini_int, str_ini_dns_type, sz_static2, 6
261
        invoke  ini.set_str, net_ini, str_ini_int, str_ini_dns_type, sz_static, 6
230
  @@:
262
  @@:
231
 
263
 
Line 276... Line 308...
276
        mov     [edit_ip.color], 0xcacaca
308
        mov     [edit_ip.color], 0xcacaca
277
        mov     [edit_subnet.color], 0xcacaca
309
        mov     [edit_subnet.color], 0xcacaca
278
        mov     [edit_gateway.color], 0xcacaca
310
        mov     [edit_gateway.color], 0xcacaca
279
  @@:
311
  @@:
Line 280... Line -...
280
 
-
 
281
        mov     [edit_dns.color], 0xffffff
-
 
282
        cmp     [option_dns], op_dns_static
-
 
283
        je      @f
312
 
-
 
313
        mov     [edit_dns.color], 0xcacaca
-
 
314
        cmp     [option_ip], op_ip_disabled
-
 
315
        je      @f
-
 
316
        cmp     [option_dns], op_dns_static
-
 
317
        jne     @f
284
        mov     [edit_dns.color], 0xcacaca
318
        mov     [edit_dns.color], 0xffffff
Line 285... Line 319...
285
  @@:
319
  @@:
Line 348... Line 382...
348
 
382
 
349
 
383
 
Line 350... Line 384...
350
;-------------------------
384
;-------------------------
351
; DATA
385
; DATA
352
 
386
 
353
edit_ip         edit_box 100, 80, 30, 0xffffff, 0x6f9480, 0, 0, 0, 15, str_edit_ip, mouse_dd, 0, 0, 1
387
edit_ip         edit_box 100, 80, 45, 0xffffff, 0x6f9480, 0, 0, 0, 15, str_edit_ip, mouse_dd, 0, 0, 1
354
edit_subnet     edit_box 100, 80, 50, 0xffffff, 0x6f9480, 0, 0, 0, 15, str_edit_subnet, mouse_dd, 0, 0, 1
388
edit_subnet     edit_box 100, 80, 65, 0xffffff, 0x6f9480, 0, 0, 0, 15, str_edit_subnet, mouse_dd, 0, 0, 1
-
 
389
edit_gateway    edit_box 100, 80, 85, 0xffffff, 0x6f9480, 0, 0, 0, 15, str_edit_gateway, mouse_dd, 0, 0, 1
-
 
390
 
-
 
391
edit_dns        edit_box 100, 80, 130, 0xffffff, 0x6f9480, 0, 0, 0, 15, str_edit_dns, mouse_dd, 0, 0, 1
-
 
392
 
Line 355... Line -...
355
edit_gateway    edit_box 100, 80, 70, 0xffffff, 0x6f9480, 0, 0, 0, 15, str_edit_gateway, mouse_dd, 0, 0, 1
-
 
356
 
-
 
357
edit_dns        edit_box 100, 80, 115, 0xffffff, 0x6f9480, 0, 0, 0, 15, str_edit_dns, mouse_dd, 0, 0, 1
-
 
358
 
393
op_ip_disabled  option_box option_ip, 15, 5, 6, 12, 0xffffff, 0, 0, sz_disabled, 9
359
op_ip_auto      option_box option_ip, 15, 10, 6, 12, 0xffffff, 0, 0, sz_auto, 5
394
op_ip_auto      option_box option_ip, 15, 25, 6, 12, 0xffffff, 0, 0, sz_auto, 5
Line 360... Line 395...
360
op_ip_static    option_box option_ip, 80, 10, 6, 12, 0xffffff, 0, 0, sz_static, 7
395
op_ip_static    option_box option_ip, 80, 25, 6, 12, 0xffffff, 0, 0, sz_static, 7
361
 
396
 
362
op_dns_auto     option_box option_dns, 15, 95, 6, 12, 0xffffff, 0, 0, sz_auto, 5
397
op_dns_auto     option_box option_dns, 15, 110, 6, 12, 0xffffff, 0, 0, sz_auto, 5
363
op_dns_static   option_box option_dns, 80, 95, 6, 12, 0xffffff, 0, 0, sz_static, 7
398
op_dns_static   option_box option_dns, 80, 110, 6, 12, 0xffffff, 0, 0, sz_static, 7
Line 364... Line 399...
364
 
399
 
Line 365... Line 400...
365
option_ip       dd op_ip_auto
400
option_ip       dd op_ip_auto
366
option_dns      dd op_dns_auto
401
option_dns      dd op_dns_auto
367
Option_boxs1    dd op_ip_auto, op_ip_static, 0
402
Option_boxs1    dd op_ip_disabled, op_ip_auto, op_ip_static, 0
368
Option_boxs2    dd op_dns_auto, op_dns_static, 0
403
Option_boxs2    dd op_dns_auto, op_dns_static, 0
369
 
404
 
370
net_ini         db '/sys/settings/network.ini', 0
405
net_ini         db '/sys/settings/network.ini', 0
371
 
406
 
372
str_ini_int     db 'ip1', 0
407
str_ini_int     db 'ip1', 0
Line 373... Line -...
373
                rb 10
-
 
374
str_ini_ip      db 'ip', 0
-
 
375
str_ini_subnet  db 'subnet', 0
-
 
376
str_ini_gateway db 'gateway', 0
-
 
377
str_ini_dns     db 'dns1', 0
408
                rb 10
-
 
409
str_ini_ip      db 'ip', 0
378
str_ini_ip_type db 'ip_type', 0
410
str_ini_subnet  db 'subnet', 0
379
str_ini_dns_type db 'dns_type', 0
411
str_ini_gateway db 'gateway', 0
380
 
412
str_ini_dns     db 'dns', 0
381
sz_0            db 0
413
str_ini_ip_type db 'ip_type', 0
382
sz_dhcp         db 'dhcp', 0
414
str_ini_dns_type db 'dns_type', 0
383
sz_static2      db 'static', 0
415
 
-
 
416
str_title       db 'IP settings', 0
384
 
417
sz_0            db 0
Line 385... Line 418...
385
str_title       db 'IP settings', 0
418
sz_ip           db 'IP:', 0
386
sz_ip           db 'IP:', 0
419
sz_subnet       db 'Subnet mask:', 0
387
sz_subnet       db 'Subnet mask:', 0
420
sz_gateway      db 'Gateway:', 0