/*
    Copyright 2004, Broadcom Corporation      
    All Rights Reserved.      
          
    THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY      
    KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM      
    SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS      
    FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.      

    This file was automatically generated by xml2c.pl
*/

#include "upnp_dbg.h"
#include "upnp_osl.h"
#include "upnp.h"
#include "lanhostconfig.h"

/* 

    Below you will find definitions for a number of Action structures.
    The second argument to those structures is a pointer to a function
    that implements that action.  Your job is to define all of the
    actions so that none of them is left unimplemented.

    As a convenience, all generated actions have been predefined to
    invoke the action 'NotImplemented', an action that will print an
    error message whenever it is invoked.  As you define functions for
    each action, be sure to remove that function name from the list of
    'NotImplemented' defines in the list below.
    
    The following are pre-defined action functions that you can use:

    NotImplemented - prints an error message on the console 
                     and returns 0 parameters to the caller.

    DefaultAction  - Returns all 'out' parameters with values
                     taken from the corresponding 'relatedStateVariable'.
                     This function actually covers the behavior of 
                     a surprisingly large number of UPnP actions.

*/

#define SetDomainName LANHostConfig_SetDomainName
#define GetDomainName DefaultAction

#define GetDHCPServerConfigurable DefaultAction
#define GetDHCPRelay DefaultAction
#define GetSubnetMask DefaultAction
#define GetAddressRange DefaultAction

#define GetReservedAddresses DefaultAction
#define GetDNSServers DefaultAction

#define SetDHCPServerConfigurable NotImplemented
#define SetDHCPRelay NotImplemented
#define SetSubnetMask NotImplemented
#define SetIPRouter NotImplemented
#define DeleteIPRouter NotImplemented
#define GetIPRoutersList NotImplemented
#define SetAddressRange NotImplemented
#define SetReservedAddress NotImplemented
#define DeleteReservedAddress NotImplemented
#define SetDNSServer NotImplemented
#define DeleteDNSServer NotImplemented

/* VAR_ offsets are include from lanhostconfigmanagement.h */

static VarTemplate StateVariables[] = {
    { "DHCPServerConfigurable", "1", VAR_BOOL },
    { "DHCPRelay", "1", VAR_BOOL },
    { "SubnetMask", "", VAR_STRING },
    { "IPRouters", "", VAR_STRING },
    { "DNSServers", "", VAR_STRING },
    { "DomainName", "", VAR_STRING },
    { "MinAddress", "", VAR_STRING },		/* dynamic */
    { "MaxAddress", "", VAR_STRING },		/* dynamic */
    { "ReservedAddresses", "", VAR_STRING },
    { NULL }
};


static Action _SetDHCPServerConfigurable = {
    "SetDHCPServerConfigurable", SetDHCPServerConfigurable,
   (Param []) {
       {"NewDHCPServerConfigurable", VAR_DHCPServerConfigurable, VAR_IN},
       { 0 }
    }
};

static Action _GetDHCPServerConfigurable = {
    "GetDHCPServerConfigurable", GetDHCPServerConfigurable,
   (Param []) {
       {"NewDHCPServerConfigurable", VAR_DHCPServerConfigurable, VAR_OUT},
       { 0 }
    }
};

static Action _SetDHCPRelay = {
    "SetDHCPRelay", SetDHCPRelay,
   (Param []) {
       {"NewDHCPRelay", VAR_DHCPRelay, VAR_IN},
       { 0 }
    }
};

static Action _GetDHCPRelay = {
    "GetDHCPRelay", GetDHCPRelay,
   (Param []) {
       {"NewDHCPRelay", VAR_DHCPRelay, VAR_OUT},
       { 0 }
    }
};

static Action _SetSubnetMask = {
    "SetSubnetMask", SetSubnetMask,
   (Param []) {
       {"NewSubnetMask", VAR_SubnetMask, VAR_IN},
       { 0 }
    }
};

static Action _GetSubnetMask = {
    "GetSubnetMask", GetSubnetMask,
   (Param []) {
       {"NewSubnetMask", VAR_SubnetMask, VAR_OUT},
       { 0 }
    }
};

