data_types

package
v0.0.0-...-dd13c3c Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACE

type ACE struct {
	Name       string      `json:"name"`
	Matches    *Matches    `json:"matches"`
	Actions    *Actions    `json:"actions"`
	Statistics *Statistics `yang:"nonconfig" json:"statistics"`
}

type ACEs

type ACEs struct {
	ACE []ACE `json:"ace"`
}

type ACL

type ACL struct {
	Name            string          `json:"name"`
	Type            *ACLType        `yang:"config" json:"type"`
	ActivationType  *ActivationType `yang:"config" json:"activation-type"`
	PendingLifetime *int32          `yang:"nonconfig" json:"pending-lifetime"`
	ACEs            ACEs            `json:"aces"`
}

type ACLType

type ACLType string
const (
	ACLType_IPv4ACLType             ACLType = "ipv4-acl-type"
	ACLType_IPv6ACLType             ACLType = "ipv6-acl-type"
	ACLType_EthACLType              ACLType = "eth-acl-type"
	ACLType_MixedEthIPv4ACLType     ACLType = "mixed-eth-ipv4-acl-type"
	ACLType_MixedEthIPv6ACLType     ACLType = "mixed-eth-ipv6-acl-type"
	ACLType_MixedEthIPv4IPv6ACLType ACLType = "mixed-eth-ipv4-ipv6-acl-type"
)

func (ACLType) MarshalJSON

func (e ACLType) MarshalJSON() ([]byte, error)

func (ACLType) String

func (e ACLType) String() string

func (*ACLType) UnmarshalJSON

func (p *ACLType) UnmarshalJSON(data []byte) error

type ACLs

type ACLs struct {
	ACL []ACL `json:"acl"`
}

type Actions

type Actions struct {
	Forwarding *ForwardingAction `yang:"config" json:"forwarding"`
	RateLimit  *decimal.Decimal  `yang:"config" json:"rate-limit"`
}

type ActivationType

type ActivationType string
const (
	ActivationType_NotType                ActivationType = "not-type" // When the acl is deleted or expired
	ActivationType_ActivateWhenMitigating ActivationType = "activate-when-mitigating"
	ActivationType_Immediate              ActivationType = "immediate"
	ActivationType_Deactivate             ActivationType = "deactivate"
)

func (ActivationType) MarshalJSON

func (e ActivationType) MarshalJSON() ([]byte, error)

func (ActivationType) String

func (e ActivationType) String() string

func (*ActivationType) UnmarshalJSON

func (p *ActivationType) UnmarshalJSON(data []byte) error

type AddressFamily

type AddressFamily string
const (
	AddressFamily_IPv4 AddressFamily = "ipv4"
	AddressFamily_IPv6 AddressFamily = "ipv6"
)

func (AddressFamily) MarshalJSON

func (e AddressFamily) MarshalJSON() ([]byte, error)

func (AddressFamily) String

func (e AddressFamily) String() string

func (*AddressFamily) UnmarshalJSON

func (p *AddressFamily) UnmarshalJSON(data []byte) error

type Alias

type Alias struct {
	Name            string      `json:"name"`
	TargetPrefix    []IPPrefix  `yang:"config" json:"target-prefix"`
	TargetPortRange []PortRange `yang:"config" json:"target-port-range"`
	TargetProtocol  UInt8List   `yang:"config" json:"target-protocol"`
	TargetFQDN      []string    `yang:"config" json:"target-fqdn"` //TODO: inet:domain-name
	TargetURI       []string    `yang:"config" json:"target-uri"`  //TODO: inet:uri
	PendingLifetime *int32      `yang:"nonconfig" json:"pending-lifetime"`
}

type Aliases

type Aliases struct {
	Alias []Alias `json:"alias"`
}

type AttackMapping

type AttackMapping struct {
	AttackId          *uint32 `yang:"config" json:"attack-id"`
	AttackDescription *string `yang:"config" json:"attack-description"`
}

