; Assembler header file for DHCPClient
; Written by DefMod (Dec  9 2012) on Sun Dec  9 15:43:43 2012
; John Tytgat, John.Tytgat@aaug.net, 27 Aug 2009

; OSLib---efficient, type-safe, transparent, extensible,
; register-safe API coverage of RISC OS
; 
; Copyright (c) 1994-2012 Jonathan Coxhead and OSLib maintainers
; 
; Licence:
; 
;    OSLib is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 1, or (at your option)
; any later version - and this with the following clarification and
; special exception:
; 
;    Linking this library statically or dynamically with other modules
; is making a combined work based on this library. Thus, the terms
; and conditions of the GNU General Public License cover the whole
; combination.
; 
;    As a special exception, the copyright holders of this library
; give you permission to link this library with independent modules
; to produce an executable, regardless of the license terms of these
; independent modules, and to copy and distribute the resulting
; executable under terms of your choice, provided that you also meet,
; for each linked independent module, the terms and conditions of the
; license of that module. An independent module is a module which is
; not derived from or based on this library. If you modify this
; library, you may extend this exception to your version of the library,
; but you are not obliged to do so. If you do not wish to do so, delete
; this exception statement from your version.
; 
;    OSLib is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
; 
;    You should have received a copy of the GNU General Public License
; along with this programme; if not, write to the Free Software
; Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, USA.

        [       :LNOT: :DEF: DHCPClient_Hdr
        GBLS    DHCPClient_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET oslib/OS.Hdr"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

;Symbols for constants
DHCPClientControlReason_Add     *       &0
DHCPClientControlReason_Remove  *       &1
DHCPClientControlReason_Renew   *       &2
DHCPClientStateType_EndOfList   *       &FFFFFFFF
DHCPClientStateType_State       *       &0
DHCPClientStateType_BoundAddress *       &1
DHCPClientStateType_ServerAddress *       &2
DHCPClientStateType_GatewayAddress *       &3
DHCPClientStateType_LeasePeriod *       &4
DHCPClientStateType_T1Period    *       &5
DHCPClientStateType_T2Period    *       &6
DHCPClientStateType_DHCPStart   *       &7
DHCPClientStateType_LeaseStart  *       &8
DHCPClientStateType_LeaseEnd    *       &9
DHCPClientStateType_T1End       *       &A
DHCPClientStateType_T2End       *       &B
DHCPClientStateState_Sleeping   *       &0
DHCPClientStateState_InitReboot *       &0
DHCPClientStateState_Init       *       &0
DHCPClientStateState_Rebooting  *       &0
DHCPClientStateState_Selecting  *       &0
DHCPClientStateState_Requesting *       &0
DHCPClientStateState_Bound      *       &0
DHCPClientStateState_Renewing   *       &0
DHCPClientStateState_Rebinding  *       &8

;Symbols for structure offsets and sizes
        ^       0
        #       Int
DHCPClientControl_Reason        *       @

        ^       0
        #       Int
DHCPClientState_Types           *       @

        ^       0
        #       Int
DHCPClientState_State           *       @


;Symbols for SWI's and SWI reason codes
XDHCPClient_Control             *       &75E00
DHCPClient_Control              *       &55E00
   ;Entry
   ;  R0 = reason (DHCPClientControl_Reason)
   ;  R1 -> interface_name (Char)

XDHCPClient_State               *       &75E01
DHCPClient_State                *       &55E01
   ;Entry
   ;  R0 -> interface_name (Char)
   ;  R1 -> type_list (DHCPClientState_Types)
   ;  R2 -> buf (data)
   ;  R3 = buf_size (Int)
   ;Exit
   ;  R1 -> last_type (DHCPClientState_Types)
   ;  R2 -> buf_end (data)
   ;  R3 = space_left (Int)

XDHCPClient_Enumerate           *       &75E02
DHCPClient_Enumerate            *       &55E02
   ;Entry
   ;  R0 -> interface_name (Char)
   ;  R1 = buf (pointer to Char)
   ;  R2 = buf_size (Int)
   ;Exit
   ;  R0 = num_state_transitions (Int)
   ;  R1 = buf_end (pointer to Char)
   ;  R2 = space_left (Int)

Service_InternetStatus4         *       &4
   ;Entry
   ;  R0 = &4
   ;  R1 = &B0
   ;  R2 -> interface_name (Char)
   ;  R3 -> dib (data)
   ;  R4 -> dhcp_reply (data)
   ;  R5 = dhcp_reply_size (Int)
   ;Exit
   ;  R1 = unclaimed (Bool)

Service_InternetStatus5         *       &5
   ;Entry
   ;  R0 = &5
   ;  R1 = &B0
   ;  R2 -> interface_name (Char)
   ;  R3 -> dib (data)
   ;  R4 -> dhcpoffer_buf (data)
   ;  R5 = dhcpoffer_buf_size (Int)
   ;Exit
   ;  R1 = unclaimed (Bool)

Service_InternetStatus30        *       &30
   ;Entry
   ;  R0 = &30
   ;  R1 = &B0
   ;  R2 -> interface_name (Char)
   ;  R3 = ip_address (Int)

Service_InternetService31       *       &31
   ;Entry
   ;  R0 = &31
   ;  R1 = &B0
   ;  R2 -> interface_name (Char)
   ;  R3 = ip_address (Int)

        ]
        END
