2014-06-07 20:24:11 +00:00
|
|
|
// Client for UPnP Device Control Protocol Internet Gateway Device v2.
|
|
|
|
//
|
2022-03-21 13:46:32 +00:00
|
|
|
// This DCP is documented in detail at:
|
|
|
|
// - http://upnp.org/specs/gw/UPnP-gw-InternetGatewayDevice-v2-Device.pdf
|
2014-06-07 20:24:11 +00:00
|
|
|
//
|
2015-06-06 10:53:50 +00:00
|
|
|
// Typically, use one of the New* functions to create clients for services.
|
2013-10-06 22:16:53 +00:00
|
|
|
package internetgateway2
|
|
|
|
|
2017-11-05 13:40:23 +00:00
|
|
|
// ***********************************************************
|
|
|
|
// GENERATED FILE - DO NOT EDIT BY HAND. See README.md
|
|
|
|
// ***********************************************************
|
2014-06-07 19:29:41 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
import (
|
2021-07-11 13:53:32 +00:00
|
|
|
"context"
|
2015-06-06 10:53:50 +00:00
|
|
|
"net/url"
|
2013-12-31 16:56:20 +00:00
|
|
|
"time"
|
|
|
|
|
2013-12-31 20:01:17 +00:00
|
|
|
"github.com/huin/goupnp"
|
2013-12-31 16:56:20 +00:00
|
|
|
"github.com/huin/goupnp/soap"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Hack to avoid Go complaining if time isn't used.
|
|
|
|
var _ time.Time
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 18:04:59 +00:00
|
|
|
// Device URNs:
|
2013-10-06 22:16:53 +00:00
|
|
|
const (
|
2013-12-31 18:04:59 +00:00
|
|
|
URN_LANDevice_1 = "urn:schemas-upnp-org:device:LANDevice:1"
|
2013-10-06 22:16:53 +00:00
|
|
|
URN_WANConnectionDevice_1 = "urn:schemas-upnp-org:device:WANConnectionDevice:1"
|
|
|
|
URN_WANConnectionDevice_2 = "urn:schemas-upnp-org:device:WANConnectionDevice:2"
|
2013-12-31 18:04:59 +00:00
|
|
|
URN_WANDevice_1 = "urn:schemas-upnp-org:device:WANDevice:1"
|
|
|
|
URN_WANDevice_2 = "urn:schemas-upnp-org:device:WANDevice:2"
|
2013-10-06 22:16:53 +00:00
|
|
|
)
|
|
|
|
|
2013-12-31 18:04:59 +00:00
|
|
|
// Service URNs:
|
2013-10-06 22:16:53 +00:00
|
|
|
const (
|
2015-06-07 08:04:24 +00:00
|
|
|
URN_DeviceProtection_1 = "urn:schemas-upnp-org:service:DeviceProtection:1"
|
2013-12-31 18:04:59 +00:00
|
|
|
URN_LANHostConfigManagement_1 = "urn:schemas-upnp-org:service:LANHostConfigManagement:1"
|
|
|
|
URN_Layer3Forwarding_1 = "urn:schemas-upnp-org:service:Layer3Forwarding:1"
|
|
|
|
URN_WANCableLinkConfig_1 = "urn:schemas-upnp-org:service:WANCableLinkConfig:1"
|
2013-10-06 22:16:53 +00:00
|
|
|
URN_WANCommonInterfaceConfig_1 = "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1"
|
2013-12-31 18:04:59 +00:00
|
|
|
URN_WANDSLLinkConfig_1 = "urn:schemas-upnp-org:service:WANDSLLinkConfig:1"
|
|
|
|
URN_WANEthernetLinkConfig_1 = "urn:schemas-upnp-org:service:WANEthernetLinkConfig:1"
|
|
|
|
URN_WANIPConnection_1 = "urn:schemas-upnp-org:service:WANIPConnection:1"
|
|
|
|
URN_WANIPConnection_2 = "urn:schemas-upnp-org:service:WANIPConnection:2"
|
2015-06-07 08:27:13 +00:00
|
|
|
URN_WANIPv6FirewallControl_1 = "urn:schemas-upnp-org:service:WANIPv6FirewallControl:1"
|
2013-12-31 18:04:59 +00:00
|
|
|
URN_WANPOTSLinkConfig_1 = "urn:schemas-upnp-org:service:WANPOTSLinkConfig:1"
|
|
|
|
URN_WANPPPConnection_1 = "urn:schemas-upnp-org:service:WANPPPConnection:1"
|
2013-10-06 22:16:53 +00:00
|
|
|
)
|
|
|
|
|
2015-06-07 08:04:24 +00:00
|
|
|
// DeviceProtection1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:DeviceProtection:1". See
|
|
|
|
// goupnp.ServiceClient, which contains RootDevice and Service attributes which
|
|
|
|
// are provided for informational value.
|
|
|
|
type DeviceProtection1 struct {
|
|
|
|
goupnp.ServiceClient
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewDeviceProtection1Clients discovers instances of the service on the network,
|
|
|
|
// and returns clients to any that are found. errors will contain an error for
|
|
|
|
// any devices that replied but which could not be queried, and err will be set
|
|
|
|
// if the discovery process failed outright.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package.
|
|
|
|
func NewDeviceProtection1Clients() (clients []*DeviceProtection1, errors []error, err error) {
|
|
|
|
var genericClients []goupnp.ServiceClient
|
|
|
|
if genericClients, errors, err = goupnp.NewServiceClients(URN_DeviceProtection_1); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
clients = newDeviceProtection1ClientsFromGenericClients(genericClients)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewDeviceProtection1ClientsByURL discovers instances of the service at the given
|
|
|
|
// URL, and returns clients to any that are found. An error is returned if
|
|
|
|
// there was an error probing the service.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered service URL.
|
|
|
|
func NewDeviceProtection1ClientsByURL(loc *url.URL) ([]*DeviceProtection1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsByURL(loc, URN_DeviceProtection_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newDeviceProtection1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewDeviceProtection1ClientsFromRootDevice discovers instances of the service in
|
|
|
|
// a given root device, and returns clients to any that are found. An error is
|
|
|
|
// returned if there was not at least one instance of the service within the
|
|
|
|
// device. The location parameter is simply assigned to the Location attribute
|
|
|
|
// of the wrapped ServiceClient(s).
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered root device.
|
|
|
|
func NewDeviceProtection1ClientsFromRootDevice(rootDevice *goupnp.RootDevice, loc *url.URL) ([]*DeviceProtection1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsFromRootDevice(rootDevice, loc, URN_DeviceProtection_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newDeviceProtection1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func newDeviceProtection1ClientsFromGenericClients(genericClients []goupnp.ServiceClient) []*DeviceProtection1 {
|
|
|
|
clients := make([]*DeviceProtection1, len(genericClients))
|
|
|
|
for i := range genericClients {
|
|
|
|
clients[i] = &DeviceProtection1{genericClients[i]}
|
|
|
|
}
|
|
|
|
return clients
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *DeviceProtection1) AddIdentityListCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
IdentityList string,
|
|
|
|
) (IdentityListResult string, err error) {
|
2015-06-07 08:04:24 +00:00
|
|
|
// Request structure.
|
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
IdentityList string
|
2015-06-07 08:04:24 +00:00
|
|
|
}{}
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.IdentityList, err = soap.MarshalString(IdentityList); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
IdentityListResult string
|
2015-06-07 08:04:24 +00:00
|
|
|
}{}
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "AddIdentityList", request, response); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if IdentityListResult, err = soap.UnmarshalString(response.IdentityListResult); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// AddIdentityList is the legacy version of AddIdentityListCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *DeviceProtection1) AddIdentityList(IdentityList string) (IdentityListResult string, err error) {
|
|
|
|
return client.AddIdentityListCtx(context.Background(),
|
|
|
|
IdentityList,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *DeviceProtection1) AddRolesForIdentityCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
Identity string,
|
|
|
|
RoleList string,
|
|
|
|
) (err error) {
|
|
|
|
// Request structure.
|
|
|
|
request := &struct {
|
|
|
|
Identity string
|
|
|
|
RoleList string
|
|
|
|
}{}
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
if request.Identity, err = soap.MarshalString(Identity); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.RoleList, err = soap.MarshalString(RoleList); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := interface{}(nil)
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "AddRolesForIdentity", request, response); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// AddRolesForIdentity is the legacy version of AddRolesForIdentityCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *DeviceProtection1) AddRolesForIdentity(Identity string, RoleList string) (err error) {
|
|
|
|
return client.AddRolesForIdentityCtx(context.Background(),
|
|
|
|
Identity,
|
|
|
|
RoleList,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (client *DeviceProtection1) GetACLDataCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (ACL string, err error) {
|
2015-06-07 08:04:24 +00:00
|
|
|
// Request structure.
|
|
|
|
request := interface{}(nil)
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
ACL string
|
2015-06-07 08:04:24 +00:00
|
|
|
}{}
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "GetACLData", request, response); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if ACL, err = soap.UnmarshalString(response.ACL); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetACLData is the legacy version of GetACLDataCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *DeviceProtection1) GetACLData() (ACL string, err error) {
|
|
|
|
return client.GetACLDataCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (client *DeviceProtection1) GetAssignedRolesCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (RoleList string, err error) {
|
2015-06-07 08:04:24 +00:00
|
|
|
// Request structure.
|
|
|
|
request := interface{}(nil)
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := &struct {
|
|
|
|
RoleList string
|
|
|
|
}{}
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "GetAssignedRoles", request, response); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if RoleList, err = soap.UnmarshalString(response.RoleList); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetAssignedRoles is the legacy version of GetAssignedRolesCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *DeviceProtection1) GetAssignedRoles() (RoleList string, err error) {
|
|
|
|
return client.GetAssignedRolesCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (client *DeviceProtection1) GetRolesForActionCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
DeviceUDN string,
|
|
|
|
ServiceId string,
|
|
|
|
ActionName string,
|
|
|
|
) (RoleList string, RestrictedRoleList string, err error) {
|
2015-06-07 08:04:24 +00:00
|
|
|
// Request structure.
|
|
|
|
request := &struct {
|
2017-11-05 13:50:25 +00:00
|
|
|
DeviceUDN string
|
|
|
|
ServiceId string
|
2015-06-07 08:04:24 +00:00
|
|
|
ActionName string
|
|
|
|
}{}
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
if request.DeviceUDN, err = soap.MarshalString(DeviceUDN); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.ServiceId, err = soap.MarshalString(ServiceId); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.ActionName, err = soap.MarshalString(ActionName); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := &struct {
|
2017-11-05 13:50:25 +00:00
|
|
|
RoleList string
|
2015-06-07 08:04:24 +00:00
|
|
|
RestrictedRoleList string
|
|
|
|
}{}
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "GetRolesForAction", request, response); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if RoleList, err = soap.UnmarshalString(response.RoleList); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if RestrictedRoleList, err = soap.UnmarshalString(response.RestrictedRoleList); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetRolesForAction is the legacy version of GetRolesForActionCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *DeviceProtection1) GetRolesForAction(DeviceUDN string, ServiceId string, ActionName string) (RoleList string, RestrictedRoleList string, err error) {
|
|
|
|
return client.GetRolesForActionCtx(context.Background(),
|
|
|
|
DeviceUDN,
|
|
|
|
ServiceId,
|
|
|
|
ActionName,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *DeviceProtection1) GetSupportedProtocolsCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (ProtocolList string, err error) {
|
|
|
|
// Request structure.
|
|
|
|
request := interface{}(nil)
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := &struct {
|
|
|
|
ProtocolList string
|
|
|
|
}{}
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "GetSupportedProtocols", request, response); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if ProtocolList, err = soap.UnmarshalString(response.ProtocolList); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetSupportedProtocols is the legacy version of GetSupportedProtocolsCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *DeviceProtection1) GetSupportedProtocols() (ProtocolList string, err error) {
|
|
|
|
return client.GetSupportedProtocolsCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
func (client *DeviceProtection1) GetUserLoginChallengeCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
ProtocolType string,
|
|
|
|
Name string,
|
|
|
|
) (Salt []byte, Challenge []byte, err error) {
|
2015-06-07 08:04:24 +00:00
|
|
|
// Request structure.
|
|
|
|
request := &struct {
|
|
|
|
ProtocolType string
|
2017-11-05 13:50:25 +00:00
|
|
|
Name string
|
2015-06-07 08:04:24 +00:00
|
|
|
}{}
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
if request.ProtocolType, err = soap.MarshalString(ProtocolType); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.Name, err = soap.MarshalString(Name); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := &struct {
|
2017-11-05 13:50:25 +00:00
|
|
|
Salt string
|
2015-06-07 08:04:24 +00:00
|
|
|
Challenge string
|
|
|
|
}{}
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "GetUserLoginChallenge", request, response); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if Salt, err = soap.UnmarshalBinBase64(response.Salt); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if Challenge, err = soap.UnmarshalBinBase64(response.Challenge); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetUserLoginChallenge is the legacy version of GetUserLoginChallengeCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *DeviceProtection1) GetUserLoginChallenge(ProtocolType string, Name string) (Salt []byte, Challenge []byte, err error) {
|
|
|
|
return client.GetUserLoginChallengeCtx(context.Background(),
|
|
|
|
ProtocolType,
|
|
|
|
Name,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *DeviceProtection1) RemoveIdentityCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
Identity string,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2015-06-07 08:04:24 +00:00
|
|
|
// Request structure.
|
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
Identity string
|
2015-06-07 08:04:24 +00:00
|
|
|
}{}
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.Identity, err = soap.MarshalString(Identity); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := interface{}(nil)
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "RemoveIdentity", request, response); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// RemoveIdentity is the legacy version of RemoveIdentityCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *DeviceProtection1) RemoveIdentity(Identity string) (err error) {
|
|
|
|
return client.RemoveIdentityCtx(context.Background(),
|
|
|
|
Identity,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *DeviceProtection1) RemoveRolesForIdentityCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
Identity string,
|
|
|
|
RoleList string,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2015-06-07 08:04:24 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
Identity string
|
|
|
|
RoleList string
|
|
|
|
}{}
|
2015-06-07 08:04:24 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.Identity, err = soap.MarshalString(Identity); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.RoleList, err = soap.MarshalString(RoleList); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2015-06-07 08:04:24 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := interface{}(nil)
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "RemoveRolesForIdentity", request, response); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// RemoveRolesForIdentity is the legacy version of RemoveRolesForIdentityCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *DeviceProtection1) RemoveRolesForIdentity(Identity string, RoleList string) (err error) {
|
|
|
|
return client.RemoveRolesForIdentityCtx(context.Background(),
|
|
|
|
Identity,
|
|
|
|
RoleList,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *DeviceProtection1) SendSetupMessageCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
ProtocolType string,
|
|
|
|
InMessage []byte,
|
|
|
|
) (OutMessage []byte, err error) {
|
2015-06-07 08:04:24 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
ProtocolType string
|
|
|
|
InMessage string
|
|
|
|
}{}
|
2015-06-07 08:04:24 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.ProtocolType, err = soap.MarshalString(ProtocolType); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.InMessage, err = soap.MarshalBinBase64(InMessage); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2015-06-07 08:04:24 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
OutMessage string
|
2015-06-07 08:04:24 +00:00
|
|
|
}{}
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "SendSetupMessage", request, response); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if OutMessage, err = soap.UnmarshalBinBase64(response.OutMessage); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SendSetupMessage is the legacy version of SendSetupMessageCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *DeviceProtection1) SendSetupMessage(ProtocolType string, InMessage []byte) (OutMessage []byte, err error) {
|
|
|
|
return client.SendSetupMessageCtx(context.Background(),
|
|
|
|
ProtocolType,
|
|
|
|
InMessage,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *DeviceProtection1) SetUserLoginPasswordCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
ProtocolType string,
|
|
|
|
Name string,
|
|
|
|
Stored []byte,
|
|
|
|
Salt []byte,
|
|
|
|
) (err error) {
|
2015-06-07 08:04:24 +00:00
|
|
|
// Request structure.
|
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
ProtocolType string
|
|
|
|
Name string
|
|
|
|
Stored string
|
|
|
|
Salt string
|
2015-06-07 08:04:24 +00:00
|
|
|
}{}
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.ProtocolType, err = soap.MarshalString(ProtocolType); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.Name, err = soap.MarshalString(Name); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.Stored, err = soap.MarshalBinBase64(Stored); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.Salt, err = soap.MarshalBinBase64(Salt); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2015-06-07 08:04:24 +00:00
|
|
|
|
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "SetUserLoginPassword", request, response); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetUserLoginPassword is the legacy version of SetUserLoginPasswordCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *DeviceProtection1) SetUserLoginPassword(ProtocolType string, Name string, Stored []byte, Salt []byte) (err error) {
|
|
|
|
return client.SetUserLoginPasswordCtx(context.Background(),
|
|
|
|
ProtocolType,
|
|
|
|
Name,
|
|
|
|
Stored,
|
|
|
|
Salt,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *DeviceProtection1) UserLoginCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
|
|
|
ProtocolType string,
|
2022-03-13 09:02:29 +00:00
|
|
|
Challenge []byte,
|
|
|
|
Authenticator []byte,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2015-06-07 08:04:24 +00:00
|
|
|
// Request structure.
|
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
ProtocolType string
|
|
|
|
Challenge string
|
|
|
|
Authenticator string
|
2015-06-07 08:04:24 +00:00
|
|
|
}{}
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
if request.ProtocolType, err = soap.MarshalString(ProtocolType); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.Challenge, err = soap.MarshalBinBase64(Challenge); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.Authenticator, err = soap.MarshalBinBase64(Authenticator); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := interface{}(nil)
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "UserLogin", request, response); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// UserLogin is the legacy version of UserLoginCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *DeviceProtection1) UserLogin(ProtocolType string, Challenge []byte, Authenticator []byte) (err error) {
|
|
|
|
return client.UserLoginCtx(context.Background(),
|
2021-07-11 13:53:32 +00:00
|
|
|
ProtocolType,
|
2022-03-13 09:02:29 +00:00
|
|
|
Challenge,
|
|
|
|
Authenticator,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *DeviceProtection1) UserLogoutCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
|
|
|
) (err error) {
|
2015-06-07 08:04:24 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2015-06-07 08:04:24 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := interface{}(nil)
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "UserLogout", request, response); err != nil {
|
2015-06-07 08:04:24 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// UserLogout is the legacy version of UserLogoutCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *DeviceProtection1) UserLogout() (err error) {
|
|
|
|
return client.UserLogoutCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2013-12-31 20:01:17 +00:00
|
|
|
// LANHostConfigManagement1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:LANHostConfigManagement:1". See
|
|
|
|
// goupnp.ServiceClient, which contains RootDevice and Service attributes which
|
|
|
|
// are provided for informational value.
|
2013-10-06 22:16:53 +00:00
|
|
|
type LANHostConfigManagement1 struct {
|
2013-12-31 20:01:17 +00:00
|
|
|
goupnp.ServiceClient
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewLANHostConfigManagement1Clients discovers instances of the service on the network,
|
|
|
|
// and returns clients to any that are found. errors will contain an error for
|
|
|
|
// any devices that replied but which could not be queried, and err will be set
|
|
|
|
// if the discovery process failed outright.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package.
|
|
|
|
func NewLANHostConfigManagement1Clients() (clients []*LANHostConfigManagement1, errors []error, err error) {
|
|
|
|
var genericClients []goupnp.ServiceClient
|
|
|
|
if genericClients, errors, err = goupnp.NewServiceClients(URN_LANHostConfigManagement_1); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
clients = newLANHostConfigManagement1ClientsFromGenericClients(genericClients)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewLANHostConfigManagement1ClientsByURL discovers instances of the service at the given
|
|
|
|
// URL, and returns clients to any that are found. An error is returned if
|
|
|
|
// there was an error probing the service.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered service URL.
|
|
|
|
func NewLANHostConfigManagement1ClientsByURL(loc *url.URL) ([]*LANHostConfigManagement1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsByURL(loc, URN_LANHostConfigManagement_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newLANHostConfigManagement1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewLANHostConfigManagement1ClientsFromRootDevice discovers instances of the service in
|
|
|
|
// a given root device, and returns clients to any that are found. An error is
|
|
|
|
// returned if there was not at least one instance of the service within the
|
|
|
|
// device. The location parameter is simply assigned to the Location attribute
|
|
|
|
// of the wrapped ServiceClient(s).
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered root device.
|
|
|
|
func NewLANHostConfigManagement1ClientsFromRootDevice(rootDevice *goupnp.RootDevice, loc *url.URL) ([]*LANHostConfigManagement1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsFromRootDevice(rootDevice, loc, URN_LANHostConfigManagement_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newLANHostConfigManagement1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func newLANHostConfigManagement1ClientsFromGenericClients(genericClients []goupnp.ServiceClient) []*LANHostConfigManagement1 {
|
|
|
|
clients := make([]*LANHostConfigManagement1, len(genericClients))
|
2013-12-31 20:01:17 +00:00
|
|
|
for i := range genericClients {
|
|
|
|
clients[i] = &LANHostConfigManagement1{genericClients[i]}
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
return clients
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) DeleteDNSServerCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewDNSServers string,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewDNSServers string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewDNSServers, err = soap.MarshalString(NewDNSServers); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "DeleteDNSServer", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// DeleteDNSServer is the legacy version of DeleteDNSServerCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) DeleteDNSServer(NewDNSServers string) (err error) {
|
|
|
|
return client.DeleteDNSServerCtx(context.Background(),
|
|
|
|
NewDNSServers,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) DeleteIPRouterCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewIPRouters string,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewIPRouters string
|
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewIPRouters, err = soap.MarshalString(NewIPRouters); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "DeleteIPRouter", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// DeleteIPRouter is the legacy version of DeleteIPRouterCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) DeleteIPRouter(NewIPRouters string) (err error) {
|
|
|
|
return client.DeleteIPRouterCtx(context.Background(),
|
|
|
|
NewIPRouters,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) DeleteReservedAddressCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewReservedAddresses string,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewReservedAddresses string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewReservedAddresses, err = soap.MarshalString(NewReservedAddresses); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "DeleteReservedAddress", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// DeleteReservedAddress is the legacy version of DeleteReservedAddressCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) DeleteReservedAddress(NewReservedAddresses string) (err error) {
|
|
|
|
return client.DeleteReservedAddressCtx(context.Background(),
|
|
|
|
NewReservedAddresses,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) GetAddressRangeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewMinAddress string, NewMaxAddress string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewMinAddress string
|
|
|
|
NewMaxAddress string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetAddressRange", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewMinAddress, err = soap.UnmarshalString(response.NewMinAddress); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewMaxAddress, err = soap.UnmarshalString(response.NewMaxAddress); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetAddressRange is the legacy version of GetAddressRangeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) GetAddressRange() (NewMinAddress string, NewMaxAddress string, err error) {
|
|
|
|
return client.GetAddressRangeCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) GetDHCPRelayCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewDHCPRelay bool, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewDHCPRelay string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetDHCPRelay", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewDHCPRelay, err = soap.UnmarshalBoolean(response.NewDHCPRelay); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetDHCPRelay is the legacy version of GetDHCPRelayCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) GetDHCPRelay() (NewDHCPRelay bool, err error) {
|
|
|
|
return client.GetDHCPRelayCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) GetDHCPServerConfigurableCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewDHCPServerConfigurable bool, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewDHCPServerConfigurable string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetDHCPServerConfigurable", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewDHCPServerConfigurable, err = soap.UnmarshalBoolean(response.NewDHCPServerConfigurable); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetDHCPServerConfigurable is the legacy version of GetDHCPServerConfigurableCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) GetDHCPServerConfigurable() (NewDHCPServerConfigurable bool, err error) {
|
|
|
|
return client.GetDHCPServerConfigurableCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) GetDNSServersCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewDNSServers string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewDNSServers string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetDNSServers", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewDNSServers, err = soap.UnmarshalString(response.NewDNSServers); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetDNSServers is the legacy version of GetDNSServersCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) GetDNSServers() (NewDNSServers string, err error) {
|
|
|
|
return client.GetDNSServersCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) GetDomainNameCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewDomainName string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewDomainName string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetDomainName", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewDomainName, err = soap.UnmarshalString(response.NewDomainName); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetDomainName is the legacy version of GetDomainNameCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) GetDomainName() (NewDomainName string, err error) {
|
|
|
|
return client.GetDomainNameCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (client *LANHostConfigManagement1) GetIPRoutersListCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (NewIPRouters string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2013-12-31 17:06:15 +00:00
|
|
|
NewIPRouters string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetIPRoutersList", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if NewIPRouters, err = soap.UnmarshalString(response.NewIPRouters); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetIPRoutersList is the legacy version of GetIPRoutersListCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *LANHostConfigManagement1) GetIPRoutersList() (NewIPRouters string, err error) {
|
|
|
|
return client.GetIPRoutersListCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) GetReservedAddressesCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewReservedAddresses string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewReservedAddresses string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetReservedAddresses", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewReservedAddresses, err = soap.UnmarshalString(response.NewReservedAddresses); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetReservedAddresses is the legacy version of GetReservedAddressesCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) GetReservedAddresses() (NewReservedAddresses string, err error) {
|
|
|
|
return client.GetReservedAddressesCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) GetSubnetMaskCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewSubnetMask string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewSubnetMask string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetSubnetMask", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewSubnetMask, err = soap.UnmarshalString(response.NewSubnetMask); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetSubnetMask is the legacy version of GetSubnetMaskCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) GetSubnetMask() (NewSubnetMask string, err error) {
|
|
|
|
return client.GetSubnetMaskCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (client *LANHostConfigManagement1) SetAddressRangeCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
NewMinAddress string,
|
|
|
|
NewMaxAddress string,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2013-12-31 17:06:15 +00:00
|
|
|
NewMinAddress string
|
|
|
|
NewMaxAddress string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
if request.NewMinAddress, err = soap.MarshalString(NewMinAddress); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewMaxAddress, err = soap.MarshalString(NewMaxAddress); err != nil {
|
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetAddressRange", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// SetAddressRange is the legacy version of SetAddressRangeCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *LANHostConfigManagement1) SetAddressRange(NewMinAddress string, NewMaxAddress string) (err error) {
|
|
|
|
return client.SetAddressRangeCtx(context.Background(),
|
|
|
|
NewMinAddress,
|
|
|
|
NewMaxAddress,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) SetDHCPRelayCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewDHCPRelay bool,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewDHCPRelay string
|
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewDHCPRelay, err = soap.MarshalBoolean(NewDHCPRelay); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetDHCPRelay", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetDHCPRelay is the legacy version of SetDHCPRelayCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) SetDHCPRelay(NewDHCPRelay bool) (err error) {
|
|
|
|
return client.SetDHCPRelayCtx(context.Background(),
|
|
|
|
NewDHCPRelay,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) SetDHCPServerConfigurableCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewDHCPServerConfigurable bool,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewDHCPServerConfigurable string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewDHCPServerConfigurable, err = soap.MarshalBoolean(NewDHCPServerConfigurable); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetDHCPServerConfigurable", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetDHCPServerConfigurable is the legacy version of SetDHCPServerConfigurableCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) SetDHCPServerConfigurable(NewDHCPServerConfigurable bool) (err error) {
|
|
|
|
return client.SetDHCPServerConfigurableCtx(context.Background(),
|
|
|
|
NewDHCPServerConfigurable,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) SetDNSServerCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewDNSServers string,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewDNSServers string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewDNSServers, err = soap.MarshalString(NewDNSServers); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetDNSServer", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetDNSServer is the legacy version of SetDNSServerCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) SetDNSServer(NewDNSServers string) (err error) {
|
|
|
|
return client.SetDNSServerCtx(context.Background(),
|
|
|
|
NewDNSServers,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) SetDomainNameCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewDomainName string,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewDomainName string
|
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewDomainName, err = soap.MarshalString(NewDomainName); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetDomainName", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetDomainName is the legacy version of SetDomainNameCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) SetDomainName(NewDomainName string) (err error) {
|
|
|
|
return client.SetDomainNameCtx(context.Background(),
|
|
|
|
NewDomainName,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) SetIPRouterCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewIPRouters string,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewIPRouters string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewIPRouters, err = soap.MarshalString(NewIPRouters); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetIPRouter", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetIPRouter is the legacy version of SetIPRouterCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) SetIPRouter(NewIPRouters string) (err error) {
|
|
|
|
return client.SetIPRouterCtx(context.Background(),
|
|
|
|
NewIPRouters,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) SetReservedAddressCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewReservedAddresses string,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewReservedAddresses string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewReservedAddresses, err = soap.MarshalString(NewReservedAddresses); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetReservedAddress", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetReservedAddress is the legacy version of SetReservedAddressCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) SetReservedAddress(NewReservedAddresses string) (err error) {
|
|
|
|
return client.SetReservedAddressCtx(context.Background(),
|
|
|
|
NewReservedAddresses,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) SetSubnetMaskCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewSubnetMask string,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewSubnetMask string
|
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewSubnetMask, err = soap.MarshalString(NewSubnetMask); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetSubnetMask", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetSubnetMask is the legacy version of SetSubnetMaskCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *LANHostConfigManagement1) SetSubnetMask(NewSubnetMask string) (err error) {
|
|
|
|
return client.SetSubnetMaskCtx(context.Background(),
|
|
|
|
NewSubnetMask,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2013-12-31 20:01:17 +00:00
|
|
|
// Layer3Forwarding1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:Layer3Forwarding:1". See
|
|
|
|
// goupnp.ServiceClient, which contains RootDevice and Service attributes which
|
|
|
|
// are provided for informational value.
|
2013-10-06 22:16:53 +00:00
|
|
|
type Layer3Forwarding1 struct {
|
2013-12-31 20:01:17 +00:00
|
|
|
goupnp.ServiceClient
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewLayer3Forwarding1Clients discovers instances of the service on the network,
|
|
|
|
// and returns clients to any that are found. errors will contain an error for
|
|
|
|
// any devices that replied but which could not be queried, and err will be set
|
|
|
|
// if the discovery process failed outright.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package.
|
|
|
|
func NewLayer3Forwarding1Clients() (clients []*Layer3Forwarding1, errors []error, err error) {
|
|
|
|
var genericClients []goupnp.ServiceClient
|
|
|
|
if genericClients, errors, err = goupnp.NewServiceClients(URN_Layer3Forwarding_1); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
clients = newLayer3Forwarding1ClientsFromGenericClients(genericClients)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewLayer3Forwarding1ClientsByURL discovers instances of the service at the given
|
|
|
|
// URL, and returns clients to any that are found. An error is returned if
|
|
|
|
// there was an error probing the service.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered service URL.
|
|
|
|
func NewLayer3Forwarding1ClientsByURL(loc *url.URL) ([]*Layer3Forwarding1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsByURL(loc, URN_Layer3Forwarding_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newLayer3Forwarding1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewLayer3Forwarding1ClientsFromRootDevice discovers instances of the service in
|
|
|
|
// a given root device, and returns clients to any that are found. An error is
|
|
|
|
// returned if there was not at least one instance of the service within the
|
|
|
|
// device. The location parameter is simply assigned to the Location attribute
|
|
|
|
// of the wrapped ServiceClient(s).
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered root device.
|
|
|
|
func NewLayer3Forwarding1ClientsFromRootDevice(rootDevice *goupnp.RootDevice, loc *url.URL) ([]*Layer3Forwarding1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsFromRootDevice(rootDevice, loc, URN_Layer3Forwarding_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newLayer3Forwarding1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func newLayer3Forwarding1ClientsFromGenericClients(genericClients []goupnp.ServiceClient) []*Layer3Forwarding1 {
|
|
|
|
clients := make([]*Layer3Forwarding1, len(genericClients))
|
2013-12-31 20:01:17 +00:00
|
|
|
for i := range genericClients {
|
|
|
|
clients[i] = &Layer3Forwarding1{genericClients[i]}
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
return clients
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *Layer3Forwarding1) GetDefaultConnectionServiceCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewDefaultConnectionService string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewDefaultConnectionService string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_Layer3Forwarding_1, "GetDefaultConnectionService", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewDefaultConnectionService, err = soap.UnmarshalString(response.NewDefaultConnectionService); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetDefaultConnectionService is the legacy version of GetDefaultConnectionServiceCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *Layer3Forwarding1) GetDefaultConnectionService() (NewDefaultConnectionService string, err error) {
|
|
|
|
return client.GetDefaultConnectionServiceCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *Layer3Forwarding1) SetDefaultConnectionServiceCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewDefaultConnectionService string,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewDefaultConnectionService string
|
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewDefaultConnectionService, err = soap.MarshalString(NewDefaultConnectionService); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_Layer3Forwarding_1, "SetDefaultConnectionService", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetDefaultConnectionService is the legacy version of SetDefaultConnectionServiceCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *Layer3Forwarding1) SetDefaultConnectionService(NewDefaultConnectionService string) (err error) {
|
|
|
|
return client.SetDefaultConnectionServiceCtx(context.Background(),
|
|
|
|
NewDefaultConnectionService,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2013-12-31 20:01:17 +00:00
|
|
|
// WANCableLinkConfig1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANCableLinkConfig:1". See
|
|
|
|
// goupnp.ServiceClient, which contains RootDevice and Service attributes which
|
|
|
|
// are provided for informational value.
|
2013-10-06 22:16:53 +00:00
|
|
|
type WANCableLinkConfig1 struct {
|
2013-12-31 20:01:17 +00:00
|
|
|
goupnp.ServiceClient
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANCableLinkConfig1Clients discovers instances of the service on the network,
|
|
|
|
// and returns clients to any that are found. errors will contain an error for
|
|
|
|
// any devices that replied but which could not be queried, and err will be set
|
|
|
|
// if the discovery process failed outright.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package.
|
|
|
|
func NewWANCableLinkConfig1Clients() (clients []*WANCableLinkConfig1, errors []error, err error) {
|
|
|
|
var genericClients []goupnp.ServiceClient
|
|
|
|
if genericClients, errors, err = goupnp.NewServiceClients(URN_WANCableLinkConfig_1); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
clients = newWANCableLinkConfig1ClientsFromGenericClients(genericClients)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANCableLinkConfig1ClientsByURL discovers instances of the service at the given
|
|
|
|
// URL, and returns clients to any that are found. An error is returned if
|
|
|
|
// there was an error probing the service.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered service URL.
|
|
|
|
func NewWANCableLinkConfig1ClientsByURL(loc *url.URL) ([]*WANCableLinkConfig1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsByURL(loc, URN_WANCableLinkConfig_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newWANCableLinkConfig1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANCableLinkConfig1ClientsFromRootDevice discovers instances of the service in
|
|
|
|
// a given root device, and returns clients to any that are found. An error is
|
|
|
|
// returned if there was not at least one instance of the service within the
|
|
|
|
// device. The location parameter is simply assigned to the Location attribute
|
|
|
|
// of the wrapped ServiceClient(s).
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered root device.
|
|
|
|
func NewWANCableLinkConfig1ClientsFromRootDevice(rootDevice *goupnp.RootDevice, loc *url.URL) ([]*WANCableLinkConfig1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsFromRootDevice(rootDevice, loc, URN_WANCableLinkConfig_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newWANCableLinkConfig1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func newWANCableLinkConfig1ClientsFromGenericClients(genericClients []goupnp.ServiceClient) []*WANCableLinkConfig1 {
|
|
|
|
clients := make([]*WANCableLinkConfig1, len(genericClients))
|
2013-12-31 20:01:17 +00:00
|
|
|
for i := range genericClients {
|
|
|
|
clients[i] = &WANCableLinkConfig1{genericClients[i]}
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
return clients
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCableLinkConfig1) GetBPIEncryptionEnabledCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (NewBPIEncryptionEnabled bool, err error) {
|
|
|
|
// Request structure.
|
|
|
|
request := interface{}(nil)
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := &struct {
|
|
|
|
NewBPIEncryptionEnabled string
|
|
|
|
}{}
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetBPIEncryptionEnabled", request, response); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if NewBPIEncryptionEnabled, err = soap.UnmarshalBoolean(response.NewBPIEncryptionEnabled); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetBPIEncryptionEnabled is the legacy version of GetBPIEncryptionEnabledCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANCableLinkConfig1) GetBPIEncryptionEnabled() (NewBPIEncryptionEnabled bool, err error) {
|
|
|
|
return client.GetBPIEncryptionEnabledCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
2013-12-31 18:04:59 +00:00
|
|
|
//
|
2013-10-06 22:16:53 +00:00
|
|
|
// Return values:
|
2013-12-31 18:04:59 +00:00
|
|
|
//
|
2013-12-31 17:52:43 +00:00
|
|
|
// * NewCableLinkConfigState: allowed values: notReady, dsSyncComplete, usParamAcquired, rangingComplete, ipComplete, todEstablished, paramTransferComplete, registrationComplete, operational, accessDenied
|
2013-10-06 22:16:53 +00:00
|
|
|
//
|
2013-12-31 17:52:43 +00:00
|
|
|
// * NewLinkType: allowed values: Ethernet
|
2021-07-11 13:53:32 +00:00
|
|
|
func (client *WANCableLinkConfig1) GetCableLinkConfigInfoCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (NewCableLinkConfigState string, NewLinkType string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2013-12-31 17:06:15 +00:00
|
|
|
NewCableLinkConfigState string
|
2017-11-05 13:50:25 +00:00
|
|
|
NewLinkType string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetCableLinkConfigInfo", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
if NewCableLinkConfigState, err = soap.UnmarshalString(response.NewCableLinkConfigState); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewLinkType, err = soap.UnmarshalString(response.NewLinkType); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetCableLinkConfigInfo is the legacy version of GetCableLinkConfigInfoCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANCableLinkConfig1) GetCableLinkConfigInfo() (NewCableLinkConfigState string, NewLinkType string, err error) {
|
|
|
|
return client.GetCableLinkConfigInfoCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCableLinkConfig1) GetConfigFileCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewConfigFile string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewConfigFile string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetConfigFile", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewConfigFile, err = soap.UnmarshalString(response.NewConfigFile); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetConfigFile is the legacy version of GetConfigFileCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCableLinkConfig1) GetConfigFile() (NewConfigFile string, err error) {
|
|
|
|
return client.GetConfigFileCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCableLinkConfig1) GetDownstreamFrequencyCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewDownstreamFrequency uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewDownstreamFrequency string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetDownstreamFrequency", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewDownstreamFrequency, err = soap.UnmarshalUi4(response.NewDownstreamFrequency); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetDownstreamFrequency is the legacy version of GetDownstreamFrequencyCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCableLinkConfig1) GetDownstreamFrequency() (NewDownstreamFrequency uint32, err error) {
|
|
|
|
return client.GetDownstreamFrequencyCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
//
|
|
|
|
// Return values:
|
|
|
|
//
|
|
|
|
// * NewDownstreamModulation: allowed values: 64QAM, 256QAM
|
|
|
|
func (client *WANCableLinkConfig1) GetDownstreamModulationCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewDownstreamModulation string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewDownstreamModulation string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetDownstreamModulation", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewDownstreamModulation, err = soap.UnmarshalString(response.NewDownstreamModulation); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetDownstreamModulation is the legacy version of GetDownstreamModulationCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCableLinkConfig1) GetDownstreamModulation() (NewDownstreamModulation string, err error) {
|
|
|
|
return client.GetDownstreamModulationCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCableLinkConfig1) GetTFTPServerCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewTFTPServer string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewTFTPServer string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetTFTPServer", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewTFTPServer, err = soap.UnmarshalString(response.NewTFTPServer); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetTFTPServer is the legacy version of GetTFTPServerCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCableLinkConfig1) GetTFTPServer() (NewTFTPServer string, err error) {
|
|
|
|
return client.GetTFTPServerCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (client *WANCableLinkConfig1) GetUpstreamChannelIDCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (NewUpstreamChannelID uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2013-12-31 17:06:15 +00:00
|
|
|
NewUpstreamChannelID string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetUpstreamChannelID", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if NewUpstreamChannelID, err = soap.UnmarshalUi4(response.NewUpstreamChannelID); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetUpstreamChannelID is the legacy version of GetUpstreamChannelIDCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANCableLinkConfig1) GetUpstreamChannelID() (NewUpstreamChannelID uint32, err error) {
|
|
|
|
return client.GetUpstreamChannelIDCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCableLinkConfig1) GetUpstreamFrequencyCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewUpstreamFrequency uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewUpstreamFrequency string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetUpstreamFrequency", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewUpstreamFrequency, err = soap.UnmarshalUi4(response.NewUpstreamFrequency); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetUpstreamFrequency is the legacy version of GetUpstreamFrequencyCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCableLinkConfig1) GetUpstreamFrequency() (NewUpstreamFrequency uint32, err error) {
|
|
|
|
return client.GetUpstreamFrequencyCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
//
|
|
|
|
// Return values:
|
|
|
|
//
|
|
|
|
// * NewUpstreamModulation: allowed values: QPSK, 16QAM
|
|
|
|
func (client *WANCableLinkConfig1) GetUpstreamModulationCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewUpstreamModulation string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewUpstreamModulation string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetUpstreamModulation", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewUpstreamModulation, err = soap.UnmarshalString(response.NewUpstreamModulation); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetUpstreamModulation is the legacy version of GetUpstreamModulationCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCableLinkConfig1) GetUpstreamModulation() (NewUpstreamModulation string, err error) {
|
|
|
|
return client.GetUpstreamModulationCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCableLinkConfig1) GetUpstreamPowerLevelCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewUpstreamPowerLevel uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewUpstreamPowerLevel string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetUpstreamPowerLevel", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewUpstreamPowerLevel, err = soap.UnmarshalUi4(response.NewUpstreamPowerLevel); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetUpstreamPowerLevel is the legacy version of GetUpstreamPowerLevelCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCableLinkConfig1) GetUpstreamPowerLevel() (NewUpstreamPowerLevel uint32, err error) {
|
|
|
|
return client.GetUpstreamPowerLevelCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// WANCommonInterfaceConfig1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1". See
|
|
|
|
// goupnp.ServiceClient, which contains RootDevice and Service attributes which
|
|
|
|
// are provided for informational value.
|
|
|
|
type WANCommonInterfaceConfig1 struct {
|
|
|
|
goupnp.ServiceClient
|
|
|
|
}
|
2013-12-31 20:01:17 +00:00
|
|
|
|
|
|
|
// NewWANCommonInterfaceConfig1Clients discovers instances of the service on the network,
|
|
|
|
// and returns clients to any that are found. errors will contain an error for
|
|
|
|
// any devices that replied but which could not be queried, and err will be set
|
|
|
|
// if the discovery process failed outright.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package.
|
|
|
|
func NewWANCommonInterfaceConfig1Clients() (clients []*WANCommonInterfaceConfig1, errors []error, err error) {
|
|
|
|
var genericClients []goupnp.ServiceClient
|
|
|
|
if genericClients, errors, err = goupnp.NewServiceClients(URN_WANCommonInterfaceConfig_1); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
clients = newWANCommonInterfaceConfig1ClientsFromGenericClients(genericClients)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANCommonInterfaceConfig1ClientsByURL discovers instances of the service at the given
|
|
|
|
// URL, and returns clients to any that are found. An error is returned if
|
|
|
|
// there was an error probing the service.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered service URL.
|
|
|
|
func NewWANCommonInterfaceConfig1ClientsByURL(loc *url.URL) ([]*WANCommonInterfaceConfig1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsByURL(loc, URN_WANCommonInterfaceConfig_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newWANCommonInterfaceConfig1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANCommonInterfaceConfig1ClientsFromRootDevice discovers instances of the service in
|
|
|
|
// a given root device, and returns clients to any that are found. An error is
|
|
|
|
// returned if there was not at least one instance of the service within the
|
|
|
|
// device. The location parameter is simply assigned to the Location attribute
|
|
|
|
// of the wrapped ServiceClient(s).
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered root device.
|
|
|
|
func NewWANCommonInterfaceConfig1ClientsFromRootDevice(rootDevice *goupnp.RootDevice, loc *url.URL) ([]*WANCommonInterfaceConfig1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsFromRootDevice(rootDevice, loc, URN_WANCommonInterfaceConfig_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newWANCommonInterfaceConfig1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func newWANCommonInterfaceConfig1ClientsFromGenericClients(genericClients []goupnp.ServiceClient) []*WANCommonInterfaceConfig1 {
|
|
|
|
clients := make([]*WANCommonInterfaceConfig1, len(genericClients))
|
2013-12-31 20:01:17 +00:00
|
|
|
for i := range genericClients {
|
|
|
|
clients[i] = &WANCommonInterfaceConfig1{genericClients[i]}
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
return clients
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCommonInterfaceConfig1) GetActiveConnectionCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewActiveConnectionIndex uint16,
|
|
|
|
) (NewActiveConnDeviceContainer string, NewActiveConnectionServiceID string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewActiveConnectionIndex string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewActiveConnectionIndex, err = soap.MarshalUi2(NewActiveConnectionIndex); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewActiveConnDeviceContainer string
|
|
|
|
NewActiveConnectionServiceID string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetActiveConnection", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewActiveConnDeviceContainer, err = soap.UnmarshalString(response.NewActiveConnDeviceContainer); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewActiveConnectionServiceID, err = soap.UnmarshalString(response.NewActiveConnectionServiceID); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetActiveConnection is the legacy version of GetActiveConnectionCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCommonInterfaceConfig1) GetActiveConnection(NewActiveConnectionIndex uint16) (NewActiveConnDeviceContainer string, NewActiveConnectionServiceID string, err error) {
|
|
|
|
return client.GetActiveConnectionCtx(context.Background(),
|
|
|
|
NewActiveConnectionIndex,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2013-12-31 18:04:59 +00:00
|
|
|
//
|
2013-10-06 22:16:53 +00:00
|
|
|
// Return values:
|
2013-12-31 18:04:59 +00:00
|
|
|
//
|
2013-12-31 17:52:43 +00:00
|
|
|
// * NewWANAccessType: allowed values: DSL, POTS, Cable, Ethernet
|
2013-10-06 22:16:53 +00:00
|
|
|
//
|
2013-12-31 17:52:43 +00:00
|
|
|
// * NewPhysicalLinkStatus: allowed values: Up, Down
|
2021-07-11 13:53:32 +00:00
|
|
|
func (client *WANCommonInterfaceConfig1) GetCommonLinkPropertiesCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (NewWANAccessType string, NewLayer1UpstreamMaxBitRate uint32, NewLayer1DownstreamMaxBitRate uint32, NewPhysicalLinkStatus string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2017-11-05 13:50:25 +00:00
|
|
|
NewWANAccessType string
|
|
|
|
NewLayer1UpstreamMaxBitRate string
|
2013-12-31 17:06:15 +00:00
|
|
|
NewLayer1DownstreamMaxBitRate string
|
2017-11-05 13:50:25 +00:00
|
|
|
NewPhysicalLinkStatus string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetCommonLinkProperties", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if NewWANAccessType, err = soap.UnmarshalString(response.NewWANAccessType); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewLayer1UpstreamMaxBitRate, err = soap.UnmarshalUi4(response.NewLayer1UpstreamMaxBitRate); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewLayer1DownstreamMaxBitRate, err = soap.UnmarshalUi4(response.NewLayer1DownstreamMaxBitRate); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewPhysicalLinkStatus, err = soap.UnmarshalString(response.NewPhysicalLinkStatus); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetCommonLinkProperties is the legacy version of GetCommonLinkPropertiesCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANCommonInterfaceConfig1) GetCommonLinkProperties() (NewWANAccessType string, NewLayer1UpstreamMaxBitRate uint32, NewLayer1DownstreamMaxBitRate uint32, NewPhysicalLinkStatus string, err error) {
|
|
|
|
return client.GetCommonLinkPropertiesCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCommonInterfaceConfig1) GetEnabledForInternetCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewEnabledForInternet bool, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewEnabledForInternet string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetEnabledForInternet", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewEnabledForInternet, err = soap.UnmarshalBoolean(response.NewEnabledForInternet); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetEnabledForInternet is the legacy version of GetEnabledForInternetCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCommonInterfaceConfig1) GetEnabledForInternet() (NewEnabledForInternet bool, err error) {
|
|
|
|
return client.GetEnabledForInternetCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2013-12-31 18:04:59 +00:00
|
|
|
//
|
2013-10-06 22:16:53 +00:00
|
|
|
// Return values:
|
|
|
|
//
|
2013-12-31 18:04:59 +00:00
|
|
|
// * NewMaximumActiveConnections: allowed value range: minimum=1, step=1
|
2021-07-11 13:53:32 +00:00
|
|
|
func (client *WANCommonInterfaceConfig1) GetMaximumActiveConnectionsCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (NewMaximumActiveConnections uint16, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2013-12-31 17:06:15 +00:00
|
|
|
NewMaximumActiveConnections string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetMaximumActiveConnections", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
if NewMaximumActiveConnections, err = soap.UnmarshalUi2(response.NewMaximumActiveConnections); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetMaximumActiveConnections is the legacy version of GetMaximumActiveConnectionsCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANCommonInterfaceConfig1) GetMaximumActiveConnections() (NewMaximumActiveConnections uint16, err error) {
|
|
|
|
return client.GetMaximumActiveConnectionsCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCommonInterfaceConfig1) GetTotalBytesReceivedCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (NewTotalBytesReceived uint64, err error) {
|
|
|
|
// Request structure.
|
|
|
|
request := interface{}(nil)
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := &struct {
|
|
|
|
NewTotalBytesReceived string
|
|
|
|
}{}
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetTotalBytesReceived", request, response); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if NewTotalBytesReceived, err = soap.UnmarshalUi8(response.NewTotalBytesReceived); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetTotalBytesReceived is the legacy version of GetTotalBytesReceivedCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANCommonInterfaceConfig1) GetTotalBytesReceived() (NewTotalBytesReceived uint64, err error) {
|
|
|
|
return client.GetTotalBytesReceivedCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
func (client *WANCommonInterfaceConfig1) GetTotalBytesSentCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (NewTotalBytesSent uint64, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2013-12-31 17:06:15 +00:00
|
|
|
NewTotalBytesSent string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetTotalBytesSent", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2017-11-09 17:45:09 +00:00
|
|
|
if NewTotalBytesSent, err = soap.UnmarshalUi8(response.NewTotalBytesSent); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetTotalBytesSent is the legacy version of GetTotalBytesSentCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANCommonInterfaceConfig1) GetTotalBytesSent() (NewTotalBytesSent uint64, err error) {
|
|
|
|
return client.GetTotalBytesSentCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCommonInterfaceConfig1) GetTotalPacketsReceivedCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewTotalPacketsReceived uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewTotalPacketsReceived string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetTotalPacketsReceived", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewTotalPacketsReceived, err = soap.UnmarshalUi4(response.NewTotalPacketsReceived); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetTotalPacketsReceived is the legacy version of GetTotalPacketsReceivedCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCommonInterfaceConfig1) GetTotalPacketsReceived() (NewTotalPacketsReceived uint32, err error) {
|
|
|
|
return client.GetTotalPacketsReceivedCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (client *WANCommonInterfaceConfig1) GetTotalPacketsSentCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (NewTotalPacketsSent uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2013-12-31 17:06:15 +00:00
|
|
|
NewTotalPacketsSent string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetTotalPacketsSent", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if NewTotalPacketsSent, err = soap.UnmarshalUi4(response.NewTotalPacketsSent); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetTotalPacketsSent is the legacy version of GetTotalPacketsSentCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANCommonInterfaceConfig1) GetTotalPacketsSent() (NewTotalPacketsSent uint32, err error) {
|
|
|
|
return client.GetTotalPacketsSentCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCommonInterfaceConfig1) GetWANAccessProviderCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewWANAccessProvider string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewWANAccessProvider string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetWANAccessProvider", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewWANAccessProvider, err = soap.UnmarshalString(response.NewWANAccessProvider); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetWANAccessProvider is the legacy version of GetWANAccessProviderCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCommonInterfaceConfig1) GetWANAccessProvider() (NewWANAccessProvider string, err error) {
|
|
|
|
return client.GetWANAccessProviderCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCommonInterfaceConfig1) SetEnabledForInternetCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewEnabledForInternet bool,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewEnabledForInternet string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewEnabledForInternet, err = soap.MarshalBoolean(NewEnabledForInternet); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "SetEnabledForInternet", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetEnabledForInternet is the legacy version of SetEnabledForInternetCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANCommonInterfaceConfig1) SetEnabledForInternet(NewEnabledForInternet bool) (err error) {
|
|
|
|
return client.SetEnabledForInternetCtx(context.Background(),
|
|
|
|
NewEnabledForInternet,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2013-12-31 20:01:17 +00:00
|
|
|
// WANDSLLinkConfig1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANDSLLinkConfig:1". See
|
|
|
|
// goupnp.ServiceClient, which contains RootDevice and Service attributes which
|
|
|
|
// are provided for informational value.
|
2013-10-06 22:16:53 +00:00
|
|
|
type WANDSLLinkConfig1 struct {
|
2013-12-31 20:01:17 +00:00
|
|
|
goupnp.ServiceClient
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANDSLLinkConfig1Clients discovers instances of the service on the network,
|
|
|
|
// and returns clients to any that are found. errors will contain an error for
|
|
|
|
// any devices that replied but which could not be queried, and err will be set
|
|
|
|
// if the discovery process failed outright.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package.
|
|
|
|
func NewWANDSLLinkConfig1Clients() (clients []*WANDSLLinkConfig1, errors []error, err error) {
|
|
|
|
var genericClients []goupnp.ServiceClient
|
|
|
|
if genericClients, errors, err = goupnp.NewServiceClients(URN_WANDSLLinkConfig_1); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
clients = newWANDSLLinkConfig1ClientsFromGenericClients(genericClients)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANDSLLinkConfig1ClientsByURL discovers instances of the service at the given
|
|
|
|
// URL, and returns clients to any that are found. An error is returned if
|
|
|
|
// there was an error probing the service.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered service URL.
|
|
|
|
func NewWANDSLLinkConfig1ClientsByURL(loc *url.URL) ([]*WANDSLLinkConfig1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsByURL(loc, URN_WANDSLLinkConfig_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newWANDSLLinkConfig1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANDSLLinkConfig1ClientsFromRootDevice discovers instances of the service in
|
|
|
|
// a given root device, and returns clients to any that are found. An error is
|
|
|
|
// returned if there was not at least one instance of the service within the
|
|
|
|
// device. The location parameter is simply assigned to the Location attribute
|
|
|
|
// of the wrapped ServiceClient(s).
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered root device.
|
|
|
|
func NewWANDSLLinkConfig1ClientsFromRootDevice(rootDevice *goupnp.RootDevice, loc *url.URL) ([]*WANDSLLinkConfig1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsFromRootDevice(rootDevice, loc, URN_WANDSLLinkConfig_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newWANDSLLinkConfig1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func newWANDSLLinkConfig1ClientsFromGenericClients(genericClients []goupnp.ServiceClient) []*WANDSLLinkConfig1 {
|
|
|
|
clients := make([]*WANDSLLinkConfig1, len(genericClients))
|
2013-12-31 20:01:17 +00:00
|
|
|
for i := range genericClients {
|
|
|
|
clients[i] = &WANDSLLinkConfig1{genericClients[i]}
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
return clients
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANDSLLinkConfig1) GetATMEncapsulationCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewATMEncapsulation string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewATMEncapsulation string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetATMEncapsulation", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewATMEncapsulation, err = soap.UnmarshalString(response.NewATMEncapsulation); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetATMEncapsulation is the legacy version of GetATMEncapsulationCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANDSLLinkConfig1) GetATMEncapsulation() (NewATMEncapsulation string, err error) {
|
|
|
|
return client.GetATMEncapsulationCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANDSLLinkConfig1) GetAutoConfigCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewAutoConfig bool, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewAutoConfig string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetAutoConfig", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewAutoConfig, err = soap.UnmarshalBoolean(response.NewAutoConfig); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetAutoConfig is the legacy version of GetAutoConfigCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANDSLLinkConfig1) GetAutoConfig() (NewAutoConfig bool, err error) {
|
|
|
|
return client.GetAutoConfigCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
//
|
|
|
|
// Return values:
|
|
|
|
//
|
|
|
|
// * NewLinkStatus: allowed values: Up, Down
|
|
|
|
func (client *WANDSLLinkConfig1) GetDSLLinkInfoCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewLinkType string, NewLinkStatus string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewLinkType string
|
|
|
|
NewLinkStatus string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetDSLLinkInfo", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewLinkType, err = soap.UnmarshalString(response.NewLinkType); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewLinkStatus, err = soap.UnmarshalString(response.NewLinkStatus); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetDSLLinkInfo is the legacy version of GetDSLLinkInfoCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANDSLLinkConfig1) GetDSLLinkInfo() (NewLinkType string, NewLinkStatus string, err error) {
|
|
|
|
return client.GetDSLLinkInfoCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANDSLLinkConfig1) GetDestinationAddressCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewDestinationAddress string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewDestinationAddress string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetDestinationAddress", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewDestinationAddress, err = soap.UnmarshalString(response.NewDestinationAddress); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetDestinationAddress is the legacy version of GetDestinationAddressCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANDSLLinkConfig1) GetDestinationAddress() (NewDestinationAddress string, err error) {
|
|
|
|
return client.GetDestinationAddressCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANDSLLinkConfig1) GetFCSPreservedCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewFCSPreserved bool, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewFCSPreserved string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetFCSPreserved", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewFCSPreserved, err = soap.UnmarshalBoolean(response.NewFCSPreserved); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetFCSPreserved is the legacy version of GetFCSPreservedCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANDSLLinkConfig1) GetFCSPreserved() (NewFCSPreserved bool, err error) {
|
|
|
|
return client.GetFCSPreservedCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANDSLLinkConfig1) GetModulationTypeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewModulationType string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewModulationType string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetModulationType", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewModulationType, err = soap.UnmarshalString(response.NewModulationType); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetModulationType is the legacy version of GetModulationTypeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANDSLLinkConfig1) GetModulationType() (NewModulationType string, err error) {
|
|
|
|
return client.GetModulationTypeCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (client *WANDSLLinkConfig1) SetATMEncapsulationCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
NewATMEncapsulation string,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2013-12-31 17:06:15 +00:00
|
|
|
NewATMEncapsulation string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
if request.NewATMEncapsulation, err = soap.MarshalString(NewATMEncapsulation); err != nil {
|
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "SetATMEncapsulation", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// SetATMEncapsulation is the legacy version of SetATMEncapsulationCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANDSLLinkConfig1) SetATMEncapsulation(NewATMEncapsulation string) (err error) {
|
|
|
|
return client.SetATMEncapsulationCtx(context.Background(),
|
|
|
|
NewATMEncapsulation,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANDSLLinkConfig1) SetDSLLinkTypeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewLinkType string,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewLinkType string
|
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewLinkType, err = soap.MarshalString(NewLinkType); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "SetDSLLinkType", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetDSLLinkType is the legacy version of SetDSLLinkTypeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANDSLLinkConfig1) SetDSLLinkType(NewLinkType string) (err error) {
|
|
|
|
return client.SetDSLLinkTypeCtx(context.Background(),
|
|
|
|
NewLinkType,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANDSLLinkConfig1) SetDestinationAddressCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewDestinationAddress string,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewDestinationAddress string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewDestinationAddress, err = soap.MarshalString(NewDestinationAddress); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "SetDestinationAddress", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetDestinationAddress is the legacy version of SetDestinationAddressCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANDSLLinkConfig1) SetDestinationAddress(NewDestinationAddress string) (err error) {
|
|
|
|
return client.SetDestinationAddressCtx(context.Background(),
|
|
|
|
NewDestinationAddress,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANDSLLinkConfig1) SetFCSPreservedCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewFCSPreserved bool,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewFCSPreserved string
|
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewFCSPreserved, err = soap.MarshalBoolean(NewFCSPreserved); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "SetFCSPreserved", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetFCSPreserved is the legacy version of SetFCSPreservedCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANDSLLinkConfig1) SetFCSPreserved(NewFCSPreserved bool) (err error) {
|
|
|
|
return client.SetFCSPreservedCtx(context.Background(),
|
|
|
|
NewFCSPreserved,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2013-12-31 20:01:17 +00:00
|
|
|
// WANEthernetLinkConfig1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANEthernetLinkConfig:1". See
|
|
|
|
// goupnp.ServiceClient, which contains RootDevice and Service attributes which
|
|
|
|
// are provided for informational value.
|
2013-10-06 22:16:53 +00:00
|
|
|
type WANEthernetLinkConfig1 struct {
|
2013-12-31 20:01:17 +00:00
|
|
|
goupnp.ServiceClient
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANEthernetLinkConfig1Clients discovers instances of the service on the network,
|
|
|
|
// and returns clients to any that are found. errors will contain an error for
|
|
|
|
// any devices that replied but which could not be queried, and err will be set
|
|
|
|
// if the discovery process failed outright.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package.
|
|
|
|
func NewWANEthernetLinkConfig1Clients() (clients []*WANEthernetLinkConfig1, errors []error, err error) {
|
|
|
|
var genericClients []goupnp.ServiceClient
|
|
|
|
if genericClients, errors, err = goupnp.NewServiceClients(URN_WANEthernetLinkConfig_1); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
clients = newWANEthernetLinkConfig1ClientsFromGenericClients(genericClients)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANEthernetLinkConfig1ClientsByURL discovers instances of the service at the given
|
|
|
|
// URL, and returns clients to any that are found. An error is returned if
|
|
|
|
// there was an error probing the service.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered service URL.
|
|
|
|
func NewWANEthernetLinkConfig1ClientsByURL(loc *url.URL) ([]*WANEthernetLinkConfig1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsByURL(loc, URN_WANEthernetLinkConfig_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newWANEthernetLinkConfig1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANEthernetLinkConfig1ClientsFromRootDevice discovers instances of the service in
|
|
|
|
// a given root device, and returns clients to any that are found. An error is
|
|
|
|
// returned if there was not at least one instance of the service within the
|
|
|
|
// device. The location parameter is simply assigned to the Location attribute
|
|
|
|
// of the wrapped ServiceClient(s).
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered root device.
|
|
|
|
func NewWANEthernetLinkConfig1ClientsFromRootDevice(rootDevice *goupnp.RootDevice, loc *url.URL) ([]*WANEthernetLinkConfig1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsFromRootDevice(rootDevice, loc, URN_WANEthernetLinkConfig_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newWANEthernetLinkConfig1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func newWANEthernetLinkConfig1ClientsFromGenericClients(genericClients []goupnp.ServiceClient) []*WANEthernetLinkConfig1 {
|
|
|
|
clients := make([]*WANEthernetLinkConfig1, len(genericClients))
|
2013-12-31 20:01:17 +00:00
|
|
|
for i := range genericClients {
|
|
|
|
clients[i] = &WANEthernetLinkConfig1{genericClients[i]}
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
return clients
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
|
|
|
|
2013-12-31 18:04:59 +00:00
|
|
|
//
|
2013-10-06 22:16:53 +00:00
|
|
|
// Return values:
|
|
|
|
//
|
2013-12-31 18:04:59 +00:00
|
|
|
// * NewEthernetLinkStatus: allowed values: Up, Down
|
2021-07-11 13:53:32 +00:00
|
|
|
func (client *WANEthernetLinkConfig1) GetEthernetLinkStatusCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (NewEthernetLinkStatus string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2013-12-31 17:06:15 +00:00
|
|
|
NewEthernetLinkStatus string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANEthernetLinkConfig_1, "GetEthernetLinkStatus", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
if NewEthernetLinkStatus, err = soap.UnmarshalString(response.NewEthernetLinkStatus); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetEthernetLinkStatus is the legacy version of GetEthernetLinkStatusCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANEthernetLinkConfig1) GetEthernetLinkStatus() (NewEthernetLinkStatus string, err error) {
|
|
|
|
return client.GetEthernetLinkStatusCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
2013-12-31 20:01:17 +00:00
|
|
|
// WANIPConnection1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANIPConnection:1". See
|
|
|
|
// goupnp.ServiceClient, which contains RootDevice and Service attributes which
|
|
|
|
// are provided for informational value.
|
2013-10-06 22:16:53 +00:00
|
|
|
type WANIPConnection1 struct {
|
2013-12-31 20:01:17 +00:00
|
|
|
goupnp.ServiceClient
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANIPConnection1Clients discovers instances of the service on the network,
|
|
|
|
// and returns clients to any that are found. errors will contain an error for
|
|
|
|
// any devices that replied but which could not be queried, and err will be set
|
|
|
|
// if the discovery process failed outright.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package.
|
|
|
|
func NewWANIPConnection1Clients() (clients []*WANIPConnection1, errors []error, err error) {
|
|
|
|
var genericClients []goupnp.ServiceClient
|
|
|
|
if genericClients, errors, err = goupnp.NewServiceClients(URN_WANIPConnection_1); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
clients = newWANIPConnection1ClientsFromGenericClients(genericClients)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANIPConnection1ClientsByURL discovers instances of the service at the given
|
|
|
|
// URL, and returns clients to any that are found. An error is returned if
|
|
|
|
// there was an error probing the service.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered service URL.
|
|
|
|
func NewWANIPConnection1ClientsByURL(loc *url.URL) ([]*WANIPConnection1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsByURL(loc, URN_WANIPConnection_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newWANIPConnection1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANIPConnection1ClientsFromRootDevice discovers instances of the service in
|
|
|
|
// a given root device, and returns clients to any that are found. An error is
|
|
|
|
// returned if there was not at least one instance of the service within the
|
|
|
|
// device. The location parameter is simply assigned to the Location attribute
|
|
|
|
// of the wrapped ServiceClient(s).
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered root device.
|
|
|
|
func NewWANIPConnection1ClientsFromRootDevice(rootDevice *goupnp.RootDevice, loc *url.URL) ([]*WANIPConnection1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsFromRootDevice(rootDevice, loc, URN_WANIPConnection_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newWANIPConnection1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func newWANIPConnection1ClientsFromGenericClients(genericClients []goupnp.ServiceClient) []*WANIPConnection1 {
|
|
|
|
clients := make([]*WANIPConnection1, len(genericClients))
|
2013-12-31 20:01:17 +00:00
|
|
|
for i := range genericClients {
|
|
|
|
clients[i] = &WANIPConnection1{genericClients[i]}
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
return clients
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
//
|
|
|
|
// Arguments:
|
|
|
|
//
|
|
|
|
// * NewProtocol: allowed values: TCP, UDP
|
|
|
|
|
|
|
|
func (client *WANIPConnection1) AddPortMappingCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewRemoteHost string,
|
|
|
|
NewExternalPort uint16,
|
|
|
|
NewProtocol string,
|
|
|
|
NewInternalPort uint16,
|
|
|
|
NewInternalClient string,
|
|
|
|
NewEnabled bool,
|
|
|
|
NewPortMappingDescription string,
|
|
|
|
NewLeaseDuration uint32,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewRemoteHost string
|
|
|
|
NewExternalPort string
|
|
|
|
NewProtocol string
|
|
|
|
NewInternalPort string
|
|
|
|
NewInternalClient string
|
|
|
|
NewEnabled string
|
|
|
|
NewPortMappingDescription string
|
|
|
|
NewLeaseDuration string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewRemoteHost, err = soap.MarshalString(NewRemoteHost); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewExternalPort, err = soap.MarshalUi2(NewExternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewProtocol, err = soap.MarshalString(NewProtocol); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewInternalPort, err = soap.MarshalUi2(NewInternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewInternalClient, err = soap.MarshalString(NewInternalClient); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewEnabled, err = soap.MarshalBoolean(NewEnabled); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewPortMappingDescription, err = soap.MarshalString(NewPortMappingDescription); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewLeaseDuration, err = soap.MarshalUi4(NewLeaseDuration); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "AddPortMapping", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// AddPortMapping is the legacy version of AddPortMappingCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) AddPortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32) (err error) {
|
|
|
|
return client.AddPortMappingCtx(context.Background(),
|
|
|
|
NewRemoteHost,
|
|
|
|
NewExternalPort,
|
|
|
|
NewProtocol,
|
|
|
|
NewInternalPort,
|
|
|
|
NewInternalClient,
|
|
|
|
NewEnabled,
|
|
|
|
NewPortMappingDescription,
|
|
|
|
NewLeaseDuration,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2013-12-31 18:04:59 +00:00
|
|
|
//
|
2022-03-13 09:02:29 +00:00
|
|
|
// Arguments:
|
2013-12-31 18:04:59 +00:00
|
|
|
//
|
2022-03-13 09:02:29 +00:00
|
|
|
// * NewProtocol: allowed values: TCP, UDP
|
|
|
|
|
|
|
|
func (client *WANIPConnection1) DeletePortMappingCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewRemoteHost string,
|
|
|
|
NewExternalPort uint16,
|
|
|
|
NewProtocol string,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewRemoteHost string
|
|
|
|
NewExternalPort string
|
|
|
|
NewProtocol string
|
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewRemoteHost, err = soap.MarshalString(NewRemoteHost); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewExternalPort, err = soap.MarshalUi2(NewExternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewProtocol, err = soap.MarshalString(NewProtocol); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "DeletePortMapping", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// DeletePortMapping is the legacy version of DeletePortMappingCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) DeletePortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (err error) {
|
|
|
|
return client.DeletePortMappingCtx(context.Background(),
|
|
|
|
NewRemoteHost,
|
|
|
|
NewExternalPort,
|
|
|
|
NewProtocol,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) ForceTerminationCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "ForceTermination", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// ForceTermination is the legacy version of ForceTerminationCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) ForceTermination() (err error) {
|
|
|
|
return client.ForceTerminationCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) GetAutoDisconnectTimeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewAutoDisconnectTime uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewAutoDisconnectTime string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetAutoDisconnectTime", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewAutoDisconnectTime, err = soap.UnmarshalUi4(response.NewAutoDisconnectTime); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetAutoDisconnectTime is the legacy version of GetAutoDisconnectTimeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime uint32, err error) {
|
|
|
|
return client.GetAutoDisconnectTimeCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
//
|
|
|
|
// Return values:
|
|
|
|
//
|
|
|
|
// * NewPossibleConnectionTypes: allowed values: Unconfigured, IP_Routed, IP_Bridged
|
|
|
|
func (client *WANIPConnection1) GetConnectionTypeInfoCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewConnectionType string, NewPossibleConnectionTypes string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewConnectionType string
|
|
|
|
NewPossibleConnectionTypes string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetConnectionTypeInfo", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewConnectionType, err = soap.UnmarshalString(response.NewConnectionType); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewPossibleConnectionTypes, err = soap.UnmarshalString(response.NewPossibleConnectionTypes); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetConnectionTypeInfo is the legacy version of GetConnectionTypeInfoCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) GetConnectionTypeInfo() (NewConnectionType string, NewPossibleConnectionTypes string, err error) {
|
|
|
|
return client.GetConnectionTypeInfoCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) GetExternalIPAddressCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewExternalIPAddress string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewExternalIPAddress string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetExternalIPAddress", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewExternalIPAddress, err = soap.UnmarshalString(response.NewExternalIPAddress); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetExternalIPAddress is the legacy version of GetExternalIPAddressCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) GetExternalIPAddress() (NewExternalIPAddress string, err error) {
|
|
|
|
return client.GetExternalIPAddressCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2013-12-31 18:04:59 +00:00
|
|
|
//
|
2013-10-06 22:16:53 +00:00
|
|
|
// Return values:
|
2013-12-31 18:04:59 +00:00
|
|
|
//
|
2022-03-13 09:02:29 +00:00
|
|
|
// * NewProtocol: allowed values: TCP, UDP
|
|
|
|
func (client *WANIPConnection1) GetGenericPortMappingEntryCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewPortMappingIndex uint16,
|
|
|
|
) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewPortMappingIndex string
|
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewPortMappingIndex, err = soap.MarshalUi2(NewPortMappingIndex); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewRemoteHost string
|
|
|
|
NewExternalPort string
|
|
|
|
NewProtocol string
|
|
|
|
NewInternalPort string
|
|
|
|
NewInternalClient string
|
|
|
|
NewEnabled string
|
|
|
|
NewPortMappingDescription string
|
|
|
|
NewLeaseDuration string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetGenericPortMappingEntry", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewRemoteHost, err = soap.UnmarshalString(response.NewRemoteHost); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewExternalPort, err = soap.UnmarshalUi2(response.NewExternalPort); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewProtocol, err = soap.UnmarshalString(response.NewProtocol); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewInternalPort, err = soap.UnmarshalUi2(response.NewInternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewInternalClient, err = soap.UnmarshalString(response.NewInternalClient); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewEnabled, err = soap.UnmarshalBoolean(response.NewEnabled); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewPortMappingDescription, err = soap.UnmarshalString(response.NewPortMappingDescription); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewLeaseDuration, err = soap.UnmarshalUi4(response.NewLeaseDuration); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetGenericPortMappingEntry is the legacy version of GetGenericPortMappingEntryCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex uint16) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) {
|
|
|
|
return client.GetGenericPortMappingEntryCtx(context.Background(),
|
|
|
|
NewPortMappingIndex,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) GetIdleDisconnectTimeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewIdleDisconnectTime uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewIdleDisconnectTime string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetIdleDisconnectTime", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewIdleDisconnectTime, err = soap.UnmarshalUi4(response.NewIdleDisconnectTime); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetIdleDisconnectTime is the legacy version of GetIdleDisconnectTimeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime uint32, err error) {
|
|
|
|
return client.GetIdleDisconnectTimeCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) GetNATRSIPStatusCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewRSIPAvailable bool, NewNATEnabled bool, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewRSIPAvailable string
|
|
|
|
NewNATEnabled string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetNATRSIPStatus", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewRSIPAvailable, err = soap.UnmarshalBoolean(response.NewRSIPAvailable); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewNATEnabled, err = soap.UnmarshalBoolean(response.NewNATEnabled); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetNATRSIPStatus is the legacy version of GetNATRSIPStatusCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANIPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNATEnabled bool, err error) {
|
|
|
|
return client.GetNATRSIPStatusCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
2013-12-31 18:04:59 +00:00
|
|
|
//
|
2015-06-07 09:42:22 +00:00
|
|
|
// Arguments:
|
2013-10-06 22:16:53 +00:00
|
|
|
//
|
2013-12-31 17:52:43 +00:00
|
|
|
// * NewProtocol: allowed values: TCP, UDP
|
2015-06-07 09:42:22 +00:00
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
func (client *WANIPConnection1) GetSpecificPortMappingEntryCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
NewRemoteHost string,
|
|
|
|
NewExternalPort uint16,
|
|
|
|
NewProtocol string,
|
|
|
|
) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2017-11-05 13:50:25 +00:00
|
|
|
NewRemoteHost string
|
2013-12-31 17:06:15 +00:00
|
|
|
NewExternalPort string
|
2017-11-05 13:50:25 +00:00
|
|
|
NewProtocol string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
if request.NewRemoteHost, err = soap.MarshalString(NewRemoteHost); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewExternalPort, err = soap.MarshalUi2(NewExternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewProtocol, err = soap.MarshalString(NewProtocol); err != nil {
|
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2017-11-05 13:50:25 +00:00
|
|
|
NewInternalPort string
|
|
|
|
NewInternalClient string
|
|
|
|
NewEnabled string
|
2013-12-31 17:06:15 +00:00
|
|
|
NewPortMappingDescription string
|
2017-11-05 13:50:25 +00:00
|
|
|
NewLeaseDuration string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetSpecificPortMappingEntry", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if NewInternalPort, err = soap.UnmarshalUi2(response.NewInternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewInternalClient, err = soap.UnmarshalString(response.NewInternalClient); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewEnabled, err = soap.UnmarshalBoolean(response.NewEnabled); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewPortMappingDescription, err = soap.UnmarshalString(response.NewPortMappingDescription); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewLeaseDuration, err = soap.UnmarshalUi4(response.NewLeaseDuration); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetSpecificPortMappingEntry is the legacy version of GetSpecificPortMappingEntryCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANIPConnection1) GetSpecificPortMappingEntry(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) {
|
|
|
|
return client.GetSpecificPortMappingEntryCtx(context.Background(),
|
|
|
|
NewRemoteHost,
|
|
|
|
NewExternalPort,
|
|
|
|
NewProtocol,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2013-10-06 22:16:53 +00:00
|
|
|
//
|
2022-03-13 09:02:29 +00:00
|
|
|
// Return values:
|
2013-10-06 22:16:53 +00:00
|
|
|
//
|
2022-03-13 09:02:29 +00:00
|
|
|
// * NewConnectionStatus: allowed values: Unconfigured, Connected, Disconnected
|
|
|
|
//
|
|
|
|
// * NewLastConnectionError: allowed values: ERROR_NONE
|
|
|
|
func (client *WANIPConnection1) GetStatusInfoCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := &struct {
|
|
|
|
NewConnectionStatus string
|
|
|
|
NewLastConnectionError string
|
|
|
|
NewUptime string
|
|
|
|
}{}
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetStatusInfo", request, response); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if NewConnectionStatus, err = soap.UnmarshalString(response.NewConnectionStatus); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewLastConnectionError, err = soap.UnmarshalString(response.NewLastConnectionError); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewUptime, err = soap.UnmarshalUi4(response.NewUptime); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetStatusInfo is the legacy version of GetStatusInfoCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANIPConnection1) GetStatusInfo() (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) {
|
|
|
|
return client.GetStatusInfoCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (client *WANIPConnection1) GetWarnDisconnectDelayCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (NewWarnDisconnectDelay uint32, err error) {
|
|
|
|
// Request structure.
|
|
|
|
request := interface{}(nil)
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewWarnDisconnectDelay string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetWarnDisconnectDelay", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewWarnDisconnectDelay, err = soap.UnmarshalUi4(response.NewWarnDisconnectDelay); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetWarnDisconnectDelay is the legacy version of GetWarnDisconnectDelayCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDelay uint32, err error) {
|
|
|
|
return client.GetWarnDisconnectDelayCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) RequestConnectionCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "RequestConnection", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// RequestConnection is the legacy version of RequestConnectionCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) RequestConnection() (err error) {
|
|
|
|
return client.RequestConnectionCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) RequestTerminationCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "RequestTermination", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// RequestTermination is the legacy version of RequestTerminationCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) RequestTermination() (err error) {
|
|
|
|
return client.RequestTerminationCtx(context.Background())
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) SetAutoDisconnectTimeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewAutoDisconnectTime uint32,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewAutoDisconnectTime string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewAutoDisconnectTime, err = soap.MarshalUi4(NewAutoDisconnectTime); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "SetAutoDisconnectTime", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetAutoDisconnectTime is the legacy version of SetAutoDisconnectTimeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uint32) (err error) {
|
|
|
|
return client.SetAutoDisconnectTimeCtx(context.Background(),
|
|
|
|
NewAutoDisconnectTime,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) SetConnectionTypeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewConnectionType string,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewConnectionType string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2022-03-13 09:02:29 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewConnectionType, err = soap.MarshalString(NewConnectionType); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "SetConnectionType", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetConnectionType is the legacy version of SetConnectionTypeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) SetConnectionType(NewConnectionType string) (err error) {
|
|
|
|
return client.SetConnectionTypeCtx(context.Background(),
|
|
|
|
NewConnectionType,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) SetIdleDisconnectTimeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewIdleDisconnectTime uint32,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewIdleDisconnectTime string
|
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewIdleDisconnectTime, err = soap.MarshalUi4(NewIdleDisconnectTime); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "SetIdleDisconnectTime", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetIdleDisconnectTime is the legacy version of SetIdleDisconnectTimeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uint32) (err error) {
|
|
|
|
return client.SetIdleDisconnectTimeCtx(context.Background(),
|
|
|
|
NewIdleDisconnectTime,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) SetWarnDisconnectDelayCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewWarnDisconnectDelay uint32,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewWarnDisconnectDelay string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewWarnDisconnectDelay, err = soap.MarshalUi4(NewWarnDisconnectDelay); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "SetWarnDisconnectDelay", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetWarnDisconnectDelay is the legacy version of SetWarnDisconnectDelayCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay uint32) (err error) {
|
|
|
|
return client.SetWarnDisconnectDelayCtx(context.Background(),
|
|
|
|
NewWarnDisconnectDelay,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// WANIPConnection2 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANIPConnection:2". See
|
|
|
|
// goupnp.ServiceClient, which contains RootDevice and Service attributes which
|
|
|
|
// are provided for informational value.
|
|
|
|
type WANIPConnection2 struct {
|
|
|
|
goupnp.ServiceClient
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANIPConnection2Clients discovers instances of the service on the network,
|
|
|
|
// and returns clients to any that are found. errors will contain an error for
|
|
|
|
// any devices that replied but which could not be queried, and err will be set
|
|
|
|
// if the discovery process failed outright.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package.
|
|
|
|
func NewWANIPConnection2Clients() (clients []*WANIPConnection2, errors []error, err error) {
|
|
|
|
var genericClients []goupnp.ServiceClient
|
|
|
|
if genericClients, errors, err = goupnp.NewServiceClients(URN_WANIPConnection_2); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
clients = newWANIPConnection2ClientsFromGenericClients(genericClients)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANIPConnection2ClientsByURL discovers instances of the service at the given
|
|
|
|
// URL, and returns clients to any that are found. An error is returned if
|
|
|
|
// there was an error probing the service.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered service URL.
|
|
|
|
func NewWANIPConnection2ClientsByURL(loc *url.URL) ([]*WANIPConnection2, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsByURL(loc, URN_WANIPConnection_2)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newWANIPConnection2ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANIPConnection2ClientsFromRootDevice discovers instances of the service in
|
|
|
|
// a given root device, and returns clients to any that are found. An error is
|
|
|
|
// returned if there was not at least one instance of the service within the
|
|
|
|
// device. The location parameter is simply assigned to the Location attribute
|
|
|
|
// of the wrapped ServiceClient(s).
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered root device.
|
|
|
|
func NewWANIPConnection2ClientsFromRootDevice(rootDevice *goupnp.RootDevice, loc *url.URL) ([]*WANIPConnection2, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsFromRootDevice(rootDevice, loc, URN_WANIPConnection_2)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newWANIPConnection2ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func newWANIPConnection2ClientsFromGenericClients(genericClients []goupnp.ServiceClient) []*WANIPConnection2 {
|
|
|
|
clients := make([]*WANIPConnection2, len(genericClients))
|
|
|
|
for i := range genericClients {
|
|
|
|
clients[i] = &WANIPConnection2{genericClients[i]}
|
|
|
|
}
|
|
|
|
return clients
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Arguments:
|
|
|
|
//
|
|
|
|
// * NewProtocol: allowed values: TCP, UDP
|
|
|
|
|
|
|
|
func (client *WANIPConnection2) AddAnyPortMappingCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
NewRemoteHost string,
|
|
|
|
NewExternalPort uint16,
|
|
|
|
NewProtocol string,
|
|
|
|
NewInternalPort uint16,
|
|
|
|
NewInternalClient string,
|
|
|
|
NewEnabled bool,
|
|
|
|
NewPortMappingDescription string,
|
|
|
|
NewLeaseDuration uint32,
|
|
|
|
) (NewReservedPort uint16, err error) {
|
|
|
|
// Request structure.
|
|
|
|
request := &struct {
|
|
|
|
NewRemoteHost string
|
|
|
|
NewExternalPort string
|
|
|
|
NewProtocol string
|
|
|
|
NewInternalPort string
|
|
|
|
NewInternalClient string
|
|
|
|
NewEnabled string
|
|
|
|
NewPortMappingDescription string
|
|
|
|
NewLeaseDuration string
|
|
|
|
}{}
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
if request.NewRemoteHost, err = soap.MarshalString(NewRemoteHost); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewExternalPort, err = soap.MarshalUi2(NewExternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewProtocol, err = soap.MarshalString(NewProtocol); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewInternalPort, err = soap.MarshalUi2(NewInternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewInternalClient, err = soap.MarshalString(NewInternalClient); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewEnabled, err = soap.MarshalBoolean(NewEnabled); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewPortMappingDescription, err = soap.MarshalString(NewPortMappingDescription); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewLeaseDuration, err = soap.MarshalUi4(NewLeaseDuration); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := &struct {
|
|
|
|
NewReservedPort string
|
|
|
|
}{}
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "AddAnyPortMapping", request, response); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if NewReservedPort, err = soap.UnmarshalUi2(response.NewReservedPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// AddAnyPortMapping is the legacy version of AddAnyPortMappingCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANIPConnection2) AddAnyPortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32) (NewReservedPort uint16, err error) {
|
|
|
|
return client.AddAnyPortMappingCtx(context.Background(),
|
|
|
|
NewRemoteHost,
|
|
|
|
NewExternalPort,
|
|
|
|
NewProtocol,
|
|
|
|
NewInternalPort,
|
|
|
|
NewInternalClient,
|
|
|
|
NewEnabled,
|
|
|
|
NewPortMappingDescription,
|
|
|
|
NewLeaseDuration,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Arguments:
|
|
|
|
//
|
|
|
|
// * NewProtocol: allowed values: TCP, UDP
|
|
|
|
|
|
|
|
func (client *WANIPConnection2) AddPortMappingCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
NewRemoteHost string,
|
|
|
|
NewExternalPort uint16,
|
|
|
|
NewProtocol string,
|
|
|
|
NewInternalPort uint16,
|
|
|
|
NewInternalClient string,
|
|
|
|
NewEnabled bool,
|
|
|
|
NewPortMappingDescription string,
|
|
|
|
NewLeaseDuration uint32,
|
|
|
|
) (err error) {
|
|
|
|
// Request structure.
|
|
|
|
request := &struct {
|
|
|
|
NewRemoteHost string
|
|
|
|
NewExternalPort string
|
|
|
|
NewProtocol string
|
|
|
|
NewInternalPort string
|
|
|
|
NewInternalClient string
|
|
|
|
NewEnabled string
|
|
|
|
NewPortMappingDescription string
|
|
|
|
NewLeaseDuration string
|
|
|
|
}{}
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
if request.NewRemoteHost, err = soap.MarshalString(NewRemoteHost); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewExternalPort, err = soap.MarshalUi2(NewExternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewProtocol, err = soap.MarshalString(NewProtocol); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewInternalPort, err = soap.MarshalUi2(NewInternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewInternalClient, err = soap.MarshalString(NewInternalClient); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewEnabled, err = soap.MarshalBoolean(NewEnabled); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewPortMappingDescription, err = soap.MarshalString(NewPortMappingDescription); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewLeaseDuration, err = soap.MarshalUi4(NewLeaseDuration); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := interface{}(nil)
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "AddPortMapping", request, response); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// AddPortMapping is the legacy version of AddPortMappingCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANIPConnection2) AddPortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32) (err error) {
|
|
|
|
return client.AddPortMappingCtx(context.Background(),
|
|
|
|
NewRemoteHost,
|
|
|
|
NewExternalPort,
|
|
|
|
NewProtocol,
|
|
|
|
NewInternalPort,
|
|
|
|
NewInternalClient,
|
|
|
|
NewEnabled,
|
|
|
|
NewPortMappingDescription,
|
|
|
|
NewLeaseDuration,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Arguments:
|
|
|
|
//
|
|
|
|
// * NewProtocol: allowed values: TCP, UDP
|
|
|
|
|
|
|
|
func (client *WANIPConnection2) DeletePortMappingCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
NewRemoteHost string,
|
|
|
|
NewExternalPort uint16,
|
|
|
|
NewProtocol string,
|
|
|
|
) (err error) {
|
|
|
|
// Request structure.
|
|
|
|
request := &struct {
|
|
|
|
NewRemoteHost string
|
|
|
|
NewExternalPort string
|
|
|
|
NewProtocol string
|
|
|
|
}{}
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
if request.NewRemoteHost, err = soap.MarshalString(NewRemoteHost); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewExternalPort, err = soap.MarshalUi2(NewExternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewProtocol, err = soap.MarshalString(NewProtocol); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := interface{}(nil)
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "DeletePortMapping", request, response); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// DeletePortMapping is the legacy version of DeletePortMappingCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANIPConnection2) DeletePortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (err error) {
|
|
|
|
return client.DeletePortMappingCtx(context.Background(),
|
|
|
|
NewRemoteHost,
|
|
|
|
NewExternalPort,
|
|
|
|
NewProtocol,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Arguments:
|
|
|
|
//
|
|
|
|
// * NewProtocol: allowed values: TCP, UDP
|
|
|
|
|
|
|
|
func (client *WANIPConnection2) DeletePortMappingRangeCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
NewStartPort uint16,
|
|
|
|
NewEndPort uint16,
|
|
|
|
NewProtocol string,
|
|
|
|
NewManage bool,
|
|
|
|
) (err error) {
|
|
|
|
// Request structure.
|
|
|
|
request := &struct {
|
|
|
|
NewStartPort string
|
|
|
|
NewEndPort string
|
|
|
|
NewProtocol string
|
|
|
|
NewManage string
|
|
|
|
}{}
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
if request.NewStartPort, err = soap.MarshalUi2(NewStartPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewEndPort, err = soap.MarshalUi2(NewEndPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewProtocol, err = soap.MarshalString(NewProtocol); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewManage, err = soap.MarshalBoolean(NewManage); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "DeletePortMappingRange", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// DeletePortMappingRange is the legacy version of DeletePortMappingRangeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) DeletePortMappingRange(NewStartPort uint16, NewEndPort uint16, NewProtocol string, NewManage bool) (err error) {
|
|
|
|
return client.DeletePortMappingRangeCtx(context.Background(),
|
|
|
|
NewStartPort,
|
|
|
|
NewEndPort,
|
|
|
|
NewProtocol,
|
|
|
|
NewManage,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) ForceTerminationCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "ForceTermination", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// ForceTermination is the legacy version of ForceTerminationCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) ForceTermination() (err error) {
|
|
|
|
return client.ForceTerminationCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) GetAutoDisconnectTimeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewAutoDisconnectTime uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewAutoDisconnectTime string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetAutoDisconnectTime", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewAutoDisconnectTime, err = soap.UnmarshalUi4(response.NewAutoDisconnectTime); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetAutoDisconnectTime is the legacy version of GetAutoDisconnectTimeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) GetAutoDisconnectTime() (NewAutoDisconnectTime uint32, err error) {
|
|
|
|
return client.GetAutoDisconnectTimeCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) GetConnectionTypeInfoCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewConnectionType string, NewPossibleConnectionTypes string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewConnectionType string
|
|
|
|
NewPossibleConnectionTypes string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetConnectionTypeInfo", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewConnectionType, err = soap.UnmarshalString(response.NewConnectionType); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewPossibleConnectionTypes, err = soap.UnmarshalString(response.NewPossibleConnectionTypes); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetConnectionTypeInfo is the legacy version of GetConnectionTypeInfoCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) GetConnectionTypeInfo() (NewConnectionType string, NewPossibleConnectionTypes string, err error) {
|
|
|
|
return client.GetConnectionTypeInfoCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) GetExternalIPAddressCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewExternalIPAddress string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewExternalIPAddress string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetExternalIPAddress", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewExternalIPAddress, err = soap.UnmarshalString(response.NewExternalIPAddress); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetExternalIPAddress is the legacy version of GetExternalIPAddressCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) GetExternalIPAddress() (NewExternalIPAddress string, err error) {
|
|
|
|
return client.GetExternalIPAddressCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
//
|
|
|
|
// Return values:
|
|
|
|
//
|
|
|
|
// * NewProtocol: allowed values: TCP, UDP
|
|
|
|
func (client *WANIPConnection2) GetGenericPortMappingEntryCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewPortMappingIndex uint16,
|
|
|
|
) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewPortMappingIndex string
|
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewPortMappingIndex, err = soap.MarshalUi2(NewPortMappingIndex); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewRemoteHost string
|
|
|
|
NewExternalPort string
|
|
|
|
NewProtocol string
|
|
|
|
NewInternalPort string
|
|
|
|
NewInternalClient string
|
|
|
|
NewEnabled string
|
|
|
|
NewPortMappingDescription string
|
|
|
|
NewLeaseDuration string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetGenericPortMappingEntry", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewRemoteHost, err = soap.UnmarshalString(response.NewRemoteHost); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewExternalPort, err = soap.UnmarshalUi2(response.NewExternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewProtocol, err = soap.UnmarshalString(response.NewProtocol); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewInternalPort, err = soap.UnmarshalUi2(response.NewInternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewInternalClient, err = soap.UnmarshalString(response.NewInternalClient); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewEnabled, err = soap.UnmarshalBoolean(response.NewEnabled); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewPortMappingDescription, err = soap.UnmarshalString(response.NewPortMappingDescription); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewLeaseDuration, err = soap.UnmarshalUi4(response.NewLeaseDuration); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetGenericPortMappingEntry is the legacy version of GetGenericPortMappingEntryCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) GetGenericPortMappingEntry(NewPortMappingIndex uint16) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) {
|
|
|
|
return client.GetGenericPortMappingEntryCtx(context.Background(),
|
|
|
|
NewPortMappingIndex,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) GetIdleDisconnectTimeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewIdleDisconnectTime uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewIdleDisconnectTime string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetIdleDisconnectTime", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewIdleDisconnectTime, err = soap.UnmarshalUi4(response.NewIdleDisconnectTime); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetIdleDisconnectTime is the legacy version of GetIdleDisconnectTimeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) GetIdleDisconnectTime() (NewIdleDisconnectTime uint32, err error) {
|
|
|
|
return client.GetIdleDisconnectTimeCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 22:16:53 +00:00
|
|
|
//
|
2022-03-13 09:02:29 +00:00
|
|
|
// Arguments:
|
2013-12-31 18:04:59 +00:00
|
|
|
//
|
2013-12-31 17:52:43 +00:00
|
|
|
// * NewProtocol: allowed values: TCP, UDP
|
2022-03-13 09:02:29 +00:00
|
|
|
|
|
|
|
func (client *WANIPConnection2) GetListOfPortMappingsCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewStartPort uint16,
|
|
|
|
NewEndPort uint16,
|
|
|
|
NewProtocol string,
|
|
|
|
NewManage bool,
|
|
|
|
NewNumberOfPorts uint16,
|
|
|
|
) (NewPortListing string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewStartPort string
|
|
|
|
NewEndPort string
|
|
|
|
NewProtocol string
|
|
|
|
NewManage string
|
|
|
|
NewNumberOfPorts string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewStartPort, err = soap.MarshalUi2(NewStartPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewEndPort, err = soap.MarshalUi2(NewEndPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewProtocol, err = soap.MarshalString(NewProtocol); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewManage, err = soap.MarshalBoolean(NewManage); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewNumberOfPorts, err = soap.MarshalUi2(NewNumberOfPorts); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewPortListing string
|
|
|
|
}{}
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetListOfPortMappings", request, response); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if NewPortListing, err = soap.UnmarshalString(response.NewPortListing); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetListOfPortMappings is the legacy version of GetListOfPortMappingsCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANIPConnection2) GetListOfPortMappings(NewStartPort uint16, NewEndPort uint16, NewProtocol string, NewManage bool, NewNumberOfPorts uint16) (NewPortListing string, err error) {
|
|
|
|
return client.GetListOfPortMappingsCtx(context.Background(),
|
|
|
|
NewStartPort,
|
|
|
|
NewEndPort,
|
|
|
|
NewProtocol,
|
|
|
|
NewManage,
|
|
|
|
NewNumberOfPorts,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (client *WANIPConnection2) GetNATRSIPStatusCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (NewRSIPAvailable bool, NewNATEnabled bool, err error) {
|
|
|
|
// Request structure.
|
|
|
|
request := interface{}(nil)
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := &struct {
|
|
|
|
NewRSIPAvailable string
|
|
|
|
NewNATEnabled string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetNATRSIPStatus", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewRSIPAvailable, err = soap.UnmarshalBoolean(response.NewRSIPAvailable); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewNATEnabled, err = soap.UnmarshalBoolean(response.NewNATEnabled); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetNATRSIPStatus is the legacy version of GetNATRSIPStatusCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNATEnabled bool, err error) {
|
|
|
|
return client.GetNATRSIPStatusCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 22:16:53 +00:00
|
|
|
//
|
2015-06-07 09:42:22 +00:00
|
|
|
// Arguments:
|
2013-10-06 22:16:53 +00:00
|
|
|
//
|
2013-12-31 17:52:43 +00:00
|
|
|
// * NewProtocol: allowed values: TCP, UDP
|
2015-06-07 09:42:22 +00:00
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
func (client *WANIPConnection2) GetSpecificPortMappingEntryCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
NewRemoteHost string,
|
|
|
|
NewExternalPort uint16,
|
|
|
|
NewProtocol string,
|
|
|
|
) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2017-11-05 13:50:25 +00:00
|
|
|
NewRemoteHost string
|
2013-12-31 17:06:15 +00:00
|
|
|
NewExternalPort string
|
2017-11-05 13:50:25 +00:00
|
|
|
NewProtocol string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
if request.NewRemoteHost, err = soap.MarshalString(NewRemoteHost); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewExternalPort, err = soap.MarshalUi2(NewExternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewProtocol, err = soap.MarshalString(NewProtocol); err != nil {
|
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2017-11-05 13:50:25 +00:00
|
|
|
NewInternalPort string
|
|
|
|
NewInternalClient string
|
|
|
|
NewEnabled string
|
2013-12-31 17:06:15 +00:00
|
|
|
NewPortMappingDescription string
|
2017-11-05 13:50:25 +00:00
|
|
|
NewLeaseDuration string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetSpecificPortMappingEntry", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if NewInternalPort, err = soap.UnmarshalUi2(response.NewInternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewInternalClient, err = soap.UnmarshalString(response.NewInternalClient); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewEnabled, err = soap.UnmarshalBoolean(response.NewEnabled); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewPortMappingDescription, err = soap.UnmarshalString(response.NewPortMappingDescription); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewLeaseDuration, err = soap.UnmarshalUi4(response.NewLeaseDuration); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetSpecificPortMappingEntry is the legacy version of GetSpecificPortMappingEntryCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANIPConnection2) GetSpecificPortMappingEntry(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) {
|
|
|
|
return client.GetSpecificPortMappingEntryCtx(context.Background(),
|
|
|
|
NewRemoteHost,
|
|
|
|
NewExternalPort,
|
|
|
|
NewProtocol,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2013-10-06 22:16:53 +00:00
|
|
|
//
|
2022-03-13 09:02:29 +00:00
|
|
|
// Return values:
|
2013-10-06 22:16:53 +00:00
|
|
|
//
|
2022-03-13 09:02:29 +00:00
|
|
|
// * NewConnectionStatus: allowed values: Unconfigured, Connecting, Connected, PendingDisconnect, Disconnecting, Disconnected
|
|
|
|
//
|
|
|
|
// * NewLastConnectionError: allowed values: ERROR_NONE, ERROR_COMMAND_ABORTED, ERROR_NOT_ENABLED_FOR_INTERNET, ERROR_USER_DISCONNECT, ERROR_ISP_DISCONNECT, ERROR_IDLE_DISCONNECT, ERROR_FORCED_DISCONNECT, ERROR_NO_CARRIER, ERROR_IP_CONFIGURATION, ERROR_UNKNOWN
|
|
|
|
func (client *WANIPConnection2) GetStatusInfoCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := &struct {
|
|
|
|
NewConnectionStatus string
|
|
|
|
NewLastConnectionError string
|
|
|
|
NewUptime string
|
|
|
|
}{}
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetStatusInfo", request, response); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if NewConnectionStatus, err = soap.UnmarshalString(response.NewConnectionStatus); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewLastConnectionError, err = soap.UnmarshalString(response.NewLastConnectionError); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewUptime, err = soap.UnmarshalUi4(response.NewUptime); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetStatusInfo is the legacy version of GetStatusInfoCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANIPConnection2) GetStatusInfo() (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) {
|
|
|
|
return client.GetStatusInfoCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (client *WANIPConnection2) GetWarnDisconnectDelayCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (NewWarnDisconnectDelay uint32, err error) {
|
|
|
|
// Request structure.
|
|
|
|
request := interface{}(nil)
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := &struct {
|
|
|
|
NewWarnDisconnectDelay string
|
|
|
|
}{}
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetWarnDisconnectDelay", request, response); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if NewWarnDisconnectDelay, err = soap.UnmarshalUi4(response.NewWarnDisconnectDelay); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetWarnDisconnectDelay is the legacy version of GetWarnDisconnectDelayCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANIPConnection2) GetWarnDisconnectDelay() (NewWarnDisconnectDelay uint32, err error) {
|
|
|
|
return client.GetWarnDisconnectDelayCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (client *WANIPConnection2) RequestConnectionCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (err error) {
|
|
|
|
// Request structure.
|
|
|
|
request := interface{}(nil)
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "RequestConnection", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// RequestConnection is the legacy version of RequestConnectionCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) RequestConnection() (err error) {
|
|
|
|
return client.RequestConnectionCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) RequestTerminationCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "RequestTermination", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// RequestTermination is the legacy version of RequestTerminationCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) RequestTermination() (err error) {
|
|
|
|
return client.RequestTerminationCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) SetAutoDisconnectTimeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewAutoDisconnectTime uint32,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewAutoDisconnectTime string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewAutoDisconnectTime, err = soap.MarshalUi4(NewAutoDisconnectTime); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "SetAutoDisconnectTime", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetAutoDisconnectTime is the legacy version of SetAutoDisconnectTimeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) SetAutoDisconnectTime(NewAutoDisconnectTime uint32) (err error) {
|
|
|
|
return client.SetAutoDisconnectTimeCtx(context.Background(),
|
|
|
|
NewAutoDisconnectTime,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) SetConnectionTypeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewConnectionType string,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewConnectionType string
|
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewConnectionType, err = soap.MarshalString(NewConnectionType); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "SetConnectionType", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetConnectionType is the legacy version of SetConnectionTypeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) SetConnectionType(NewConnectionType string) (err error) {
|
|
|
|
return client.SetConnectionTypeCtx(context.Background(),
|
|
|
|
NewConnectionType,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) SetIdleDisconnectTimeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewIdleDisconnectTime uint32,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewIdleDisconnectTime string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewIdleDisconnectTime, err = soap.MarshalUi4(NewIdleDisconnectTime); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "SetIdleDisconnectTime", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetIdleDisconnectTime is the legacy version of SetIdleDisconnectTimeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) SetIdleDisconnectTime(NewIdleDisconnectTime uint32) (err error) {
|
|
|
|
return client.SetIdleDisconnectTimeCtx(context.Background(),
|
|
|
|
NewIdleDisconnectTime,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) SetWarnDisconnectDelayCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewWarnDisconnectDelay uint32,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewWarnDisconnectDelay string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewWarnDisconnectDelay, err = soap.MarshalUi4(NewWarnDisconnectDelay); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "SetWarnDisconnectDelay", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetWarnDisconnectDelay is the legacy version of SetWarnDisconnectDelayCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPConnection2) SetWarnDisconnectDelay(NewWarnDisconnectDelay uint32) (err error) {
|
|
|
|
return client.SetWarnDisconnectDelayCtx(context.Background(),
|
|
|
|
NewWarnDisconnectDelay,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2013-12-31 20:01:17 +00:00
|
|
|
// WANIPv6FirewallControl1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANIPv6FirewallControl:1". See
|
|
|
|
// goupnp.ServiceClient, which contains RootDevice and Service attributes which
|
|
|
|
// are provided for informational value.
|
2013-10-06 22:16:53 +00:00
|
|
|
type WANIPv6FirewallControl1 struct {
|
2013-12-31 20:01:17 +00:00
|
|
|
goupnp.ServiceClient
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANIPv6FirewallControl1Clients discovers instances of the service on the network,
|
|
|
|
// and returns clients to any that are found. errors will contain an error for
|
|
|
|
// any devices that replied but which could not be queried, and err will be set
|
|
|
|
// if the discovery process failed outright.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package.
|
|
|
|
func NewWANIPv6FirewallControl1Clients() (clients []*WANIPv6FirewallControl1, errors []error, err error) {
|
|
|
|
var genericClients []goupnp.ServiceClient
|
|
|
|
if genericClients, errors, err = goupnp.NewServiceClients(URN_WANIPv6FirewallControl_1); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
clients = newWANIPv6FirewallControl1ClientsFromGenericClients(genericClients)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANIPv6FirewallControl1ClientsByURL discovers instances of the service at the given
|
|
|
|
// URL, and returns clients to any that are found. An error is returned if
|
|
|
|
// there was an error probing the service.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered service URL.
|
|
|
|
func NewWANIPv6FirewallControl1ClientsByURL(loc *url.URL) ([]*WANIPv6FirewallControl1, error) {
|
2022-03-13 09:02:29 +00:00
|
|
|
genericClients, err := goupnp.NewServiceClientsByURL(loc, URN_WANIPv6FirewallControl_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
return newWANIPv6FirewallControl1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// NewWANIPv6FirewallControl1ClientsFromRootDevice discovers instances of the service in
|
|
|
|
// a given root device, and returns clients to any that are found. An error is
|
|
|
|
// returned if there was not at least one instance of the service within the
|
|
|
|
// device. The location parameter is simply assigned to the Location attribute
|
|
|
|
// of the wrapped ServiceClient(s).
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered root device.
|
|
|
|
func NewWANIPv6FirewallControl1ClientsFromRootDevice(rootDevice *goupnp.RootDevice, loc *url.URL) ([]*WANIPv6FirewallControl1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsFromRootDevice(rootDevice, loc, URN_WANIPv6FirewallControl_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
2013-12-31 16:56:20 +00:00
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
return newWANIPv6FirewallControl1ClientsFromGenericClients(genericClients), nil
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func newWANIPv6FirewallControl1ClientsFromGenericClients(genericClients []goupnp.ServiceClient) []*WANIPv6FirewallControl1 {
|
|
|
|
clients := make([]*WANIPv6FirewallControl1, len(genericClients))
|
|
|
|
for i := range genericClients {
|
|
|
|
clients[i] = &WANIPv6FirewallControl1{genericClients[i]}
|
|
|
|
}
|
|
|
|
return clients
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 22:16:53 +00:00
|
|
|
//
|
2015-06-07 09:42:22 +00:00
|
|
|
// Arguments:
|
2013-10-06 22:16:53 +00:00
|
|
|
//
|
2013-12-31 17:52:43 +00:00
|
|
|
// * LeaseTime: allowed value range: minimum=1, maximum=86400
|
2015-06-07 09:42:22 +00:00
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
func (client *WANIPv6FirewallControl1) AddPinholeCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
RemoteHost string,
|
|
|
|
RemotePort uint16,
|
|
|
|
InternalClient string,
|
|
|
|
InternalPort uint16,
|
|
|
|
Protocol uint16,
|
|
|
|
LeaseTime uint32,
|
|
|
|
) (UniqueID uint16, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2017-11-05 13:50:25 +00:00
|
|
|
RemoteHost string
|
|
|
|
RemotePort string
|
2013-12-31 17:06:15 +00:00
|
|
|
InternalClient string
|
2017-11-05 13:50:25 +00:00
|
|
|
InternalPort string
|
|
|
|
Protocol string
|
|
|
|
LeaseTime string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
if request.RemoteHost, err = soap.MarshalString(RemoteHost); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.RemotePort, err = soap.MarshalUi2(RemotePort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.InternalClient, err = soap.MarshalString(InternalClient); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.InternalPort, err = soap.MarshalUi2(InternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.Protocol, err = soap.MarshalUi2(Protocol); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.LeaseTime, err = soap.MarshalUi4(LeaseTime); err != nil {
|
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2013-12-31 17:06:15 +00:00
|
|
|
UniqueID string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPv6FirewallControl_1, "AddPinhole", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if UniqueID, err = soap.UnmarshalUi2(response.UniqueID); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// AddPinhole is the legacy version of AddPinholeCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANIPv6FirewallControl1) AddPinhole(RemoteHost string, RemotePort uint16, InternalClient string, InternalPort uint16, Protocol uint16, LeaseTime uint32) (UniqueID uint16, err error) {
|
|
|
|
return client.AddPinholeCtx(context.Background(),
|
|
|
|
RemoteHost,
|
|
|
|
RemotePort,
|
|
|
|
InternalClient,
|
|
|
|
InternalPort,
|
|
|
|
Protocol,
|
|
|
|
LeaseTime,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPv6FirewallControl1) CheckPinholeWorkingCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
|
|
|
UniqueID uint16,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (IsWorking bool, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
UniqueID string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
if request.UniqueID, err = soap.MarshalUi2(UniqueID); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
IsWorking string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPv6FirewallControl_1, "CheckPinholeWorking", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if IsWorking, err = soap.UnmarshalBoolean(response.IsWorking); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// CheckPinholeWorking is the legacy version of CheckPinholeWorkingCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPv6FirewallControl1) CheckPinholeWorking(UniqueID uint16) (IsWorking bool, err error) {
|
|
|
|
return client.CheckPinholeWorkingCtx(context.Background(),
|
2021-07-11 13:53:32 +00:00
|
|
|
UniqueID,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (client *WANIPv6FirewallControl1) DeletePinholeCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
UniqueID uint16,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2013-12-31 17:06:15 +00:00
|
|
|
UniqueID string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
if request.UniqueID, err = soap.MarshalUi2(UniqueID); err != nil {
|
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPv6FirewallControl_1, "DeletePinhole", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// DeletePinhole is the legacy version of DeletePinholeCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANIPv6FirewallControl1) DeletePinhole(UniqueID uint16) (err error) {
|
|
|
|
return client.DeletePinholeCtx(context.Background(),
|
|
|
|
UniqueID,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPv6FirewallControl1) GetFirewallStatusCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (FirewallEnabled bool, InboundPinholeAllowed bool, err error) {
|
|
|
|
// Request structure.
|
|
|
|
request := interface{}(nil)
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := &struct {
|
|
|
|
FirewallEnabled string
|
|
|
|
InboundPinholeAllowed string
|
|
|
|
}{}
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPv6FirewallControl_1, "GetFirewallStatus", request, response); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if FirewallEnabled, err = soap.UnmarshalBoolean(response.FirewallEnabled); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if InboundPinholeAllowed, err = soap.UnmarshalBoolean(response.InboundPinholeAllowed); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetFirewallStatus is the legacy version of GetFirewallStatusCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANIPv6FirewallControl1) GetFirewallStatus() (FirewallEnabled bool, InboundPinholeAllowed bool, err error) {
|
|
|
|
return client.GetFirewallStatusCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (client *WANIPv6FirewallControl1) GetOutboundPinholeTimeoutCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
RemoteHost string,
|
|
|
|
RemotePort uint16,
|
|
|
|
InternalClient string,
|
|
|
|
InternalPort uint16,
|
|
|
|
Protocol uint16,
|
|
|
|
) (OutboundPinholeTimeout uint32, err error) {
|
|
|
|
// Request structure.
|
|
|
|
request := &struct {
|
|
|
|
RemoteHost string
|
|
|
|
RemotePort string
|
|
|
|
InternalClient string
|
|
|
|
InternalPort string
|
|
|
|
Protocol string
|
|
|
|
}{}
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
if request.RemoteHost, err = soap.MarshalString(RemoteHost); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.RemotePort, err = soap.MarshalUi2(RemotePort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.InternalClient, err = soap.MarshalString(InternalClient); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.InternalPort, err = soap.MarshalUi2(InternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.Protocol, err = soap.MarshalUi2(Protocol); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
|
|
|
// Response structure.
|
|
|
|
response := &struct {
|
|
|
|
OutboundPinholeTimeout string
|
|
|
|
}{}
|
|
|
|
|
|
|
|
// Perform the SOAP call.
|
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPv6FirewallControl_1, "GetOutboundPinholeTimeout", request, response); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if OutboundPinholeTimeout, err = soap.UnmarshalUi4(response.OutboundPinholeTimeout); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetOutboundPinholeTimeout is the legacy version of GetOutboundPinholeTimeoutCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANIPv6FirewallControl1) GetOutboundPinholeTimeout(RemoteHost string, RemotePort uint16, InternalClient string, InternalPort uint16, Protocol uint16) (OutboundPinholeTimeout uint32, err error) {
|
|
|
|
return client.GetOutboundPinholeTimeoutCtx(context.Background(),
|
|
|
|
RemoteHost,
|
|
|
|
RemotePort,
|
|
|
|
InternalClient,
|
|
|
|
InternalPort,
|
|
|
|
Protocol,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
func (client *WANIPv6FirewallControl1) GetPinholePacketsCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
UniqueID uint16,
|
|
|
|
) (PinholePackets uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2013-12-31 17:06:15 +00:00
|
|
|
UniqueID string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
if request.UniqueID, err = soap.MarshalUi2(UniqueID); err != nil {
|
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2013-12-31 17:06:15 +00:00
|
|
|
PinholePackets string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPv6FirewallControl_1, "GetPinholePackets", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
if PinholePackets, err = soap.UnmarshalUi4(response.PinholePackets); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetPinholePackets is the legacy version of GetPinholePacketsCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANIPv6FirewallControl1) GetPinholePackets(UniqueID uint16) (PinholePackets uint32, err error) {
|
|
|
|
return client.GetPinholePacketsCtx(context.Background(),
|
|
|
|
UniqueID,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
//
|
|
|
|
// Arguments:
|
|
|
|
//
|
|
|
|
// * NewLeaseTime: allowed value range: minimum=1, maximum=86400
|
|
|
|
|
|
|
|
func (client *WANIPv6FirewallControl1) UpdatePinholeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
|
|
|
UniqueID uint16,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewLeaseTime uint32,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
UniqueID string
|
|
|
|
NewLeaseTime string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
if request.UniqueID, err = soap.MarshalUi2(UniqueID); err != nil {
|
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewLeaseTime, err = soap.MarshalUi4(NewLeaseTime); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPv6FirewallControl_1, "UpdatePinhole", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// UpdatePinhole is the legacy version of UpdatePinholeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANIPv6FirewallControl1) UpdatePinhole(UniqueID uint16, NewLeaseTime uint32) (err error) {
|
|
|
|
return client.UpdatePinholeCtx(context.Background(),
|
2021-07-11 13:53:32 +00:00
|
|
|
UniqueID,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewLeaseTime,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2013-12-31 20:01:17 +00:00
|
|
|
// WANPOTSLinkConfig1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANPOTSLinkConfig:1". See
|
|
|
|
// goupnp.ServiceClient, which contains RootDevice and Service attributes which
|
|
|
|
// are provided for informational value.
|
2013-10-06 22:16:53 +00:00
|
|
|
type WANPOTSLinkConfig1 struct {
|
2013-12-31 20:01:17 +00:00
|
|
|
goupnp.ServiceClient
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANPOTSLinkConfig1Clients discovers instances of the service on the network,
|
|
|
|
// and returns clients to any that are found. errors will contain an error for
|
|
|
|
// any devices that replied but which could not be queried, and err will be set
|
|
|
|
// if the discovery process failed outright.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package.
|
|
|
|
func NewWANPOTSLinkConfig1Clients() (clients []*WANPOTSLinkConfig1, errors []error, err error) {
|
|
|
|
var genericClients []goupnp.ServiceClient
|
|
|
|
if genericClients, errors, err = goupnp.NewServiceClients(URN_WANPOTSLinkConfig_1); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
clients = newWANPOTSLinkConfig1ClientsFromGenericClients(genericClients)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANPOTSLinkConfig1ClientsByURL discovers instances of the service at the given
|
|
|
|
// URL, and returns clients to any that are found. An error is returned if
|
|
|
|
// there was an error probing the service.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered service URL.
|
|
|
|
func NewWANPOTSLinkConfig1ClientsByURL(loc *url.URL) ([]*WANPOTSLinkConfig1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsByURL(loc, URN_WANPOTSLinkConfig_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newWANPOTSLinkConfig1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANPOTSLinkConfig1ClientsFromRootDevice discovers instances of the service in
|
|
|
|
// a given root device, and returns clients to any that are found. An error is
|
|
|
|
// returned if there was not at least one instance of the service within the
|
|
|
|
// device. The location parameter is simply assigned to the Location attribute
|
|
|
|
// of the wrapped ServiceClient(s).
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered root device.
|
|
|
|
func NewWANPOTSLinkConfig1ClientsFromRootDevice(rootDevice *goupnp.RootDevice, loc *url.URL) ([]*WANPOTSLinkConfig1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsFromRootDevice(rootDevice, loc, URN_WANPOTSLinkConfig_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newWANPOTSLinkConfig1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func newWANPOTSLinkConfig1ClientsFromGenericClients(genericClients []goupnp.ServiceClient) []*WANPOTSLinkConfig1 {
|
|
|
|
clients := make([]*WANPOTSLinkConfig1, len(genericClients))
|
2013-12-31 20:01:17 +00:00
|
|
|
for i := range genericClients {
|
|
|
|
clients[i] = &WANPOTSLinkConfig1{genericClients[i]}
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
return clients
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPOTSLinkConfig1) GetCallRetryInfoCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewNumberOfRetries uint32, NewDelayBetweenRetries uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewNumberOfRetries string
|
|
|
|
NewDelayBetweenRetries string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetCallRetryInfo", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewNumberOfRetries, err = soap.UnmarshalUi4(response.NewNumberOfRetries); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewDelayBetweenRetries, err = soap.UnmarshalUi4(response.NewDelayBetweenRetries); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetCallRetryInfo is the legacy version of GetCallRetryInfoCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPOTSLinkConfig1) GetCallRetryInfo() (NewNumberOfRetries uint32, NewDelayBetweenRetries uint32, err error) {
|
|
|
|
return client.GetCallRetryInfoCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPOTSLinkConfig1) GetDataCompressionCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewDataCompression string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewDataCompression string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetDataCompression", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewDataCompression, err = soap.UnmarshalString(response.NewDataCompression); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetDataCompression is the legacy version of GetDataCompressionCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPOTSLinkConfig1) GetDataCompression() (NewDataCompression string, err error) {
|
|
|
|
return client.GetDataCompressionCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPOTSLinkConfig1) GetDataModulationSupportedCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewDataModulationSupported string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewDataModulationSupported string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetDataModulationSupported", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewDataModulationSupported, err = soap.UnmarshalString(response.NewDataModulationSupported); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetDataModulationSupported is the legacy version of GetDataModulationSupportedCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPOTSLinkConfig1) GetDataModulationSupported() (NewDataModulationSupported string, err error) {
|
|
|
|
return client.GetDataModulationSupportedCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPOTSLinkConfig1) GetDataProtocolCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewDataProtocol string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewDataProtocol string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetDataProtocol", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewDataProtocol, err = soap.UnmarshalString(response.NewDataProtocol); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetDataProtocol is the legacy version of GetDataProtocolCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPOTSLinkConfig1) GetDataProtocol() (NewDataProtocol string, err error) {
|
|
|
|
return client.GetDataProtocolCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (client *WANPOTSLinkConfig1) GetFclassCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (NewFclass string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2013-12-31 17:06:15 +00:00
|
|
|
NewFclass string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetFclass", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
if NewFclass, err = soap.UnmarshalString(response.NewFclass); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetFclass is the legacy version of GetFclassCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANPOTSLinkConfig1) GetFclass() (NewFclass string, err error) {
|
|
|
|
return client.GetFclassCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
//
|
|
|
|
// Return values:
|
|
|
|
//
|
|
|
|
// * NewLinkType: allowed values: PPP_Dialup
|
|
|
|
func (client *WANPOTSLinkConfig1) GetISPInfoCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewISPPhoneNumber string, NewISPInfo string, NewLinkType string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewISPPhoneNumber string
|
|
|
|
NewISPInfo string
|
|
|
|
NewLinkType string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetISPInfo", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewISPPhoneNumber, err = soap.UnmarshalString(response.NewISPPhoneNumber); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewISPInfo, err = soap.UnmarshalString(response.NewISPInfo); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewLinkType, err = soap.UnmarshalString(response.NewLinkType); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetISPInfo is the legacy version of GetISPInfoCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPOTSLinkConfig1) GetISPInfo() (NewISPPhoneNumber string, NewISPInfo string, NewLinkType string, err error) {
|
|
|
|
return client.GetISPInfoCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPOTSLinkConfig1) GetPlusVTRCommandSupportedCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewPlusVTRCommandSupported bool, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewPlusVTRCommandSupported string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetPlusVTRCommandSupported", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewPlusVTRCommandSupported, err = soap.UnmarshalBoolean(response.NewPlusVTRCommandSupported); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetPlusVTRCommandSupported is the legacy version of GetPlusVTRCommandSupportedCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPOTSLinkConfig1) GetPlusVTRCommandSupported() (NewPlusVTRCommandSupported bool, err error) {
|
|
|
|
return client.GetPlusVTRCommandSupportedCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPOTSLinkConfig1) SetCallRetryInfoCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewNumberOfRetries uint32,
|
|
|
|
NewDelayBetweenRetries uint32,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewNumberOfRetries string
|
|
|
|
NewDelayBetweenRetries string
|
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewNumberOfRetries, err = soap.MarshalUi4(NewNumberOfRetries); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewDelayBetweenRetries, err = soap.MarshalUi4(NewDelayBetweenRetries); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "SetCallRetryInfo", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetCallRetryInfo is the legacy version of SetCallRetryInfoCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPOTSLinkConfig1) SetCallRetryInfo(NewNumberOfRetries uint32, NewDelayBetweenRetries uint32) (err error) {
|
|
|
|
return client.SetCallRetryInfoCtx(context.Background(),
|
|
|
|
NewNumberOfRetries,
|
|
|
|
NewDelayBetweenRetries,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
//
|
|
|
|
// Arguments:
|
|
|
|
//
|
|
|
|
// * NewLinkType: allowed values: PPP_Dialup
|
|
|
|
|
|
|
|
func (client *WANPOTSLinkConfig1) SetISPInfoCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewISPPhoneNumber string,
|
|
|
|
NewISPInfo string,
|
|
|
|
NewLinkType string,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewISPPhoneNumber string
|
|
|
|
NewISPInfo string
|
|
|
|
NewLinkType string
|
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewISPPhoneNumber, err = soap.MarshalString(NewISPPhoneNumber); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewISPInfo, err = soap.MarshalString(NewISPInfo); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewLinkType, err = soap.MarshalString(NewLinkType); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "SetISPInfo", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetISPInfo is the legacy version of SetISPInfoCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPOTSLinkConfig1) SetISPInfo(NewISPPhoneNumber string, NewISPInfo string, NewLinkType string) (err error) {
|
|
|
|
return client.SetISPInfoCtx(context.Background(),
|
|
|
|
NewISPPhoneNumber,
|
|
|
|
NewISPInfo,
|
|
|
|
NewLinkType,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2013-12-31 20:01:17 +00:00
|
|
|
// WANPPPConnection1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANPPPConnection:1". See
|
|
|
|
// goupnp.ServiceClient, which contains RootDevice and Service attributes which
|
|
|
|
// are provided for informational value.
|
2013-10-06 22:16:53 +00:00
|
|
|
type WANPPPConnection1 struct {
|
2013-12-31 20:01:17 +00:00
|
|
|
goupnp.ServiceClient
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANPPPConnection1Clients discovers instances of the service on the network,
|
|
|
|
// and returns clients to any that are found. errors will contain an error for
|
|
|
|
// any devices that replied but which could not be queried, and err will be set
|
|
|
|
// if the discovery process failed outright.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package.
|
|
|
|
func NewWANPPPConnection1Clients() (clients []*WANPPPConnection1, errors []error, err error) {
|
|
|
|
var genericClients []goupnp.ServiceClient
|
|
|
|
if genericClients, errors, err = goupnp.NewServiceClients(URN_WANPPPConnection_1); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2015-06-06 10:53:50 +00:00
|
|
|
clients = newWANPPPConnection1ClientsFromGenericClients(genericClients)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANPPPConnection1ClientsByURL discovers instances of the service at the given
|
|
|
|
// URL, and returns clients to any that are found. An error is returned if
|
|
|
|
// there was an error probing the service.
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered service URL.
|
|
|
|
func NewWANPPPConnection1ClientsByURL(loc *url.URL) ([]*WANPPPConnection1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsByURL(loc, URN_WANPPPConnection_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newWANPPPConnection1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWANPPPConnection1ClientsFromRootDevice discovers instances of the service in
|
|
|
|
// a given root device, and returns clients to any that are found. An error is
|
|
|
|
// returned if there was not at least one instance of the service within the
|
|
|
|
// device. The location parameter is simply assigned to the Location attribute
|
|
|
|
// of the wrapped ServiceClient(s).
|
|
|
|
//
|
|
|
|
// This is a typical entry calling point into this package when reusing an
|
|
|
|
// previously discovered root device.
|
|
|
|
func NewWANPPPConnection1ClientsFromRootDevice(rootDevice *goupnp.RootDevice, loc *url.URL) ([]*WANPPPConnection1, error) {
|
|
|
|
genericClients, err := goupnp.NewServiceClientsFromRootDevice(rootDevice, loc, URN_WANPPPConnection_1)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return newWANPPPConnection1ClientsFromGenericClients(genericClients), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func newWANPPPConnection1ClientsFromGenericClients(genericClients []goupnp.ServiceClient) []*WANPPPConnection1 {
|
|
|
|
clients := make([]*WANPPPConnection1, len(genericClients))
|
2013-12-31 20:01:17 +00:00
|
|
|
for i := range genericClients {
|
|
|
|
clients[i] = &WANPPPConnection1{genericClients[i]}
|
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
return clients
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Arguments:
|
|
|
|
//
|
|
|
|
// * NewProtocol: allowed values: TCP, UDP
|
|
|
|
|
|
|
|
func (client *WANPPPConnection1) AddPortMappingCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
NewRemoteHost string,
|
|
|
|
NewExternalPort uint16,
|
|
|
|
NewProtocol string,
|
|
|
|
NewInternalPort uint16,
|
|
|
|
NewInternalClient string,
|
|
|
|
NewEnabled bool,
|
|
|
|
NewPortMappingDescription string,
|
|
|
|
NewLeaseDuration uint32,
|
|
|
|
) (err error) {
|
|
|
|
// Request structure.
|
|
|
|
request := &struct {
|
|
|
|
NewRemoteHost string
|
|
|
|
NewExternalPort string
|
|
|
|
NewProtocol string
|
|
|
|
NewInternalPort string
|
|
|
|
NewInternalClient string
|
|
|
|
NewEnabled string
|
|
|
|
NewPortMappingDescription string
|
|
|
|
NewLeaseDuration string
|
|
|
|
}{}
|
|
|
|
// BEGIN Marshal arguments into request.
|
|
|
|
|
|
|
|
if request.NewRemoteHost, err = soap.MarshalString(NewRemoteHost); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewExternalPort, err = soap.MarshalUi2(NewExternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewProtocol, err = soap.MarshalString(NewProtocol); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewInternalPort, err = soap.MarshalUi2(NewInternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewInternalClient, err = soap.MarshalString(NewInternalClient); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewEnabled, err = soap.MarshalBoolean(NewEnabled); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewPortMappingDescription, err = soap.MarshalString(NewPortMappingDescription); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewLeaseDuration, err = soap.MarshalUi4(NewLeaseDuration); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "AddPortMapping", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// AddPortMapping is the legacy version of AddPortMappingCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) AddPortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32) (err error) {
|
|
|
|
return client.AddPortMappingCtx(context.Background(),
|
|
|
|
NewRemoteHost,
|
|
|
|
NewExternalPort,
|
|
|
|
NewProtocol,
|
|
|
|
NewInternalPort,
|
|
|
|
NewInternalClient,
|
|
|
|
NewEnabled,
|
|
|
|
NewPortMappingDescription,
|
|
|
|
NewLeaseDuration,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) ConfigureConnectionCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewUserName string,
|
|
|
|
NewPassword string,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewUserName string
|
|
|
|
NewPassword string
|
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewUserName, err = soap.MarshalString(NewUserName); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewPassword, err = soap.MarshalString(NewPassword); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "ConfigureConnection", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// ConfigureConnection is the legacy version of ConfigureConnectionCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) ConfigureConnection(NewUserName string, NewPassword string) (err error) {
|
|
|
|
return client.ConfigureConnectionCtx(context.Background(),
|
|
|
|
NewUserName,
|
|
|
|
NewPassword,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
//
|
|
|
|
// Arguments:
|
|
|
|
//
|
|
|
|
// * NewProtocol: allowed values: TCP, UDP
|
|
|
|
|
|
|
|
func (client *WANPPPConnection1) DeletePortMappingCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewRemoteHost string,
|
|
|
|
NewExternalPort uint16,
|
|
|
|
NewProtocol string,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewRemoteHost string
|
|
|
|
NewExternalPort string
|
|
|
|
NewProtocol string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewRemoteHost, err = soap.MarshalString(NewRemoteHost); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewExternalPort, err = soap.MarshalUi2(NewExternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewProtocol, err = soap.MarshalString(NewProtocol); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "DeletePortMapping", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// DeletePortMapping is the legacy version of DeletePortMappingCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) DeletePortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (err error) {
|
|
|
|
return client.DeletePortMappingCtx(context.Background(),
|
|
|
|
NewRemoteHost,
|
|
|
|
NewExternalPort,
|
|
|
|
NewProtocol,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) ForceTerminationCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "ForceTermination", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// ForceTermination is the legacy version of ForceTerminationCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) ForceTermination() (err error) {
|
|
|
|
return client.ForceTerminationCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetAutoDisconnectTimeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewAutoDisconnectTime uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewAutoDisconnectTime string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetAutoDisconnectTime", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewAutoDisconnectTime, err = soap.UnmarshalUi4(response.NewAutoDisconnectTime); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetAutoDisconnectTime is the legacy version of GetAutoDisconnectTimeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime uint32, err error) {
|
|
|
|
return client.GetAutoDisconnectTimeCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
//
|
|
|
|
// Return values:
|
|
|
|
//
|
|
|
|
// * NewPossibleConnectionTypes: allowed values: Unconfigured, IP_Routed, DHCP_Spoofed, PPPoE_Bridged, PPTP_Relay, L2TP_Relay, PPPoE_Relay
|
|
|
|
func (client *WANPPPConnection1) GetConnectionTypeInfoCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewConnectionType string, NewPossibleConnectionTypes string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewConnectionType string
|
|
|
|
NewPossibleConnectionTypes string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetConnectionTypeInfo", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewConnectionType, err = soap.UnmarshalString(response.NewConnectionType); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewPossibleConnectionTypes, err = soap.UnmarshalString(response.NewPossibleConnectionTypes); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetConnectionTypeInfo is the legacy version of GetConnectionTypeInfoCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetConnectionTypeInfo() (NewConnectionType string, NewPossibleConnectionTypes string, err error) {
|
|
|
|
return client.GetConnectionTypeInfoCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetExternalIPAddressCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewExternalIPAddress string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewExternalIPAddress string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetExternalIPAddress", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewExternalIPAddress, err = soap.UnmarshalString(response.NewExternalIPAddress); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetExternalIPAddress is the legacy version of GetExternalIPAddressCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetExternalIPAddress() (NewExternalIPAddress string, err error) {
|
|
|
|
return client.GetExternalIPAddressCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
//
|
|
|
|
// Return values:
|
|
|
|
//
|
|
|
|
// * NewProtocol: allowed values: TCP, UDP
|
|
|
|
func (client *WANPPPConnection1) GetGenericPortMappingEntryCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewPortMappingIndex uint16,
|
|
|
|
) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewPortMappingIndex string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewPortMappingIndex, err = soap.MarshalUi2(NewPortMappingIndex); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewRemoteHost string
|
|
|
|
NewExternalPort string
|
|
|
|
NewProtocol string
|
|
|
|
NewInternalPort string
|
|
|
|
NewInternalClient string
|
|
|
|
NewEnabled string
|
|
|
|
NewPortMappingDescription string
|
|
|
|
NewLeaseDuration string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetGenericPortMappingEntry", request, response); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewRemoteHost, err = soap.UnmarshalString(response.NewRemoteHost); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewExternalPort, err = soap.UnmarshalUi2(response.NewExternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewProtocol, err = soap.UnmarshalString(response.NewProtocol); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewInternalPort, err = soap.UnmarshalUi2(response.NewInternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewInternalClient, err = soap.UnmarshalString(response.NewInternalClient); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewEnabled, err = soap.UnmarshalBoolean(response.NewEnabled); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewPortMappingDescription, err = soap.UnmarshalString(response.NewPortMappingDescription); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewLeaseDuration, err = soap.UnmarshalUi4(response.NewLeaseDuration); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
|
|
|
return
|
|
|
|
}
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetGenericPortMappingEntry is the legacy version of GetGenericPortMappingEntryCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex uint16) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) {
|
|
|
|
return client.GetGenericPortMappingEntryCtx(context.Background(),
|
|
|
|
NewPortMappingIndex,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetIdleDisconnectTimeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewIdleDisconnectTime uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := &struct {
|
|
|
|
NewIdleDisconnectTime string
|
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetIdleDisconnectTime", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewIdleDisconnectTime, err = soap.UnmarshalUi4(response.NewIdleDisconnectTime); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetIdleDisconnectTime is the legacy version of GetIdleDisconnectTimeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime uint32, err error) {
|
|
|
|
return client.GetIdleDisconnectTimeCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetLinkLayerMaxBitRatesCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewUpstreamMaxBitRate uint32, NewDownstreamMaxBitRate uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewUpstreamMaxBitRate string
|
|
|
|
NewDownstreamMaxBitRate string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetLinkLayerMaxBitRates", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewUpstreamMaxBitRate, err = soap.UnmarshalUi4(response.NewUpstreamMaxBitRate); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewDownstreamMaxBitRate, err = soap.UnmarshalUi4(response.NewDownstreamMaxBitRate); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetLinkLayerMaxBitRates is the legacy version of GetLinkLayerMaxBitRatesCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetLinkLayerMaxBitRates() (NewUpstreamMaxBitRate uint32, NewDownstreamMaxBitRate uint32, err error) {
|
|
|
|
return client.GetLinkLayerMaxBitRatesCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetNATRSIPStatusCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewRSIPAvailable bool, NewNATEnabled bool, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewRSIPAvailable string
|
|
|
|
NewNATEnabled string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetNATRSIPStatus", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewRSIPAvailable, err = soap.UnmarshalBoolean(response.NewRSIPAvailable); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewNATEnabled, err = soap.UnmarshalBoolean(response.NewNATEnabled); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetNATRSIPStatus is the legacy version of GetNATRSIPStatusCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNATEnabled bool, err error) {
|
|
|
|
return client.GetNATRSIPStatusCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetPPPAuthenticationProtocolCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewPPPAuthenticationProtocol string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewPPPAuthenticationProtocol string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetPPPAuthenticationProtocol", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewPPPAuthenticationProtocol, err = soap.UnmarshalString(response.NewPPPAuthenticationProtocol); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetPPPAuthenticationProtocol is the legacy version of GetPPPAuthenticationProtocolCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetPPPAuthenticationProtocol() (NewPPPAuthenticationProtocol string, err error) {
|
|
|
|
return client.GetPPPAuthenticationProtocolCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (client *WANPPPConnection1) GetPPPCompressionProtocolCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (NewPPPCompressionProtocol string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2013-12-31 17:06:15 +00:00
|
|
|
NewPPPCompressionProtocol string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetPPPCompressionProtocol", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if NewPPPCompressionProtocol, err = soap.UnmarshalString(response.NewPPPCompressionProtocol); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetPPPCompressionProtocol is the legacy version of GetPPPCompressionProtocolCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANPPPConnection1) GetPPPCompressionProtocol() (NewPPPCompressionProtocol string, err error) {
|
|
|
|
return client.GetPPPCompressionProtocolCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetPPPEncryptionProtocolCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewPPPEncryptionProtocol string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewPPPEncryptionProtocol string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetPPPEncryptionProtocol", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewPPPEncryptionProtocol, err = soap.UnmarshalString(response.NewPPPEncryptionProtocol); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetPPPEncryptionProtocol is the legacy version of GetPPPEncryptionProtocolCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetPPPEncryptionProtocol() (NewPPPEncryptionProtocol string, err error) {
|
|
|
|
return client.GetPPPEncryptionProtocolCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetPasswordCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewPassword string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewPassword string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetPassword", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewPassword, err = soap.UnmarshalString(response.NewPassword); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetPassword is the legacy version of GetPasswordCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetPassword() (NewPassword string, err error) {
|
|
|
|
return client.GetPasswordCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
//
|
|
|
|
// Arguments:
|
|
|
|
//
|
|
|
|
// * NewProtocol: allowed values: TCP, UDP
|
|
|
|
|
|
|
|
func (client *WANPPPConnection1) GetSpecificPortMappingEntryCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewRemoteHost string,
|
|
|
|
NewExternalPort uint16,
|
|
|
|
NewProtocol string,
|
|
|
|
) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewRemoteHost string
|
|
|
|
NewExternalPort string
|
|
|
|
NewProtocol string
|
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewRemoteHost, err = soap.MarshalString(NewRemoteHost); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewExternalPort, err = soap.MarshalUi2(NewExternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if request.NewProtocol, err = soap.MarshalString(NewProtocol); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewInternalPort string
|
|
|
|
NewInternalClient string
|
|
|
|
NewEnabled string
|
|
|
|
NewPortMappingDescription string
|
|
|
|
NewLeaseDuration string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetSpecificPortMappingEntry", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewInternalPort, err = soap.UnmarshalUi2(response.NewInternalPort); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewInternalClient, err = soap.UnmarshalString(response.NewInternalClient); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewEnabled, err = soap.UnmarshalBoolean(response.NewEnabled); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewPortMappingDescription, err = soap.UnmarshalString(response.NewPortMappingDescription); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewLeaseDuration, err = soap.UnmarshalUi4(response.NewLeaseDuration); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetSpecificPortMappingEntry is the legacy version of GetSpecificPortMappingEntryCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetSpecificPortMappingEntry(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) {
|
|
|
|
return client.GetSpecificPortMappingEntryCtx(context.Background(),
|
|
|
|
NewRemoteHost,
|
|
|
|
NewExternalPort,
|
|
|
|
NewProtocol,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
//
|
|
|
|
// Return values:
|
|
|
|
//
|
|
|
|
// * NewConnectionStatus: allowed values: Unconfigured, Connected, Disconnected
|
|
|
|
//
|
|
|
|
// * NewLastConnectionError: allowed values: ERROR_NONE
|
|
|
|
func (client *WANPPPConnection1) GetStatusInfoCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewConnectionStatus string
|
|
|
|
NewLastConnectionError string
|
|
|
|
NewUptime string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetStatusInfo", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewConnectionStatus, err = soap.UnmarshalString(response.NewConnectionStatus); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewLastConnectionError, err = soap.UnmarshalString(response.NewLastConnectionError); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if NewUptime, err = soap.UnmarshalUi4(response.NewUptime); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetStatusInfo is the legacy version of GetStatusInfoCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetStatusInfo() (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) {
|
|
|
|
return client.GetStatusInfoCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetUserNameCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (NewUserName string, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewUserName string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetUserName", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if NewUserName, err = soap.UnmarshalString(response.NewUserName); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// GetUserName is the legacy version of GetUserNameCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) GetUserName() (NewUserName string, err error) {
|
|
|
|
return client.GetUserNameCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (client *WANPPPConnection1) GetWarnDisconnectDelayCtx(
|
|
|
|
ctx context.Context,
|
|
|
|
) (NewWarnDisconnectDelay uint32, err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := &struct {
|
2013-12-31 17:06:15 +00:00
|
|
|
NewWarnDisconnectDelay string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2021-07-11 13:53:32 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetWarnDisconnectDelay", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
if NewWarnDisconnectDelay, err = soap.UnmarshalUi4(response.NewWarnDisconnectDelay); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-11 13:53:32 +00:00
|
|
|
// GetWarnDisconnectDelay is the legacy version of GetWarnDisconnectDelayCtx, but uses
|
|
|
|
// context.Background() as the context.
|
|
|
|
func (client *WANPPPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDelay uint32, err error) {
|
|
|
|
return client.GetWarnDisconnectDelayCtx(context.Background())
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) RequestConnectionCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "RequestConnection", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// RequestConnection is the legacy version of RequestConnectionCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) RequestConnection() (err error) {
|
|
|
|
return client.RequestConnectionCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) RequestTerminationCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := interface{}(nil)
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "RequestTermination", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// RequestTermination is the legacy version of RequestTerminationCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) RequestTermination() (err error) {
|
|
|
|
return client.RequestTerminationCtx(context.Background())
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) SetAutoDisconnectTimeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewAutoDisconnectTime uint32,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewAutoDisconnectTime string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewAutoDisconnectTime, err = soap.MarshalUi4(NewAutoDisconnectTime); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "SetAutoDisconnectTime", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetAutoDisconnectTime is the legacy version of SetAutoDisconnectTimeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uint32) (err error) {
|
|
|
|
return client.SetAutoDisconnectTimeCtx(context.Background(),
|
|
|
|
NewAutoDisconnectTime,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) SetConnectionTypeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewConnectionType string,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewConnectionType string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewConnectionType, err = soap.MarshalString(NewConnectionType); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "SetConnectionType", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetConnectionType is the legacy version of SetConnectionTypeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) SetConnectionType(NewConnectionType string) (err error) {
|
|
|
|
return client.SetConnectionTypeCtx(context.Background(),
|
|
|
|
NewConnectionType,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) SetIdleDisconnectTimeCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewIdleDisconnectTime uint32,
|
2021-07-11 13:53:32 +00:00
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
request := &struct {
|
2022-03-13 09:02:29 +00:00
|
|
|
NewIdleDisconnectTime string
|
2014-01-06 20:17:00 +00:00
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewIdleDisconnectTime, err = soap.MarshalUi4(NewIdleDisconnectTime); err != nil {
|
2013-12-31 16:56:20 +00:00
|
|
|
return
|
2013-10-06 22:16:53 +00:00
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2014-01-06 20:17:00 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "SetIdleDisconnectTime", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetIdleDisconnectTime is the legacy version of SetIdleDisconnectTimeCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uint32) (err error) {
|
|
|
|
return client.SetIdleDisconnectTimeCtx(context.Background(),
|
|
|
|
NewIdleDisconnectTime,
|
2021-07-11 13:53:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) SetWarnDisconnectDelayCtx(
|
2021-07-11 13:53:32 +00:00
|
|
|
ctx context.Context,
|
2022-03-13 09:02:29 +00:00
|
|
|
NewWarnDisconnectDelay uint32,
|
|
|
|
) (err error) {
|
2013-12-31 17:06:15 +00:00
|
|
|
// Request structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
request := &struct {
|
|
|
|
NewWarnDisconnectDelay string
|
|
|
|
}{}
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Marshal arguments into request.
|
2013-10-06 22:16:53 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
if request.NewWarnDisconnectDelay, err = soap.MarshalUi4(NewWarnDisconnectDelay); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-12-31 16:56:20 +00:00
|
|
|
// END Marshal arguments into request.
|
|
|
|
|
2013-12-31 17:06:15 +00:00
|
|
|
// Response structure.
|
2022-03-13 09:02:29 +00:00
|
|
|
response := interface{}(nil)
|
2013-12-31 17:06:15 +00:00
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// Perform the SOAP call.
|
2022-03-13 09:02:29 +00:00
|
|
|
if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "SetWarnDisconnectDelay", request, response); err != nil {
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2013-12-31 16:56:20 +00:00
|
|
|
// BEGIN Unmarshal arguments from response.
|
|
|
|
|
|
|
|
// END Unmarshal arguments from response.
|
2013-10-06 22:16:53 +00:00
|
|
|
return
|
|
|
|
}
|
2021-07-11 13:53:32 +00:00
|
|
|
|
2022-03-13 09:02:29 +00:00
|
|
|
// SetWarnDisconnectDelay is the legacy version of SetWarnDisconnectDelayCtx, but uses
|
2021-07-11 13:53:32 +00:00
|
|
|
// context.Background() as the context.
|
2022-03-13 09:02:29 +00:00
|
|
|
func (client *WANPPPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay uint32) (err error) {
|
|
|
|
return client.SetWarnDisconnectDelayCtx(context.Background(),
|
|
|
|
NewWarnDisconnectDelay,
|
|
|
|
)
|
2021-07-11 13:53:32 +00:00
|
|
|
}
|