Documentation
¶
Overview ¶
Copyright (c) Facebook, Inc. and its affiliates.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func NewSendWorker(i int, c *Config, st stats.Stats) *sendWorker
- type Config
- type Server
- type SubscriptionClient
- func (sc *SubscriptionClient) Announce() *ptp.Announce
- func (sc *SubscriptionClient) DelayResp() *ptp.DelayResp
- func (sc *SubscriptionClient) Expired() bool
- func (sc *SubscriptionClient) Followup() *ptp.FollowUp
- func (sc *SubscriptionClient) Grant() *ptp.Signaling
- func (sc *SubscriptionClient) IncSequenceID()
- func (sc *SubscriptionClient) Once()
- func (sc *SubscriptionClient) Running() bool
- func (sc *SubscriptionClient) Start()
- func (sc *SubscriptionClient) Stop()
- func (sc *SubscriptionClient) Sync() *ptp.SyncDelayReq
- func (sc *SubscriptionClient) UpdateAnnounce()
- func (sc *SubscriptionClient) UpdateDelayResp(h *ptp.Header, received time.Time)
- func (sc *SubscriptionClient) UpdateFollowup(hwts time.Time)
- func (sc *SubscriptionClient) UpdateGrant(sg *ptp.Signaling, mt ptp.UnicastMsgTypeAndFlags, interval ptp.LogInterval, ...)
- func (sc *SubscriptionClient) UpdateSync()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { DSCP int Interface string IP net.IP LogLevel string MaxSubDuration time.Duration MetricInterval time.Duration MinSubInterval time.Duration MonitoringPort int SHM bool TimestampType string UTCOffset time.Duration SendWorkers int RecvWorkers int QueueSize int // contains filtered or unexported fields }
Config is a server config structure
func (*Config) IfaceHasIP ¶
IfaceHasIP checks if selected IP is on interface
func (*Config) SetUTCOffsetFromSHM ¶
SetUTCOffsetFromSHM reads SHM and if valid sets UTC offset
type SubscriptionClient ¶
SubscriptionClient is sending subscriptionType messages periodically
func NewSubscriptionClient ¶
func NewSubscriptionClient(q chan *SubscriptionClient, eclisa, gclisa unix.Sockaddr, st ptp.MessageType, sc *Config, i time.Duration, e time.Time) *SubscriptionClient
NewSubscriptionClient gets minimal required arguments to create a subscription
func (*SubscriptionClient) Announce ¶
func (sc *SubscriptionClient) Announce() *ptp.Announce
Announce returns ptp Announce packet
func (*SubscriptionClient) DelayResp ¶
func (sc *SubscriptionClient) DelayResp() *ptp.DelayResp
DelayResp returns ptp Delay Response packet
func (*SubscriptionClient) Expired ¶
func (sc *SubscriptionClient) Expired() bool
Expired checks if the subscription expired or not
func (*SubscriptionClient) Followup ¶
func (sc *SubscriptionClient) Followup() *ptp.FollowUp
Followup returns ptp Follow Up packet
func (*SubscriptionClient) Grant ¶
func (sc *SubscriptionClient) Grant() *ptp.Signaling
Grant returns ptp Signaling packet granting the requested subscription
func (*SubscriptionClient) IncSequenceID ¶
func (sc *SubscriptionClient) IncSequenceID()
IncSequenceID adds 1 to a sequence id
func (*SubscriptionClient) Once ¶
func (sc *SubscriptionClient) Once()
Once adds itself to the worker queue once
func (*SubscriptionClient) Running ¶
func (sc *SubscriptionClient) Running() bool
Running returns the running bool
func (*SubscriptionClient) Start ¶
func (sc *SubscriptionClient) Start()
Start launches the subscription timers and exit on expire
func (*SubscriptionClient) Sync ¶
func (sc *SubscriptionClient) Sync() *ptp.SyncDelayReq
Sync returns ptp Sync packet
func (*SubscriptionClient) UpdateAnnounce ¶
func (sc *SubscriptionClient) UpdateAnnounce()
UpdateAnnounce updates ptp Announce packet
func (*SubscriptionClient) UpdateDelayResp ¶
func (sc *SubscriptionClient) UpdateDelayResp(h *ptp.Header, received time.Time)
UpdateDelayResp updates ptp Delay Response packet
func (*SubscriptionClient) UpdateFollowup ¶
func (sc *SubscriptionClient) UpdateFollowup(hwts time.Time)
UpdateFollowup updates ptp Follow Up packet
func (*SubscriptionClient) UpdateGrant ¶
func (sc *SubscriptionClient) UpdateGrant(sg *ptp.Signaling, mt ptp.UnicastMsgTypeAndFlags, interval ptp.LogInterval, duration uint32)
UpdateGrant updates ptp Signaling packet granting the requested subscription
func (*SubscriptionClient) UpdateSync ¶
func (sc *SubscriptionClient) UpdateSync()
UpdateSync updates ptp Sync packet