proto

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ACSFaultCodeMethodNotSupported = 8000
	ACSFaultCodeRequestDenied      = 8001
	ACSFaultCodeInternalError      = 8002
	ACSFaultCodeInvalidArguments   = 8003
	ACSFaultCodeResourcesExceeded  = 8004
	ACSFaultCodeRetryRequest       = 8005
)
View Source
const (
	XMLNS_XSD      = "http://www.w3.org/2001/XMLSchema"
	XMLNS_XSI      = "http://www.w3.org/2001/XMLSchema-instance"
	XMLNS_SOAP_ENC = "http://schemas.xmlsoap.org/soap/encoding/"
	XMLNS_SOAP_ENV = "http://schemas.xmlsoap.org/soap/envelope/"

	XMLNS_CWMP_1_0 = "urn:dslforum-org:cwmp-1-0"
	XMLNS_CWMP_1_1 = "urn:dslforum-org:cwmp-1-1"
	XMLNS_CWMP_1_2 = "urn:dslforum-org:cwmp-1-2"
	XMLNS_CWMP_1_3 = "urn:dslforum-org:cwmp-1-3"
	XMLNS_CWMP_1_4 = "urn:dslforum-org:cwmp-1-4"
)

Variables

This section is empty.

Functions

func CleanXMLData

func CleanXMLData(data []byte) []byte

func FormateTime

func FormateTime(t time.Time) string

func MustParseTime

func MustParseTime(value string) time.Time

func ParseTime

func ParseTime(value string) (time.Time, error)

Types

type AccessList

type AccessList struct {
	XMLName xml.Name
	Text    string     `xml:",chardata"`
	Attrs   []xml.Attr `xml:",any,attr"`
	Strings []string   `xml:"string"`
}

type AddObject

type AddObject struct {
	XMLName      xml.Name
	Text         string `xml:",chardata"`
	ObjectName   string `xml:"ObjectName"`
	ParameterKey string `xml:"ParameterKey"`
}

type AddObjectResponse

type AddObjectResponse struct {
	XMLName        xml.Name
	Text           string `xml:",chardata"`
	InstanceNumber uint   `xml:"InstanceNumber"`
	Status         int    `xml:"status"`
}

type AutonomousTransferComplete

type AutonomousTransferComplete struct {
	XMLName        xml.Name
	Text           string      `xml:",chardata"`
	AnnounceURL    string      `xml:"AnnounceURL"`
	TransferURL    string      `xml:"TransferURL"`
	IsDownload     bool        `xml:"IsDownload"`
	FileType       string      `xml:"FileType"`
	FileSize       uint        `xml:"FileSize"`
	TargetFileName string      `xml:"TargetFileName"`
	FaultStruct    FaultStruct `xml:"FaultStruct"`
	StartTime      string      `xml:"StartTime"`
	CompleteTime   string      `xml:"CompleteTime"`
}

type AutonomousTransferCompleteResponse

type AutonomousTransferCompleteResponse struct {
	XMLName xml.Name
	Text    string `xml:",chardata"`
}

type CwmpFault

type CwmpFault struct {
	XMLName                  xml.Name
	Text                     string                    `xml:",chardata"`
	FaultCode                string                    `xml:"FaultCode"`
	FaultString              string                    `xml:"FaultString"`
	SetParameterValuesFaults []SetParameterValuesFault `xml:"SetParameterValuesFault"`
}

func (CwmpFault) String

func (m CwmpFault) String() string

type CwmpID

type CwmpID struct {
	XMLName xml.Name
	Text    string     `xml:",chardata"`
	Attrs   []xml.Attr `xml:",any,attr"`
}

type DeleteObject

type DeleteObject struct {
	XMLName      xml.Name
	Text         string `xml:",chardata"`
	ObjectName   string `xml:"ObjectName"`
	ParameterKey string `xml:"ParameterKey"`
}

type DeleteObjectResponse

type DeleteObjectResponse struct {
	XMLName xml.Name
	Text    string `xml:",chardata"`
	Status  int    `xml:"status"`
}

type DeviceID

type DeviceID struct {
	XMLName      xml.Name
	Text         string `xml:",chardata"`
	Manufacturer string `xml:"Manufacturer"`
	OUI          string `xml:"OUI"`
	ProductClass string `xml:"ProductClass"`
	SerialNumber string `xml:"SerialNumber"`
}

func (DeviceID) String

func (m DeviceID) String() string

type Download

