sdp

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2018 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package sdp implements Session Description Protocol (SDP) Offer/Answer procedures for Interactive Connectivity Establishment (ICE).

Currently this implementation is based on the following Internet Draft: https://tools.ietf.org/html/draft-ietf-mmusic-ice-sip-sdp-21

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseAttribute

func ParseAttribute(v []byte, c *Candidate) error

ParseAttribute parses v into ct and returns error if any.

Types

type Address added in v0.5.3

type Address struct {
	Host []byte
	IP   net.IP
	Type AddressType
}

Address represents address that can be ipv4/6 or FQDN.

func (Address) Equal added in v0.5.3

func (a Address) Equal(b Address) bool

Equal returns true if b equals to a.

func (Address) String added in v0.5.3

func (a Address) String() string

type AddressType added in v0.6.0

type AddressType byte

AddressType is type for Address.

const (
	AddressIPv4 AddressType = iota
	AddressIPv6
	AddressFQDN
)

Possible address types.

func (AddressType) String added in v0.6.0

func (a AddressType) String() string

type Attribute

type Attribute struct {
	Key   []byte
	Value []byte
}

Attribute is key-value pair.

func (Attribute) String

func (a Attribute) String() string

type Attributes

type Attributes []Attribute

Attributes is list of attributes.

func (Attributes) Equal

func (a Attributes) Equal(b Attributes) bool

Equal returns true if a equals b.

func (Attributes) Value

func (a Attributes) Value(k []byte) []byte

Value returns first attribute value with key k or nil of none found.

type Candidate

type Candidate struct {
	ConnectionAddress Address
	Port              int
	Transport         ct.Protocol
	TransportValue    []byte
	Foundation        int
	ComponentID       int
	Priority          int
	Type              ct.Type
	RelatedAddress    Address
	RelatedPort       int

	// Extended attributes
	NetworkCost int
	Generation  int

	// Other attributes
	Attributes Attributes
}

Candidate is parsed ICE candidate from SDP.

This attribute is used with Interactive Connectivity Establishment (ICE), and provides one of many possible candidate addresses for communication. These addresses are validated with an end-to-end connectivity check using Session Traversal Utilities for NAT (STUN)).

func (Candidate) Equal

func (c Candidate) Equal(b *Candidate) bool

Equal returns true if b candidate is equal to ct.

func (*Candidate) Reset

func (c *Candidate) Reset()

Reset sets all fields to zero values.

Jump to

Keyboard shortcuts

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