Subversion Repositories Kolibri OS

Rev

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

Rev 3787 Rev 3835
Line 2409... Line 2409...
2409
  * eax = -1 - error (there is too many threads)
2409
  * eax = -1 - error (there is too many threads)
2410
  * otherwise eax = TID - thread identifier
2410
  * otherwise eax = TID - thread identifier
2411
    
2411
    
Line 2412... Line 2412...
2412
 
2412
 
2413
======================================================================
-
 
2414
=========================== Function 52 ==============================
-
 
2415
======================================================================
-
 
2416
 
-
 
2417
WARNING: This function is obsolete and is only present in the
-
 
2418
	 documentation as a guide to understand/port the older network
-
 
2419
         applications. For new programs, use function 74
-
 
2420
 
-
 
2421
======================================================================
-
 
2422
=== Function 52, subfunction 0 - get network driver configuration. ===
-
 
2423
======================================================================
-
 
2424
 
-
 
2425
Parameters:
-
 
2426
  * eax = 52 - function number
-
 
2427
  * ebx = 0 - subfunction number
-
 
2428
Returned value:
-
 
2429
  * eax = configuration dword
-
 
2430
Remarks:
-
 
2431
  * Configuration dword can be set by subfunction 2.
-
 
2432
  * The kernel does not use this variable. The value of this
-
 
2433
    variable and working with it subfunctions 0 and 2 is represented
-
 
2434
    doubtful.
-
 
2435
 
-
 
2436
======================================================================
-
 
2437
========= Function 52, subfunction 1 - get local IP-address. =========
-
 
2438
======================================================================
-
 
2439
Parameters:
-
 
2440
  * eax = 52 - function number
-
 
2441
  * ebx = 1 - subfunction number
-
 
2442
Returned value:
-
 
2443
  * eax = IP-address (4 bytes)
-
 
2444
Remarks:
-
 
2445
  * Local IP-address is set by subfunction 3.
-
 
2446
 
-
 
2447
======================================================================
-
 
2448
=== Function 52, subfunction 2 - set network driver configuration. ===
-
 
2449
======================================================================
-
 
2450
Parameters:
-
 
2451
  * eax = 52 - function number
-
 
2452
  * ebx = 2 - subfunction number
-
 
2453
  * ecx = configuration dword; if low 7 bits derivate the number 3,
-
 
2454
    function [re-]initializes Ethernet-card, otherwise
-
 
2455
    Ethernet turns off
-
 
2456
Returned value:
-
 
2457
  * if Ethernet-interface is not requested, function returns eax=2,
-
 
2458
    but this can be changed in future kernel versions
-
 
2459
  * if Ethernet-interface is requested, eax=0 means error
-
 
2460
    (absence of Ethernet-card), and nonzero value - success
-
 
2461
Remarks:
-
 
2462
  * Configuration dword can be read by subfunction 0.
-
 
2463
  * The kernel does not use this variable. The value of this
-
 
2464
    variable, subfunction 0 and part of subfunction 2, which set it,
-
 
2465
    is represented doubtful.
-
 
2466
 
-
 
2467
======================================================================
-
 
2468
========= Function 52, subfunction 3 - set local IP-address. =========
-
 
2469
======================================================================
-
 
2470
Parameters:
-
 
2471
  * eax = 52 - function number
-
 
2472
  * ebx = 3 - subfunction number
-
 
2473
  * ecx = IP-address (4 bytes)
-
 
2474
Returned value:
-
 
2475
  * the current implementation returns eax=3, but this can be changed
-
 
2476
    in future versions
-
 
2477
Remarks:
-
 
2478
  * Local IP-address can be get by subfunction 1.
-
 
2479
 
-
 
2480
======================================================================
-
 
2481
= Function 52, subfunction 6 - add data to the stack of input queue. =
-
 
2482
======================================================================
-
 
2483
Parameters:
-
 
2484
  * eax = 52 - function number
-
 
2485
  * ebx = 6 - subfunction number
-
 
2486
  * edx = data size
-
 
2487
  * esi = data pointer
-
 
2488
Returned value:
-
 
