func (p *PTPInterfaceEntity) Get(name string) PTPInterfaceConfig {
	parent := `interface\s+` + name
	config, _ := p.GetBlock(parent)
	return PTPInterfaceConfig{
		"enabled":   strconv.FormatBool(p.parsePTPEnabled(config)),
		"role":      p.parsePTPRole(config),
		"transport": p.parsePTPTransport(config),
	}
}
Get returns an PTPInterfaceConfig type for a given interface name(string).
package module
import (
	"fmt"
	"regexp"
	"strconv"
	"github.com/aristanetworks/goeapi"
)
type PtpConfig struct {
	sourceIP string
	mode     string
	ttl      string
}
func (p *PtpConfig) SourceIP() string {
	return p.sourceIP
}
func (p *PtpConfig) Mode() string {
	return p.mode
}
func (p *PtpConfig) TTL() string {
	return p.ttl
}
type PTPEntity struct {
	interfaces *PTPInterfaceEntity
	*AbstractBaseEntity
}
func (p *PTPEntity) Interfaces() *PTPInterfaceEntity {
	if p.interfaces == nil {
		p.interfaces = PTPInterfaces(p.AbstractBaseEntity.node)
	}
	return p.interfaces
}
func Ptp(node *goeapi.Node) *PTPEntity {
	return &PTPEntity{AbstractBaseEntity: &AbstractBaseEntity{node}}
}
func (p *PTPEntity) Get() *PtpConfig {
	config := p.Config()
	var ptp = new(PtpConfig)
	ptp.sourceIP = p.parse(config, "source ip")
	ptp.mode = p.parse(config, "mode")
	ptp.ttl = p.parse(config, "ttl")
	return ptp
}
func (p *PTPEntity) ConfigurePtp(cmd string) bool {
	config := p.Get()
	if config == nil {
		return false
	}
	commands := []string{
		cmd,
	}
	return p.Configure(commands...)
}
func (p *PTPEntity) SetSourceIP(value string) bool {
	if value == "" {
		return p.ConfigurePtp("no ptp source ip")
	}
	return p.ConfigurePtp("ptp source ip " + value)
}
func (p *PTPEntity) SetMode(value string) bool {
	if value == "" {
		return p.ConfigurePtp("no ptp mode")
	}
	return p.ConfigurePtp("ptp mode " + value)
}
func (p *PTPEntity) SetTTL(value string) bool {
	if value == "" {
		return p.ConfigurePtp("no ptp ttl")
	}
	return p.ConfigurePtp("ptp ttl " + value)
}
func (p *PTPEntity) parse(config string, pattern string) string {
	str := fmt.Sprintf(`(?m)ptp %s ([^\s]+)`, pattern)
	re := regexp.MustCompile(str)
	match := re.FindStringSubmatch(config)
	if match == nil {
		return ""
	}
	return match[1]
}
type PTPInterfaceConfig map[string]string
type PTPInterfaceCollection map[string]PTPInterfaceConfig
type PTPInterfaceEntity struct {
	*AbstractBaseEntity
}
func PTPInterfaces(node *goeapi.Node) *PTPInterfaceEntity {
	return &PTPInterfaceEntity{&AbstractBaseEntity{node}}
}