type Capabilities

type Capabilities struct {
	AddressFamily      []AddressFamily    `yang:"nonconfig" json:"address-family"`
	ForwardingActions  []ForwardingAction `yang:"nonconfig" json:"forwarding-actions"`
	RateLimit          *bool              `yang:"nonconfig" json:"rate-limit"`
	TransportProtocols UInt8List          `yang:"nonconfig" json:"transport-protocols"`

	IPv4 *Capabilities_IPv4 `yang:"nonconfig" json:"ipv4"`
	IPv6 *Capabilities_IPv6 `yang:"nonconfig" json:"ipv6"`
	TCP  *Capabilities_TCP  `yang:"nonconfig" json:"tcp"`
	UDP  *Capabilities_UDP  `yang:"nonconfig" json:"udp"`
	ICMP *Capabilities_ICMP `yang:"nonconfig" json:"icmp"`

	VendorMappingEnabled *bool `yang:"nonconfig" json:"ietf-dots-mapping:vendor-mapping-enabled"`
}

type Capabilities_ICMP

type Capabilities_ICMP struct {
	Type         *bool `yang:"nonconfig" json:"type"`
	Code         *bool `yang:"nonconfig" json:"code"`
	RestOfHeader *bool `yang:"nonconfig" json:"rest-of-header"`
}

type Capabilities_IPv4

type Capabilities_IPv4 struct {
	DSCP              *bool `yang:"nonconfig" json:"dscp"`
	ECN               *bool `yang:"nonconfig" json:"ecn"`
	Length            *bool `yang:"nonconfig" json:"length"`
	TTL               *bool `yang:"nonconfig" json:"ttl"`
	Protocol          *bool `yang:"nonconfig" json:"protocol"`
	IHL               *bool `yang:"nonconfig" json:"ihl"`
	Flags             *bool `yang:"nonconfig" json:"flags"`
	Offset            *bool `yang:"nonconfig" json:"offset"`
	Identification    *bool `yang:"nonconfig" json:"identification"`
	SourcePrefix      *bool `yang:"nonconfig" json:"source-prefix"`
	DestinationPrefix *bool `yang:"nonconfig" json:"destination-prefix"`
	Fragment          *bool `yang:"nonconfig" json:"fragment"`
}

type Capabilities_IPv6

type Capabilities_IPv6 struct {
	DSCP              *bool `yang:"nonconfig" json:"dscp"`
	ECN               *bool `yang:"nonconfig" json:"ecn"`
	FlowLabel         *bool `yang:"nonconfig" json:"flow-label"`
	Length            *bool `yang:"nonconfig" json:"length"`
	Protocol          *bool `yang:"nonconfig" json:"protocol"`
	HopLimit          *bool `yang:"nonconfig" json:"hoplimit"`
	Identification    *bool `yang:"nonconfig" json:"identification"`
	SourcePrefix      *bool `yang:"nonconfig" json:"source-prefix"`
	DestinationPrefix *bool `yang:"nonconfig" json:"destination-prefix"`
	Fragment          *bool `yang:"nonconfig" json:"fragment"`
}

type Capabilities_TCP

type Capabilities_TCP struct {
	SequenceNumber        *bool `yang:"nonconfig" json:"sequence-number"`
	AcknowledgementNumber *bool `yang:"nonconfig" json:"acknowledgement-number"`
	DataOffset            *bool `yang:"nonconfig" json:"data-offset"`
	Reserved              *bool `yang:"nonconfig" json:"reserved"`
	Flags                 *bool `yang:"nonconfig" json:"flags"`
	FlagsBitmask          *bool `yang:"nonconfig" json:"flags-bitmask"`
	WindowSize            *bool `yang:"nonconfig" json:"window-size"`
	UrgentPointer         *bool `yang:"nonconfig" json:"urgent-pointer"`
	Options               *bool `yang:"nonconfig" json:"options"`
	SourcePort            *bool `yang:"nonconfig" json:"source-port"`
	DestinationPort       *bool `yang:"nonconfig" json:"destination-port"`
	PortRange             *bool `yang:"nonconfig" json:"port-range"`
}