2489
  * eax = -1 - error
-
 
2490
  * eax = 0 - success
-
 
2491
Remarks:
-
 
2492
  * This function is intended only for slow network drivers
-
 
2493
    (PPP, SLIP).
-
 
2494
  * Data size must not exceed 1500 bytes, though function
-
 
2495
    performs no checks on correctness.
-
 
2496
 
-
 
2497
======================================================================
-
 
2498
 Function 52, subfunction 8 - read data from the network output queue.
-
 
2499
======================================================================
-
 
2500
Parameters:
-
 
2501
  * eax = 52 - function number
-
 
2502
  * ebx = 8 - subfunction number
-
 
2503
  * esi = pointer to 1500-byte buffer
-
 
2504
Returned value:
-
 
2505
  * eax = number of read bytes (in the current implementation
-
 
2506
    either 0 = no data or 1500)
-
 
2507
  * data was copied in buffer
-
 
2508
Remarks:
-
 
2509
  * This function is intended only for slow network drivers
-
 
2510
    (PPP, SLIP).
-
 
2511
 
-
 
2512
======================================================================
-
 
2513
============ Function 52, subfunction 9 - get gateway IP. ============
-
 
2514
======================================================================
-
 
2515
Parameters:
-
 
2516
  * eax = 52 - function number
-
 
2517
  * ebx = 9 - subfunction number
-
 
2518
Returned value:
-
 
2519
  * eax = gateway IP (4 bytes)
-
 
2520
 
-
 
2521
======================================================================
-
 
2522
=========== Function 52, subfunction 10 - get subnet mask. ===========
-
 
2523
======================================================================
-
 
2524
Parameters:
-
 
2525
  * eax = 52 - function number
-
 
2526
  * ebx = 10 - subfunction number
-
 
2527
Returned value:
-
 
2528
  * eax = subnet mask
-
 
2529
 
-
 
2530
======================================================================
-
 
2531
============ Function 52, subfunction 11 - set gateway IP. ===========
-
 
2532
======================================================================
-
 
2533
Parameters:
-
 
2534
  * eax = 52 - function number
-
 
2535
  * ebx = 11 - subfunction number
-
 
2536
  * ecx = gateway IP (4 bytes)
-
 
2537
Returned value:
-
 
2538
  * the current implementation returns eax=11, but this can be changed
-
 
2539
    in future versions
-
 
2540
 
-
 
2541
======================================================================
-
 
2542
=========== Function 52, subfunction 12 - set subnet mask. ===========
-
 
2543
======================================================================
-
 
2544
Parameters:
-
 
2545
  * eax = 52 - function number
-
 
2546
  * ebx = 12 - subfunction number
-
 
2547
  * ecx = subnet mask
-
 
2548
Returned value:
-
 
2549
  * the current implementation returns eax=12, but this can be changed
-
 
2550
    in future versions
-
 
2551
 
-
 
2552
======================================================================
-
 
2553
============== Function 52, subfunction 13 - get DNS IP. =============
-
 
2554
======================================================================
-
 
2555
Parameters:
-
 
2556
  * eax = 52 - function number
-
 
2557
  * ebx = 13 - subfunction number
-
 
2558
Returned value:
-
 
2559
  * eax = DNS IP (4 bytes)
-
 
2560
 
-
 
2561
======================================================================
-
 
2562
============== Function 52, subfunction 14 - set DNS IP. =============
-
 
2563
======================================================================
-
 
2564
Parameters:
-
 
2565
  * eax = 52 - function number
-
 
2566
  * ebx = 14 - subfunction number
-
 
2567
  * ecx = DNS IP (4 bytes)
-
 
2568
Returned value:
-
 
2569
  * the current implementation returns eax=14, but this can be changed
-
 
2570
    in future versions
-
 
2571
 
-
 
2572
======================================================================
-
 
2573
======== Function 52, subfunction 15 - get local MAC address. ========
-
 
2574
======================================================================
-
 
2575
Parameters:
-
 
2576
  * eax = 52 - function number
-
 
2577
  * ebx = 15 - subfunction number
-
 
2578
  * ecx = 0 - read first 4 bytes,
