-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathget_subnet_mask.go
30 lines (27 loc) · 920 Bytes
/
get_subnet_mask.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package lan
import (
"encoding/xml"
"github.com/nitram509/gofritz/pkg/soap"
"github.com/nitram509/gofritz/pkg/tr064model"
)
// GetSubnetMask AUTO-GENERATED (do not edit) code from [lanhostconfigmgmSCPD],
// based on SOAP action 'GetSubnetMask', Fritz!Box-System-Version 164.08.00
//
// [lanhostconfigmgmSCPD]: http://fritz.box:49000/lanhostconfigmgmSCPD.xml
func GetSubnetMask(session *soap.SoapSession) (tr064model.GetSubnetMaskResponse, error) {
fbAction, err := soap.NewSoapRequest(session).
ReqPath("/upnp/control/lanhostconfigmgm").
Uri("urn:dslforum-org:service:LANHostConfigManagement:1").
Action("GetSubnetMask").
Do()
if err != nil {
return tr064model.GetSubnetMaskResponse{}, err
}
bodyData := fbAction.Body.Data
result := tr064model.GetSubnetMaskResponse{}
err = xml.Unmarshal(bodyData, &result)
if err != nil {
return tr064model.GetSubnetMaskResponse{}, err
}
return result, nil
}