type Capabilities_UDP

type Capabilities_UDP struct {
	Length          *bool `yang:"nonconfig" json:"length"`
	SourcePort      *bool `yang:"nonconfig" json:"source-port"`
	DestinationPort *bool `yang:"nonconfig" json:"destination-port"`
	PortRange       *bool `yang:"nonconfig" json:"port-range"`
}

type DotsClient

type DotsClient struct {
	Cuid    string   `json:"cuid"`
	Cdid    *string  `json:"cdid"`
	Aliases *Aliases `json:"aliases"`
	ACLs    *ACLs    `json:"acls"`
}

type Empty

type Empty int
const (
	Empty_Value Empty = 0
)

func (Empty) MarshalJSON

func (e Empty) MarshalJSON() ([]byte, error)

func (Empty) String

func (e Empty) String() string

func (*Empty) UnmarshalJSON

func (p *Empty) UnmarshalJSON(data []byte) error

type FlagsBitmask

type FlagsBitmask struct {
	Operator *OperatorBit `json:"operator"`
	Bitmask  uint16       `json:"bitmask"`
}

type ForwardingAction

type ForwardingAction string
const (
	ForwardingAction_Accept    ForwardingAction = "accept"
	ForwardingAction_Drop      ForwardingAction = "drop"
	ForwardingAction_RateLimit ForwardingAction = "rate-limit"
)

func (ForwardingAction) MarshalJSON

func (e ForwardingAction) MarshalJSON() ([]byte, error)

func (ForwardingAction) String

func (e ForwardingAction) String() string

func (*ForwardingAction) UnmarshalJSON

func (p *ForwardingAction) UnmarshalJSON(data []byte) error

type Fragment

type Fragment struct {
	Operator *OperatorBit  `json:"operator"`
	Type     *FragmentType `json:"type"`
}

type FragmentType

type FragmentType string
const (
	FragmentType_DF  FragmentType = "df"
	FragmentType_ISF FragmentType = "isf"
	FragmentType_FF  FragmentType = "ff"
	FragmentType_LF  FragmentType = "lf"
)

func (FragmentType) MarshalJSON

func (e FragmentType) MarshalJSON() ([]byte, error)

func (FragmentType) String

func (e FragmentType) String() string

func (*FragmentType) UnmarshalJSON

func (p *FragmentType) UnmarshalJSON(data []byte) error

type ICMP

type ICMP struct {
	Type         *uint8  `yang:"config" json:"type"`
	Code         *uint8  `yang:"config" json:"code"`
	RestOfHeader *uint32 `yang:"config" json:"rest-of-header"`
}

type IPPrefix

type IPPrefix struct {
	IP     net.IP
	Length int
}

func (IPPrefix) MarshalJSON

func (e IPPrefix) MarshalJSON() ([]byte, error)

func (IPPrefix) String

func (e IPPrefix) String() string

func (*IPPrefix) UnmarshalJSON

func (p *IPPrefix) UnmarshalJSON(data []byte) error

type IPv4

type IPv4 struct {
	DSCP                   *uint8      `yang:"config" json:"dscp"` //TODO: value range (0..63)
	ECN                    *uint8      `yang:"config" json:"ecn"`  //TODO: value range (0..3)
	Length                 *uint16     `yang:"config" json:"length"`
	TTL                    *uint8      `yang:"config" json:"ttl"`
	Protocol               *uint8      `yang:"config" json:"protocol"`
	IHL                    *uint8      `yang:"config" json:"ihl"` //TODO: value range (5..60)
	Flags                  *IPv4Flags  `yang:"config" json:"flags"`
	Offset                 *uint16     `yang:"config" json:"offset"` //TODO: value range (20..65535)
	DestinationIPv4Network *IPv4Prefix `yang:"config" json:"destination-ipv4-network"`
	SourceIPv4Network      *IPv4Prefix `yang:"config" json:"source-ipv4-network"`
	Identification         *uint16     `yang:"config" json:"identification"`
	Fragment               *Fragment   `yang:"config" json:"fragment"`
}