-
 
2579
    ecx = 4 - read last 2 bytes
-
 
2580
Returned value:
-
 
2581
  * for ecx=0: eax = first 4 bytes of MAC address
-
 
2582
  * for ecx=4: ax = last 2 bytes of MAC address,
-
 
2583
               high half of eax is destroyed
-
 
2584
  * for other ecx: eax = -1 indicates an error
-
 
2585
 
-
 
2586
======================================================================
-
 
2587
=========================== Function 53 ==============================
-
 
2588
======================================================================
-
 
2589
 
-
 
2590
WARNING: This function is obsolete and is only present in the
-
 
2591
	 documentation as a guide to understand/port the older network
-
 
2592
         applications. For new programs, use function 75.
-
 
2593
 
-
 
2594
======================================================================
-
 
2595
============ Function 53, subfunction 0 - open UDP-socket. ===========
-
 
2596
======================================================================
-
 
2597
Parameters:
-
 
2598
  * eax = 53 - function number
-
 
2599
  * ebx = 0 - subfunction number
-
 
2600
  * ecx = local port (only low word is taken into account),
-
 
2601
    ecx = 0 - let the system choose a port
-
 
2602
  * edx = remote port (only low word is taken into account)
-
 
2603
  * esi = remote IP
-
 
2604
Returned value:
-
 
2605
  * eax = -1 = 0xFFFFFFFF - error; ebx destroyed
-
 
2606
  * eax = socket handle (some number which unambiguously identifies
-
 
2607
    socket and have sense only for the system) - success;
-
 
2608
    ebx destroyed
-
 
2609
 
-
 
2610
======================================================================
-
 
2611
=========== Function 53, subfunction 1 - close UDP-socket. ===========
-
 
2612
======================================================================
-
 
2613
Parameters:
-
 
2614
  * eax = 53 - function number
-
 
2615
  * ebx = 1 - subfunction number
-
 
2616
  * ecx = socket handle
-
 
2617
Returned value:
-
 
2618
  * eax = -1 - incorrect handle
-
 
2619
  * eax = 0 - success
-
 
2620
  * ebx destroyed
-
 
2621
Remarks:
-
 
2622
  * The current implementation does not close automatically all
-
 
2623
    sockets of a thread at termination. In particular, one should not
-
 
2624
    kill a thread with many opened sockets - there will be an outflow
-
 
2625
    of resources.
-
 
2626
 
-
 
2627
======================================================================
-
 
2628
============== Function 53, subfunction 2 - poll socket. =============
-
 
2629
======================================================================
-
 
2630
Parameters:
-
 
2631
  * eax = 53 - function number
-
 
2632
  * ebx = 2 - subfunction number
-
 
2633
  * ecx = socket handle
-
 
2634
Returned value:
-
 
2635
  * eax = number of read bytes, 0 for incorrect handle
-
 
2636
  * ebx destroyed
-
 
2637
 
-
 
2638
======================================================================
-
 
2639
========= Function 53, subfunction 3 - read byte from socket. ========
-
 
2640
======================================================================
-
 
2641
Parameters:
-
 
2642
  * eax = 53 - function number
-
 
2643
  * ebx = 3 - subfunction number
-
 
2644
  * ecx = socket handle
-
 
2645
Returned value:
-
 
2646
  * if there is no read data or handle is incorrect: eax=0, bl=0,
-
 
2647
    other bytes of ebx are destroyed
-
 
2648
  * if there are read data: eax=number of rest bytes
-
 
2649
    (possibly 0), bl=read byte, other bytes of ebx are destroyed
-
 
2650
 
-
 
2651
======================================================================
-
 
2652
========== Function 53, subfunction 4 - write to UDP-socket. =========
-
 
2653
======================================================================
-
 
2654
Parameters:
-
 
2655
  * eax = 53 - function number
-
 
2656
  * ebx = 4 - subfunction number
-
 
2657
  * ecx = socket handle
-
 
2658
  * edx = number of bytes to write
-
 
2659
  * esi = pointer to data to write
-
 
2660
Returned value:
-
 