type Download struct {
	XMLName        xml.Name
	Text           string `xml:",chardata"`
	CommandKey     string `xml:"CommandKey"`
	FileType       string `xml:"FileType"`
	URL            string `xml:"URL"`
	Username       string `xml:"Username"`
	Password       string `xml:"Password"`
	FileSize       uint   `xml:"FileSize"`
	TargetFileName string `xml:"TargetFileName"`
	DelaySeconds   uint   `xml:"DelaySeconds"`
	SuccessURL     string `xml:"SuccessURL"`
	FailureURL     string `xml:"FailureURL"`
}

type DownloadResponse

type DownloadResponse struct {
	XMLName      xml.Name
	Text         string `xml:",chardata"`
	Status       int    `xml:"status"`
	StartTime    string `xml:"StartTime"`
	CompleteTime string `xml:"CompleteTime"`
}

type Event

type Event struct {
	XMLName xml.Name
	Text    string        `xml:",chardata"`
	Events  []EventStruct `xml:"EventStruct"`
}

func (Event) String

func (m Event) String() string

type EventStruct

type EventStruct struct {
	XMLName    xml.Name
	Text       string `xml:",chardata"`
	EventCode  string `xml:"EventCode"`
	CommandKey string `xml:"CommandKey"`
}

func (EventStruct) String

func (m EventStruct) String() string

type FactoryReset

type FactoryReset struct {
	XMLName xml.Name
	Text    string `xml:",chardata"`
}

type FactoryResetResponse

type FactoryResetResponse struct {
	XMLName xml.Name
	Text    string `xml:",chardata"`
}

type FaultStruct

type FaultStruct struct {
	XMLName     xml.Name
	Text        string `xml:",chardata"`
	FaultCode   int    `xml:"FaultCode"`
	FaultString string `xml:"FaultString"`
}

type GetParameterAttributes

type GetParameterAttributes struct {
	XMLName        xml.Name
	Text           string         `xml:",chardata"`
	ParameterNames ParameterNames `xml:"ParameterNames"`
}

type GetParameterAttributesResponse

type GetParameterAttributesResponse struct {
	XMLName       xml.Name
	Text          string                            `xml:",chardata"`
	ParameterList ParameterListOfParameterAttribute `xml:"ParameterList"`
}

type GetParameterNames

type GetParameterNames struct {
	XMLName       xml.Name
	Text          string `xml:",chardata"`
	ParameterPath string `xml:"ParameterPath"`
	NextLevel     string `xml:"NextLevel"`
}

type GetParameterNamesResponse

type GetParameterNamesResponse struct {
	XMLName       xml.Name
	Text          string                       `xml:",chardata"`
	ParameterList ParameterListOfParameterInfo `xml:"ParameterList"`
}

type GetParameterValues

type GetParameterValues struct {
	XMLName        xml.Name
	Text           string         `xml:",chardata"`
	ParameterNames ParameterNames `xml:"ParameterNames"`
}

type GetParameterValuesResponse

type GetParameterValuesResponse struct {
	XMLName       xml.Name
	Text          string                        `xml:",chardata"`
	ParameterList ParameterListOfParameterValue `xml:"ParameterList"`
}

type GetRPCMethods

type GetRPCMethods struct {
	XMLName xml.Name
	Text    string `xml:",chardata"`
}

type GetRPCMethodsResponse

type GetRPCMethodsResponse struct {
	XMLName    xml.Name
	Text       string     `xml:",chardata"`
	MethodList MethodList `xml:"MethodList"`
}

type HoldRequests

type HoldRequests struct {
	XMLName        xml.Name
	Text           string `xml:",chardata"`
	MustUnderstand string `xml:"mustUnderstand,attr"` // must "1"
}

type Inform

type Inform struct {
	XMLName       xml.Name
	Text          string                        `xml:",chardata"`
	DeviceID      DeviceID                      `xml:"DeviceId"`
	Event         Event                         `xml:"Event"`
	MaxEnvelopes  int                           `xml:"MaxEnvelopes"`
	CurrentTime   string                        `xml:"CurrentTime"`
	RetryCount    int                           `xml:"RetryCount"`
	ParameterList ParameterListOfParameterValue `xml:"ParameterList"`
}

func (Inform) String

func (m Inform) String() string

type InformResponse

type InformResponse struct {
	XMLName      xml.Name
	Text         string `xml:",chardata"`
	MaxEnvelopes int    `xml:"MaxEnvelopes"`
}