type IPv4Flag

type IPv4Flag string
const (
	IPv4Flag_Reserved IPv4Flag = "reserved"
	IPv4Flag_Fragment IPv4Flag = "fragment"
	IPv4Flag_More     IPv4Flag = "more"
)

func (IPv4Flag) String

func (e IPv4Flag) String() string

type IPv4Flags

type IPv4Flags []IPv4Flag

func (IPv4Flags) MarshalJSON

func (e IPv4Flags) MarshalJSON() ([]byte, error)

func (IPv4Flags) String

func (e IPv4Flags) String() string

func (*IPv4Flags) UnmarshalJSON

func (p *IPv4Flags) UnmarshalJSON(data []byte) error

type IPv4Prefix

type IPv4Prefix IPPrefix

func (IPv4Prefix) MarshalJSON

func (e IPv4Prefix) MarshalJSON() ([]byte, error)

func (IPv4Prefix) String

func (e IPv4Prefix) String() string

func (*IPv4Prefix) UnmarshalJSON

func (p *IPv4Prefix) UnmarshalJSON(data []byte) error

type IPv6

type IPv6 struct {
	DSCP                   *uint8      `yang:"config" json:"dscp"` //TODO: value range (0..63)
	ECN                    *uint8      `yang:"config" json:"ecn"`  //TODO: value range (0..3)
	Length                 *uint16     `yang:"config" json:"length"`
	TTL                    *uint8      `yang:"config" json:"ttl"`
	Protocol               *uint8      `yang:"config" json:"protocol"`
	DestinationIPv6Network *IPv6Prefix `yang:"config" json:"destination-ipv6-network"`
	SourceIPv6Network      *IPv6Prefix `yang:"config" json:"source-ipv6-network"`
	FlowLabel              *uint32     `yang:"config" json:"flow-label"` //TODO: value range(0..01048575)
	Fragment               *Fragment   `yang:"config" json:"fragment"`
}

type IPv6Prefix

type IPv6Prefix IPPrefix

func (IPv6Prefix) MarshalJSON

func (e IPv6Prefix) MarshalJSON() ([]byte, error)

func (IPv6Prefix) String

func (e IPv6Prefix) String() string

func (*IPv6Prefix) UnmarshalJSON

func (p *IPv6Prefix) UnmarshalJSON(data []byte) error

type Insert

type Insert string
const (
	FIRST  Insert = "first"
	LAST   Insert = "last"
	BEFORE Insert = "before"
	AFTER  Insert = "after"
)

type Matches

type Matches struct {
	IPv4 *IPv4 `json:"ipv4"`
	IPv6 *IPv6 `json:"ipv6"`
	TCP  *TCP  `json:"tcp"`
	UDP  *UDP  `json:"udp"`
	ICMP *ICMP `json:"icmp"`
}

type Operator

type Operator string

Operator from ietf-netmod-acl-model

const (
	Operator_LTE Operator = "lte"
	Operator_GTE Operator = "gte"
	Operator_EQ  Operator = "eq"
	Operator_NEQ Operator = "neq"
)

func (Operator) MarshalJSON

func (e Operator) MarshalJSON() ([]byte, error)

func (Operator) String

func (e Operator) String() string

func (*Operator) UnmarshalJSON

func (p *Operator) UnmarshalJSON(data []byte) error

type OperatorBit

type OperatorBit string

Operator from ietf-dots-data-channel-18

const (
	Operator_NOT   OperatorBit = "not"
	Operator_MATCH OperatorBit = "match"
	Operator_ANY   OperatorBit = "any"
)