2661
  * eax = 0xffffffff - error (invalid handle or not enough memory)
-
 
2662
  * eax = 0 - success
-
 
2663
  * ebx destroyed
-
 
2664
Remarks:
-
 
2665
  * Number of bytes to write must not exceed 1500-28, though
-
 
2666
    the appropriate check is not made.
-
 
2667
 
-
 
2668
======================================================================
-
 
2669
============ Function 53, subfunction 5 - open TCP-socket. ===========
-
 
2670
======================================================================
-
 
2671
Parameters:
-
 
2672
  * eax = 53 - function number
-
 
2673
  * ebx = 5 - subfunction number
-
 
2674
  * ecx = local port (only low word is taken into account),
-
 
2675
    ecx = 0 - let the system choose a port
-
 
2676
  * edx = remote port (only low word is taken into account)
-
 
2677
  * esi = remote IP
-
 
2678
  * edi = open mode: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1
-
 
2679
Returned value:
-
 
2680
  * eax = -1 = 0xFFFFFFFF - error; ebx destroys
-
 
2681
  * eax = socket handle (some number which unambiguously identifies
-
 
2682
    socket and have sense only for the system) - success;
-
 
2683
    ebx destroyed
-
 
2684
 
-
 
2685
======================================================================
-
 
2686
========= Function 53, subfunction 6 - get TCP-socket status. ========
-
 
2687
======================================================================
-
 
2688
Parameters:
-
 
2689
  * eax = 53 - function number
-
 
2690
  * ebx = 6 - subfunction number
-
 
2691
  * ecx = socket handle
-
 
2692
Returned value:
-
 
2693
  * eax = 0 for incorrect handle or socket status: one of
-
 
2694
  * TCB_LISTEN = 1
-
 
2695
  * TCB_SYN_SENT = 2
-
 
2696
  * TCB_SYN_RECEIVED = 3
-
 
2697
  * TCB_ESTABLISHED = 4
-
 
2698
  * TCB_FIN_WAIT_1 = 5
-
 
2699
  * TCB_FIN_WAIT_2 = 6
-
 
2700
  * TCB_CLOSE_WAIT = 7
-
 
2701
  * TCB_CLOSING = 8
-
 
2702
  * TCB_LAST_ASK = 9
-
 
2703
  * TCB_TIME_WAIT = 10
-
 
2704
  * TCB_CLOSED = 11
-
 
2705
  * ebx destroyed
-
 
2706
 
-
 
2707
======================================================================
-
 
2708
========== Function 53, subfunction 7 - write to TCP-socket. =========
-
 
2709
======================================================================
-
 
2710
Parameters:
-
 
2711
  * eax = 53 - function number
-
 
2712
  * ebx = 7 - subfunction number
-
 
2713
  * ecx = socket handle
-
 
2714
  * edx = number of bytes to write
-
 
2715
  * esi = pointer to data to write
-
 
2716
Returned value:
-
 
2717
  * eax = 0xffffffff - error (invalid handle or not enough memory)
-
 
2718
  * eax = 0 - success
-
 
2719
  * ebx destroyed
-
 
2720
Remarks:
-
 
2721
  * Number of bytes to write must not exceed 1500-40, though
-
 
2722
    the appropriate check is not made.
-
 
2723
 
-
 
2724
======================================================================
-
 
2725
=========== Function 53, subfunction 8 - close TCP-socket. ===========
-
 
2726
======================================================================
-
 
2727
Parameters:
-
 
2728
  * eax = 53 - function number
-
 
2729
  * ebx = 8 - subfunction number
-
 
2730
  * ecx = socket handle
-
 
2731
Returned value:
-
 
2732
  * eax = -1 - error (invalid handle or
-
 
2733
    not enough memory for socket close packet)
-
 
2734
  * eax = 0 - success
-
 
2735
  * ebx destroyed
-
 
2736
Remarks:
-
 
2737
  * The current implementation does not close automatically all
-
 
2738
    sockets of a thread at termination. In particular, one should not
-
 
2739
    kill a thread with many opened sockets - there will be an outflow
-
 
2740
    of resources.
-
 
2741
 
-
 