type MethodList

type MethodList struct {
	XMLName xml.Name
	Text    string     `xml:",chardata"`
	Attrs   []xml.Attr `xml:",any,attr"`
	Strings []string   `xml:"string"`
}

type ParameterAttributesStruct

type ParameterAttributesStruct struct {
	XMLName      xml.Name
	Text         string     `xml:",chardata"`
	Name         string     `xml:"Name"`
	Notification int        `xml:"Notification"`
	AccessList   AccessList `xml:"AccessList"`
}

type ParameterInfoStruct

type ParameterInfoStruct struct {
	XMLName  xml.Name
	Text     string `xml:",chardata"`
	Name     string `xml:"Name"`
	Writable string `xml:"Writable"`
}

type ParameterListOfParameterAttribute

type ParameterListOfParameterAttribute struct {
	XMLName                    xml.Name
	Text                       string                       `xml:",chardata"`
	Attrs                      []xml.Attr                   `xml:",any,attr"`
	ParameterAttributesStructs []*ParameterAttributesStruct `xml:"ParameterAttributesStruct"`
}

type ParameterListOfParameterInfo

type ParameterListOfParameterInfo struct {
	XMLName              xml.Name
	Text                 string                 `xml:",chardata"`
	Attrs                []xml.Attr             `xml:",any,attr"`
	ParameterInfoStructs []*ParameterInfoStruct `xml:"ParameterInfoStruct"`
}

func (ParameterListOfParameterInfo) String

type ParameterListOfParameterValue

type ParameterListOfParameterValue struct {
	XMLName               xml.Name
	Text                  string                  `xml:",chardata"`
	Attrs                 []xml.Attr              `xml:",any,attr"`
	ParameterValueStructs []*ParameterValueStruct `xml:"ParameterValueStruct"`
}

func (ParameterListOfParameterValue) String

type ParameterListOfSetParameterAttribute

type ParameterListOfSetParameterAttribute struct {
	XMLName                       xml.Name
	Text                          string                          `xml:",chardata"`
	Attrs                         []xml.Attr                      `xml:",any,attr"`
	SetParameterAttributesStructs []*SetParameterAttributesStruct `xml:"SetParameterAttributesStruct"`
}

type ParameterName

type ParameterName struct {
	XMLName xml.Name
	Text    string     `xml:",chardata"`
	Attrs   []xml.Attr `xml:",any,attr"`
}

type ParameterNames

type ParameterNames struct {
	XMLName xml.Name
	Text    string     `xml:",chardata"`
	Attrs   []xml.Attr `xml:",any,attr"`
	Strings []string   `xml:"string"`
}

type ParameterValue

type ParameterValue struct {
	XMLName  xml.Name
	Text     string     `xml:",chardata"`
	Attrs    []xml.Attr `xml:",any,attr"`
	TypeName string     `xml:"-"`
}

type ParameterValueStruct

type ParameterValueStruct struct {
	XMLName xml.Name
	Text    string         `xml:",chardata"`
	Name    ParameterName  `xml:"Name"`
	Value   ParameterValue `xml:"Value"`
}

func (ParameterValueStruct) String

func (m ParameterValueStruct) String() string

type Reboot

type Reboot struct {
	XMLName    xml.Name
	Text       string `xml:",chardata"`
	CommandKey string `xml:"CommandKey"`
}

type RebootResponse

type RebootResponse struct {
	XMLName xml.Name
	Text    string `xml:",chardata"`
}

type SessionTimeout

type SessionTimeout struct {
	XMLName        xml.Name
	Text           string `xml:",chardata"`
	MustUnderstand string `xml:"mustUnderstand,attr"` // must "0"
}

type SetParameterAttributes

type SetParameterAttributes struct {
	XMLName       xml.Name
	Text          string                               `xml:",chardata"`
	ParameterList ParameterListOfSetParameterAttribute `xml:"ParameterList"`
}

type SetParameterAttributesResponse

type SetParameterAttributesResponse struct {
	XMLName xml.Name
	Text    string `xml:",chardata"`
}

type SetParameterAttributesStruct

type SetParameterAttributesStruct struct {
	XMLName            xml.Name
	Text               string     `xml:",chardata"`
	Name               string     `xml:"Name"`
	NotificationChange bool       `xml:"NotificationChange,omitempty"`
	Notification       int        `xml:"Notification,omitempty"`
	AccessListChange   bool       `xml:"AccessListChange,omitempty"`
	AccessList         AccessList `xml:"AccessList,omitempty"`
}