func (OperatorBit) MarshalJSON

func (e OperatorBit) MarshalJSON() ([]byte, error)

func (OperatorBit) String

func (e OperatorBit) String() string

func (*OperatorBit) UnmarshalJSON

func (p *OperatorBit) UnmarshalJSON(data []byte) error

type PortNumber

type PortNumber uint16

type PortRange

type PortRange struct {
	LowerPort *PortNumber `json:"lower-port"`
	UpperPort *PortNumber `json:"upper-port"`
}

type PortRangeOrOperator

type PortRangeOrOperator struct {
	LowerPort *PortNumber `json:"lower-port"`
	UpperPort *PortNumber `json:"upper-port"`
	Operator  *Operator   `json:"operator"`
	Port      *PortNumber `json:"port"`
}

type Statistics

type Statistics struct {
	MatchedPackets *uint64 `json:"matched-packets" yang:"nonconfig"`
	MatchedOctets  *uint64 `json:"matched-octets"  yang:"nonconfig"`
}

type TCP

type TCP struct {
	SequenceNumber        *uint32              `yang:"config" json:"sequence-number"`
	AcknowledgementNumber *uint32              `yang:"config" json:"acknowledgement-number"`
	DataOffset            *uint8               `yang:"config" json:"data-offset"`
	Reserved              *uint8               `yang:"config" json:"reserved"`
	Flags                 *TCPFlags            `yang:"config" json:"flags"`
	WindowSize            *uint16              `yang:"config" json:"window-size"`
	UrgentPointer         *uint16              `yang:"config" json:"urgent-pointer"`
	Options               *uint32              `yang:"config" json:"options"`
	FlagsBitmask          *FlagsBitmask        `yang:"config" json:"flags-bitmask"`
	SourcePort            *PortRangeOrOperator `yang:"config" json:"source-port-range-or-operator"`
	DestinationPort       *PortRangeOrOperator `yang:"config" json:"destination-port-range-or-operator"`
}

type TCPFlag

type TCPFlag string
const (
	TCPFlag_CWR TCPFlag = "cwr"
	TCPFlag_ECE TCPFlag = "ece"
	TCPFlag_URG TCPFlag = "urg"
	TCPFlag_ACK TCPFlag = "ack"
	TCPFlag_PSH TCPFlag = "psh"
	TCPFlag_RST TCPFlag = "rst"
	TCPFlag_SYN TCPFlag = "syn"
	TCPFlag_FIN TCPFlag = "fin"
)

func (TCPFlag) String

func (e TCPFlag) String() string

type TCPFlags

type TCPFlags []TCPFlag

func (TCPFlags) MarshalJSON

func (e TCPFlags) MarshalJSON() ([]byte, error)

func (TCPFlags) String

func (e TCPFlags) String() string

func (*TCPFlags) UnmarshalJSON

func (p *TCPFlags) UnmarshalJSON(data []byte) error

type UDP

type UDP struct {
	Length          *uint16              `yang:"config" json:"length"`
	SourcePort      *PortRangeOrOperator `yang:"config" json:"source-port-range-or-operator"`
	DestinationPort *PortRangeOrOperator `yang:"config" json:"destination-port-range-or-operator"`
}

type UInt8List

type UInt8List []uint8

func (UInt8List) MarshalJSON

func (e UInt8List) MarshalJSON() ([]byte, error)

type Vendor

type Vendor struct {
	VendorId        *uint32         `yang:"config" json:"vendor-id"`
	VendorName      *string         `yang:"config" json:"vendor-name"`
	DescriptionLang *string         `yang:"config" json:"description-lang"`
	LastUpdated     *string         `yang:"config" json:"last-updated"`
	AttackMapping   []AttackMapping `yang:"config" json:"attack-mapping"`
}

type VendorMapping

type VendorMapping struct {
	Vendor []Vendor `json:"vendor"`
}

Jump to

Keyboard shortcuts

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