static Action _SetIPRouter = {
    "SetIPRouter", SetIPRouter,
   (Param []) {
       {"NewIPRouters", VAR_IPRouters, VAR_IN},
       { 0 }
    }
};

static Action _DeleteIPRouter = {
    "DeleteIPRouter", DeleteIPRouter,
   (Param []) {
       {"NewIPRouters", VAR_IPRouters, VAR_IN},
       { 0 }
    }
};

static Action _GetIPRoutersList = {
    "GetIPRoutersList", GetIPRoutersList,
   (Param []) {
       {"NewIPRouters", VAR_IPRouters, VAR_OUT},
       { 0 }
    }
};

static Action _SetDomainName = {
    "SetDomainName", SetDomainName,
   (Param []) {
       {"NewDomainName", VAR_DomainName, VAR_IN},
       { 0 }
    }
};

static Action _GetDomainName = {
    "GetDomainName", GetDomainName,
   (Param []) {
       {"NewDomainName", VAR_DomainName, VAR_OUT},
       { 0 }
    }
};

static Action _SetAddressRange = {
    "SetAddressRange", SetAddressRange,
   (Param []) {
       {"NewMinAddress", VAR_MinAddress, VAR_IN},
       {"NewMaxAddress", VAR_MaxAddress, VAR_IN},
       { 0 }
    }
};

static Action _GetAddressRange = {
    "GetAddressRange", GetAddressRange,
   (Param []) {
       {"NewMinAddress", VAR_MinAddress, VAR_OUT},
       {"NewMaxAddress", VAR_MaxAddress, VAR_OUT},
       { 0 }
    }
};

static Action _SetReservedAddress = {
    "SetReservedAddress", SetReservedAddress,
   (Param []) {
       {"NewReservedAddresses", VAR_ReservedAddresses, VAR_IN},
       { 0 }
    }
};

static Action _DeleteReservedAddress = {
    "DeleteReservedAddress", DeleteReservedAddress,
   (Param []) {
       {"NewReservedAddresses", VAR_ReservedAddresses, VAR_IN},
       { 0 }
    }
};

static Action _GetReservedAddresses = {
    "GetReservedAddresses", GetReservedAddresses,
   (Param []) {
       {"NewReservedAddresses", VAR_ReservedAddresses, VAR_OUT},
       { 0 }
    }
};

static Action _SetDNSServer = {
    "SetDNSServer", SetDNSServer,
   (Param []) {
       {"NewDNSServers", VAR_DNSServers, VAR_IN},
       { 0 }
    }
};

static Action _DeleteDNSServer = {
    "DeleteDNSServer", DeleteDNSServer,
   (Param []) {
       {"NewDNSServers", VAR_DNSServers, VAR_IN},
       { 0 }
    }
};

static Action _GetDNSServers = {
    "GetDNSServers", GetDNSServers,
   (Param []) {
       {"NewDNSServers", VAR_DNSServers, VAR_OUT},
       { 0 }
    }
};



static PAction Actions[] = {
    &_SetDHCPServerConfigurable,
    &_GetDHCPServerConfigurable,
    &_SetDHCPRelay,
    &_GetDHCPRelay,
    &_SetSubnetMask,
    &_GetSubnetMask,
    &_SetIPRouter,
    &_DeleteIPRouter,
    &_GetIPRoutersList,
    &_SetDomainName,
    &_GetDomainName,
    &_SetAddressRange,
    &_GetAddressRange,
    &_SetReservedAddress,
    &_DeleteReservedAddress,
    &_GetReservedAddresses,
    &_SetDNSServer,
    &_DeleteDNSServer,
    &_GetDNSServers,
    NULL
};

ServiceTemplate Template_LANHostConfigManagement = {
    "LANHostConfigManagement:1",	/* name of service */
    NULL,		/* PFSVCINIT service initialization function */
    LANHostConfig_GetVar,		/* PFGETVAR get service state variable function */
    NULL,		/* SVCXML service XML generation function (not used) */
    ARRAYSIZE(StateVariables)-1, /* number of state variables */
    StateVariables,     /* pointer to list of state variables */
    Actions,             /* pointer to list of actions */
    0,
    "urn:upnp-org:serviceId:LANHostCfg"
};
