-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathset_app_vpnwith_pfs.go
35 lines (32 loc) · 1.29 KB
/
set_app_vpnwith_pfs.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
35
package gateway
import (
"encoding/xml"
"github.com/nitram509/gofritz/pkg/soap"
"github.com/nitram509/gofritz/pkg/tr064model"
)
// SetAppVPNwithPFS AUTO-GENERATED (do not edit) code from [x_appsetupSCPD],
// based on SOAP action 'SetAppVPNwithPFS', Fritz!Box-System-Version 164.08.00
//
// [x_appsetupSCPD]: http://fritz.box:49000/x_appsetupSCPD.xml
func SetAppVPNwithPFS(session *soap.SoapSession, appId string, ipSecIdentifier string, ipSecPreSharedKey string, ipSecXauthUsername string, ipSecXauthPassword string) (tr064model.SetAppVPNwithPFSResponse, error) {
fbAction, err := soap.NewSoapRequest(session).
ReqPath("/upnp/control/x_appsetup").
Uri("urn:dslforum-org:service:X_AVM-DE_AppSetup:1").
Action("SetAppVPNwithPFS").
AddStringParam("NewAppId", appId).
AddStringParam("NewIPSecIdentifier", ipSecIdentifier).
AddStringParam("NewIPSecPreSharedKey", ipSecPreSharedKey).
AddStringParam("NewIPSecXauthUsername", ipSecXauthUsername).
AddStringParam("NewIPSecXauthPassword", ipSecXauthPassword).
Do()
if err != nil {
return tr064model.SetAppVPNwithPFSResponse{}, err
}
bodyData := fbAction.Body.Data
result := tr064model.SetAppVPNwithPFSResponse{}
err = xml.Unmarshal(bodyData, &result)
if err != nil {
return tr064model.SetAppVPNwithPFSResponse{}, err
}
return result, nil
}