-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdelete_forwarding_entry.go
34 lines (31 loc) · 1.27 KB
/
delete_forwarding_entry.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
31
32
33
34
package gateway
import (
"encoding/xml"
"github.com/nitram509/gofritz/pkg/soap"
"github.com/nitram509/gofritz/pkg/tr064model"
)
// DeleteForwardingEntry AUTO-GENERATED (do not edit) code from [layer3forwardingSCPD],
// based on SOAP action 'DeleteForwardingEntry', Fritz!Box-System-Version 164.08.00
//
// [layer3forwardingSCPD]: http://fritz.box:49000/layer3forwardingSCPD.xml
func DeleteForwardingEntry(session *soap.SoapSession, destIpAddress string, destSubnetMask string, sourceIpAddress string, sourceSubnetMask string) (tr064model.DeleteForwardingEntryResponse, error) {
fbAction, err := soap.NewSoapRequest(session).
ReqPath("/upnp/control/layer3forwarding").
Uri("urn:dslforum-org:service:Layer3Forwarding:1").
Action("DeleteForwardingEntry").
AddStringParam("NewDestIPAddress", destIpAddress).
AddStringParam("NewDestSubnetMask", destSubnetMask).
AddStringParam("NewSourceIPAddress", sourceIpAddress).
AddStringParam("NewSourceSubnetMask", sourceSubnetMask).
Do()
if err != nil {
return tr064model.DeleteForwardingEntryResponse{}, err
}
bodyData := fbAction.Body.Data
result := tr064model.DeleteForwardingEntryResponse{}
err = xml.Unmarshal(bodyData, &result)
if err != nil {
return tr064model.DeleteForwardingEntryResponse{}, err
}
return result, nil
}