2742
======================================================================
-
 
2743
=== Function 53, subfunction 9 - check whether local port is free. ===
-
 
2744
======================================================================
-
 
2745
Parameters:
-
 
2746
  * eax = 53 - function number
-
 
2747
  * ebx = 9 - subfunction number
-
 
2748
  * ecx = local port number (low 16 bits are used only)
-
 
2749
Returned value:
-
 
2750
  * eax = 0 - port is used
-
 
2751
  * eax = 1 - port is free
-
 
2752
  * ebx destroyed
-
 
2753
 
-
 
2754
======================================================================
-
 
2755
===== Function 53, subfunction 10 - query Ethernet cable status. =====
-
 
2756
======================================================================
-
 
2757
Parameters:
-
 
2758
  * eax = 53 - function number
-
 
2759
  * ebx = 10 - subfunction number
-
 
2760
Returned value:
-
 
2761
  * al = -1 - a network driver is not loaded or
-
 
2762
              does not support this function
-
 
2763
  * al = 0 - Ethernet cable is unplugged
-
 
2764
  * al = 1 - Ethernet cable is plugged
-
 
2765
  * ebx destroyed
-
 
2766
Remarks:
-
 
2767
  * The current kernel implementation supports this function
-
 
2768
    only for RTL8139 network cards.
-
 
2769
 
-
 
2770
======================================================================
-
 
2771
======= Function 53, subfunction 11 - read network stack data. =======
-
 
2772
======================================================================
-
 
2773
Paramters:
-
 
2774
  * eax = 53 - function number
-
 
2775
  * ebx = 11 - subfunction number
-
 
2776
  * ecx = socket handle
-
 
2777
  * edx = pointer to buffer
-
 
2778
  * esi = number of bytes to read;
-
 
2779
  * esi = 0 - read all data (maximum 4096 bytes)
-
 
2780
Returned value:
-
 
2781
  * eax = number of bytes read (0 for incorrect handle)
-
 
2782
  * ebx destroyed
-
 
2783
 
-
 
2784
======================================================================
-
 
2785
= Function 53, subfunction 255 - debug information of network driver.
-
 
2786
======================================================================
-
 
2787
Parameters:
-
 
2788
  * eax = 53 - function number
-
 
2789
  * ebx = 255 - subfunction number
-
 
2790
  * ecx = type of requested information (see below)
-
 
2791
Returned value:
-
 
2792
  * eax = requested information
-
 
2793
  * ebx destroyed
-
 
2794
Possible values for ecx:
-
 
2795
  * 100: length of queue 0 (empty queue)
-
 
2796
  * 101: length of queue 1 (ip-out queue)
-
 
2797
  * 102: length of queue 2 (ip-in queue)
-
 
2798
  * 103: length of queue 3 (net1out queue)
-
 
2799
  * 200: number of items in the ARP table
-
 
2800
  * 201: size of the ARP table (in items) (20 for current version)
-
 
2801
  * 202: read item at edx of the ARP table to the temporary buffer,
-
 
2802
    whence 5 following types take information;
-
 
2803
    in this case eax is not defined
-
 
2804
  * 203: IP-address saved by type 202
-
 
2805
  * 204: high dword of MAC-address saved by type 202
-
 
2806
  * 205: low word of MAC-address saved by type 202
-
 
2807
  * 206: status word saved by type 202
-
 
2808
  * 207: ttl word saved by type 202
-
 
2809
  * 2: total number of received IP-packets
-
 
2810
  * 3: total number of transferred IP-packets
-
 
2811
  * 4: total number of dumped received packets
-
 
2812
  * 5: total number of received ARP-packets
-
 
2813
  * 6: status of packet driver, 0=inactive, nonzero=active
-
 
2814
 
-
 
2815
======================================================================
2413
======================================================================
2816
 Function 55, subfunction 55 - begin to play data on built-in speaker.
2414
 Function 55, subfunction 55 - begin to play data on built-in speaker.
2817
======================================================================
2415
======================================================================
2818
Parameters:
2416
Parameters:
2819
  * eax = 55 - function number
2417
  * eax = 55 - function number