type SetParameterValues

type SetParameterValues struct {
	XMLName       xml.Name
	Text          string                        `xml:",chardata"`
	ParameterList ParameterListOfParameterValue `xml:"ParameterList"`
	ParameterKey  string                        `xml:"ParameterKey"`
}

type SetParameterValuesFault

type SetParameterValuesFault struct {
	XMLName       xml.Name
	Text          string `xml:",chardata"`
	ParameterName string `xml:"ParameterName"`
	FaultCode     int    `xml:"FaultCode"`
	FaultString   string `xml:"FaultString"`
}

type SetParameterValuesResponse

type SetParameterValuesResponse struct {
	XMLName xml.Name
	Text    string `xml:",chardata"`
	Status  int    `xml:"status"`
}

type SoapBody

type SoapBody struct {
	XMLName xml.Name
	Text    string     `xml:",chardata"`
	Fault   *SoapFault `xml:"Fault,omitempty"`

	GetRPCMethods                  *GetRPCMethods                  `xml:"GetRPCMethods,omitempty"`
	GetRPCMethodsResponse          *GetRPCMethodsResponse          `xml:"GetRPCMethodsResponse,omitempty"`
	SetParameterValues             *SetParameterValues             `xml:"SetParameterValues,omitempty"`
	SetParameterValuesResponse     *SetParameterValuesResponse     `xml:"SetParameterValuesResponse,omitempty"`
	GetParameterValues             *GetParameterValues             `xml:"GetParameterValues,omitempty"`
	GetParameterValuesResponse     *GetParameterValuesResponse     `xml:"GetParameterValuesResponse,omitempty"`
	GetParameterNames              *GetParameterNames              `xml:"GetParameterNames,omitempty"`
	GetParameterNamesResponse      *GetParameterNamesResponse      `xml:"GetParameterNamesResponse,omitempty"`
	GetParameterAttributes         *GetParameterAttributes         `xml:"GetParameterAttributes,omitempty"`
	GetParameterAttributesResponse *GetParameterAttributesResponse `xml:"GetParameterAttributesResponse,omitempty"`
	SetParameterAttributes         *SetParameterAttributes         `xml:"SetParameterAttributes,omitempty"`
	SetParameterAttributesResponse *SetParameterAttributesResponse `xml:"SetParameterAttributesResponse,omitempty"`
	AddObject                      *AddObject                      `xml:"AddObject,omitempty"`
	AddObjectResponse              *AddObjectResponse              `xml:"AddObjectResponse,omitempty"`
	DeleteObject                   *DeleteObject                   `xml:"DeleteObject,omitempty"`
	DeleteObjectResponse           *DeleteObjectResponse           `xml:"DeleteObjectResponse,omitempty"`
	Download                       *Download                       `xml:"Download,omitempty"`
	DownloadResponse               *DownloadResponse               `xml:"DownloadResponse,omitempty"`
	Upload                         *Upload                         `xml:"Upload,omitempty"`
	UploadResponse                 *UploadResponse                 `xml:"UploadResponse,omitempty"`
	Reboot                         *Reboot                         `xml:"Reboot,omitempty"`
	RebootResponse                 *RebootResponse                 `xml:"RebootResponse,omitempty"`
	FactoryReset                   *FactoryReset                   `xml:"FactoryReset,omitempty"`
	FactoryResetResponse           *FactoryResetResponse           `xml:"FactoryResetResponse,omitempty"`

	Inform                             *Inform                             `xml:"Inform,omitempty"`
	InformResponse                     *InformResponse                     `xml:"InformResponse,omitempty"`
	TransferComplete                   *TransferComplete                   `xml:"TransferComplete,omitempty"`
	TransferCompleteResponse           *TransferCompleteResponse           `xml:"TransferCompleteResponse,omitempty"`
	AutonomousTransferComplete         *AutonomousTransferComplete         `xml:"AutonomousTransferComplete,omitempty"`
	AutonomousTransferCompleteResponse *AutonomousTransferCompleteResponse `xml:"AutonomousTransferCompleteResponse,omitempty"`
}

type SoapEnvelope

type SoapEnvelope struct {
	XMLName xml.Name
	Text    string        `xml:",chardata"`
	Attrs   []xml.Attr    `xml:",any,attr"`
	NS      SoapNamespace `xml:"-"`

	Header SoapHeader `xml:"Header"`
	Body   SoapBody   `xml:"Body"`
}

