1/* 2 Copyright 2004, Broadcom Corporation 3 All Rights Reserved. 4 5 THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY 6 KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM 7 SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS 8 FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE. 9 10 This file was automatically generated by xml2c.pl 11*/ 12 13#include "upnp_dbg.h" 14#include "upnp_osl.h" 15#include "upnp.h" 16#include "lanhostconfig.h" 17 18/* 19 20 Below you will find definitions for a number of Action structures. 21 The second argument to those structures is a pointer to a function 22 that implements that action. Your job is to define all of the 23 actions so that none of them is left unimplemented. 24 25 As a convenience, all generated actions have been predefined to 26 invoke the action 'NotImplemented', an action that will print an 27 error message whenever it is invoked. As you define functions for 28 each action, be sure to remove that function name from the list of 29 'NotImplemented' defines in the list below. 30 31 The following are pre-defined action functions that you can use: 32 33 NotImplemented - prints an error message on the console 34 and returns 0 parameters to the caller. 35 36 DefaultAction - Returns all 'out' parameters with values 37 taken from the corresponding 'relatedStateVariable'. 38 This function actually covers the behavior of 39 a surprisingly large number of UPnP actions. 40 41*/ 42 43#define SetDomainName LANHostConfig_SetDomainName 44#define GetDomainName DefaultAction 45 46#define GetDHCPServerConfigurable DefaultAction 47#define GetDHCPRelay DefaultAction 48#define GetSubnetMask DefaultAction 49#define GetAddressRange DefaultAction 50 51#define GetReservedAddresses DefaultAction 52#define GetDNSServers DefaultAction 53 54#define SetDHCPServerConfigurable NotImplemented 55#define SetDHCPRelay NotImplemented 56#define SetSubnetMask NotImplemented 57#define SetIPRouter NotImplemented 58#define DeleteIPRouter NotImplemented 59#define GetIPRoutersList NotImplemented 60#define SetAddressRange NotImplemented 61#define SetReservedAddress NotImplemented 62#define DeleteReservedAddress NotImplemented 63#define SetDNSServer NotImplemented 64#define DeleteDNSServer NotImplemented 65 66/* VAR_ offsets are include from lanhostconfigmanagement.h */ 67 68static VarTemplate StateVariables[] = { 69 { "DHCPServerConfigurable", "1", VAR_BOOL }, 70 { "DHCPRelay", "1", VAR_BOOL }, 71 { "SubnetMask", "", VAR_STRING }, 72 { "IPRouters", "", VAR_STRING }, 73 { "DNSServers", "", VAR_STRING }, 74 { "DomainName", "", VAR_STRING }, 75 { "MinAddress", "", VAR_STRING }, /* dynamic */ 76 { "MaxAddress", "", VAR_STRING }, /* dynamic */ 77 { "ReservedAddresses", "", VAR_STRING }, 78 { NULL } 79}; 80 81 82static Action _SetDHCPServerConfigurable = { 83 "SetDHCPServerConfigurable", SetDHCPServerConfigurable, 84 (Param []) { 85 {"NewDHCPServerConfigurable", VAR_DHCPServerConfigurable, VAR_IN}, 86 { 0 } 87 } 88}; 89 90static Action _GetDHCPServerConfigurable = { 91 "GetDHCPServerConfigurable", GetDHCPServerConfigurable, 92 (Param []) { 93 {"NewDHCPServerConfigurable", VAR_DHCPServerConfigurable, VAR_OUT}, 94 { 0 } 95 } 96}; 97 98static Action _SetDHCPRelay = { 99 "SetDHCPRelay", SetDHCPRelay, 100 (Param []) { 101 {"NewDHCPRelay", VAR_DHCPRelay, VAR_IN}, 102 { 0 } 103 } 104}; 105 106static Action _GetDHCPRelay = { 107 "GetDHCPRelay", GetDHCPRelay, 108 (Param []) { 109 {"NewDHCPRelay", VAR_DHCPRelay, VAR_OUT}, 110 { 0 } 111 } 112}; 113 114static Action _SetSubnetMask = { 115 "SetSubnetMask", SetSubnetMask, 116 (Param []) { 117 {"NewSubnetMask", VAR_SubnetMask, VAR_IN}, 118 { 0 } 119 } 120}; 121 122static Action _GetSubnetMask = { 123 "GetSubnetMask", GetSubnetMask, 124 (Param []) { 125 {"NewSubnetMask", VAR_SubnetMask, VAR_OUT}, 126 { 0 } 127 } 128}; 129 130static Action _SetIPRouter = { 131 "SetIPRouter", SetIPRouter, 132 (Param []) { 133 {"NewIPRouters", VAR_IPRouters, VAR_IN}, 134 { 0 } 135 } 136}; 137 138static Action _DeleteIPRouter = { 139 "DeleteIPRouter", DeleteIPRouter, 140 (Param []) { 141 {"NewIPRouters", VAR_IPRouters, VAR_IN}, 142 { 0 } 143 } 144}; 145 146static Action _GetIPRoutersList = { 147 "GetIPRoutersList", GetIPRoutersList, 148 (Param []) { 149 {"NewIPRouters", VAR_IPRouters, VAR_OUT}, 150 { 0 } 151 } 152}; 153 154static Action _SetDomainName = { 155 "SetDomainName", SetDomainName, 156 (Param []) { 157 {"NewDomainName", VAR_DomainName, VAR_IN}, 158 { 0 } 159 } 160}; 161 162static Action _GetDomainName = { 163 "GetDomainName", GetDomainName, 164 (Param []) { 165 {"NewDomainName", VAR_DomainName, VAR_OUT}, 166 { 0 } 167 } 168}; 169 170static Action _SetAddressRange = { 171 "SetAddressRange", SetAddressRange, 172 (Param []) { 173 {"NewMinAddress", VAR_MinAddress, VAR_IN}, 174 {"NewMaxAddress", VAR_MaxAddress, VAR_IN}, 175 { 0 } 176 } 177}; 178 179static Action _GetAddressRange = { 180 "GetAddressRange", GetAddressRange, 181 (Param []) { 182 {"NewMinAddress", VAR_MinAddress, VAR_OUT}, 183 {"NewMaxAddress", VAR_MaxAddress, VAR_OUT}, 184 { 0 } 185 } 186}; 187 188static Action _SetReservedAddress = { 189 "SetReservedAddress", SetReservedAddress, 190 (Param []) { 191 {"NewReservedAddresses", VAR_ReservedAddresses, VAR_IN}, 192 { 0 } 193 } 194}; 195 196static Action _DeleteReservedAddress = { 197 "DeleteReservedAddress", DeleteReservedAddress, 198 (Param []) { 199 {"NewReservedAddresses", VAR_ReservedAddresses, VAR_IN}, 200 { 0 } 201 } 202}; 203 204static Action _GetReservedAddresses = { 205 "GetReservedAddresses", GetReservedAddresses, 206 (Param []) { 207 {"NewReservedAddresses", VAR_ReservedAddresses, VAR_OUT}, 208 { 0 } 209 } 210}; 211 212static Action _SetDNSServer = { 213 "SetDNSServer", SetDNSServer, 214 (Param []) { 215 {"NewDNSServers", VAR_DNSServers, VAR_IN}, 216 { 0 } 217 } 218}; 219 220static Action _DeleteDNSServer = { 221 "DeleteDNSServer", DeleteDNSServer, 222 (Param []) { 223 {"NewDNSServers", VAR_DNSServers, VAR_IN}, 224 { 0 } 225 } 226}; 227 228static Action _GetDNSServers = { 229 "GetDNSServers", GetDNSServers, 230 (Param []) { 231 {"NewDNSServers", VAR_DNSServers, VAR_OUT}, 232 { 0 } 233 } 234}; 235 236 237 238static PAction Actions[] = { 239 &_SetDHCPServerConfigurable, 240 &_GetDHCPServerConfigurable, 241 &_SetDHCPRelay, 242 &_GetDHCPRelay, 243 &_SetSubnetMask, 244 &_GetSubnetMask, 245 &_SetIPRouter, 246 &_DeleteIPRouter, 247 &_GetIPRoutersList, 248 &_SetDomainName, 249 &_GetDomainName, 250 &_SetAddressRange, 251 &_GetAddressRange, 252 &_SetReservedAddress, 253 &_DeleteReservedAddress, 254 &_GetReservedAddresses, 255 &_SetDNSServer, 256 &_DeleteDNSServer, 257 &_GetDNSServers, 258 NULL 259}; 260 261ServiceTemplate Template_LANHostConfigManagement = { 262 "LANHostConfigManagement:1", /* name of service */ 263 NULL, /* PFSVCINIT service initialization function */ 264 LANHostConfig_GetVar, /* PFGETVAR get service state variable function */ 265 NULL, /* SVCXML service XML generation function (not used) */ 266 ARRAYSIZE(StateVariables)-1, /* number of state variables */ 267 StateVariables, /* pointer to list of state variables */ 268 Actions, /* pointer to list of actions */ 269 0, 270 "urn:upnp-org:serviceId:LANHostCfg" 271}; 272