func CreateEnvelope

func CreateEnvelope(id string, ns SoapNamespace, body any) *SoapEnvelope

func CreateEnvelopeFault

func CreateEnvelopeFault(id string, ns SoapNamespace, code int, err error) *SoapEnvelope

func CreateEnvelopeWithRequest

func CreateEnvelopeWithRequest(req *SoapEnvelope) *SoapEnvelope

func (*SoapEnvelope) Decode

func (m *SoapEnvelope) Decode() error

func (*SoapEnvelope) Encode

func (m *SoapEnvelope) Encode() error

func (*SoapEnvelope) GetNamespace

func (m *SoapEnvelope) GetNamespace() SoapNamespace

type SoapFault

type SoapFault struct {
	XMLName     xml.Name
	Text        string          `xml:",chardata"`
	FaultCode   string          `xml:"faultcode"`
	FaultString string          `xml:"faultstring"`
	Detail      SoapFaultDetail `xml:"detail"`
}

func CreateSoapFault

func CreateSoapFault(code int, err error) *SoapFault

func (SoapFault) String

func (m SoapFault) String() string

type SoapFaultDetail

type SoapFaultDetail struct {
	XMLName xml.Name
	Text    string    `xml:",chardata"`
	Fault   CwmpFault `xml:"Fault"`
}

func (SoapFaultDetail) String

func (m SoapFaultDetail) String() string

type SoapHeader

type SoapHeader struct {
	XMLName               xml.Name
	Text                  string                 `xml:",chardata"`
	ID                    *CwmpID                `xml:"ID,omitempty"`
	HoldRequests          *HoldRequests          `xml:"HoldRequests,omitempty"`          // ACS to CPE
	SessionTimeout        *SessionTimeout        `xml:"SessionTimeout,omitempty"`        // CPE to ACS
	SupportedCWMPVersions *SupportedCWMPVersions `xml:"SupportedCWMPVersions,omitempty"` // CPE to ACS
	UseCWMPVersion        *UseCWMPVersion        `xml:"UseCWMPVersion,omitempty"`        // ACS to CPE
}

type SoapNamespace

type SoapNamespace struct {
	SoapEnv xml.Attr `xml:"-"`
	SoapEnc xml.Attr `xml:"-"`
	Cwmp    xml.Attr `xml:"-"`
	Xsd     xml.Attr `xml:"-"`
	Xsi     xml.Attr `xml:"-"`
}

func (*SoapNamespace) FromString

func (m *SoapNamespace) FromString(in string) error

func (SoapNamespace) ToString

func (m SoapNamespace) ToString() string

type SupportedCWMPVersions

type SupportedCWMPVersions struct {
	XMLName        xml.Name
	Text           string `xml:",chardata"`
	MustUnderstand string `xml:"mustUnderstand,attr"` // must "0"
}

type TransferComplete

type TransferComplete struct {
	XMLName      xml.Name
	Text         string      `xml:",chardata"`
	CommandKey   string      `xml:"CommandKey"`
	FaultStruct  FaultStruct `xml:"FaultStruct"`
	StartTime    string      `xml:"StartTime"`
	CompleteTime string      `xml:"CompleteTime"`
}

type TransferCompleteResponse

type TransferCompleteResponse struct {
	XMLName xml.Name
	Text    string `xml:",chardata"`
}

type Upload

type Upload struct {
	XMLName      xml.Name
	Text         string `xml:",chardata"`
	CommandKey   string `xml:"CommandKey"`
	FileType     string `xml:"FileType"`
	URL          string `xml:"URL"`
	Username     string `xml:"Username"`
	Password     string `xml:"Password"`
	DelaySeconds uint   `xml:"DelaySeconds"`
}

type UploadResponse

type UploadResponse struct {
	XMLName      xml.Name
	Text         string `xml:",chardata"`
	Status       int    `xml:"status"`
	StartTime    string `xml:"StartTime"`
	CompleteTime string `xml:"CompleteTime"`
}

type UseCWMPVersion

type UseCWMPVersion struct {
	XMLName        xml.Name
	Text           string `xml:",chardata"`
	MustUnderstand string `xml:"mustUnderstand,attr"` // must "1"
}

type Value

type Value struct {
	XMLName xml.Name
	Text    string     `xml:",chardata"`
	Attrs   []xml.Attr `xml:",any,attr"`
}

func (Value) String

func (m Value) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL